* dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
220cb2bd
MA
12012-10-31 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4
218e997a
MR
52012-10-31 Martin Rudalics <rudalics@gmx.at>
6
7 * minibuf.c (read_minibuf): Restore current buffer since
8 choose_minibuf_frame calling Fset_frame_selected_window may
9 change it (Bug#12766).
10
02615da0
JD
112012-10-30 Jan Djärv <jan.h.d@swipnet.se>
12
13 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
14
aee5b18e
KH
152012-10-30 Kenichi Handa <handa@gnu.org>
16
17 * font.c (Ffont_at): If WINDOW is specified and it is not
18 displaying the current buffer, signal an error.
19
ba116008
DC
202012-10-29 Daniel Colascione <dancol@dancol.org>
21
22 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
23 preparation for fixing bug#12739, move these functions from
24 here...
25
26 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
27 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
28 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 29
640bf8ad
EZ
302012-10-28 Eli Zaretskii <eliz@gnu.org>
31
32 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
33 (timer_loop, getitimer, setitimer): Use it instead of
34 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
35 'clock'.
36 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
37 literal 10000.
38
64ccff5f
JD
392012-10-28 Jan Djärv <jan.h.d@swipnet.se>
40
41 * nsterm.m (NO_APPDEFINED_DATA): New define.
42 (last_appdefined_event_data): New variable
43 (last_appdefined_event): Remove.
44 (ns_select): Initialize t from last_appdefined_event_data instead
45 of [last_appdefined_event data1].
46 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
47 remove last_appdefined_event (Bug#12698).
48
e483264c
SM
492012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
50
51 * frame.c (x_set_font): Catch internal error.
52
6c16c13e
EZ
532012-10-27 Eli Zaretskii <eliz@gnu.org>
54
e483264c
SM
55 Avoid overflow in w32 implementation of interval timers.
56 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
57 actually executes.
58 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
59 'volatile ULONGLONG' types. All the other data which was
60 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
61 (GetThreadTimes_Proc): New typedef.
62 (w32_get_timer_time): New function, returns a suitable time value
63 for the timer.
64 (timer_loop): Enter critical section when accessing ULONGLONG
65 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
66 atomic. Call 'w32_get_timer_time' instead of 'clock'.
67 Remove unused variable.
6c16c13e
EZ
68 (init_timers): Initialize s_pfn_Get_Thread_Times.
69 (start_timer_thread): Don't assign itimer->caller_thread here.
70 (getitimer): Assign itimer->caller_thread here.
71 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 72 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 73
ccc83f50
EZ
742012-10-26 Eli Zaretskii <eliz@gnu.org>
75
76 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
77 mouse movement events if the menu bar is active. This avoids
78 producing a busy "hour-glass" cursor by Windows if the mouse
79 pointer is positioned over a tooltip shown for some menu item.
80
69deda53
PE
812012-10-25 Paul Eggert <eggert@cs.ucla.edu>
82
83 Don't assume process IDs fit in int.
84 * emacs.c (shut_down_emacs) [!DOS_NT]:
85 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
86 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
87 Use pid_t, not int, to store process IDs, as 'int'
88 is not wide enough on a few platforms (e.g., AIX and IRIX).
89
7e70a152
KH
902012-10-23 Kenichi Handa <handa@gnu.org>
91
92 The following change is to make face-font-rescale-alist work
93 correctly for non-ASCII fonts.
94
95 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
96 (font_open_for_lface): Handle Vface_font_rescale_alist.
97
49238e7f
CY
982012-10-23 Chong Yidong <cyd@gnu.org>
99
100 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
101
5ec86886
JD
1022012-10-21 Jan Djärv <jan.h.d@swipnet.se>
103
ef446959
JD
104 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
105 for screen font.
106 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
107
5ec86886
JD
108 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
109 event (Bug#12681).
110
ee7a418d
GM
1112012-10-21 Glenn Morris <rgm@gnu.org>
112
113 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
114
4973679b
PE
1152012-10-20 Paul Eggert <eggert@cs.ucla.edu>
116
117 Port to OpenBSD 5.1.
118 * frame.c (Fmouse_position, Fmouse_pixel_position):
119 * xdisp.c (produce_stretch_glyph):
120 Declare local vars only when they're needed.
121 This is clearer and avoids a warning on OpenBSD about unused vars.
122 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
123 This is safer, and avoids OpenBSD warnings about unused vars.
124 * keyboard.c (record_menu_key): Remove unnecessary decl.
125 (poll_timer): Define only if POLL_FOR_INPUT is defined.
126 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
127 as our definition clashes with OpenBSD's.
128 * xfaces.c (load_face_colors, check_lface_attrs)
129 (get_lface_attributes_no_remap, get_lface_attributes)
130 (lface_fully_specified_p, x_supports_face_attributes_p)
131 (tty_supports_face_attributes_p, face_fontset, realize_face)
132 (realize_x_face, realize_tty_face):
133 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
134 merely Lisp_Object *. This is more informative and avoids
135 a warning on OpenBSD about accessing beyond an object's size.
136
c664f463
CY
1372012-10-20 Chong Yidong <cyd@gnu.org>
138
139 * lread.c (Fload): Doc fix (Bug#12592).
140
6ec83f92 1412012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
142
143 * font.c (Ffont_at): Fix previous change.
144
d2824928
EZ
1452012-10-19 Eli Zaretskii <eliz@gnu.org>
146
e483264c
SM
147 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
148 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
149 for the reasons.
150
d2824928
EZ
151 * alloc.c (NSTATICS): Decrease to 0x800.
152
f60d391f
SM
1532012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
154
155 * fns.c (Fnreverse): Include the problem element when signalling an
156 error (bug#12677).
157
1a9327d5
JD
1582012-10-18 Jan Djärv <jan.h.d@swipnet.se>
159
160 * nsterm.m (ns_select): Check writefds before call to
161 FD_ISSET (Bug#12668).
162
14145a1e
DC
1632012-10-18 Daniel Colascione <dancol@dancol.org>
164
165 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
166 (staticpro): If we run out of staticpro slots, die with an
167 informative error instead of just calling emacs_abort.
168
1f76f6f5
MR
1692012-10-18 Martin Rudalics <rudalics@gmx.at>
170
171 Fix two flaws reported by Dmitry Antipov.
172 * window.c (Ftemp_output_buffer_show): Remove.
173 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
174 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
175
fcf14875
EZ
1762012-10-17 Eli Zaretskii <eliz@gnu.org>
177
1f76f6f5
MR
178 * makefile.w32-in ($(BLD)/w32.$(O)):
179 ($(BLD)/vm-limit.$(O)):
180 ($(BLD)/term.$(O)):
181 ($(BLD)/unexw32.$(O)):
182 ($(BLD)/fileio.$(O)):
a68089e4
EZ
183 ($(BLD)/dispnew.$(O)): Update dependencies.
184
185 * w32term.h (w32_initialize_display_info, initialize_w32_display):
186 Add prototypes.
187
188 * w32proc.c: Include ctype.h.
189
190 * w32.h (init_environment, check_windows_init_file)
191 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
192 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
193 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
194 (sys_link): Add prototypes.
195
196 * w32.c: Include w32select.h.
197 (sys_access, e_malloc, sys_select): Add prototypes.
198 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
199
200 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
201
202 * unexw32.c: Include lisp.h and w32.h.
203
204 * term.c [WINDOWSNT]: Include w32term.h.
205
206 * process.c [WINDOWSNT]: Add prototype of sys_select.
207
208 * fileio.c [WINDOWSNT]: Include w32.h.
209
210 * dispnew.c [WINDOWSNT]: Include w32.h.
211
fcf14875
EZ
212 * cygw32.c (Fcygwin_convert_path_to_windows)
213 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
214 Lisp_Object values. (Bug#12661)
215
216 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
217 to Lisp_Object. (Bug#12661)
218
fe0b1ec4
KH
2192012-10-17 Kenichi Handa <handa@gnu.org>
220
221 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
222 invalidate.
223
d556ebf9
DA
2242012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
225
226 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 227 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 228
f0863a54
DA
2292012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
230
231 Do not verify indirection counters of killed buffers (Bug#12579).
232 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
233 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
234
12fbe755
DA
2352012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
236
237 * alloc.c (Fmake_byte_code): Fix typo in comment.
238 * print.c (print_interval): Define as static to match prototype.
239 * indent.c (disptab_matches_widthtab, recompute_width_table):
240 Convert to eassert.
241
61655b89
DA
2422012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
243
244 * editfns.c (get_system_name): Remove.
245 * lisp.h (get_system_name): Remove prototype.
246 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
247 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
248
9520f2f2
DC
2492012-10-15 Daniel Colascione <dancol@dancol.org>
250
251 * dbusbind.c: Add comment explaining reason for previous change.
252
dca778d5
MR
2532012-10-15 Martin Rudalics <rudalics@gmx.at>
254
255 * window.c (Fwindow_end): Rewrite check whether cached position
256 can be used (Bug#12600).
257 (resize_frame_windows, grow_mini_window, shrink_mini_window):
258 Set windows_or_buffers_changed.
259
3e0341b0
DC
2602012-10-15 Daniel Colascione <dancol@dancol.org>
261
262 * dbusbind.c: Fix cygw32 build break when compiling with dbus
263 enabled by undefining the symbol "interface", which the platform
264 headers define to something incompatible.
265
33d4113c
DC
2662012-10-14 Daniel Colascione <dancol@dancol.org>
267
268 * image.c (init_tiff_functions, init_imagemagick_functions)
269 (init_svg_functions): Fix cygw32 build break by using these
270 functions only when WINDOWSNT _and_ HAVE_NTGUI.
271
a36fb15e
JD
2722012-10-14 Jan Djärv <jan.h.d@swipnet.se>
273
274 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
275
537f336d
JD
2762012-10-13 Jan Djärv <jan.h.d@swipnet.se>
277
278 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
279
0ba06a77
KH
2802012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
281
282 * coding.c (detect_coding): Set coding->id before calling
283 this->detector.
284
ce2fe65a
AS
2852012-10-13 Andreas Schwab <schwab@linux-m68k.org>
286
287 * fileio.c: Formatting fixes.
288
d6453ce4
PE
2892012-10-13 Paul Eggert <eggert@cs.ucla.edu>
290
291 Fix some stat-related races.
292 * fileio.c (Fwrite_region): Avoid race condition if a file is
293 removed or renamed by some other process immediately after Emacs
294 writes it but before Emacs stats it. Do not assume that stat (or
295 fstat) succeeds.
296 * image.c (slurp_file): Resolve the file name with fopen + fstat
297 rather than stat + fopen.
298 (pbm_read_file) [0]: Remove unused code with stat race.
299 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
300 Remove ineffective code with stat race.
301
06485aa8
SM
3022012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
303
304 * doc.c (get_doc_string): Don't signal an error if the file is missing.
305
167e3640
JD
3062012-10-12 Jan Djärv <jan.h.d@swipnet.se>
307
308 * nsterm.m (hold_event_q): New static variable.
309 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
310 ! q_event_ptr.
311 (hold_event): New function.
312 (ns_read_socket): If hold_event_q have events, store them and
313 return (Bug#12384).
314 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
315 is zero (Bug#12384).
316
c40239df
JB
3172012-10-12 Juanma Barranquero <lekktu@gmail.com>
318
319 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
320
bb385a92
EZ
3212012-10-12 Eli Zaretskii <eliz@gnu.org>
322
2a9f1099
EZ
323 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
324
bb385a92
EZ
325 * fileio.c (check_existing): New function.
326 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
327 instead of calling 'stat', when what's needed is to check whether
328 a file exists. This avoids expensive system calls on MS-Windows.
329 (Bug#12587)
330
8599b23a 331 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
332
333 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
334 determine whether a file exists and is not a directory.
335
336 * lisp.h (check_existing): Add prototype.
337
2b9c2e68
JD
3382012-10-12 Jan Djärv <jan.h.d@swipnet.se>
339
340 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
341
81749a23
GM
3422012-10-12 Glenn Morris <rgm@gnu.org>
343
344 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
345
5253a5fd
SM
3462012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
347
389a94a5
SM
348 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
349
5253a5fd
SM
350 * eval.c (Fautoload): Remember previous autoload status in load-history.
351
7cded46f
PE
3522012-10-11 Paul Eggert <eggert@cs.ucla.edu>
353
354 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
355 * lread.c (load_each_byte, new_backquote_flag, readchar)
356 (read_filtered_event, lisp_file_lexically_bound_p)
357 (safe_to_load_version, Fload, complete_filename_p, openp)
358 (build_load_history, readevalloop, read_escape, read1)
359 (string_to_number, read_vector, read_list):
360 * macros.c (Fstart_kbd_macro):
361 * marker.c (CONSIDER):
362 * menu.c (parse_single_submenu, digest_single_submenu)
363 (find_and_return_menu_selection, Fx_popup_menu):
364 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
365 (Ftry_completion):
366 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
367 (ns_menu_show):
368 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
369 (xmenu_show, xdialog_show):
370 Use bool for booleans.
371 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
372 as it's not a predicate. All uses changed. Omit unnecessary
373 buffer termination.
374
549c3414
DA
3752012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
376
377 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
378 (save_excursion_restore): Do not restore mark if it was not saved.
379
e85aafe7
PE
3802012-10-11 Paul Eggert <eggert@cs.ucla.edu>
381
fd2f90cf
PE
382 * marker.c (cached_modiff): EMACS_INT, not int.
383
c1af190b
PE
384 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
385 instead of having a wrong decl.
e85aafe7
PE
386 * nsmenu.m (waiting_for_input): Remove wrong decl.
387
e738ca56
PE
3882012-10-10 Paul Eggert <eggert@cs.ucla.edu>
389
9fa1de30
PE
390 keyboard.c, keymap.c: Use bool for booleans.
391 * dispnew.c (sit_for): Distinguish between 3-way display_option
392 and boolean do_display.
393 * keyboard.c (single_kboard, this_command_key_count_reset)
394 (waiting_for_input, echoing, immediate_quit, input_pending)
395 (interrupt_input, interrupts_deferred, pop_kboard)
396 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
397 (command_loop_1, adjust_point_for_property)
398 (safe_run_hooks_error, input_polling_used, read_char):
399 (help_char_p, readable_events, kbd_buffer_events_waiting)
400 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
401 (lucid_event_type_list_p, get_input_pending):
402 (gobble_input, menu_separator_name_p, menu_bar_item)
403 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
404 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
405 (keyremap_step, test_undefined, read_key_sequence)
406 (detect_input_pending, detect_input_pending_ignore_squeezables)
407 (detect_input_pending_run_timers, requeued_events_pending_p)
408 (quit_throw_to_read_char, Fset_input_interrupt_mode):
409 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
410 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
411 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
412 (accessible_keymaps_1, Fkey_description, push_key_description):
413 (shadow_lookup, struct where_is_internal_data)
414 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
415 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
416 (describe_map, describe_vector):
417 * menu.c (single_menu_item):
418 * nsmenu.m (ns_update_menubar):
419 * process.c (wait_reading_process_output):
420 * search.c (scan_buffer, scan_newline):
421 Use bool for boolean.
422 * keyboard.c (timers_run, swallow_events)
423 (detect_input_pending_run_timers):
424 * process.c (wait_reading_process_output):
425 Use unsigned for counter where wraparound-on-overflow is desired,
426 since unsigned is guaranteed to have that behavior and signed is not.
427 (read_char): Use ptrdiff_t for string length.
428 (get_input_pending): Remove first argument, since it was always
429 the same pointer-to-int (now pointer-to-boolean) &input_pending,
430 and behave as if it had that value. Return new value of
431 input_pending. All callers changed.
432 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
433 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
434 a string length.
435 * keymap.c (push_key_description): Omit last arg, which was always 1.
436 All callers changed.
437
e738ca56
PE
438 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
439
29f21cdf
JB
4402012-10-10 Juanma Barranquero <lekktu@gmail.com>
441
442 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
443 ($(BLD)/term.$(O)): Update dependencies.
444
6aea7528
DA
4452012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
446
447 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
448 * lisp.h (enum pvec_type): Adjust comments and omit explicit
449 initializer for PVEC_NORMAL_VECTOR.
450
5f3f57be
PE
4512012-10-10 Paul Eggert <eggert@cs.ucla.edu>
452
453 Clean out old termopts cruft.
454 * termopts.h (flow_control, meta_key): Remove unused decls.
455 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
456 Don't include termopts.h.
457
3e98c68e
DA
4582012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
459
460 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
461
77e344e5
PE
4622012-10-10 Paul Eggert <eggert@cs.ucla.edu>
463
464 * commands.h (immediate_quit): Remove duplicate decl.
465
5683d7cd
JD
4662012-10-09 Jan Djärv <jan.h.d@swipnet.se>
467
468 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
469 caching.
470 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 471 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 472
cf5fc6db
EZ
4732012-10-09 Eli Zaretskii <eliz@gnu.org>
474
b15736e6
EZ
475 * w32fns.c (w32_last_error): Change the return value to DWORD, to
476 match what GetLastError returns. Explain why the function is
477 needed.
478
cf5fc6db
EZ
479 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
480 'is_tooltip_frame', to avoid confusion with its global namesake.
481
f99714ce
DC
4822012-10-08 Daniel Colascione <dancol@dancol.org>
483
484 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
485 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
486 build that caused Emacs to display the hourglass cursor forever.
f99714ce 487
fd59cb29
GM
488 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
489 which is broken under remote desktop, calculate the number of
490 colors available for a display based on the display's number of
491 planes and number of bits per pixel per plane. (bug#10397).
492
62c480c9 4932012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 494
62c480c9
JD
495 * nsfont.m (Vfonts_in_cache): New variable.
496 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
497 are used. Add cached fonts to Vfonts_in_cache.
498 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
499
607446ba
JB
5002012-10-08 Juanma Barranquero <lekktu@gmail.com>
501
fd5125ad
JB
502 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
503 in nt/config.nt.
46979e0b
JB
504 (FONT_H): Define after FRAME_H.
505 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
506 Update dependencies.
fd5125ad 507
607446ba
JB
508 * w32term.c: Remove leftover declaration of keyboard_codepage.
509
b6f4e300
EZ
5102012-10-08 Eli Zaretskii <eliz@gnu.org>
511
c54ebba4
EZ
512 * makefile.w32-in (FONT_H): Add $(FRAME_H).
513 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
514 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
515 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
516 ($(BLD)/unexw32.$(O)):
517 ($(BLD)/w32.$(O)):
518 ($(BLD)/w32console.$(O)):
519 ($(BLD)/w32fns.$(O)):
520 ($(BLD)/w32heap.$(O)):
521 ($(BLD)/w32menu.$(O)):
15c720a3 522 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 523
b6f4e300
EZ
524 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
525 'const char *'.
526 (x_to_w32_color): Don't modify the argument, modify a copy instead.
527
501199a3
DC
5282012-10-08 Daniel Colascione <dancol@dancol.org>
529
530 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
531 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
532 accidental message numbering hole. Change other messages to
533 match.
534
535 * w32select.h (HAVE_W32SELECT): Remove.
536
537 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 538 w32common.h instead of w32heap.h.
501199a3
DC
539
540 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
541 (get_allocation_unit, get_processor_type, get_w32_major_version)
542 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
543 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
544 (OS_NT, os_subtype, cache_system_info): Move declarations to
545 w32common.
546
547 * w32heap.c: Include w32common.h.
548 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
549 (w32_minor_version, w32_build_number, w32_subtype):
550 Remove duplicate definitions.
501199a3
DC
551
552 * w32fns.c: Include w32common.h; include w32heap.h only in
553 WINDOWSNT.
554
555 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
556 Use `report_file_error' instead of `error' in order to better
557 inform users of what went wrong. Increase NTGUI_UNICODE file
558 dialog box file name length to 32k, the maximum allowed by the NT
559 kernel.
560
561 * w32common.h: New file.
562 (ROUND_UP, ROUND_DOWN, get_page_size)
563 (get_allocation_unit, get_processor_type, get_w32_major_version)
564 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
565 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
566 (OS_NT, os_subtype, cache_system_info): Move here.
567
568 * unexw32.c, unexcw.c: Include w32common.h.
569
570 * emacs.c (main): Use (defined (WINDOWSNT) || defined
571 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
572 to call syms_of_w32select.
573
574 * cygw32.h: Remove obsolete EXFUN declarations.
575
576 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
577
578 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
579 of w32inevt.o from SOME_MACHINE_OBJECTS.
580
93aa5c81
DC
5812012-10-08 Daniel Colascione <dancol@dancol.org>
582
583 * image.c: Permanent fix for JPEG compilation issue --- limit
584 jpeglib `boolean' redefinition to Cygwin builds.
585
d424f3d8
EZ
5862012-10-08 Eli Zaretskii <eliz@gnu.org>
587
8ee4c6ce
EZ
588 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
589
d424f3d8
EZ
590 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
591 Cygwin.
592
e08348a0
DC
5932012-10-08 Daniel Colascione <dancol@dancol.org>
594
595 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
596 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
597 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
598 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
599 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
600 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
601 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
602 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
603 now a supported configuration.
604
605 * Makefile.in: consolidate image variables into LIBIMAGE; add
606 W32_OBJ and W32_LIBS. Compile new files.
607
608 * conf_post.h:
609 (_DebPrint) declare tracing facility for W32 debugging. We need
610 to unify tracing later.
611
612 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
613 unconditional use of W32 Unicode functions. Cygwin runs only on
614 100% Unicode operating systems.
615
616 * cygw32.c: New file. Define Cygwin-specific facilities.
617 (Fcygwin_convert_path_to_windows)
618 (Fcygwin_convert_path_from_windows): New user functions for
619 accessing Cygwin path-munging routines.
620
621 * cygw32.h: New file.
622 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
623 UTF-16LE strings temporarily inside non-Lisp-visible string
624 objects.
625
626 (w32_strerror): Just what it says on the tin.
627
628 * emacs.c: Make the NS fork-then-exec code for daemon-launching
629 also run for Cygwin; both systems have the same problem with using
630 GUI facilities in a forked child. Also call syms_of_cygw32,
631 syms_of_w32select in correct places.
632
633 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
634 needs fork-then-exec for daemon launching.
635
636 * font.h: Include frame.h.
637
638 * image.c: Use the image library cache machinery only when we're
639 compiling for native WINDOWSNT; Cygwin can use shared libraries
640 like any other Unixlike system.
641
642 * keyboard.c: Clarify a comment regarding the input loop.
643
644 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
645 functions directly instead of trying to detect at runtime that our
646 host operating system supports them. We make this change for two
647 reasons: Cygwin lacks support for the multibyte character
648 conversion functions used by the legacy menu code, and Cygwin
649 never needs to rely on non-Unicode APIs.
650
651 * unexw32.c (hinst): Declare extern.
652
653 * w32.c: Change header order;
654 (w32_strerror): Move to w32fns.c because we need it for
655 non-WINDOWSNT builds.
656
657 * w32.h: Add #error macro to make sure we don't include w32.h for
658 Cygwin builds. Remove w32select declarations.
659
660 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 661 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
662
663 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
664 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
665 POSIXy alternative.
666 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
667 (w32_major_version, w32_minor_version, w32_build_number)
668 (os_subtype, sound_type): Define here
669 (w32_defined_color): Make color parameter const for consistency
670 with other _defined_color functions.
671 (w32_createwindow): Unconditionally call w32_init_class instead of
672 doing so only when hprevinst is non-NULL. Plumbing hprevinst
673 through the code is complex and unnecessary because class
674 registration is practically free.
675 (w32_name_of_message): New EMACSDEBUG-only function.
676 (Fset_message_beep): Move here
677 (Fx_open_connection): Require that the display name for Windows be
678 "w32" for consistency, emacsclient disambiguation, and maybe, one
679 day, multi-window-system support.
680 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
681 Cygwin files for W32 GUI facilities, since these clearly don't
682 expect Cygwin names.
683 (_DebPrint): Define.
684 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
685 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
686 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
687 (w32_last_error): Remove.
688
689 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
690
691 * w32heap.c (syspage_mask): Declare here.
692 (cache_system_info): Remove.
693
694 * w32inevt.c (faked_key): Define globally, not statically.
695 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
696 (w32_console_toggle_lock_key): Move to w32fns.c.
697
698 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
699
700 * w32proc.c (_DebPrint): Move to w32fns.c.
701 * w32select.c: Include string.h, stdio.h for Cygwin.
702 * w32select.h: New File.
703
704 * w32term.c: Include io.h for non-CYGWIN builds; needed for
705 get_osfhandle.
706 (w32_message_fd): New variable. Under Cygwin, holds the file
707 descriptor the system used to tell us about pending thread
708 messages.
709
710 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
711 that prevented compilation under non-WINDOWSNT systems.
712
713 (w32_initialize): Open /dev/windows and assign it to
714 w32_message_fd. Provide w32 feature.
715
716 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
717 (WM_EMACS_INPUT_READY): add.
718 (prepend_msg, w32_message_fd): Declare globally.
719
720 * w32xfns.c:
721 (keyboard_handle): Use only when WINDOWSNT.
722 (notify_msg_ready): New function. Posts a message to the main
723 thread's message queue under CYGWIN, which wakes up the main
724 thread from select(2) by making the /dev/windows file descriptor
725 ready. Under WINDOWSNT, it sets an event the same way the old
726 code did.
727
728 (post, prepend_msg): Actually call notify_msg_ready instead of
729 setting the input event directly.
730
98daa893
EZ
7312012-10-07 Eli Zaretskii <eliz@gnu.org>
732
733 * ralloc.c (relinquish): If a heap is ready to be relinquished,
734 but it still has blocs in it, don't return it to the system,
735 instead of aborting. (Bug#12402)
736
3bc0a2f7
JD
7372012-10-07 Jan Djärv <jan.h.d@swipnet.se>
738
8ad5b73b 739 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 740
335f5ae4
JD
741 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
742 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
743 (syms_of_nsterm): Remove comment about Panther and above for
744 ns-antialias-text.
335f5ae4
JD
745 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
746 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
747 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
748
749 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
750 MAC_OS_X_VERSION_10_4.
751
8ad5b73b
JD
752 * nsmenu.m (fillWithWidgetValue:): Remove code for <
753 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
754
755 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
756
757 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
758 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
759
3bc0a2f7
JD
760 * nsterm.m (ns_in_resize): Remove (Bug#12479).
761 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
762 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
763 Remove ns_in_resize check.
3bc0a2f7
JD
764 (ns_clear_frame_area): Remove resize handle code.
765
766 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
767 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
768 Remove ns_in_resize check.
3bc0a2f7 769
c622b48f
PE
7702012-10-07 Paul Eggert <eggert@cs.ucla.edu>
771
772 Improve sys_siglist detection.
773 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
774 defined as a macro, as is done in Solaris.
775 (sys_siglist_entries): New macro.
776 (save_strsignal): Use it.
777 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
778 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
779
04fafa46
JD
7802012-10-06 Jan Djärv <jan.h.d@swipnet.se>
781
782 * nsfns.m (Fx_create_frame): Call x_default_parameter with
783 fullscreen/Fullscreen.
784
785 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
786 tobar_height is new.
787
788 * nsterm.m (x_make_frame_visible): Check for fullscreen.
789 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
790 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
791 (windowDidResize:): Check for correct window if old style fullscreen.
792 Capitalize word in comment. Remove incorrect comment.
793 (initFrameFromEmacs:): tbar_height renamed tibar_height.
794 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
795 error in drawing background.
1f9f395d 796 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
797 Set toolbar values to zero, save old height in tobar_height.
798 Restore tool bar height when leaving fullscreen.
799 (canBecomeMainWindow): New function.
800
c6e21c03
PE
8012012-10-06 Paul Eggert <eggert@cs.ucla.edu>
802
803 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
804
0d9f584b
EZ
8052012-10-05 Eli Zaretskii <eliz@gnu.org>
806
a65fbb5f
EZ
807 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
808
0d9f584b 809 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
810 that time stamps of directories could also be changed.
811 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
812 FILE_WRITE_ATTRIBUTES access rights.
813
814 * fileio.c (Fset_file_times): Special-case ignoring errors for
815 directories only on MSDOS, not on MS-Windows.
816
e8757f09 8172012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
818
819 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
820
7604f298
EZ
8212012-10-04 Eli Zaretskii <eliz@gnu.org>
822
823 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
824 see whether CreateFile failed.
825
88d69b7d
PE
8262012-10-04 Paul Eggert <eggert@cs.ucla.edu>
827
828 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
829 to avoid similar races.
830 * keyboard.c (pending_signals): Now bool, not int.
831
7509f454
PE
832 Port timers to OpenBSD, plus check for timer failures.
833 OpenBSD problem reported by Han Boetes.
834 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
835 and/or setitimer.
836 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
837 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
838 like OpenBSD, which has timer_settime but does not declare it.
839 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
840 whether to use itimerspec-related primitives. All uses of
841 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
842
a3c5c0c5
PE
8432012-10-02 Paul Eggert <eggert@cs.ucla.edu>
844
845 * profiler.c (handle_profiler_signal): Fix a malloc race
846 that caused Emacs to hang on Fedora 17 when profiling Lisp.
847
914e743b
JD
8482012-10-02 Jan Djärv <jan.h.d@swipnet.se>
849
850 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
851
d8ab37a8
EZ
8522012-10-02 Eli Zaretskii <eliz@gnu.org>
853
854 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
855 consistent with the change in return value of 'safe_strsignal'.
856
b3ecad33
PE
8572012-10-02 Paul Eggert <eggert@cs.ucla.edu>
858
0a99eee1
PE
859 Prefer plain 'static' to 'static inline' (Bug#12541).
860 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
861 (bidi_set_sor_type, bidi_push_embedding_level)
862 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
863 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
864 (bidi_cache_search, bidi_cache_ensure_space)
865 (bidi_cache_iterator_state, bidi_cache_find)
866 (bidi_peek_at_next_level, bidi_set_paragraph_end)
867 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
868 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
869 Now 'static', not 'static inline'.
870
b3ecad33
PE
871 Count overruns when profiling; change units to ns.
872 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
873 Give extra weight to samples after overruns, to attempt to count
874 the time more accurately.
875 (setup_cpu_timer): Change sampling interval units from ms to ns, since
876 the underlying primitives nominally do ns.
877 (Fprofiler_cpu_start): Document the change. Mention that
878 the sampling intervals are only approximate.
879
090cf9db
SM
8802012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
881
882 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
883
884 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
885 case for the special 0 coding-system.
886
887 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
888 (Fmake_overlay): Remove redundant tests.
64edc777 889 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 890
81550bf4
JB
8912012-10-02 Juanma Barranquero <lekktu@gmail.com>
892
893 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
894 Update dependencies.
895
aa1ba90e
PE
8962012-10-01 Paul Eggert <eggert@cs.ucla.edu>
897
898 Fix a malloc race condition involving strsignal.
899 A signal can arrive in the middle of a malloc, and Emacs's signal
900 handler can invoke strsignal, which can invoke malloc, which is
901 not portable. This race condition bug makes Emacs hang on GNU/Linux.
902 Fix it by altering the signal handler so that it does not invoke
903 strsignal.
904 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
905 * process.c (status_message): Use const pointer, in case strsignal
906 is #defined to safe_strsignal.
907 * sysdep.c (sys_siglist, init_signals): Always define and
908 initialize a substitute sys_siglist if the system does not define
909 one, even if HAVE_STRSIGNAL.
910 (safe_strsignal): Rename from strsignal. Always define,
911 using sys_siglist. Return a const pointer.
912 * syssignal.h (safe_strsignal): New decl.
913 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
914
ace917bd
EZ
9152012-10-01 Eli Zaretskii <eliz@gnu.org>
916
917 * w32proc.c (timer_loop): Fix code that waits for timer
918 expiration, to avoid high CPU usage.
919
9eb71b9c
SM
9202012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
921
922 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
923 (sweep_weak_table): Remove redundant prototypes.
924
b3317662
FP
9252012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
926
927 * emacs.c: Move the inclusion of TERM_HEADER after including
928 windows.h on WINDOWSNT. This avoids compilation problems with
929 MSVC.
930
f0e5f225
EZ
9312012-10-01 Eli Zaretskii <eliz@gnu.org>
932
2d7d1608
EZ
933 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
934 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
935 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
936 as the previous version used 'void *'.
937
938 * ralloc.c (ROUNDUP): Fix last change.
939 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
940 'size_t'.
941
f0e5f225
EZ
942 * w32proc.c <disable_itimers>: New static flag.
943 (init_timers): Initialize it to zero, after creating the critical
944 sections used by the timer threads.
945 (term_timers): Set to 1 before deleting the critical sections.
946 (getitimer, setitimer): If disable_itimers is non-zero, return an
947 error indication without doing anything. Reported by Fabrice
948 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
949 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
950 return results.
951 [!HAVE_SETITIMER]: Behave as the previous version that didn't
952 support timers.
f0e5f225
EZ
953
954 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
955 term_ntproc after all the other bookkeeping, to get timers working
956 as long as possible.
957
82ef37c1
PE
9582012-10-01 Paul Eggert <eggert@cs.ucla.edu>
959
b3a4c387
PE
960 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
961 Suggested by Juri Linkov in
962 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
963
b0ab8123
PE
964 Prefer plain 'static' to 'static inline' (Bug#12541).
965 With static functions, modern compilers inline pretty well by
966 themselves; advice from programmers often hurts as much as it helps.
967 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
968 this change shrinks the text size of the Emacs executable by 1.1%
969 without affecting CPU significantly in my benchmark.
970 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
971 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
972 (mark_maybe_object, mark_maybe_pointer, bounded_number):
973 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
974 (bset_auto_fill_function, bset_auto_save_file_format)
975 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
976 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
977 (bset_cache_long_line_scans, bset_case_fold_search)
978 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
979 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
980 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
981 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
982 (bset_header_line_format, bset_indicate_buffer_boundaries)
983 (bset_indicate_empty_lines, bset_invisibility_spec)
984 (bset_left_fringe_width, bset_major_mode, bset_mark)
985 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
986 (bset_name, bset_overwrite_mode, bset_pt_marker)
987 (bset_right_fringe_width, bset_save_length)
988 (bset_scroll_bar_width, bset_scroll_down_aggressively)
989 (bset_scroll_up_aggressively, bset_selective_display)
990 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
991 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
992 (set_buffer_overlays_after):
993 * category.c (bset_category_table):
994 * charset.c (read_hex):
995 * coding.c (produce_composition, produce_charset)
996 (handle_composition_annotation, handle_charset_annotation)
997 (char_encodable_p):
998 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
999 (assign_row, set_frame_matrix_frame, make_current)
1000 (add_row_entry):
1001 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1002 * fns.c (maybe_resize_hash_table):
1003 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1004 * gmalloc.c (register_heapinfo):
1005 * image.c (lookup_image_type):
1006 * intervals.c (set_interval_object, set_interval_left)
1007 (set_interval_right, copy_interval_parent, rotate_right)
1008 (rotate_left, balance_possible_root_interval):
1009 * keyboard.c (kset_echo_string, kset_kbd_queue)
1010 (kset_keyboard_translate_table, kset_last_prefix_arg)
1011 (kset_last_repeatable_command, kset_local_function_key_map)
1012 (kset_overriding_terminal_local_map, kset_real_last_command)
1013 (kset_system_key_syms, clear_event, set_prop):
1014 * lread.c (digit_to_number):
1015 * marker.c (attach_marker, live_buffer, set_marker_internal):
1016 * nsterm.m (ns_compute_glyph_string_overhangs):
1017 * process.c (pset_buffer, pset_command)
1018 (pset_decode_coding_system, pset_decoding_buf)
1019 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1020 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1021 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1022 * syntax.c (bset_syntax_table, dec_bytepos):
1023 * terminal.c (tset_param_alist):
1024 * textprop.c (interval_has_some_properties)
1025 (interval_has_some_properties_list):
1026 * window.c (wset_combination_limit, wset_dedicated)
1027 (wset_display_table, wset_hchild, wset_left_fringe_width)
1028 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1029 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1030 (wset_right_fringe_width, wset_right_margin_cols)
1031 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1032 (wset_vertical_scroll_bar_type, wset_window_parameters):
1033 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1034 (wset_column_number_displayed, wset_region_showing)
1035 (window_box_edges, run_window_scroll_functions)
1036 (append_glyph_string_lists, prepend_glyph_string_lists)
1037 (append_glyph_string, set_glyph_string_background_width)
1038 (append_glyph, append_composite_glyph)
1039 (take_vertical_position_into_account):
1040 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1041 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1042 (lface_hash, lface_same_font_attributes_p, lookup_face):
1043 * xml.c (libxml2_loaded_p):
1044 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1045 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1046 Now 'static', not 'static inline'.
1047
05584c31
PE
1048 * bidi.c: Tune.
1049 (bidi_copy_it): Do the whole copy with a single memcpy.
1050 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1051
86ec63ba
PE
1052 Revert the FOLLOW-SYMLINKS change for file-attributes.
1053 Doing it right would require several changes to Tramp, and there's
1054 not enough time to get that tested before the freeze today.
1055 * dired.c (directory_files_internal, Ffile_attributes):
1056 Undo last change.
1057
82ef37c1
PE
1058 * frame.c (x_report_frame_params): Port better to wider ints.
1059 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1060 or that pointers can be printed in 15 decimal digits.
1061 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1062
62aba0d4
FP
10632012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1064
1065 Support x64 build on MS-Windows.
1066 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1067 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1068 compatibility with x64.
5e4daaf3 1069 (x_get_focus_frame): Add prototype.
62aba0d4
FP
1070
1071 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1072 defining an XRectangle structure.
1073
1074 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1075 arithmetics for compatibility with x64.
1076
1077 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1078 compatibility with x64.
1079
1080 * w32heap.h: Adjust prototypes and declarations.
1081
1082 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1083 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1084 DWORD, long, and unsigned long, for compatibility with x64.
1085 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1086 (sbrk): Argument is now of type ptrdiff_t.
1087
1088 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1089 less than 0x0500.
1090 (w32_msg_pump): Use WPARAM type for 'result'.
1091
1092 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1093 architecture.
1094 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1095 compatibility with x64.
1096
1097 * vm-limit.c (lim_data): Now size_t.
1098 (check_memory_limits): Adjust prototypes of real_morecore and
1099 __morecore to receive argument of type ptrdiff_t. Use size_t for
1100 five_percent and data_size.
1101
1102 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1103 variables, for compatibility with x64.
1104 (rva_to_section, offset_to_section, relocate_offset)
1105 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1106 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1107 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1108 for compatibility with x64.
1109
1110 * sysdep.c (STDERR_FILENO): Define if not already defined.
1111
1112 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1113 (__morecore): Argument type is now ptrdiff_t.
1114 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1115 (relinquish): Use ptrdiff_t type for 'excess'.
1116 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1117
1118 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1119 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1120 instead of a literal number.
1121
1122 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1123 (min): Define only if not already defined.
1124
1125 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1126 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1127 hosts.
1128
1129 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1130 'bitmaps' is a pointer.
1131
1132 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1133
1134 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1135
e7a2937b
PE
11362012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1137
1138 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1139 * dired.c (directory_files_internal, Ffile_attributes):
1140 New arg follow_symlinks. All uses changed.
1141
b43d62ae
SM
11422012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1143
1144 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1145
c06c382a
EZ
11462012-09-30 Eli Zaretskii <eliz@gnu.org>
1147
1148 Support atimers and CPU profiler via profile.c on MS-Windows.
1149 * w32proc.c (sig_mask, crit_sig): New static variables.
1150 (sys_signal): Support SIGALRM and SIGPROF.
1151 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 1152 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
1153 sigfillset, and sigprocmask are no longer no-ops.
1154 (sigismember): New function.
1155 (struct itimer_data): New definition.
1156 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1157 (crit_prof): New static variables.
1158 (MAX_SINGLE_SLEEP): New definition.
1159 (timer_loop, stop_timer_thread, term_timers, init_timers)
1160 (start_timer_thread, getitimer, setitimer): New functions.
1161 (alarm): No longer a no-op, calls setitimer.
1162
1163 * w32.c (term_ntproc): Call term_timers.
1164 (init_ntproc): Make sure all signals are unblocked at startup, to
1165 erase any traces of dumping. Call init_timers.
1166
1167 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1168 Windows-specific code to display the hourglass mouse pointer is no
1169 longer used.
1170 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1171 to hourglass timer expiration.
1172 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1173 Remove, no longer used.
b43d62ae
SM
1174 (w32_note_current_window, show_hourglass, hide_hourglass):
1175 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
1176 window systems.
1177 (syms_of_w32fns): Don't initialize hourglass_timer.
1178
1179 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1180 WINDOWSNT as well.
1181 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1182
1183 * w32.h (init_timers, term_timers): Add prototypes.
1184
95402d5f
KH
11852012-09-30 Kenichi Handa <handa@gnu.org>
1186
1187 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1188 to the buffer relocation which may be caused by ccl_driver.
1189
dd946752
JD
11902012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1191
d7e642cc
JD
1192 * xfns.c (Fx_file_dialog): Update comment.
1193
1194 * w32fns.c (Fx_file_dialog): Update comment.
1195
1196 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1197 Initialize panel name field if OSX >= 10.6.
1198
1199 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1200
dd946752
JD
1201 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1202
1203 * nsterm.m (NEW_STYLE_FS): New define.
1204 (ns_fullscreen_hook, windowWillEnterFullScreen)
1205 (windowDidEnterFullScreen, windowWillExitFullScreen)
1206 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1207 (setFSValue): New functions.
1208 (EmacsFSWindow): New implementation.
1209 (canBecomeKeyWindow): New function for EmacsFSWindow.
1210 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1211 (dealloc): Release nonfs_window if in fullscreen.
1212 (updateFrameSize:): Call windowDidMove to update top/left.
1213 (windowWillResize:toSize:): Check if frame is still maximized.
1214 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1215 next_maximized, maximized_width, maximized_height and nonfs_window.
1216 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1217 tbar_height.
1218 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 1219 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
1220
1221 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1222 (EmacsView): Add variables for fullscreen.
1223 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1224 (EmacsFSWindow): New interface for fullscreen.
1225
427730eb
JB
12262012-09-30 Juanma Barranquero <lekktu@gmail.com>
1227
1228 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1229
48de8b12
CY
12302012-09-30 Chong Yidong <cyd@gnu.org>
1231
1232 * fns.c (Frandom): Doc fix.
1233
5938d519
MR
12342012-09-30 Martin Rudalics <rudalics@gmx.at>
1235
1236 * window.c (Vwindow_combination_limit): New default value.
1237 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1238
cb5b0266
PE
12392012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1242 Suggested by Eli Zaretskii in
1243 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1244
84f72efd
EZ
12452012-09-30 Eli Zaretskii <eliz@gnu.org>
1246
1247 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1248 HAVE_TIMER_SETTIME is defined.
1249
9d4dcdc9
PE
12502012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1251
d89460ed
PE
1252 Profiler improvements: more-accurate timers, overflow checks.
1253 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1254 signal.h, setjmp.h. Include systime.h instead.
1255 (saturated_add): New function.
1256 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1257 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1258 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1259 New static vars.
84f72efd 1260 (enum profiler_cpu_running): New enum.
d89460ed
PE
1261 (profiler_cpu_running): Now of that enum type, not bool.
1262 All uses changed to store the new value.
1263 (handle_profiler_signal): Rename from sigprof_handler_1,
1264 for consistency with other handlers. Do not check whether
1265 cpu_log is a hash-table if garbage collecting, since it
1266 doesn't matter in that case.
1267 (deliver_profiler_signal): Rename from sigprof_handler,
1268 for consistency with other handlers.
1269 (setup_cpu_timer): New function, with much of what used to be in
1270 Fprofiler_cpu_start. Check for out-of-range argument.
1271 Prefer timer_settime if available, and prefer
1272 thread cputime clocks, then process cputime clocks, then
1273 monotonic clocks, to the old realtime clock. Use make_timeval
1274 to round more-correctly when falling back to setitimer.
1275 (Fprofiler_cpu_start): Use it.
1276 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1277 Don't assume that passing NULL as the 2nd argument of setitimer
1278 is the same as passing a pointer to all-zero storage.
1279 Ignore SIGPROF afterwards.
1280 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1281 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1282 non-fatal signal handlers. Ignore SIGPROF on startup.
1283 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1284 in profiler.c, since sysdep.c now uses it.
1285
9d4dcdc9
PE
1286 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1287 Suggested by Eli Zaretskii in
1288 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1289
8e5691a0
JB
12902012-09-29 Juanma Barranquero <lekktu@gmail.com>
1291
1292 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1293
e7c1b6ef
SM
12942012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1295
1296 * lisp.h (struct backtrace): Remove indirection for `function' field.
1297 * xdisp.c (redisplay_internal):
1298 * profiler.c (record_backtrace, sigprof_handler_1):
1299 * alloc.c (Fgarbage_collect):
1300 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1301 (Fbacktrace_frame): Adjust accordingly.
1302
e61d39cd 13032012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1304
1305 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1306 (Frun_hook_with_args_until_failure): Doc fixes.
1307
404043ea
EZ
13082012-09-28 Eli Zaretskii <eliz@gnu.org>
1309
1310 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1311 Qautomatic_redisplay and change the symbol name. All users changed.
1312
704d3f45
TM
13132012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1314
1315 * profiler.c (sigprof_handler): Fix race condition.
1316
757140ff
GM
13172012-09-28 Glenn Morris <rgm@gnu.org>
1318
1319 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1320
a615a3ae
PE
13212012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1322
1323 Check more robustly for timer_settime.
89d17fd0
PE
1324 * Makefile.in (LIB_TIMER_TIME): New macro.
1325 (LIBES): Add it.
a615a3ae
PE
1326 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1327 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1328 call timer_settime.
1329
3670daf7
TM
13302012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1331
1332 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1333
6a586b7f
JB
13342012-09-26 Juanma Barranquero <lekktu@gmail.com>
1335
1336 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1337
41c8bfcf
PE
13382012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1339
1340 * character.h (MAYBE_UNIFY_CHAR): Remove.
1341 * charset.c, charset.h (maybe_unify_char): Now static.
1342 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1343 Since this stuff is now private to charset.c, there's no need for
1344 a public macro and no need to inline by hand.
1345
3a880af4
SM
13462012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1347 Stefan Monnier <monnier@iro.umontreal.ca>
1348 Juanma Barranquero <lekktu@gmail.com>
611b7507 1349
3a880af4
SM
1350 * profiler.c: New file.
1351 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1352 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1353 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1354 * emacs.c (main): Call syms_of_profiler.
1355 * alloc.c (Qautomatic_gc): New constant.
1356 (MALLOC_PROBE): New macro.
1357 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1358 (total_bytes_of_live_objects): New function.
1359 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1360 Call malloc_probe for the memory profiler.
1361 (syms_of_alloc): Define Qautomatic_gc.
1362 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1363 race condition.
1364 (struct backtrace): Move definition...
1365 * lisp.h (struct backtrace): ..here.
1366 (Qautomatic_gc, profiler_memory_running): Declare vars.
1367 (malloc_probe, syms_of_profiler): Declare functions.
1368 * xdisp.c (Qautomatic_redisplay): New constant.
1369 (redisplay_internal): Record itself in backtrace_list.
1370 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1371
5938d519 13722012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
13732012-09-25 Juanma Barranquero <lekktu@gmail.com>
1374
1375 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1376
e26fd2e4
PE
13772012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1378
1379 Prefer POSIX timers if available.
1380 They avoid a race if the timer is too close to the current time.
1381 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1382 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1383 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1384
eedec3ee
EZ
13852012-09-25 Eli Zaretskii <eliz@gnu.org>
1386
1387 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1388 CHAR_STRING_ADVANCE.
1389 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1390 STRING_CHAR_ADVANCE.
1391
aa15c6bb
JB
13922012-09-25 Juanma Barranquero <lekktu@gmail.com>
1393
1394 Move Vlibrary_cache to emacs.c and reset before dumping.
1395
1396 * lisp.h (reset_image_types): Declare.
1397 [WINDOWSNT] (Vlibrary_cache): Declare.
1398
1399 * image.c (reset_image_types): New function.
1400
1401 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1402 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1403 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1404
1405 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1406 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1407
1408 * w32.h (Vlibrary_cache): Do not declare.
1409
54d629be
EZ
14102012-09-25 Eli Zaretskii <eliz@gnu.org>
1411
16b22fef
EZ
1412 * w32proc.c (sys_signal): Handle all signals defined by the
1413 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1414 handlers for signals supported by Windows. Don't override
1415 term_ntproc as the handler for SIGABRT.
1416 (sigaction): Rewrite to call sys_signal instead of duplicating its
1417 code.
1418 (sys_kill): Improve commentary.
1419
1420 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1421 consistency with a signature of a signal handler. All callers
1422 changed.
1423 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1424 install term_ntproc as a signal handler for SIGABRT, as that
1425 should be done by the dumped Emacs.
1426
1427 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1428
1429 * w32select.c (term_w32select): Protect against repeated
1430 invocation by setting clipboard_owner to NULL after calling
1431 DestroyWindow.
1432
1433 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1434 and term_ntproc to their modified signatures.
1435
54d629be
EZ
1436 * character.c (char_string, string_char): Remove calls to
1437 MAYBE_UNIFY_CHAR. See the discussion starting at
1438 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1439 for the details.
1440
59f7af81
CY
14412012-09-25 Chong Yidong <cyd@gnu.org>
1442
1443 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1444
22e8cf4a
SM
14452012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1446
1447 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1448 when encountering an unknown bytecode.
1449
578098f3
PE
14502012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 image.c, indent.c: Use bool for booleans.
1453 * dispextern.h (struct image_type): Members valid_p, load, init
1454 now return bool, not int. All uses changed.
1455 * image.c: Omit unnecessary static decls.
1456 (x_create_bitmap_mask, x_build_heuristic_mask):
1457 Return void, not int, since callers don't care about the return value.
1458 (x_create_bitmap_mask, define_image_type, valid_image_p)
1459 (struct image_keyword, parse_image_spec, image_spec_value)
1460 (check_image_size, image_background)
1461 (image_background_transparent, x_clear_image_1)
1462 (postprocess_image, lookup_image, x_check_image_size)
1463 (x_create_x_image_and_pixmap, xbm_image_p)
1464 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1465 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1466 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1467 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1468 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1469 (png_image_p, init_png_functions, png_load_body, png_load)
1470 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1471 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1472 (init_gif_functions, gif_load, imagemagick_image_p)
1473 (imagemagick_load_image, imagemagick_load, svg_image_p)
1474 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1475 (gs_load):
1476 * nsimage.m (ns_load_image):
1477 * nsterm.m (ns_defined_color):
1478 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1479 * xfns.c (x_defined_color):
1480 * xterm.c (x_alloc_lighter_color_for_widget)
1481 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1482 (x_alloc_lighter_color):
1483 * indent.c (disptab_matches_widthtab, current_column)
1484 (scan_for_column, string_display_width, indented_beyond_p)
1485 (compute_motion, vmotion, Fvertical_motion):
1486 Use bool for booleans.
1487
a5f2b6ec
CY
14882012-09-24 Chong Yidong <cyd@gnu.org>
1489
1490 * chartab.c (Fset_char_table_default): Obsolete function removed.
1491
18e27ea8
PE
14922012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1493
afea8a8a
PE
1494 Move pid_t related decls out of lisp.h.
1495 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1496 (interruptible_wait_for_termination):
1497 Move these decls from lisp.h to syswait.h, since they use pid_t.
1498 Needed on FreeBSD; see Herbert J. Skuhra in
1499 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1500 * callproc.c: Include syswait.h.
1501
18e27ea8
PE
1502 gnutls.c, gtkutil.c: Use bool for boolean.
1503 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1504 (emacs_gnutls_handle_error):
1505 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1506 (xg_hide_tooltip, xg_create_frame_widgets)
1507 (create_dialog, xg_uses_old_file_dialog)
1508 (xg_get_file_with_chooser, xg_get_file_with_selection)
1509 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1510 (xg_item_label_same_p, xg_update_menubar)
1511 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1512 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1513 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1514 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1515 (update_frame_tool_bar, free_frame_tool_bar):
1516 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1517 * nsmenu.m (ns_update_menubar):
1518 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1519 * xfns.c (Fx_show_tip) [USE_GTK]:
1520 Use bool for boolean.
1521 * gtkutil.c (xg_update_frame_menubar):
1522 * xmenu.c (update_frame_menubar):
1523 Return void, not int, since caller ignores return value.
1524 * gtkutil.c (xg_change_toolbar_position):
1525 Return void, not 1.
1526
af0e9f75
JB
15272012-09-23 Juanma Barranquero <lekktu@gmail.com>
1528
1529 * makefile.w32-in (BLOCKINPUT_H): Remove.
1530 (SYSSIGNAL_H): New macro.
1531 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1532 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1533 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1534 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1535 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1536 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1537 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1538 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1539 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1540 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1541 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1542 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1543 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1544 ($(BLD)/w32xfns.$(O)): Update dependencies.
1545
5101529e
EZ
15462012-09-23 Eli Zaretskii <eliz@gnu.org>
1547
1548 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1549 fatal_error_backtrace.
1550
1551 * w32proc.c (sys_kill): Undo last change: don't do anything when
1552 invoked to deliver SIGABRT to our own process. This is now
1553 handled by emacs_raise.
1554
2c3ee0ad
JB
15552012-09-23 Juanma Barranquero <lekktu@gmail.com>
1556
1557 * w32term.c (w32_read_socket): Remove leftover reference to
1558 interrupt_input_pending.
1559
62a1d661
PE
15602012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1561
1562 Do not use SA_NODEFER.
1563 Problem reported by Dani Moncayo in
1564 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1565 * alloc.c (die):
1566 * sysdep.c (emacs_abort): Do not reset signal handler.
1567 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1568 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1569 wanted even on POSIXish hosts, and it doesn't work on Windows.
1570
a0942b9a
JD
15712012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1572
1573 * xterm.c (x_term_init): Call fixup_locale before and after calling
1574 gtk_init (Bug#12392).
1575
d07ff9db
CY
15762012-09-23 Chong Yidong <cyd@gnu.org>
1577
1578 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1579 Vdynamic_library_alist.
1580
1581 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1582 (Fgnutls_available_p): Caller changed.
1583
1584 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1585 (Flibxml_parse_xml_region): Likewise.
1586
1587 * dispextern.h (struct image_type): Remove arg from init function.
1588
1589 * image.c (Finit_image_library, lookup_image_type)
1590 (define_image_type): Remove now-unneeded second arg.
1591 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1592 (init_tiff_functions, init_gif_functions, init_svg_functions):
1593 Arglist and w32_delayed_load calling convention changed.
1594 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1595 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1596
4d7e6e51
PE
15972012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1598
1599 Simplify and avoid signal-handling races (Bug#12471).
1600 * alloc.c (die):
1601 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1602 Avoid recursive loop if there's a fatal error in the function itself.
1603 * atimer.c (pending_atimers):
1604 * blockinput.h: Don't include "atimer.h"; no longer needed.
1605 (interrupt_input_pending): Remove. All uses removed.
1606 pending_signals now counts both atimers and ordinary interrupts.
1607 This is less racy than having three separate pending-signal flags.
1608 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1609 (input_blocked_p):
1610 Rename from their upper-case counterparts BLOCK_INPUT,
1611 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1612 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1613 This makes it easier to access volatile variables more accurately.
1614 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1615 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1616 that's more reliable if the code is buggy and sets
1617 interrupt_input_blocked to a negative value. All uses changed.
1618 * atimer.c (deliver_alarm_signal):
1619 Remove. No need to deliver this to the parent; any thread can
1620 handle this signal now. All uses replaced by underlying handler.
1621 * atimer.c (turn_on_atimers):
1622 * dispnew.c (handle_window_change_signal):
1623 * emacs.c (handle_danger_signal):
1624 * keyboard.c (kbd_buffer_get_event):
1625 Don't reestablish signal handler; not needed with sigaction.
1626 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1627 (UNBLOCK_INPUT_TO):
1628 Rework to avoid unnecessary accesses to volatile variables.
1629 (UNBLOCK_INPUT_TO): Now a function.
1630 (totally_unblock_input, unblock_input): New decls.
1631 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1632 (init_data): Remove. Necessary stuff now done in init_signal.
1633 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1634 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1635 (fatal_error_code): Remove; no longer needed.
1636 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1637 it doesn't always backtrace. All uses changed. No need to reset
1638 signal to default, since sigaction and/or die does that for us now.
1639 Use emacs_raise (FOO), not kill (getpid (), FOO).
1640 (main): Check more-accurately whether we're dumping.
1641 Move fatal-error setup to sysdep.c
1642 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1643 * gtkutil.c (xg_get_file_name, xg_get_font):
1644 Remove no-longer-needed signal-mask manipulation.
1645 * keyboard.c, process.c (POLL_FOR_INPUT):
1646 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1647 * keyboard.c (read_avail_input): Remove.
1648 All uses replaced by gobble_input.
1649 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1650 (kbd_buffer_store_event_hold, gobble_input):
1651 (record_asynch_buffer_change) [USABLE_SIGIO]:
1652 (store_user_signal_events):
1653 No need to mess with signal mask.
1654 (gobble_input): If blocking input and there are terminals, simply
1655 set pending_signals to 1 and return. All hooks changed to not
1656 worry about whether input is blocked.
1657 (process_pending_signals): Clear pending_signals before processing
1658 them, in case a signal comes in while we're processing.
1659 By convention callers now test pending_signals before calling us.
1660 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1661 New functions, to support changes to blockinput.h.
1662 (handle_input_available_signal): Now extern.
1663 (reinvoke_input_signal): Remove. All uses replaced by
1664 handle_async_input.
1665 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1666 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1667 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1668 Clear sigmask reliably, even if Fsignal returns, which it can.
1669 Omit unnecessary accesses to volatile var.
1670 (quit_throw_to_read_char): No need to restore sigmask.
1671 * keyboard.c (gobble_input, handle_user_signal):
1672 * process.c (wait_reading_process_output):
1673 Call signal-handling code rather than killing ourselves.
1674 * lisp.h: Include <float.h>, for...
1675 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1676 (pending_signals): Now volatile.
1677 (syms_of_data): Now const if IEEE floating point.
1678 (handle_input_available_signal) [USABLE_SIGIO]:
1679 (terminate_due_to_signal, record_child_status_change): New decls.
1680 * process.c (create_process): Avoid disaster if memory is exhausted
1681 while we're processing a vfork, by tightening the critical section
1682 around the vfork.
1683 (send_process_frame, process_sent_to, handle_pipe_signal)
1684 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1685 ignores SIGPIPE.
1686 (send_process): No need for setjmp/longjmp any more, since the
1687 SIGPIPE stuff is now gone. Instead, report an error if errno
1688 is EPIPE.
1689 (record_child_status_change): Now extern. PID and W are now args.
1690 Return void, not bool. All callers changed.
1691 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1692 Remove. All uses removed. This bug should be fixed now in a
1693 different way.
1694 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1695 and record the child status change directly. This avoids the
1696 need to futz with the signal mask.
1697 (process_fatal_action): Move here from emacs.c.
1698 (emacs_sigaction_flags): New function, containing
1699 much of what used to be in emacs_sigaction_init.
1700 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1701 caught by emacs, to make races less likely.
1702 (deliver_process_signal): Rename from handle_on_main_thread.
1703 All uses changed.
1704 (BACKTRACE_LIMIT_MAX): Now at top level.
1705 (thread_backtrace_buffer, threadback_backtrace_pointers):
1706 New static vars.
1707 (deliver_thread_signal, deliver_fatal_thread_signal):
1708 New functions, for more-accurate delivery of thread-specific signals.
1709 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1710 (deliver_arith_signal): Handle in this thread, not
1711 in the main thread, since it's triggered by this thread.
1712 (maybe_fatal_sig): New function.
1713 (init_signals): New arg DUMPING so that we can be more accurate
1714 about whether we're dumping. Caller changed.
1715 Treat thread-specific signals differently from process-general signals.
1716 Block all signals while handling fatal error; that's safer.
1717 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1718 on IEEE hosts.
1719 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1720 Ignore SIGPIPE unless batch.
1721 (emacs_backtrace): Output backtrace for the appropriate thread,
1722 which is not necessarily the main thread.
1723 * syssignal.h: Include <stdbool.h>.
1724 (emacs_raise): New macro.
1725 * xterm.c (x_connection_signal): Remove; no longer needed
1726 now that we use sigaction.
1727 (x_connection_closed): No need to mess with sigmask now.
1728 (x_initialize): No need to reset SIGPIPE handler here, since
1729 init_signals does this for us now.
1730
8f4635e9
JD
17312012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1732
1733 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1734 background rect may be larger (Bug#12245).
8f4635e9 1735
3296976d
CY
17362012-09-23 Chong Yidong <cyd@gnu.org>
1737
1738 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1739
d41e491e
PE
17402012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 * .gdbinit: Just stop at fatal_error_backtrace.
1743 See Stefan Monnier's request in
1744 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1745 Remove no-longer-used query of system type.
1746
c88b867f
CY
17472012-09-22 Chong Yidong <cyd@gnu.org>
1748
1749 * search.c (Freplace_match): Doc fix (Bug#12325).
1750
1751 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1752
1753 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1754 (Fline_end_position): Doc fix.
1755
1756 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1757
bb4d86b4
CY
17582012-09-22 Chong Yidong <cyd@gnu.org>
1759
1760 * dispextern.h (struct image_type): Add new slot, storing a type
1761 initialization function.
1762
1763 * image.c (define_image_type): Call the image initializer function
1764 if it is defined. Arguments and return value changed.
1765 (valid_image_p, make_image): Callers changed.
1766 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1767 (gif_type, imagemagick_type, svg_type, gs_type):
1768 Add initialization functions.
bb4d86b4
CY
1769 (Finit_image_library): Call lookup_image_type.
1770 (CHECK_LIB_AVAILABLE): Macro deleted.
1771 (lookup_image_type): Call define_image_type here, rather than via
1772 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1773 (syms_of_image): Move define_image_type calls for xbm_type and
1774 pbm_type to lookup_image_type.
1775
df9685f3
EZ
17762012-09-22 Eli Zaretskii <eliz@gnu.org>
1777
1778 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1779 'idle_timers' from here ...
1780 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1781 lists, to avoid infloops when the timer does something stupid,
1782 like reinvoke itself with the same or smaller time-out.
1783 (Bug#12447)
1784
8e17c9ba
MR
17852012-09-22 Martin Rudalics <rudalics@gmx.at>
1786
1787 * window.c (Fsplit_window_internal): Handle only Qt value of
1788 Vwindow_combination_limit separately.
1789 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1790 (Vwindow_combination_limit): New default value.
1791 Rewrite doc-string.
8e17c9ba 1792
589bd69b
EZ
17932012-09-22 Eli Zaretskii <eliz@gnu.org>
1794
1795 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1796 the new overlay string. (Bug#10159)
1797
01108e3f
PE
17982012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1799
1800 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1801 or that fprintf is async-signal-safe. POSIX doesn't require
1802 either assumption.
1803
82f8cd94
CY
18042012-09-22 Chong Yidong <cyd@gnu.org>
1805
1806 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1807 (Bug#8207).
1808
3cccbd87
KH
18092012-09-22 Kenichi Handa <handa@gnu.org>
1810
1811 * composite.c (composition_reseat_it): Handle the case that a
1812 grapheme cluster is not covered by a single font (Bug#12352).
1813
09c01941
CY
18142012-09-21 Chong Yidong <cyd@gnu.org>
1815
1816 * image.c (define_image_type): Avoid adding duplicate types to
1817 image_types (Bug#12463). Suggested by Jörg Walter.
1818
acfa068f 18192012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1820
1821 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1822 (print_load_command_name): Add case LC_DATA_IN_CODE.
1823 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1824
acfa068f 18252012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1826
1827 * eval.c (Frun_hook_with_args_until_success)
1828 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1829
acfa068f 18302012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1831
1832 * fileio.c (Ffile_selinux_context): Only call freecon when
1833 lgetfilecon succeeded.
1834 (Fset_file_selinux_context): Likewise. (Bug#12444)
1835
acfa068f 18362012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1837
1838 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1839 reordering, locate the cursor by calling set_cursor_from_row; if
1840 that fails, clear the desired glyph matrix before returning a
1841 failure indication to the caller. Fixes leaving garbled display
1842 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1843 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1844 scrolling through multibyte text.
aa36e4d2 1845
e99f70c8
SM
18462012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1847
1848 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1849 calling mark_vectorlike since that's the one that marks the window.
1850 (mark_discard_killed_buffers): Mark the final cdr.
1851 * window.h (struct window): Move prev/next_buffers to the
1852 non-standard fields.
1853 * window.c (make_window): Initialize prev/next_buffers manually.
1854
f75beb47
PE
18552012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 Omit unused arg EXPECTED from socket hooks.
1858 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1859 * nsterm.m (ns_term_init):
1860 * termhooks.h (struct terminal.read_socket_hook):
1861 * w32inevt.c (w32_console_read_socket):
1862 * w32term.c (w32_read_socket):
1863 * xterm.c (XTread_socket):
1864 Omit unused arg EXPECTED. All callers changed.
1865 (store_user_signal_events): Return void, not int, since callers no
1866 longer care about the return value. All uses changed.
1867
b019b76a
JB
18682012-09-20 Juanma Barranquero <lekktu@gmail.com>
1869
1870 * w32gui.h (XParseGeometry): Do not declare.
1871
05642592
PE
18722012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1873
e4bce92a 1874 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 1875 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
1876 <http://bugs.gnu.org/12471#8> (last line).
1877
05642592
PE
1878 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1879 (XParseGeometry): Now static. Substitute extremal values for
1880 values that are out of range.
1881
e543ae91
JD
18822012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1883
1884 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1885
1886 * nsfns.m (XParseGeometry): Remove.
1887 (Fx_create_frame): Call x_set_offset to correctly interpret
1888 top_pos in geometry.
1889
3a880af4 1890 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1891 (Fx_parse_geometry): If there is a space in string, call
1892 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1893
45ba16c7
EZ
18942012-09-17 Eli Zaretskii <eliz@gnu.org>
1895
c8b9f1bc
EZ
1896 * search.c (scan_buffer): Use character positions in calls to
1897 region_cache_forward and region_cache_backward, not byte
1898 positions. (Bug#12196)
1899
b4c932a2
EZ
1900 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1901 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1902
45ba16c7
EZ
1903 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1904 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1905 emacs_blocked_malloc, now deleted.
1906
eeceac93
PE
19072012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1908
1909 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1910 The workaround was for improving performance on Solaris 2.4, but
1911 is getting in the way now. Emacs will still work if someone is
1912 still running Solaris 2.4 in a museum somewhere; Sun dropped
1913 support for Solaris 2.4 in 2003.
1914 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1915 * process.c (create_process) [HAVE_WORKING_VFORK]:
1916 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1917 since Emacs no longer uses vfork on that platform.
1918
78f83752
GM
19192012-09-17 Glenn Morris <rgm@gnu.org>
1920
1921 * emacs.c: Use COPYRIGHT.
1922
634b8cac
PE
19232012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1924
0caaedb1
PE
1925 Remove configure's --without-sync-input option (Bug#12450).
1926 When auditing signal-handling in preparation for cleaning it up,
1927 I found that SYNC_INPUT has race conditions and would be a real
1928 pain to fix. Since it's an undocumented and deprecated
1929 configure-time option, now seems like a good time to remove it.
1930 Also see <http://bugs.gnu.org/11080#16>.
1931 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1932 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1933 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1934 (malloc_hysteresis):
1935 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1936 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1937 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1938 (dont_register_blocks, bytes_used_when_reconsidered)
1939 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1940 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1941 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 1942 Remove. All uses removed.
0caaedb1
PE
1943 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1944 implementation, one that depends on whether the new macro
1945 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1946 is defined.
1947 * atimer.c (run_timers, handle_alarm_signal):
1948 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1949 (handle_async_input, process_pending_signals)
1950 (handle_input_available_signal, init_keyboard):
1951 * nsterm.m (ns_read_socket):
1952 * process.c (wait_reading_process_output):
1953 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1954 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1955 (emacs_write):
1956 * xterm.c (XTread_socket):
1957 Assume SYNC_INPUT.
1958 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1959 * eval.c (handling_signal): Remove. All uses removed.
1960 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1961 All uses replaced with the SYNC_INPUT version.
1962 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1963 Remove decls.
1964 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1965 Now static.
1966
634b8cac
PE
1967 * font.c (Ffont_shape_gstring): Remove unused local.
1968
83da1b55
GM
19692012-09-16 Glenn Morris <rgm@gnu.org>
1970
518650a5
GM
1971 * Makefile.in (clean): No longer run nextstep's clean.
1972
83da1b55
GM
1973 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1974 (ns_frag): Remove.
1975 (ns-app): Move here from ns.mk, and simplify.
1976 (clean): Simplify nextstep entry.
1977 * ns.mk: Remove file.
1978
85a43e2e
KH
19792012-09-17 Kenichi Handa <handa@gnu.org>
1980
1981 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1982 not covert the last few charactes.
1983
ba13e616 19842012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1985
1986 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1987 here, but just check the validity of glyphs in the glyph-string.
1988
a8c729af
MR
19892012-09-16 Martin Rudalics <rudalics@gmx.at>
1990
3a880af4
SM
1991 * window.c (Fwindow_parameter, Fset_window_parameter):
1992 Accept any window as argument (Bug#12452).
a8c729af 1993
c077c059
JD
19942012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1995
1996 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1997 to ns_term_init to avoid memory leak.
1998
1999 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2000 explicit retain/release.
2001 (ns_term_init): Only allow one display. Initialize outerpool and
2002 ns_*_types.
2003
39a57ad0
PE
20042012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2007 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2008 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2009 the Microsoft problem in a different way, by altering ../nt/config.nt.
2010
7105c8cb
EZ
20112012-09-15 Eli Zaretskii <eliz@gnu.org>
2012
2013 * w32xfns.c:
2014 * w32uniscribe.c:
2015 * w32term.c:
2016 * w32select.c:
2017 * w32reg.c:
2018 * w32proc.c:
2019 * w32menu.c:
2020 * w32inevt.c:
2021 * w32heap.c:
2022 * w32font.c:
2023 * w32fns.c:
2024 * w32console.c:
2025 * w32.c:
2026 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2027 by lisp.h. This completes removal of setjmp.h inclusion
2028 erroneously announced in the previous commit. (Bug#12446)
2029
2030 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2031 more accurate.
2032
2033 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2034 not defined as a macro. The latter happens on MS-Windows.
2035 (Bug#12446)
2036
0328b6de
PE
20372012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2040 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 2041 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
2042 only reason for the instance was because "lisp.h" was included.
2043 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2044 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2045 and _longjmp with the new symbols. Emacs already uses _setjmp if
2046 available, so this change affects only POSIXish hosts that have
2047 sigsetjmp but not _setjmp, such as some versions of Solaris and
2048 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2049 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2050 (png_load_body) [HAVE_PNG]:
2051 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2052 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2053 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2054 since PNG requires jmp_buf. This is the only exception to the
2055 general rule that we now use sys_setjmp and sys_longjmp.
2056 This exception is OK since this code does not change the signal
2057 mask or longjmp out of a signal handler.
2058
2af03429
PE
20592012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2060
2061 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2062 Include "syssignal.h", for 'main_thread'.
2063
2f294edf
DA
20642012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2065
2066 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
2067 * insdel.c (replace_range, replace_range_2):
2068 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
2069 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2070 Remove redundant check before calling offset_intervals.
2071
6b533e9c
MR
20722012-09-14 Martin Rudalics <rudalics@gmx.at>
2073
2074 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2075 current buffer (Bug#12387).
2076
2a7931e3
JB
20772012-09-14 Juanma Barranquero <lekktu@gmail.com>
2078
2079 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2080
c18e885b
PE
20812012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2082
2083 Use a more backwards-compatible timer format (Bug#12430).
2084 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2085 vector element, not from the 4th, since PSECS is now at the end.
2086 (Fcurrent_idle_time): Doc fix.
2087
d59a1afb
DA
20882012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2089
2090 Function to mark objects and remove killed buffers at once.
2091 * alloc.c (discard_killed_buffers): Rename to ...
2092 (mark_discard_killed buffers) ... new name. Add marking
2093 of remaining objects. Fix comment. Adjust users.
2094 (mark_object): Do not touch frame buffer lists here.
2095 * frame.c (delete_frame): Reset frame buffer lists here.
2096
5f0cb45a
PE
20972012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2098
8ea47e3a
PE
2099 Better workaround for GNOME bug when --enable-gcc-warnings.
2100 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2101 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2102 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2103
4a4bbad2
PE
2104 Simplify SIGIO usage (Bug#12408).
2105 The code that dealt with SIGIO was crufty and confusing, e.g., it
2106 played tricks like "#undef SIGIO" but these tricks were not used
2107 consistently. Simplify mostly by not #undeffing standard symbols,
2108 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2109 or not as we please) rather than "defined SIGIO" (standard symbol
2110 that we probably shouldn't #undef).
2111 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2112 Modules that need it can include it.
2113 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2114 * dispextern.h (ignore_sigio): New decl.
2115 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2116 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2117 * emacs.c (shut_down_emacs):
2118 * keyboard.c (kbd_buffer_store_event_hold):
2119 Use ignore_sigio rather than invoking 'signal' directly.
2120 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2121 for FIONREAD.
2122 (FIONREAD, SIGIO): Do not #undef.
2123 (tty_read_avail_input): Use #error rather than a syntax error.
2124 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2125 for I_PIPE, used by SETUP_SLAVE_PTY.
2126 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2127 * sysdep.c (croak): Remove; no longer needed. This bit of
2128 temporary code, with Fred N. Fish's comment that it's temporary,
2129 has been in Emacs since at least 1992!
2130 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2131 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2132 * syssignal.h (croak): Remove decl.
2133 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2134 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2135 now that we're termios-only.
2136 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2137 * term.c (dissociate_if_controlling_tty): Use #error rather than
2138 a run-time error.
2139
5f0cb45a
PE
2140 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2141 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2142 to work around GNOME bug 683906.
2143 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2144 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2145 This works around GCC bug 54561.
2146
40bce90b
PE
21472012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2148
2149 More fixes for 'volatile' and setjmp/longjmp.
2150 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2151 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2152 (png_load_body) [HAVE_PNG]:
2153 (jpeg_load_body) [HAVE_JPEG]:
2154 New function, with most of the old parent function's body.
2155 (png_load) [HAVE_PNG]:
2156 (jpeg_load) [HAVE_JPEG]:
2157 Invoke the new function, to avoid longjmp munging our locals.
2158 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2159 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2160 longjmp is passed 2, as the C standard doesn't guarantee this.
2161 Instead, store the failure code into mgr->failure_code.
2162
bfeae2cf
SM
21632012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2164
2165 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2166 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2167 (syms_of_keyboard): Remove support for unread-command-char.
2168
8099e36b
EZ
21692012-09-12 Eli Zaretskii <eliz@gnu.org>
2170
2171 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2172 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2173 violation. (Bug#12426)
2174
92547ff9
PE
21752012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2178
45b82ad0
SM
21792012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2180
2181 * eval.c: Add `inhibit-debugger'.
2182 (Qinhibit_debugger): New symbol.
2183 (call_debugger): Bind it instead of Qdebug_on_error.
2184 (maybe_call_debugger): Test Vinhibit_debugger.
2185 (syms_of_eval): Define inhibit-debugger.
2186 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2187 (syms_of_xdisp): Remove inhibit-debug-on-message.
2188
5779a1dc
PE
21892012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2190
50f2e553
PE
2191 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2192 If a nonvolatile local variable is written before a _longjmp to
2193 the frame containing the variable, and is read after the _longjmp,
2194 the value read is indeterminate. Some local variables of type
2195 'struct handler' and 'struct catchtag' are used in this way, so
2196 mark each of their slots as volatile if the slot can be set before
2197 _longjmp and read afterwards.
2198 * lisp.h (struct handler): var and chosen_clause are now volatile.
2199 (struct catchtag): val, next, and pdlcount are now volatile.
2200
ae1d87e2
PE
2201 * bidi.c (bidi_push_it, bidi_pop_it):
2202 * fns.c (copy_hash_table):
2203 * image.c (define_image_type):
2204 * keyboard.c (kbd_buffer_store_event_hold):
2205 * process.c (Fprocess_send_eof):
2206 * xfaces.c (x_create_gc) [HAVE_NS]:
2207 * xgselect.c (xg_select):
2208 Prefer assignment to memcpy when either will do.
2209
5779a1dc
PE
2210 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2211 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2212 time an item is removed. No need to mark this function 'inline';
2213 the compiler knows better than we do.
2214
c4c9756b
JD
22152012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2216
2217 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2218 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2219 to change_frame_size (Bug#12388).
2220 (windowDidResize:): Pass YES to updateFrameSize.
2221
2222 * nsterm.h: Add delay parameter to updateFrameSize.
2223
d73e321c
DA
22242012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Discard killed buffers from deleted window and frame objects.
2227 This reduces an amount of references to killed buffers and
2228 helps GC to reclaim them faster.
2229 * alloc.c (discard_killed_buffers): New function.
2230 (mark_object): Use it for deleted windows and frames.
2231 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 2232 or deleted frame, restore its global binding.
d73e321c
DA
2233 * data.c (swap_in_global_binding): Add GC notice.
2234 (swap_in_symval_forwarding): Use convenient set_blv_where.
2235 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2236 * window.h: ... to here.
2237
e578f381
DA
22382012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2239
2240 Convenient macro to check whether the buffer is live.
2241 * buffer.h (BUFFER_LIVE_P): New macro.
2242 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2243 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2244
3057e615
YM
22452012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2246
2247 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2248 composition cases (Bug#12364).
2249
2250 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2251 overhang of succeeding glyphs overlapping box cursor.
2252
2253 * w32term.c (x_draw_glyph_string): Likewise.
2254
6fda35f2
PE
22552012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2256
c990426a
PE
2257 Simplify, document, and port floating-point (Bug#12381).
2258 The porting part of this patch fixes bugs on non-IEEE platforms
2259 with frexp, ldexp, logb.
2260 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2261 Now static.
2262 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2263 support, by removing commented-out code and briefly listing the
2264 C89 functions excluded. The commented-out stuff was confusing
2265 maintenance, e.g., we thought we needed cbrt but it was commented out.
2266 (logb): Remove decl; no longer needed.
2267 (isfinite): New macro, if not already supplied.
2268 (isnan): Don't replace any existing macro.
2269 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2270 are present on all C89 platforms.
2271 (Ffrexp): Do not special-case zero, as frexp does the right thing
2272 for that case.
2273 (Flogb): Do not use logb, as it doesn't have the desired meaning
2274 on hosts that use non-base-2 floating point. Instead, stick with
2275 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2276 frexp, to avoid getting an unspecified result.
2277
6fda35f2
PE
2278 * xdisp.c (Qinhibit_debug_on_message): Now static.
2279
16130a58
JD
22802012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2281
2282 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2283 NSBezierPath (Bug#12131).
2284
d105a573
CY
22852012-09-10 Chong Yidong <cyd@gnu.org>
2286
2287 * fns.c (Fdelq, Fdelete): Doc fix.
2288
ff55dfe8
PE
22892012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2290
2291 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2292 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2293
e7032e7c
SM
22942012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2295
2296 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2297 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2298 Use it.
2299
e9957956
EZ
23002012-09-09 Eli Zaretskii <eliz@gnu.org>
2301
aba05ce9
EZ
2302 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2303 left fringe if the window has a left margin. This avoids leaving
2304 traces of the cursor because its leftmost pixel is not drawn over.
2305
e9957956
EZ
2306 * dispnew.c (update_window_line): When the left margin area of a
2307 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2308 that screen line. (Bug#12277)
2309
f6196b87
PE
23102012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 Assume C89 or later for math functions (Bug#12381).
2313 This simplifies the code, and makes it a bit smaller and faster,
2314 and (most important) makes it easier to clean up signal handling
2315 since we can stop worring about floating-point exceptions in
2316 library code. That was a problem before C89, but the problem
2317 went away many years ago on all practical Emacs targets.
2318 * data.c, image.c, lread.c, print.c:
2319 Don't include <math.h>; no longer needed.
2320 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2321 might be autoconfigured, as that never happens.
2322 * data.c (fmod):
2323 * doprnt.c (DBL_MAX_10_EXP):
2324 * print.c (DBL_DIG):
2325 Remove. C89 or later always defines these.
2326 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2327 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2328 (arith_error, domain_error, domain_error2):
2329 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2330 no longer needed -- we simply return what C returns. All uses removed.
2331 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2332 the wrapped code.
2333 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2334 Remove. All uses expanded, as these macros are no longer used
2335 more than once and are now more trouble than they're worth.
2336 (Ftan): Use tan, not sin / cos.
2337 (Flogb): Assume C89 frexp.
2338 (fmod_float): Assume C89 fmod.
2339 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2340 (init_floatfns): Remove. All uses removed.
2341
9d7f1863
JD
23422012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2343
2344 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2345 compositeToPoint for OSX < 10.6 (Bug#12390).
2346
eabf0404
PE
23472012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2350 This produces more-accurate results.
2351
0b3b1d23
JD
23522012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2353
2354 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2355 changes (Bug#12088).
2356
6dcef6ec
CY
23572012-09-08 Chong Yidong <cyd@gnu.org>
2358
2359 * syntax.c (Fstring_to_syntax): Doc fix.
2360
aa7d57c5
JD
23612012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2362
2363 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2364 in the internal border.
2365 (x_set_window_size): Remove static variables and their usage.
2366 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2367 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2368 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2369 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2370 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2371 (ns_fix_rect_ibw): Remove.
2372 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2373 (ns_dumpglyphs_box_or_relief): Ditto.
2374 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2375 adjustment.
2376 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2377 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2378 border adjustment.
2379 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2380 their usage. Add fringe_extended_p and its use as in other terms.
2381 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2382 scroll bar was removed.
2383 (updateFrameSize): New function.
2384 (windowDidResize): Move code to updateFrameSize and call it.
2385
2386 * nsterm.h (EmacsView): Add updateFrameSize.
2387
1a5432bc
CY
23882012-09-07 Chong Yidong <cyd@gnu.org>
2389
b4f5313e
CY
2390 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2391
1a5432bc
CY
2392 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2393
1a4f1e9b
PE
23942012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2397 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2398 Problem introduced when merging patches. Noted by Eli Zaretskii in
2399 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2400 * floatfns.c: Comment fix.
2401 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2402 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2403 and anyway the declaration is harmless even if SIGDANGER is not defined.
2404 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2405 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2406 source files not surprisingly expected syssignal.h to define, or
2407 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2408 Include <sys/ioctl.h>, for FIONREAD.
2409 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2410 This eliminates a problem whereby other files mysteriously had
2411 to include "syssignal.h" before including "systty.h" if they
2412 wanted to use "#ifdef SIGIO".
2413
bc8000ff
EZ
24142012-09-07 Eli Zaretskii <eliz@gnu.org>
2415
3e6d6928
EZ
2416 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2417
2418 * w32.c (sigemptyset): Empty the set.
2419 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2420
bc8000ff
EZ
2421 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2422
b4fa72f2
DA
24232012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2426 (mark_object): Likewise for frame objects.
2427
30730c93
PE
24282012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 * syssignal.h (handle_on_main_thread): Always declare,
2431 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2432 This ports to platforms without HAVE_PTHREAD.
2433
2fe28299
PE
24342012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2435
2436 Signal-handler cleanup (Bug#12327).
2437 Emacs's signal handlers were written in the old 4.2BSD style with
2438 sigblock and sigmask and so forth, and this led to some
2439 inefficiencies and confusion. Rewrite these to use
2440 pthread_sigmask etc. without copying signal sets around. Also,
2441 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2442 'signal', and instead use functions that do not attempt to take
2443 over the system name space. This patch causes Emacs's text
2444 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2445 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2446 Do not include <signal.h> or "syssignal.h", as these
2447 modules do not use signals.
2448 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2449 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2450 Do not include <signal.h>, as "syssignal.h" does that for us now.
2451 * atimer.c (sigmask_atimers): New function.
2452 (block_atimers, unblock_atimers): New functions,
2453 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2454 All uses replaced.
2455 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2456 no longer needed here.
2457 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2458 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2459 * sysdep.c (struct save_signal): New member 'action', replacing
2460 old member 'handler'.
2461 (save_signal_handlers, restore_signal_handlers):
2462 Use sigaction instead of 'signal' to save and restore.
2463 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2464 New function. All users of 'signal' modified to use set_sighandler
2465 if they're writeonly, and to use sys_signal if they're read+write.
2466 (emacs_sigaction_init, forwarded_signal): New functions.
2467 (sys_signal): Remove. All uses replaced by calls to sigaction
2468 and emacs_sigaction_init, or by direct calls to 'signal'.
2469 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2470 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2471 all uses replaced by pthread_sigmask etc. calls.
2472 * syssignal.h: Include <signal.h>.
2473 (emacs_sigaction_init, forwarded_signal): New decls.
2474 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2475 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2476 (sigmask, sys_sigmask): Remove; no longer needed.
2477 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2478 (sigblock, sigunblock, sigfree):
2479 (sigsetmask) [!defined sigsetmask]:
2480 Remove. All uses replaced by pthread_sigmask.
2481 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2482 no longer need to be replaced, and its typical old uses
2483 are now done via emacs_sigaction_init and sigaction.
2484 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2485 (sys_sigdel): Remove; unused.
2486 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2487
0216c128
EZ
24882012-09-06 Eli Zaretskii <eliz@gnu.org>
2489
2490 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2491 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2492
c752cfa9
DA
24932012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 Explicitly mark buffer_defaults and buffer_local_symbols.
2496 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2497 mark_local_symbols here.
2498 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2499 since special buffers aren't marked here any more.
2500 (allocate_buffer): Chain new buffer with all_buffers here...
2501 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2502 not here.
2503 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2504 (syms_of_buffer): Remove staticpro of the above.
2505 (init_buffer_once): Set names for buffer_defaults and
2506 buffer_local_symbols.
2507
a864ef14
PE
25082012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 Use bool for booleans in font-related modules.
2511 * font.c (font_intern_prop, font_style_to_value)
2512 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2513 (generate_otf_features, font_check_otf_features, font_check_otf)
2514 (font_match_p, font_list_entities, font_at):
2515 * fontset.c (fontset_id_valid_p, reorder_font_vector
2516 (fontset_find_font, Fset_fontset_font)
2517 (face_suitable_for_char_p) [0]:
2518 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2519 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2520 (m17n_flt_initialized, ftfont_shape_by_flt):
2521 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2522 * nsfont.m (nsfont_draw):
2523 * w32font.c (w32font_draw):
2524 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2525 Use bool for booleans.
2526 * font.h: Adjust to above API changes.
2527 (struct font, struct font_driver, struct font_driver_list):
2528 Use bool for booleans.
2529 (struct font): Remove useless member encoding_type.
2530 All users removed.
2531 * fontset.c, xftfont.c: Omit unnecessary static decls.
2532
0699fc18
DA
25332012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2534
2535 * alloc.c (mark_object): Revert window marking code
2536 since it's unsafe for the Fset_window_configuration.
2537
20ef56db
PE
25382012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2539
2fe28299 2540 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2541 Be more systematic about preserving errno whenever a signal
2542 handler returns, even if it's not in the main thread. Do this by
2543 renaming signal handlers to distinguish between signal delivery
2544 and signal handling. All uses changed.
2545 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2546 * data.c (deliver_arith_signal): Rename from arith_error.
2547 * dispnew.c (deliver_window_change_signal): Rename from
2548 window_change_signal.
2549 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2550 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2551 * keyboard.c (deliver_input_available_signal): Rename from
2552 input_available_signal.
2553 (deliver_user_signal): Rename from handle_user_signal.
2554 (deliver_interrupt_signal): Rename from interrupt_signal.
2555 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2556 (deliver_child_signal): Rename from sigchld_handler.
2557 * atimer.c (handle_alarm_signal):
2558 * data.c (handle_arith_signal):
2559 * dispnew.c (handle_window_change_signal):
2560 * emacs.c (handle_fatal_signal, handle_danger_signal):
2561 * keyboard.c (handle_input_available_signal):
2562 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2563 * process.c (handle_pipe_signal, handle_child_signal):
2564 New functions, with the actual signal-handling code taken from the
2565 original respective signal handlers, sans the sporadic attempts to
2566 preserve errno, since that's now done by handle_on_main_thread.
2567 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2568 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2569 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2570 Move to sysdep.c.
2571 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2572 Move initialization of main_thread to sysdep.c's init_signals.
2573 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2574 our usage, and simplifies the mainline code.
2575 (record_child_status_change): New static function, as a helper
2576 for handle_child_signal, and with most of the old child handler's
2577 contents.
2578 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2579 (handle_child_signal): Use the above.
2580 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2581 Moved here from emacs.c.
2582 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2583 code moved here from emacs.c's main function.
2584 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2585 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2586 This lets callers save and restore errno properly.
20ef56db 2587
e3ccf108
DA
25882012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2589
2590 Remove redundant or unused things here and there.
2591 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2592 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2593 * editfns.c (Fcompare_buffer_substrings): Likewise.
2594 * frame.h (struct terminal, struct font_driver_list):
2595 Remove redundant declarations.
2596 * window.h (Qleft, Qright): Likewise.
2597
697e1e39
DA
25982012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2599
2600 Do not mark objects from deleted buffers, windows and frames.
2601 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2602 (mark_object): Likewise for windows and frames.
2603
c1ca42ca
DA
26042012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2605
2606 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2607 buffer_defaults and buffer_local_symbols as valid objects.
2608 Return special value to denote them.
2609
014d93be
PE
26102012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2611
f75d7a91
PE
2612 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2613 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2614 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2615 (file_name_absolute_p, Fsubstitute_in_file_name):
2616 (check_executable, check_writable, Ffile_accessible_directory_p)
2617 (Fset_file_selinux_context, Fdefault_file_modes)
2618 (Finsert_file_contents, choose_write_coding_system)
2619 (Fwrite_region, build_annotations, a_write, e_write)
2620 (Fdo_auto_save):
2621 * filelock.c (boot_time_initialized, get_boot_time)
2622 (get_boot_time_1, lock_file_1, within_one_second):
2623 * floatfns.c (in_float):
2624 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2625 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2626 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2627 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2628 * window.c (compare_window_configurations):
2629 Use bool for booleans.
2630 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2631 (Fdefault_file_modes): Now mode_t, not int, for modes.
2632 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2633 (internal_delete_file): Now returns void, not a (boolean) int,
2634 since nobody was looking at the return value.
2635 * lisp.h, window.h: Adjust to above API changes.
2636
014d93be
PE
2637 * xdisp.c (set_message): Simplify and reindent last change.
2638
776f29e1
JB
26392012-09-05 Juanma Barranquero <lekktu@gmail.com>
2640
2641 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2642
7f7e0167
LI
26432012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2644
2645 * eval.c (call_debugger): Make the function non-static so that we
2646 can call it from set_message.
2647
2648 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2649 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2650
cf29dd84
PE
26512012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 Give more-useful info on a fatal error (Bug#12328).
2654 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2655 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2656 of doing the work ourselves.
2657 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2658 do most of the work.
2659 (fatal_error_backtrace): New function, taken from the guts
2660 of the old fatal_error_signal, but with a new option to output
2661 a backtrace.
2662 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2663 info about the signal than just its number.
2664 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2665 * sysdep.c: Include <execinfo.h>
2666 (emacs_backtrace): New function, taken partly from the previous
2667 code of the 'die' function.
2668 (emacs_abort): Call fatal_error_backtrace rather than abort.
2669
972debf2
SM
26702012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2671
2672 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2673 eager (load-time) macro-expansion.
2674 * lisp.mk (lisp): Add macroexp.
2675
1088b922
PE
26762012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 Simplify redefinition of 'abort' (Bug#12316).
2679 Do not try to redefine the 'abort' function. Instead, redo
2680 the code so that it calls 'emacs_abort' rather than 'abort'.
2681 This removes the need for the NO_ABORT configure-time macro
2682 and makes it easier to change the abort code to do a backtrace.
2683 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2684 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2685 Remove; sysdep.c's emacs_abort now takes its place.
2686 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2687 'abort' changed to use 'emacs_abort'.
2688 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2689 (abort) [!defined abort]: Rename to ...
2690 (emacs_abort): ... new name.
2691 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2692 the place of the old 'abort' in emacs.c.
2693 * w32.c, w32fns.c (abort): Do not #undef.
2694 * w32.c (emacs_abort): Rename from w32_abort.
2695
30934d33
EZ
26962012-09-04 Eli Zaretskii <eliz@gnu.org>
2697
2698 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2699 offsets[j].dv, since the y axis of the screen coordinates points
2700 down, while the y axis of the font definition coordinates points
2701 up. This fixes display of Arabic diacritics such as KASRA and
2702 KASRATAN. (Bug#11860)
2703
af26b72c
PE
27042012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2705
2706 Be more systematic about _setjmp vs setjmp.
2707 * alloc.c (test_setjmp, mark_stack):
2708 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2709 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2710 (png_load, my_error_exit, jpeg_load):
2711 * process.c (send_process_trap, send_process):
2712 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2713 The underscored versions are up to 30x faster on some hosts.
2714 Formerly, the code used setjmp+longjmp sometimes and
2715 _setjmp+_longjmp at other times, with no particular reason to
2716 prefer setjmp+longjmp.
2717
26d4541d
PE
27182012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2719
d42f4f0f 2720 Fix minor problem found by static checking.
26d4541d 2721 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2722
c5e28e39
MR
27232012-09-03 Martin Rudalics <rudalics@gmx.at>
2724
2725 * buffer.c (Fdelete_all_overlays): New function.
2726
3eab3ca9
CY
27272012-09-03 Chong Yidong <cyd@gnu.org>
2728
2729 * gtkutil.c: Add extern decl for Qxft.
2730
c04889f8
PE
27312012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2732
1882aa38
PE
2733 * emacs.c, eval.c: Use bool for boolean.
2734 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2735 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2736 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2737 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2738 (main, decode_env_path, Fdaemon_initialized):
2739 * eval.c (call_debugger, Finteractive_p, interactive_p):
2740 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2741 (maybe_call_debugger, Fbacktrace):
2742 * process.c (read_process_output, exec_sentinel):
2743 Use bool for booleans.
2744 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2745 All callers changed.
2746 * eval.c (interactive_p): Omit always-true boolean argument
2747 EXCLUDE_SUBRS_P. All callers changed.
2748 * dispextern.h, lisp.h: Reflect above API changes.
2749 * firstfile.c (dummy): Use the address of 'main', whose signature
2750 won't change, instead of the address of 'initialize', whose
2751 signature just changed from int to bool.
2752 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2753 * msdos.c (fatal_error_in_progress): ... from here.
2754 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2755 of incrementing it.
2756 (redisplay_internal, unwind_redisplay): Simply clear
2757 REDISPLAYING_P when unwinding, instead of saving its previous,
2758 always-false value and then restoring it.
2759
a411ac43
PE
2760 Clean up some extern decls.
2761 Mostly, this hoists extern decls out of .c files and into .h files.
2762 That way, we're more likely to catch errors if the interfaces change.
2763 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2764 declare xg_mark_data.
2765 * dispextern.h (x_frame_parm_handlers):
2766 * font.h (Qxft):
2767 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2768 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2769 (Qultra_bold, Qoblique, Qitalic):
2770 Move extern decl here from .c file.
2771 * alloc.c (xg_mark_data) [USE_GTK]:
2772 * doc.c (Qclosure):
2773 * eval.c (Qlexical_binding):
2774 * fns.c (time) [!HAVE_UNISTD_H]:
2775 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2776 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2777 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2778 * lread.c (Qinternal_interpreter_environment):
2779 * minibuf.c (Qbuffer):
2780 * process.c (QCfamily, QCfilter):
2781 * widget.c (free_frame_faces):
2782 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2783 * xfont.c (x_clear_errors):
2784 * xterm.c (x_frame_parm_handlers):
2785 Remove now-redundant extern decls.
2786 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2787 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2788 Now static.
2789 * xfaces.c: Remove unnecessary static decls.
2790 * xterm.c (updating_frame): Remove decl of nonexistent object.
2791
c04889f8
PE
2792 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2793 when building globals.h, as the objects that are not built on
2794 this host are not needed to compile C files on this host.
2795
8b339673
JD
27962012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2797
2798 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2799
2800 * frame.h: Add missing prototype for x_wm_set_size_hint.
2801
a08d4ba7
PE
28022012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2803
2804 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2805 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2806 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2807 (Fsubstitute_command_keys):
2808 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2809 (save_excursion_save, save_excursion_restore)
2810 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2811 (format_time_string, general_insert_function)
2812 (make_buffer_string, make_buffer_string_both)
2813 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2814 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2815 (copy_text, insert_1, insert_1_both, insert_from_string)
2816 (insert_from_string_before_markers, insert_from_string_1)
2817 (insert_from_buffer, insert_from_buffer_1, replace_range)
2818 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2819 (del_range_2, modify_region):
2820 * intervals.c (intervals_equal, balance_possible_root_interval)
2821 (adjust_intervals_for_insertion, merge_properties_sticky)
2822 (graft_intervals_into_buffer, lookup_char_property)
2823 (adjust_for_invis_intang, set_point_both)
2824 (get_property_and_range, compare_string_intervals)
2825 (set_intervals_multibyte_1, set_intervals_multibyte):
2826 * keyboard.c (decode_timer):
2827 Use bool for boolean.
2828 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2829 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2830
48c948de
CY
28312012-09-02 Chong Yidong <cyd@gnu.org>
2832
2833 * keymap.c (push_key_description): Print M-TAB as C-M-i
2834 (Bug#11758).
2835
6c49a40b
JB
28362012-09-02 Juanma Barranquero <lekktu@gmail.com>
2837
2838 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2839 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2840 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2841 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2842 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2843 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2844 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2845
4dfbd238
EZ
28462012-09-01 Eli Zaretskii <eliz@gnu.org>
2847
7e510e28
EZ
2848 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2849 more than one grapheme cluster passed to the shaper: compute the
2850 offset adjustment values separately for each cluster. (Bug#11860)
2851
4dfbd238
EZ
2852 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2853 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2854 about implicit conversions from integer to pointer.
2855
86571ae0
DC
28562012-09-01 Daniel Colascione <dancol@dancol.org>
2857
2858 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2859 system used too early.
2860
0e23ef9d
PE
28612012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 Better seed support for (random).
2864 * emacs.c (main): Call init_random.
2865 * fns.c (Frandom): Set the seed from a string argument, if given.
2866 Remove long-obsolete Gentzel cruft.
2867 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2868 (init_random): New function.
2869
17a2cbbd
DC
28702012-09-01 Daniel Colascione <dancol@dancol.org>
2871
2872 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2873 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2874 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2875 x_wm_set_size_hint, x_query_colors, x_real_positions,
2876 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2877 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2878 all of which have been moved to common code.
2879
2880 * xfaces.c: Include TERM_HEADER instead of listing all possible
2881 window-system headers.
2882
2883 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2884 to match header.
2885
2886 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2887 directly accessing frame internals.
2888
f18cbb28 2889 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2890 globals_of_w32font.
2891
2892 * process.c: Include TERM_HEADER instead of listing all possible
2893 window-system headers.
2894
3a880af4
SM
2895 * nsterm.h: Remove declarations now in frame.h.
2896 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2897
2898 * menu.c: Include TERM_HEADER instead of listing all possible
2899 window-system headers.
2900
2901 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2902 window system.
2903
2904 * keyboard.c: Include TERM_HEADER instead of listing all possible
2905 window-system headers.
2906
2907 * image.c: Include TERM_HEADER instead of listing all possible
2908 window-system headers. Declare Vlibrary_cache when compiling for
2909 Windows.
2910
2911 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2912 window system declarations.
2913
2914 * frame.h: Move common functions here: set_frame_menubar,
2915 x_set_window_size, x_sync, x_get_focus_frame,
2916 x_set_mouse_position, x_set_mouse_pixel_position,
2917 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2918 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2919 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2920 x_activate_menubar, x_real_positions, x_bitmap_icon,
2921 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2922 and x_query_colors.
2923
2924 * frame.c: Include TERM_HEADER instead of listing all possible
2925 window-system headers.
2926
2927 * font.c: Include TERM_HEADER instead of listing all possible
2928 window-system headers.
2929
2930 * emacs.c: Include TERM_HEADER.
2931
f18cbb28
EZ
2932 * dispnew.c: Include TERM_HEADER instead of listing all possible
2933 window-system headers.
17a2cbbd 2934
f18cbb28 2935 * ccl.h: Include character.h.
17a2cbbd
DC
2936
2937 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2938 the current window system; include in list of objects to link into
2939 Emacs.
2940
c650a5de
DA
29412012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Remove mark_ttys function and fix tty_display_info initialization.
2944 * lisp.h (mark_ttys): Remove prototype.
2945 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2946 to mark_ttys because all possible values of 'top_frame' slot are
2947 the frames which are reachable from Vframe_list.
2948 * term.c (mark_ttys): Remove.
2949 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2950
4e0f6479
DA
29512012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 Change struct frame bitfields from unsigned char to unsigned.
2954 * frame.h (struct frame): Change type of 'display_preempted',
2955 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2956 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2957 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2958 bitfields from unsigned char to unsigned.
2959
8b96a52c
DA
29602012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2961
2962 Remove unused member of struct x_output and struct w32_output.
2963 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2964 * w32term.h (struct w32_output): Likewise.
2965
b4444c8a
JD
29662012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2967
2968 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2969 does not become zero (Bug#12234).
2970
b98521db
PE
29712012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2972
2973 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2974 for GCC 4.7.1 x86-64.
2975
31d02438
GM
29762012-08-30 Glenn Morris <rgm@gnu.org>
2977
2978 * lread.c (init_lread): For out-of-tree builds, only add the
2979 source directory's site-lisp dir to the load-path if it exists,
2980 consistent with in-tree builds. (Bug#12302)
2981
7f8941d8
JD
29822012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2983
2984 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2985 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2986 (windowShouldClose:): Set window_closed.
2987 (dealloc): New member, free button_values.
fc0c31f8
JB
2988 (process_dialog:): Make member function. Remove window argument,
2989 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2990 in button_values.
2991 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2992 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2993 (addString:row:): Remove return self, declare return value as void.
2994 (addSplit): Remove return self, declare return value as void.
2995 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2996 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2997 (initFromContents:isQuestion:): Adjust call to process_dialog.
2998 Code formatting change.
2999 (timeout_handler:): Set timer_fired to YES.
3000 (runDialogAt:): Set timer_fired to NO.
3001 Handle click on close button as quit.
3002
3003 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3004 Add window_closed and button_values. Add void as return value for
3005 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3006 Add process_dialog as new member.
3007
eada0861 30082012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 3009
eada0861
GM
3010 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3011 is not one of the heaps we manage. (Bug#12242)
3012
30132012-08-28 Glenn Morris <rgm@gnu.org>
3014
3015 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3016
457294dd
MR
30172012-08-28 Martin Rudalics <rudalics@gmx.at>
3018
3019 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
3020 auto-buffer-name window parameter. Install revision of reverted
3021 fix.
457294dd 3022
4f2daf31
DA
30232012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 Do not allow to set major mode for a dead buffer.
3026 * buffer.c (Fset_buffer_major_mode): Signal an error
3027 if the buffer is dead.
3028 (Fother_buffer, other_buffer_safely): Remove redundant
3029 nested declaration.
3030
66322887
DA
30312012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3032
3033 Always use set_buffer_if_live to restore original buffer at unwind.
3034 * buffer.h (record_unwind_current_buffer): New function.
3035 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3036 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3037 * undo.c, window.c: Adjust users.
3038 * buffer.c (set_buffer_if_live): Fix comment.
3039
a3d794a1
DA
30402012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3041
3042 Fix usage of set_buffer_internal.
3043 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3044 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3045 * coding.c (decode_coding): Omit redundant test.
3046 * fileio.c (decide_coding_unwind): Likewise.
3047 * fns.c (secure_hash): Likewise.
3048 * insdel.c (modify_region): Likewise.
3049 * keyboard.c (command_loop_1): Likewise.
3050 * print.c (PRINTFINISH): Likewise.
3051 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3052
59ea14cd
PE
30532012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3054
3055 * dispnew.c: Use bool for boolean.
3056 (frame_garbaged, display_completed, delayed_size_change)
3057 (fonts_changed_p, add_window_display_history)
3058 (add_frame_display_history, verify_row_hash)
3059 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3060 (row_equal_p, realloc_glyph_pool)
3061 (allocate_matrices_for_frame_redisplay)
3062 (showing_window_margins_p)
3063 (adjust_frame_glyphs_for_frame_redisplay)
3064 (build_frame_matrix_from_leaf_window, make_current)
3065 (mirrored_line_dance, mirror_line_dance, update_frame)
3066 (update_window_tree, update_single_window)
3067 (check_current_matrix_flags, update_window, update_text_area)
3068 (update_window_line, set_window_update_flags, scrolling_window)
3069 (update_frame_1, scrolling, buffer_posn_from_coords)
3070 (do_pending_window_change, change_frame_size)
3071 (change_frame_size_1, sit_for):
3072 Use bool for boolean.
3073 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3074 and remove last int (actually boolean) argument, which was always 0.
3075 All callers changed.
3076 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3077 * dispextern.h (struct composition_it): Use bool for boolean.
3078 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3079 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3080 * dired.c (file_name_completion):
3081 Use bool for boolean. (This was missed in an earlier change.)
3082
95072a94
MR
30832012-08-27 Martin Rudalics <rudalics@gmx.at>
3084
3085 * window.c (Fset_window_configuration): Revert first part of
3086 last change.
3087
0f19feff
JD
30882012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3089
3090 * nsterm.h (NSPanel): New class variable dialog_return.
3091
3a880af4
SM
3092 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3093 Initialize dialog_return.
0f19feff
JD
3094 (windowShouldClose:): Use stop instead of stopModalWithCode.
3095 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3096 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3097 event.
3098 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3099 modal loop returns.
3100
f10fe38f
PE
31012012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3102
de1339b0
PE
3103 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3104 * composite.c (find_composition, composition_gstring_p)
3105 (composition_reseat_it, find_automatic_composition):
3106 * data.c (let_shadows_buffer_binding_p)
3107 (let_shadows_global_binding_p, set_internal, make_blv)
3108 (Fmake_variable_buffer_local, Fmake_local_variable)
3109 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3110 (cons_to_signed, arith_driver):
3111 * dbusbind.c (xd_in_read_queued_messages):
3112 * dired.c (directory_files_internal, file_name_completion):
3113 Use bool for booleans.
3114 * dired.c (file_name_completion):
3115 * process.h (fd_callback):
3116 Omit int (actually boolean) argument. It wasn't being used.
3117 All uses changed.
3118 * composite.h, lisp.h: Reflect above API changes.
3119
f10fe38f
PE
3120 * cmds.c, coding.c: Use bool for booleans.
3121 * cmds.c (move_point, Fself_insert_command):
3122 * coding.h (struct composition status, struct coding_system):
3123 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3124 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3125 (emacs_mule_char, decode_coding_emacs_mule)
3126 (encode_coding_emacs_mule, detect_coding_iso_2022)
3127 (decode_coding_iso_2022, encode_invocation_designation)
3128 (encode_designation_at_bol, encode_coding_iso_2022)
3129 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3130 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3131 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3132 (encode_coding_raw_text, detect_coding_charset)
3133 (decode_coding_charset, encode_coding_charset, detect_eol)
3134 (detect_coding, get_translation_table, produce_chars)
3135 (consume_chars, reused_workbuf_in_use)
3136 (make_conversion_work_buffer, code_conversion_save)
3137 (decode_coding_object, encode_coding_object)
3138 (detect_coding_system, char_encodable_p)
3139 (Funencodable_char_position, code_convert_region)
3140 (code_convert_string, code_convert_string_norecord)
3141 (Fset_coding_system_priority):
3142 * fileio.c (Finsert_file_contents):
3143 Use bool for booleans.
3144 * coding.h, lisp.h: Reflect above API changes.
3145 * coding.c: Remove unnecessary static function decls.
3146 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3147 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3148 not a boolean 'int', since callers never look at the return value.
3149 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3150 * coding.h (decoding_buffer_size, encoding_buffer_size)
3151 (emacs_mule_string_char): Remove unused extern decls.
3152 (struct iso_2022_spec, struct coding_system):
3153 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3154 (struct emacs_mule_spec): Remove unused field 'full_support'.
3155 All initializations removed.
3156 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3157
5474c384
DA
31582012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3159
f10fe38f 3160 Fix spare memory change (Bug#12286).
5474c384
DA
3161 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3162 (valid_lisp_object_p): Likewise.
3163
c4b6914d
MR
31642012-08-27 Martin Rudalics <rudalics@gmx.at>
3165
3166 * window.c (Fset_window_configuration): Record any window's old
3167 buffer if it's replaced (see Bug#8789). If the new current
3168 buffer doesn't appear in the selected window, go to its old
3169 point (Bug#12208).
3170
35aaa1ea
DA
31712012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3172
3173 Special MEM_TYPE_SPARE to denote reserved memory.
3174 * alloc.c (enum mem_type): New memory type.
3175 (refill_memory_reserve): Use new type for spare memory.
3176 This prevents live_cons_p and live_string_p from incorrect
3177 detection of uninitialized objects from spare memory as live.
3178
6af64513
PE
31792012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3180
8b2e00a3
PE
3181 Spelling fixes.
3182 * Makefile.in (.PHONY): versioclean -> versionclean.
3183
b52d6985
PE
3184 Remove unused external symbols.
3185 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3186 * window.c (Qwindow_valid_p, decode_valid_window):
3187 Now static, not extern.
3188 * data.c (Qinterval): Remove; unused.
3189 (syms_of_data): Do not define 'interval'.
3190 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3191 * window.h (decode_valid_window):
3192 Remove decls.
3193
d5172d4f
PE
3194 * character.c, charset.c, chartab.c: Use bool for booleans.
3195 * character.c (lisp_string_width, string_count_byte8)
3196 (string_escape_byte8):
3197 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3198 (load_charset_map_from_file, map_charset_chars)
3199 (Fdefine_charset_internal, define_charset_internal)
3200 (Fdeclare_equiv_charset, find_charsets_in_text)
3201 (Ffind_charset_region, char_charset, Fiso_charset):
3202 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3203 (sub_char_table_set, sub_char_table_set_range)
3204 (char_table_set_range, optimize_sub_char_table)
3205 (map_sub_char_table):
3206 Use bool for boolean.
3207 * character.c (str_to_unibyte): Omit last boolean argument; it was
3208 always 0. All callers changed.
3209 * character.h, charset.h: Adjust to match previous changes.
3210 * character.h (char_printable_p): Remove decl of nonexistent function.
3211 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3212 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3213 are all boolean, so make them single-bit bitfields.
3214
6af64513
PE
3215 * lisp.h (ASET): Remove attempt to detect side effects.
3216 It was meant to be temporary and it often doesn't work,
3217 because when IDX has side effects the behavior of IDX==IDX
3218 is undefined. See Stefan Monnier in
3219 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3220
e1f29348
BR
32212012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3222
3223 * lisp.h (functionp): New function (extracted from Ffunctionp).
3224 (FUNCTIONP): Use it.
3225 * eval.c (Ffunctionp): Use it.
3226
17c05d74
PE
32272012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3228
0f46bc75
PE
3229 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3230 as that's faster and simpler than static storage. Don't bother
3231 with the g_main_context_query overhead if g_main_context_pending
3232 says no events are pending.
3233 (gfds, gfds_size): Remove these static vars.
3234 (xgselect_initialize): Remove; no longer needed.
3235 All uses and decls removed.
3236
ee4c0f69
PE
3237 * emacs.c (fatal_error_signal_hook): Remove.
3238 All uses removed. This leftover from old code was always 0.
3239
17c05d74
PE
3240 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3241 * casefiddle.c (casify_object, casify_region):
3242 * casetab.c (set_case_table):
3243 * category.c, category.h (word_boundary_p):
3244 * category.h (CHAR_HAS_CATEGORY):
3245 Use bool for booleans, instead of int.
3246
391ceac5
EZ
32472012-08-25 Eli Zaretskii <eliz@gnu.org>
3248
3249 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3250
2f221583
PE
32512012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3252
f4a681b0
PE
3253 On assertion failure, print backtrace if available.
3254 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3255 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3256 * Makefile.in (LIB_EXECINFO): New macro.
3257 (LIBES): Use it.
3258
2f221583
PE
3259 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3260 * bytecode.c (exec_byte_code):
3261 * callint.c (check_mark, Fcall_interactively):
3262 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3263 (getenv_internal, sync_process_alive, call_process_exited):
3264 * lisp.h (USE_SAFE_ALLOCA):
3265 Use bool for booleans, instead of int.
3266 * lisp.h, process.h: Adjust prototypes to match above changes.
3267 * callint.c (Fcall_interactively): Don't assume the mark's
3268 offset fits in 'int'.
3269
37ef52bb
PE
32702012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 * buffer.c, buffer.h: Use bool for boolean.
3273 * buffer.c (reset_buffer_local_variables)
3274 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3275 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3276 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3277 (overlay_touches_p, overlay_strings, Foverlay_put)
3278 (report_overlay_modification, call_overlay_mod_hooks):
3279 (mmap_enlarge, mmap_set_vars):
3280 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3281 Use bool for booleans, instead of int.
3282 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3283 since the 1-or-0 return value is always ignored anyway.
3284 (mmap_initialized_p):
3285 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3286 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3287
2cc21167
PE
32882012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3289
3290 * bidi.c: Use bool for boolean.
3291 This is a bit more readable, and makes the text segment of bidi.o
3292 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3293 Presumably it's faster too.
3294 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3295 Now bool.
3296 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3297 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3298 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3299 (bidi_explicit_dir_char, bidi_level_of_next_char)
3300 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3301 Use bool for booleans, instead of int.
3302 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3303 (bidi_unshelve_cache): Adjust decls to match code.
3304
7db4ddf4
MR
33052012-08-23 Martin Rudalics <rudalics@gmx.at>
3306
3307 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3308 argument.
3309
b1bb8011
PE
33102012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3313 * atimer.h: Include <stdbool.h>.
3314
ff687885
DN
33152012-08-22 Dan Nicolaescu <dann@gnu.org>
3316
3317 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3318 compile time tests instead of run time tests on systems that do
3319 not use them.
3320 (FRAME_MAC_P): Remove leftover from deleted code.
3321 * frame.c (syms_of_frame): Remove leftover from deleted code.
3322
4ce7a138
JD
33232012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3324
3325 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3326
d733ec6d
PE
33272012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3330 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3331 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3332 (fontset_add): Return void, for FONTSET_ADD.
3333
d0d2d26f
PE
33342012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3335
fce31d69
PE
3336 * alloc.c: Use bool for booleans.
3337 (gc_in_progress, abort_on_gc)
3338 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3339 (dont_register_blocks) [GC_MALLOC_CHECK]:
3340 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3341 (check_string_bytes, make_specified_string, memory_full)
3342 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3343 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3344 (mark_stack, valid_pointer_p, make_pure_string)
3345 (Fgarbage_collect, survives_gc_p, gc_sweep):
3346 Use bool for booleans, instead of int.
3347 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3348 Remove unused local.
3349 * alloc.c (PURE_POINTER_P):
3350 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3351 * editfns.c (Fformat):
3352 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3353 (Fdo_auto_save):
3354 * fns.c (sweep_weak_table):
3355 * lisp.h (suppress_checking, push_message, survives_gc_p)
3356 (make_pure_string, gc_in_progress, abort_on_gc):
3357 * lread.c (readchar, read1):
3358 * print.c (Fprin1_to_string):
3359 * xdisp.c (push_message):
3360 Use bool for booleans affected directly or indirectly by
3361 alloc.c's changes.
3362
d0d2d26f
PE
3363 Make recently-introduced setters macros.
3364 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3365 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3366 (set_fontset_default, set_fontset_fallback): Rename from their
3367 upper-case counterparts, and make them functions rather than macros.
3368 This is more consistent with the other recently-introduced setters.
3369 These don't need to be inline, since they're local.
3370
d18e2bb6
JD
33712012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3372
3373 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3374 the loop (Bug#12247).
3375
1b9d9d16
PE
33762012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3377
3378 * lisp.h (vcopy): Use memcpy rather than our own loop.
3379 This fixes a performance regression introduced by the recent
3380 addition of vcopy. This means 'vcopy' will need to be modified
3381 for a copying collector, but that's OK. Also, tighten the
3382 checking in the assertion.
3383
b2f09701
EZ
33842012-08-21 Eli Zaretskii <eliz@gnu.org>
3385
3386 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3387 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3388 non-base glyph for the width of the base character, according to
e1f29348
BR
3389 what x_draw_composite_glyph_string_foreground expects.
3390 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3391 expectations, to produce correct width of the composed character.
3392 Reverse the sign of the DU offset produced by ScriptPlace.
3393
9b994fed
PE
33942012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3397
086ca913
DA
33982012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3399
3400 Avoid direct writes to contents member of struct Lisp_Vector.
3401 * lisp.h (vcopy): New function to copy data into vector.
3402 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3403 * fns.c (Ffillarray): Use ASET.
3404 * keyboard.c (timer_check_2): Use AREF and ASET.
3405 (append_tool_bar_item, Frecent_keys): Use vcopy.
3406 * lread.c (read_vector): Use ASET.
3407 * msdos.c (Frecent_doskeys): Use vcopy.
3408 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3409 (Finternal_merge_in_global_face): Use ASET and vcopy.
3410 * xfont.c (xfont_list_pattern): Likewise.
3411
5481664a
MR
34122012-08-21 Martin Rudalics <rudalics@gmx.at>
3413
3414 * window.c (Fwindow_point): For the selected window always return
3415 the position of its buffer's point.
3416 (Fset_window_point): For the selected window always go in its
3417 buffer to the specified position.
3418
6d470bdd
DA
34192012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3420
3421 Setter macros for fontsets.
3422 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3423 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3424 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3425 Adjust users.
3426
24564fe1
GM
34272012-08-20 Glenn Morris <rgm@gnu.org>
3428
3429 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3430 Don't assume that `ln -f' works.
3431
0a05a035
EZ
34322012-08-20 Eli Zaretskii <eliz@gnu.org>
3433
3434 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3435 and later about non-assignments with no effect. See discussion at
3436 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3437 details.
3438
e46f2325
DA
34392012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3440
3441 Inline setter functions for Lisp_Objects slots of struct specbinding.
3442 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3443 Adjust users.
3444
734fbd86
MR
34452012-08-20 Martin Rudalics <rudalics@gmx.at>
3446
3447 * window.c (select_window): Always make selected window's buffer
3448 current.
3449
f1a95992
DA
34502012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3451
3452 Use AREF and ASET for docstrings of category tables.
3453 * category.h (CATEGORY_DOCSTRING): Use AREF.
3454 (SET_CATEGORY_DOCSTRING): Use ASET.
3455 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3456
e83064be
DA
34572012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3458
3459 Inline setter functions for hash table members.
3460 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3461 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3462 (set_hash_key_and_value, set_hash_index, set_hash_next)
3463 (set_hash_hash): New functions.
3464 * charset.c, fns.c: Adjust users.
3465
4ce60d2e
DA
34662012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3467
3468 Inline getter and setter functions for per-buffer values.
3469 * buffer.h (per_buffer_default, set_per_buffer_default)
3470 (per_buffer_value, set_per_buffer_value): New functions.
3471 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3472 * buffer.c, data.c: Adjust users.
3473
c06c9690
JB
34742012-08-20 Juanma Barranquero <lekktu@gmail.com>
3475
3476 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3477
32bd4250
PE
34782012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3479
bad03192 3480 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3481 as gnulib does this if the system doesn't.
3482 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3483 Remove declaration. MS-Windows declares it on stdlib.h which is
3484 included by conf_post.h.
b69a6d22
PE
3485 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3486 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3487 * vm-limit.c: Include <unistd.h>, for 'environ'.
3488
22d7feb2
PE
3489 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3490 (start_of_data): Remove decl; mem-limits.h provides it.
3491
32bd4250
PE
3492 * xdisp.c (handle_invisible_prop): Make it a bit faster
3493 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3494
450809af
CY
34952012-08-19 Chong Yidong <cyd@gnu.org>
3496
3497 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3498 ends (Bug#3874).
3499
9e677988
AS
35002012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3501
6b1319ce
AS
3502 * .gdbinit: Use call instead of set when calling a function in the
3503 inferior.
3504
9e677988
AS
3505 * data.c (set_internal): Don't use set_blv_found.
3506 (Fkill_local_variable): Likewise.
3507
d7191076
AA
35082012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3509
3510 * nsfont.m (ns_ascii_average_width): Ensure the string
3511 ascii_printable is initialized with a null-terminated character
3512 array. Otherwise, it can contain undesired extra characters.
3513
e757f1c6
PE
35142012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 port new setting code to Sun C 5.8 2005/10/13
3517 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3518 Return void, not Lisp_Object. Otherwise, the compiler
3519 complains about (A?B:C) where B is void and C is Lisp_Object
3520 when compiling CHAR_TABLE_SET, due to the recent change to
3521 the API of sub_char_table_set_contents.
3522
a999ce26
CY
35232012-08-18 Chong Yidong <cyd@gnu.org>
3524
3525 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3526 for the string case (Bug#3874).
3527
3f22b86f
PE
35282012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3529
39eb03f1
PE
3530 * buffer.h (BSET): Remove (Bug#12215).
3531 Replace all uses with calls to new setter functions.
3532 (bset_bidi_paragraph_direction, bset_case_canon_table)
3533 (bset_case_eqv_table, bset_directory, bset_display_count)
3534 (bset_display_time, bset_downcase_table)
3535 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3536 (bset_last_selected_window, bset_local_var_alist)
3537 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3538 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3539 (bset_width_table):
3540 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3541 (bset_auto_fill_function, bset_auto_save_file_format)
3542 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3543 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3544 (bset_cache_long_line_scans, bset_case_fold_search)
3545 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3546 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3547 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3548 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3549 (bset_header_line_format, bset_indicate_buffer_boundaries)
3550 (bset_indicate_empty_lines, bset_invisibility_spec)
3551 (bset_left_fringe_width, bset_major_mode, bset_mark)
3552 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3553 (bset_name, bset_overwrite_mode, bset_pt_marker)
3554 (bset_right_fringe_width, bset_save_length)
3555 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3556 (bset_scroll_up_aggressively, bset_selective_display)
3557 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3558 (bset_word_wrap, bset_zv_marker):
3559 * category.c (bset_category_table):
3560 * syntax.c (bset_syntax_table):
3561 New setter functions.
3562
6a09a33b
PE
3563 * process.h (PSET): Remove (Bug#12215).
3564 Replace all uses with calls to new setter functions.
3565 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3566 (PROCESS_INLINE): New macro.
3567 (pset_childp): New setter function.
3568 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3569 * process.c (PROCESS_INLINE):
3570 Define to EXTERN_INLINE, so that the corresponding functions
3571 are compiled into code.
3572 (pset_buffer, pset_command, pset_decode_coding_system)
3573 (pset_decoding_buf, pset_encode_coding_system)
3574 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3575 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3576 (pset_type, pset_write_queue): New setter functions.
3577
e8c17b81
PE
3578 * window.h (WSET): Remove (Bug#12215).
3579 Replace all uses with calls to new setter functions.
3580 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3581 (WINDOW_INLINE): New macro.
3582 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3583 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3584 (wset_total_lines, wset_vertical_scroll_bar)
3585 (wset_window_end_pos, wset_window_end_valid)
3586 (wset_window_end_vpos): New setter functions.
3587 * window.c (WINDOW_INLINE):
3588 Define to EXTERN_INLINE, so that the corresponding functions
3589 are compiled into code.
3590 (wset_combination_limit, wset_dedicated, wset_display_table)
3591 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3592 (wset_new_normal, wset_new_total, wset_next_buffers)
3593 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3594 (wset_prev_buffers, wset_right_fringe_width)
3595 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3596 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3597 (wset_window_parameters):
3598 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3599 (wset_column_number_displayed, wset_region_showing):
3600 New setter functions.
3601
3f22b86f
PE
3602 * termhooks.h (TSET): Remove (Bug#12215).
3603 Replace all uses with calls to new setter functions.
3604 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3605 (TERMHOOKS_INLINE): New macro.
3606 (tset_charset_list, tset_selection_alist): New setter functions.
3607 * terminal.c (TERMHOOKS_INLINE):
3608 Define to EXTERN_INLINE, so that the corresponding functions
3609 are compiled into code.
3610 (tset_param_alist): New setter function.
3611
742af32f
PE
36122012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3613
15dbb4d6
PE
3614 * keyboard.h (KSET): Remove (Bug#12215).
3615 Replace all uses with calls to new setter functions.
3616 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3617 (KEYBOARD_INLINE): New macro.
3618 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3619 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3620 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3621 New setter functions.
3622 * keyboard.c (KEYBOARD_INLINE):
3623 Define to EXTERN_INLINE, so that the corresponding functions
3624 are compiled into code.
3625 (kset_echo_string, kset_kbd_queue)
3626 (kset_keyboard_translate_table, kset_last_prefix_arg)
3627 (kset_last_repeatable_command, kset_local_function_key_map)
3628 (kset_overriding_terminal_local_map, kset_real_last_command)
3629 (kset_system_key_syms): New setter functions.
3630
f00af5b1
PE
3631 * frame.h (FSET): Remove (Bug#12215).
3632 Replace all uses with calls to new setter functions.
3633 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3634 (FRAME_INLINE): New macro.
3635 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3636 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3637 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3638 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3639 (fset_param_alist, fset_root_window, fset_scroll_bars)
3640 (fset_selected_window, fset_title, fset_tool_bar_items)
3641 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3642 * frame.c (FRAME_INLINE):
3643 Define to EXTERN_INLINE, so that the corresponding functions
3644 are compiled into code.
3645 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3646
0c94c8d6
PE
3647 A few more naming-convention fixes for getters and setters.
3648 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3649 and rename from buffer_overlays_set_before.
3650 (set_buffer_overlays_after): Move here from buffer.h, and rename
3651 from buffer_overlays_set_after.
3652 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3653 All uses changed.
3654 (set_buffer_intervals): Rename from buffer_set_intervals.
3655 * intervals.c (set_interval_object): Move here from intervals.h,
3656 and rename from interval_set_object.
3657 (set_interval_left): Move here from intervals.h, and rename from
3658 interval_set_left.
3659 (set_interval_right): Move here from intervals.h, and rename from
3660 interval_set_right.
3661 (copy_interval_parent): Move here from intervals.h, and rename from
3662 interval_copy_parent.
3663 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3664 (set_interval_plist): Rename from interval_set_plist.
3665 Return void, not Lisp_Object, since no caller uses the result.
3666 * lisp.h (string_intervals): Rename from string_get_intervals.
3667 (set_string_intervals): Rename from string_set_intervals.
3668
34dabdb7
PE
3669 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3670 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3671 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3672 All uses changed. See the end of
3673 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3674
742af32f
PE
3675 * lisp.h (CSET): Remove (Bug#12215).
3676 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3677 (set_char_table_purpose): New functions,
3678 replacing CSET. All uses changed. For example, replace
3679 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3680 "set_char_table_parent (char_table, parent);".
742af32f
PE
3681 The old version was confusing because it used the same name
3682 'parent' for two different things.
3683
a04e2c62
DA
36842012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3685
3686 Functions to get and set Lisp_Object fields of buffer-local variables.
3687 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3688 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3689 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3690 * data.c, eval.c, frame.c: Adjust users.
3691
383dcbf9
CY
36922012-08-17 Chong Yidong <cyd@gnu.org>
3693
3694 * xfaces.c (merge_face_vectors): If the target font specfies a
3695 font spec, make the font's attributes take precedence over
3696 directly-specified attributes.
3697 (merge_face_ref): Recognize :font.
3698
44386687
DA
36992012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3700
3701 Do not use memcpy for copying intervals.
3702 * intervals.c (reproduce_interval): New function.
3703 (reproduce_tree, reproduce_tree_obj): Use it.
3704 (reproduce_tree_obj): Remove prototype.
3705
927c7216
PE
37062012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3707
3708 * lisp.h (duration_to_sec_usec): Remove unused decl.
3709
93044f7b
AA
37102012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3711
3712 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3713 to an allocated instance of NSString, not to the class itself.
3714
9851e4a5
JB
37152012-08-17 Juanma Barranquero <lekktu@gmail.com>
3716
3717 * makefile.w32-in (C_CTYPE_H): New macro.
3718 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3719 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3720 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3721
620f13b0
PE
37222012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3723
3724 Use ASCII tests for character types.
3725 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3726 * xfns.c, xterm.c:
3727 Don't include <ctype.h>; was not needed.
3728 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3729 * sysdep.c, xfaces.c:
3730 Include <c-ctype.h> instead of <ctype.h>.
3731 * nsterm.m: Include <c-ctype.h>.
3732 * charset.c (read_hex):
3733 * doc.c (Fsnarf_documentation):
3734 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3735 (DRIVE_LETTER) [DOS_NT]:
3736 (Ffile_name_directory, Fexpand_file_name)
3737 (Fsubstitute_in_file_name):
3738 * font.c (font_parse_xlfd, font_parse_fcname):
3739 * frame.c (x_set_font_backend):
3740 * gtkutil.c (xg_get_font):
3741 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3742 * nsimage.m (hexchar):
3743 * nsterm.m (ns_xlfd_to_fontname):
3744 * sysdep.c (system_process_attributes):
3745 * xfaces.c (hash_string_case_insensitive):
3746 Use C-locale tests instead of locale-specific tests for character
3747 types, since we want the ASCII interpretation here, not the
3748 interpretation suitable for whatever happens to be the current locale.
3749
52162052
MR
37502012-08-16 Martin Rudalics <rudalics@gmx.at>
3751
3752 Consistently check windows for validity/liveness
3753 (Bug#11984, Bug#12025, Bug#12026).
3754 * lisp.h (CHECK_VALID_WINDOW): New macro.
3755 * window.c (decode_window): Rename to decode_live_window.
3756 (decode_valid_window, Fwindow_valid_p): New functions.
3757 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3758 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3759 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3760 (Fwindow_prev_sibling, Fwindow_combination_limit)
3761 (Fset_window_combination_limit, Fwindow_use_time)
3762 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3763 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3764 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3765 (Fwindow_hscroll, Fset_window_hscroll)
3766 (Fwindow_redisplay_end_trigger)
3767 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3768 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3769 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3770 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3771 (Fwindow_end, Fset_window_point, Fset_window_start)
3772 (Fpos_visible_in_window_p, Fwindow_line_height)
3773 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3774 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3775 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3776 (Fset_window_parameter, Fwindow_display_table)
3777 (Fset_window_display_table, Fdelete_other_windows_internal)
3778 (Fset_window_buffer, Fset_window_new_total)
3779 (Fset_window_new_normal, Fdelete_window_internal)
3780 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3781 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3782 (Fwindow_scroll_bars): Check whether argument window is a valid or
3783 live window. Update doc-strings.
3784 (syms_of_window): New symbol Qwindow_valid_p.
3785 * keyboard.c (Fposn_at_x_y): Check whether argument
3786 frame_or_window denotes a valid window.
3787
2751c80f
DA
37882012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 Fix previous char table change.
3791 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3792 * chartab.c (optimize_sub_char_table): Likewise.
3793
032a42c8
CY
37942012-08-16 Chong Yidong <cyd@gnu.org>
3795
a2d19368
CY
3796 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3797
032a42c8
CY
3798 * xfont.c (xfont_open):
3799 * xftfont.c (xftfont_open): Set the font's max_width field.
3800
3801 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3802 min_width to space_width and average_width to the average over
3803 printable ASCII characters.
3804 (ns_char_width): Code cleanup.
3805 (ns_ascii_average_width): New utility function.
3806
3807 * font.h (struct font): Update comments.
3808
a098c930
DA
38092012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3810
032a42c8 3811 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3812 * lisp.h (CSET): New macro.
3813 (char_table_set_extras, char_table_set_contents)
3814 (sub_char_table_set_contents): New function.
3815 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3816 * syntax.c: Adjust users.
3817
8be3a09c
SM
38182012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3819
3820 * eval.c (eval_sub): Bind lexical-binding.
3821 * lread.c (Qlexical_binding): Make non-static.
3822
ac4845a6
JD
38232012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3824
ddee6515
JD
3825 * nsmenu.m (popupSession): Remove.
3826 (pop_down_menu): Remove endModalSession.
3827 (timeout_handler:): New method.
3828 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3829 Call runModalForWindow. Check timer_fired when it returns.
3830 If not set, cancel timer and break out of loop.
3831 Otherwise loop again, with a new timeout.
3832
3833 * nsterm.m: Include fcntl.h if present.
3834 (fd_entry, t_readfds, inNsSelect): Remove.
3835 (select_writefds, select_valid, select_timeout, selfds)
3836 (select_mutex, apploopnr): Add.
3837 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3838 Otherwise call kbd_buffer_store_event.
3839 (ns_send_appdefined): Remove release of fd_entry.
3840 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3841 Increment and decrement apploopnr.
3842 (ns_select): If no file descriptors, just do a NSTimer.
3843 Otherwise copy read/write masks and start select thread (fd_handler).
3844 Start main loop and wait for application defined event.
3845 Inform select thread to stop selecting after main loop is exited.
3846 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3847 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3848 (fd_handler:): Loop forever, wait for info from the main thread
3849 to either start or stop selecting. When select returns, send
3850 and appdefined event.
3851 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3852 If not call kbd_buffer_store_event.
3853
3854 * nsterm.h (EmacsApp): fd_handler takes id argument.
3855 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3856
ac4845a6
JD
3857 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3858
eb424fe3
EZ
38592012-08-15 Eli Zaretskii <eliz@gnu.org>
3860
3861 * region-cache.c (move_cache_gap): Update gap_len using the actual
3862 growth of the boundaries array. Do not change cache_len.
3863 (Bug#12196)
3864
4e6a86c6
DA
38652012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3866
3867 Generalize and cleanup font subsystem checks.
3868 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3869 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3870 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3871
5bf192ca
DA
38722012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3873
3874 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3875
f2045622
CY
38762012-08-15 Chong Yidong <cyd@gnu.org>
3877
8be3a09c
SM
3878 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3879 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3880 extract the font descriptor instead of just the font name.
3881 In that case, return a font spec instead of a string.
f2045622
CY
3882 (x_last_font_name): Move to this file from xfns.c.
3883
3884 * xfns.c (Fx_select_font): The return value can also be a font
3885 spec. Move x_last_font_name management to gtkutil.c.
3886
3887 * xfaces.c: Make font weight and style symbols non-static.
3888
7f6feb56
SM
38892012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3890
3891 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3892 (bug#12117).
3893
fecbd8ff
SM
38942012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3895
3896 * alloc.c (Fgarbage_collect): Use plural form consistently.
3897
9b8d5165
EZ
38982012-08-14 Eli Zaretskii <eliz@gnu.org>
3899
3900 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3901 iteration through the command loop. Fixes a problem whereby mouse
3902 movements are ignored until the first mouse click.
3903
f5d9e83a
PE
39042012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3905
3906 Use bool, not int, for Lisp booleans.
3907 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3908 makes Emacs a bit smaller and presumably a bit faster.
3909 * lisp.h: Include <stdbool.h>.
3910 (struct Lisp_Boolfwd, defvar_bool):
3911 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3912 * regex.c [!emacs]: Include <stdbool.h>.
3913 (false, true): Remove; <stdbool.h> does this for us now.
3914
55802e4a
CY
39152012-08-14 Chong Yidong <cyd@gnu.org>
3916
4abcdac8
CY
3917 * character.c (Fcharacterp): Doc fix (Bug#12076).
3918
3919 * data.c (Findirect_variable): Doc fix (Bug#11040).
3920
55802e4a
CY
3921 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3922
3923 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3924 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3925
8e99d072
BR
39262012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3927
3928 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3929 (bug#12022).
3930
08908aca
MR
39312012-08-14 Martin Rudalics <rudalics@gmx.at>
3932
3933 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3934 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3935 * minibuf.c (choose_minibuf_frame, read_minibuf):
3936 * w32fns.c (x_create_tip_frame):
3937 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3938 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3939
56120d6f
PE
39402012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * intervals.c (offset_intervals): Remove obsolete comment.
3943
67b77c0b
AS
39442012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3945
3946 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3947
f48b82fd
GR
39482012-08-14 Gergely Risko <gergely@risko.hu>
3949
3950 * coding.c (decode_coding): Record buffer modification before
3951 disabling undo_list (Bug#11773).
3952
fd318b54
DA
39532012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3954
3955 Revert and cleanup some recent overlay changes.
3956 * buffer.h (enum overlay_type): Remove.
3957 (buffer_get_overlays, buffer_set_overlays): Likewise.
3958 (buffer_set_overlays_before, buffer_set_overlays_after):
3959 New function. Adjust users.
3960 (unchain_both): Add eassert.
3961
41a62dd9
DA
39622012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3963
3964 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3965
5884c324
PE
39662012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3967
3968 * gtkutil.c (xg_mark_data): Don't assume C99.
3969
ca06f160
JD
39702012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3971
3972 * gtkutil.c (xg_frame_tb_info): New struct.
3973 (TB_INFO_KEY): New define.
3974 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3975 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3976 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3977 if not present.
3978 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3979 is up to date. Otherwise store new data.
ca06f160
JD
3980 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3981
7864a3f7
DA
39822012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3983
3984 Use KSET for write access to Lisp_Object members of struct kboard.
3985 * keyboard.h (KSET): New macro.
3986 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3987 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3988 * xterm.c: Adjust users.
3989
4c31be61
DA
39902012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Use BSET for write access to Lisp_Object members of struct buffer.
3993 * buffer.h (BSET): New macro.
3994 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3995 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3996 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3997 * window.c, xdisp.c, xfns.c: Adjust users.
3998
14ae4239
BT
39992012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4000
4001 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4002
32bcadb4
JD
40032012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4004
3d29b2ce 4005 * nsterm.m (not_in_argv): New function.
fc0c31f8 4006 (application:openFile, application:openTempFile:):
3d29b2ce
JD
4007 (application:openFileWithoutUI:, application:openFiles:): Open file
4008 if not_in_argv returns non-zero (bug#12171).
4009
32bcadb4 4010 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
4011 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4012 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
4013 (xg_get_font_name): Use those functions/macros here.
4014 Reported by Frans Oilinki <moilinki@gmail.com>.
4015
9ff9402d 40162012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
4017
4018 * unexmacosx.c (copy_data_segment): Copy initialized data in
4019 statically linked libraries from input file rather than memory.
4020
db74a5fc
YM
4021 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4022 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4023 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4024
25e65510
GM
40252012-08-10 Glenn Morris <rgm@gnu.org>
4026
4027 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4028 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4029
7961135c
DA
40302012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4031
4032 Fix last change to allow compilation with low optimization levels.
4033 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4034 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4035
42b3a444
DA
40362012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4037
4038 Use common inline syntax in intervals.h.
4039 * intervals.h (INTERVALS_INLINE): New macro.
4040 Change all users from LISP_INLINE.
4041
9fb0c957
DA
40422012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4043
4044 Define Qnone once for all platforms.
4045 * frame.c (Qnone): Define here.
4046 (syms_of_frame): DEFSYM it.
4047 * lisp.h (Qnone): New declaration.
4048 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4049 * xfns.c: Remove duplication. Adjust users.
4050
65e8ee52
DA
40512012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 Remove unused macros from intervals.h.
4054 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4055 * intervals.c: Adjust comment.
4056
9b855fd6
EZ
40572012-08-10 Eli Zaretskii <eliz@gnu.org>
4058
4059 * w32fns.c <w32_unicode_gui>: New static variable.
4060 (globals_of_w32fns): Initialize it according to os_subtype.
4061 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4062 testing os_subtype.
4063
39cb9e56 40642012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
4065 Eli Zaretskii <eliz@gnu.org>
4066
4067 Fix bug #10299 with Unicode characters sent by customized
4068 keyboards created by MSKLC.
4069 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4070 (w32_init_class): Use it to initialize the Emacs class with either
4071 ANSI or Unicode API calls.
4072 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4073 later.
4074 (w32_wnd_proc): If the character code sent by WM_CHAR or
4075 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4076 original message. Call DefWindowProcW on NT and later.
4077
9374581a
GM
40782012-08-10 Glenn Morris <rgm@gnu.org>
4079
4b94e8cf
GM
4080 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4081
9374581a
GM
4082 * lisp.h (DIRECTORY_SEP): Let configure set it.
4083
a2752828
DA
40842012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4085
4086 Use TSET for write access to Lisp_Object slots of struct terminal.
4087 * termhooks.h (TSET): New macro.
4088 * coding.c, terminal.c, xselect.c: Adjust users.
4089
cc92c454
SM
40902012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4091
4092 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4093 the failing expression, include them in the error message.
4094 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4095 * lisp.h (internal_condition_case_n): Update declaration.
4096
4cb3e6b3
DA
40972012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Inline functions to examine and change buffer overlays.
4100 * buffer.c (unchain_both): New function.
4101 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4102 (buffer_has_overlays): New function.
4103 (enum overlay_type): New enum.
4104 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4105 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4106
8707c1e5
DA
41072012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4108
4109 Inline functions to examine and change buffer intervals.
4110 * alloc.c (mark_interval_tree): Remove.
4111 (MARK_INTERVAL_TREE): Simplify.
4112 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4113 * intervals.c (buffer_balance_intervals): New function.
4114 (graft_intervals_into_buffer): Adjust indentation.
4115 (set_intervals_multibyte): Simplify.
4116 * buffer.h (BUF_INTERVALS): Remove.
4117 (buffer_get_intervals, buffer_set_intervals): New function.
4118 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4119 * intervals.c, textprop.c: Adjust users.
4120
ad8c997f
DA
41212012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4122
4123 Inline functions to examine and change string intervals.
4124 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4125 (string_get_intervals, string_set_intervals): New function.
4126 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4127 * lread.c, print.c, textprop.c: Adjust users.
4128
32ac3a6b
GM
41292012-08-08 Glenn Morris <rgm@gnu.org>
4130
4131 * lisp.mk (lisp): Remove language/persian.elc.
4132
77c7bcb1
DA
41332012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4134
4135 Cleanup intervals.
4136 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4137 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
4138 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4139 Adjust comment. Move under #if 0.
77c7bcb1
DA
4140 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4141 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4142
9c08a8d4
DA
41432012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4144
4145 Check total length of intervals with eassert.
4146 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4147 * intervals.c: Change all users to eassert.
4148
26d16b35
EZ
41492012-08-07 Eli Zaretskii <eliz@gnu.org>
4150
14ae4239
BT
4151 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4152 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
4153 INTERNAL_FIELD in Lisp_Cons.
4154
c644523b
DA
41552012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4156
4157 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4158 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4159 name since all xname users are fixed long time ago. Do not
4160 use INTERNAL_FIELD.
4161 (set_symbol_name, set_symbol_function, set_symbol_plist):
4162 (set_symbol_next, set_overlay_plist): New function.
4163 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4164 (struct Lisp_Overlay): Likewise.
4165 (CVAR, MVAR, SVAR): Remove.
4166 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4167 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4168 * xterm.c: Adjust users.
4169 * .gdbinit: Change to use name field of struct Lisp_Symbol
4170 where appropriate.
4171
6a3d20cc
DA
41722012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4173
4174 Basic functions to set Lisp_Object and pointer slots of intervals.
4175 * intervals.h (interval_set_parent, interval_set_object):
4176 (interval_set_left, interval_set_right, interval_set_plist):
4177 (interval_copy_parent): New function.
4178 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
4179 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4180 Adjust indentation.
6a3d20cc
DA
4181 (INTERVAL_SIZE): Remove. Adjust users.
4182 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4183
4d2b044c
DA
41842012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4185
4186 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4187 * process.h (PGET): Remove.
4188 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4189 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4190
d3d50620
DA
41912012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4194 * window.h (WGET): Remove.
4195 (struct window): Do not use INTERNAL_FIELD.
4196 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4197 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4198 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4199 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4200 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4201 Adjust users.
4202
d10a51dc
CY
42032012-08-07 Chong Yidong <cyd@gnu.org>
4204
4205 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4206 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4207 (Fdelete_window_internal): Signal an error if the window is not on
4208 a live frame (Bug#12025).
4209
e69b0960
DA
42102012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4211
4212 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4213 * frame.h (FGET): Remove.
4214 (struct frame): Do not use INTERNAL_FIELD.
4215 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4216 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4217 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4218 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4219
25a20a3a
JB
42202012-08-06 Juanma Barranquero <lekktu@gmail.com>
4221
4222 * w32.c: Silence compiler warnings.
4223 (map_w32_filename): Remove unused variable `is_fat'.
4224 (chase_symlinks): Add parentheses around expression.
4225
1c6f11f4
GM
42262012-08-06 Glenn Morris <rgm@gnu.org>
4227
1db4583a
GM
4228 * sysdep.c: Respect BROKEN_GETWD.
4229
1c6f11f4
GM
4230 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4231 Let configure handle it.
4232 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4233
2b90362b
DA
42342012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4235
4236 Use GCALIGNMENT where appropriate.
4237 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4238 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4239 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4240
5f50daf2
EZ
42412012-08-06 Eli Zaretskii <eliz@gnu.org>
4242
14ae4239
BT
4243 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4244 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 4245
cbcc7007
SM
42462012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4247
4248 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4249 that should be sufficient for everyone.
4250
4d365fa4
JD
42512012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4252
4253 * keyboard.c (timer_check_2): Add break so timer_check returns next
4254 timeout.
4255
dd86bd82
DA
42562012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 Fix Windows build errors introduced after converting to WGET and WSET.
4259 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4260 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4261
054e1668
JD
42622012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4263
4264 * nsterm.m (ns_frame_rehighlight): Use FSET.
4265
4266 * nsmenu.m (ns_update_menubar): Use FSET.
4267
21238f11
DA
42682012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4269
4270 Separate read and write access to Lisp_Object slots of Lisp_Process.
4271 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4272 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4273
077288cf
DA
42742012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4275
4276 Separate read and write access to Lisp_Object slots of struct window.
4277 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4278 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4279 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4280 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4281 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4282 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4283 Adjust users.
4284
71688bd7
DA
42852012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 Fix Windows build errors introduced after converting to FGET and FSET.
4288 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4289 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4290 (w32_judge_scroll_bars): Change to use FSET.
4291 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4292
f99bac93
DA
42932012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Fix replacement typo.
4296 * window.c (replace_window): Set root_window instead of
4297 selected_window. This fixes a total window subsystem
4298 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4299
8c2a0f2d
GM
43002012-08-06 Glenn Morris <rgm@gnu.org>
4301
4302 * lisp.mk (lisp): Add language/persian.elc.
4303
edd74c35
DA
43042012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4305
4306 Separate read and write access to Lisp_Object slots of struct frame.
4307 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4308 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4309 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4310 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4311 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4312
8671676c
AS
43132012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4314
4315 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4316
663e2b3f
DA
43172012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4318
4319 Generalize common compile-time constants.
4320 * lisp.h (header_size, bool_header_size, word_size): Now here.
4321 (struct Lisp_Vector): Add comment.
4322 (struct Lisp_Bool_Vector): Move up to define handy constants.
4323 (VECSIZE, PSEUDOVECSIZE): Simplify.
4324 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4325 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4326 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4327 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4328 * xfont.c, xmenu.c: Use word_size where appropriate.
4329
d32e47af
LM
43302012-08-05 Lawrence Mitchell <wence@gmx.li>
4331
4332 * search.c (Freplace_match): Treat \? in the replacement text
4333 literally (Bug#8161).
4334
e5d9c0d1
CY
43352012-08-05 Chong Yidong <cyd@gnu.org>
4336
4337 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4338 * frame.c (Vdelete_frame_functions):
4339 * emacs.c (Vkill_emacs_hook): Doc fix.
4340
8da0576b
EZ
43412012-08-04 Eli Zaretskii <eliz@gnu.org>
4342
4343 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4344 --with-x-toolkit=no builds.
4345 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4346
02676e5d
CY
43472012-08-04 Chong Yidong <cyd@gnu.org>
4348
4349 * syntax.c (Fmodify_syntax_entry): Doc fix.
4350
97147da9
EZ
43512012-08-04 Eli Zaretskii <eliz@gnu.org>
4352
76151e2c
EZ
4353 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4354 * w32.c (init_environment): Change the default values of many
4355 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4356 them into environment when they were not already defined.
4357 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4358 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4359 (check_windows_init_file): Now external, not static.
4360 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4361 called when Vload_path is already set up.
4362
4363 * w32.h (check_windows_init_file): Add prototype.
4364
4365 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4366 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4367 compatibility with Posix platforms.
4368 (main): Move the call to check_windows_init_file to here from
4369 w32.c.
4370 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4371 any, in the DEFALT argument into the root of the Emacs build or
4372 installation tree, as appropriate.
4373
4374 * callproc.c (init_callproc_1): Call decode_env_path instead of
4375 doing its equivalent by hand.
4376 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4377 the code that sets Vexec_path run on MS-Windows.
4378
4379 * lread.c (init_lread): Add comments to #ifdef's.
4380
97147da9
EZ
4381 * msdos.c (dos_set_window_size, IT_update_begin)
4382 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4383 instead of direct references.
4384
185ee146
PE
43852012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4386
4387 Export DEFAULT_REHASH_* to GDB.
4388 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4389 Now constants, not macros.
4390
8834c57a
PE
43912012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4392
98c6f1e3
PE
4393 Remove unnecessary casts involving pointers.
4394 These casts are no longer needed now that we assume C89 or later,
4395 since they involve casting to or from void *.
4396 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4397 (make_pure_float, make_pure_vector):
4398 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4399 * macros.c (Fstart_kbd_macro):
4400 * menu.c (find_and_return_menu_selection):
4401 * minibuf.c (read_minibuf_noninteractive):
4402 * sysdep.c (closedir):
4403 * xdisp.c (x_produce_glyphs):
4404 * xfaces.c (compare_fonts_by_sort_order):
4405 * xfns.c (x_real_positions, select_visual):
4406 * xselect.c (x_stop_queuing_selection_requests)
4407 (x_get_window_property, x_get_window_property_as_lisp_data):
4408 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4409 Remove unnecessary pointer casts.
4410 * alloc.c (record_xmalloc): New function.
4411 * lisp.h (record_xmalloc): New decl.
4412 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4413 more like a function. This is because the pointer cast is not
4414 needed. All uses changed.
4415 * print.c (print_string, print_error_message): Avoid length recalc.
4416
8834c57a
PE
4417 Improve fix for macroexp crash with debugging (Bug#12118).
4418 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4419 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4420 not supposed to be invoked from the garbage collector.
4421 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4422 (gc_aset): New function, which is like ASET but can be
4423 used in the garbage collector.
4424 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4425 (set_hash_index): Use it instead of ASET.
4426
6dad7178
EZ
44272012-08-03 Eli Zaretskii <eliz@gnu.org>
4428
4429 Support symlinks on latest versions of MS-Windows.
4430 * w32.c: Include winioctl.h and aclapi.h.
4431 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4432 (revert_to_self): Forward declarations of static functions.
4433 <static BOOL g_b_init_get_security_info>:
4434 <g_b_init_create_symbolic_link>: New static flags.
4435 (globals_of_w32): Initialize them to zero.
4436 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4437 (map_w32_filename): Improve commentary. Simplify switch.
4438 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4439 headers (most versions of MinGW w32api don't).
4440 (get_security_info, create_symbolic_link)
4441 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4442 New functions.
4443 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4444 in the argument file name.
4445 (sys_access): Call unc_volume_file_attributes only if
4446 GetFileAttributes fails with network-related error codes.
4447 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4448 have the required privileges.
14ae4239 4449 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4450 get_file_security_desc.
4451 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4452 with addition of handling of symlinks and support for 'lstat'.
4453 If possible, get file's attributes and security information by
6dad7178
EZ
4454 handle, not by name. Produce S_IFLNK bit for symlinks, when
4455 called from 'lstat'.
4456 (stat, lstat): New functions, call 'stat_worker'.
4457 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4458 symlinks when the underlying filesystem supports them.
4459
f162bcc3
PE
44602012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4461
79ea6c20
PE
4462 Fix macroexp crash on Windows with debugging (Bug#12118).
4463 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4464 checking subscripts; problem introduced with the recent
4465 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4466 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4467 since it's used in non-static inline functions now.
4468
c0ce93fd
PE
4469 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4470 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4471
f162bcc3
PE
4472 Use C99-style 'extern inline' if available.
4473 * buffer.h (BUFFER_INLINE):
4474 * category.h (CATEGORY_INLINE):
4475 * character.h (CHARACTER_INLINE):
4476 * charset.h (CHARSET_INLINE):
4477 * composite.h (COMPOSITE_INLINE):
4478 * dispextern.h (DISPEXTERN_INLINE):
4479 * lisp.h (LISP_INLINE):
4480 * systime.h (SYSTIME_INLINE):
4481 New macro, replacing 'static inline' in this header.
4482 * buffer.h, category.h, character.h, charset.h, composite.h:
4483 * dispextern.h, lisp.h, systime.h:
4484 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4485 * alloc.c (LISP_INLINE):
4486 * buffer.c (BUFFER_INLINE):
4487 * category.c (CATEGORY_INLINE):
4488 * character.c (CHARACTER_INLINE):
4489 * charset.c (CHARSET_INLINE):
4490 * composite.c (COMPOSITE_INLINE):
4491 * dispnew.c (DISPEXTERN_INLINE):
4492 * sysdep.c (SYSTIME_INLINE):
4493 Define to EXTERN_INLINE, so that the corresponding functions
4494 are compiled into code.
4495 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4496 (INLINE_HEADER_END): New macros.
4497 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4498 since it's used in non-static inline functions now.
a8333d03 4499 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4500
837b365b
GM
45012012-08-02 Glenn Morris <rgm@gnu.org>
4502
d66b744d
GM
4503 * s/: Remove empty directory.
4504
837b365b
GM
4505 * s/ms-w32.h: Move to ../nt/inc.
4506 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4507 Update for new ms-w32.h location.
4508
13294f95
PE
45092012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 Port to Solaris 8.
4512 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4513
90df0db3
GM
45142012-08-02 Glenn Morris <rgm@gnu.org>
4515
4516 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4517 hard-coding the path separator.
4518
4939150c
PE
45192012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4520
4521 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4522 This how ASET and AREF are supposed to work, and makes
4523 it easier to think about future improvements. See
4524 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4525 * charset.h (set_charset_attr): New function.
4526 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4527 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4528 (aref_addr): New function. All uses of &AREF(...) changed.
4529 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4530 (set_hash_index): New functions. All lvalue-style uses of
4531 HASH_KEY etc. changed.
4532 * keyboard.c (set_prop): New function. All lvalue-style uses
4533 of PROP changed.
4534
947b2afd
AA
45352012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4536
4537 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4538 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 4539 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
4540 * nsfns.m (ns_set_name_as_filename): Likewise.
4541 * nsmenu.m (ns_update_menubar): Likewise.
4542 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4543
4f5d0325
EZ
45442012-08-01 Eli Zaretskii <eliz@gnu.org>
4545
2008beae
EZ
4546 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4547 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4548 objects.
2008beae 4549
4f5d0325
EZ
4550 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4551
fe3cc771
GM
45522012-08-01 Glenn Morris <rgm@gnu.org>
4553
4554 * s/msdos.h: Remove file.
4555 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4556 * Makefile.in (S_FILE): Remove.
4557 (config_h): Remove S_FILE.
4558
c90acc54
JB
45592012-08-01 Juanma Barranquero <lekktu@gmail.com>
4560
4561 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4562 Remove; moved to nt/config.nt.
4563
d8a05828
DA
45642012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4565
4566 Use INTERNAL_FIELD for conses and overlays.
4567 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4568 Remove obsolete comment.
4569 (MVAR): New macro.
4570 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4571 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4572
8271d590
DA
45732012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Use INTERNAL_FIELD for symbols.
4576 * lisp.h (SVAR): New macro. Adjust users.
4577 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4578 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4579
3193acd2
DA
45802012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 Use INTERNAL_FIELD for processes.
4583 * process.h (PVAR): New macro. Adjust style.
4584 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4585 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4586
3a45383a
DA
45872012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4588
4589 Use INTERNAL_FIELD for windows.
4590 * window.h (WVAR): New macro.
4591 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4592 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4593 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4594 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4595 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4596 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4597
c1dbc63c
PE
45982012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4599
4600 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4601
5c0c0e8a
GM
46022012-08-01 Glenn Morris <rgm@gnu.org>
4603
4604 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4605 Move to configure.ac.
4606
552a99b4
JB
46072012-08-01 Juanma Barranquero <lekktu@gmail.com>
4608
4609 * makefile.w32-in (CONFIG_H): Update dependencies.
4610 (CONF_POST_H): New macro.
4611
4612 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4613
8d8e2dfe
GM
46142012-07-31 Glenn Morris <rgm@gnu.org>
4615
bc96620a
GM
4616 * Makefile.in (S_FILE): No longer set by configure.
4617
476b1b2d
GM
4618 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4619 is available.
4620 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4621
b2c7a106
GM
4622 * process.h (NULL_DEVICE):
4623 * emacs.c (SEPCHAR):
4624 * editfns.c (USER_FULL_NAME): Let configure set them.
4625
d53d062a
GM
4626 * s/README, s/template.h: Remove files.
4627
4515017f
GM
4628 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4629
8d8e2dfe
GM
4630 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4631 Move to configure.ac.
4632
5b20b3cc
EZ
46332012-07-31 Eli Zaretskii <eliz@gnu.org>
4634
1e0afd9a
EZ
4635 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4636 resulting renaming of 'struct frame' members.
4637
5b20b3cc
EZ
4638 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4639
4640 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4641 after introduction of FVAR.
4642
f1310128
JD
46432012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4644
79e721e0
JD
4645 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4646
4647 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4648 instead of compositeToPoint.
4649 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4650
8d7c7eed 4651 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4652
e34f7f79
DA
46532012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4654
4655 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4656 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4657 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4658 (BVAR): Change to use INTERNAL_FIELD.
4659 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4660 (KVAR): Change to use INTERNAL_FIELD.
4661 * frame.h (FVAR): New macro.
4662 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4663 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4664 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4665 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4666 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4667
c09bfb2f
DA
46682012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4669
4670 Miscellaneous fixes for non-default X toolkits.
4671 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4672 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4673 Move under #ifdef USE_LUCID.
4674 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4675 definition and usage to avoid warnings.
4676
14c114ae
JD
46772012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4678
4679 * nsterm.m (openFiles): Fix previous checkin.
4680
3bd21e82
PE
46812012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 * indent.c (compute_motion): Remove unused local.
4684
c1529ded
GM
46852012-07-31 Glenn Morris <rgm@gnu.org>
4686
400d5621
GM
4687 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4688
268e2432
GM
4689 * conf_post.h [USG5_4]:
4690 Move remaining contents of s/usg5-4-common.h here.
4691 * s/usg5-4-common.h: Remove file.
4692
7552f3ee
GM
4693 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4694 * s/irix6-5.h: Remove file.
4695
6a381852
GM
4696 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4697 * s/darwin.h: Remove file.
4698
c1529ded
GM
4699 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4700 * s/hpux10-20.h: Remove file, which is now empty.
4701
b429a4ee
GM
47022012-07-30 Glenn Morris <rgm@gnu.org>
4703
4704 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4705 * Makefile.in (config_h): Add conf_post.h.
4706 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4707
adff3182
JD
47082012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4709
4710 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4711 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4712 (openFile, openTempFile, openFileWithoutUI, openFiles):
4713 Open files only if ns_do_open_file.
adff3182 4714
c32af1e4
PE
47152012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4716
7393bcbb
PE
4717 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4718 This no-op macro hasn't been needed for many years.
4719 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4720
c32af1e4
PE
4721 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4722 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4723 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4724 gdb_make_enums_visible.
4725 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4726 (DIRECTORY_SEP): Now a constant, not a macro.
4727
302fc036
EZ
47282012-07-30 Eli Zaretskii <eliz@gnu.org>
4729
4730 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4731 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4732
4733 * w32term.c <w32_keyboard_codepage>: Renamed from
4734 keyboard_codepage and now external. All users changed.
4735
4736 * w32term.h: Add declaration of w32_keyboard_codepage.
4737
4738 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4739 the codepage to translate keys to Unicode. If this argument is
4740 -1, use the value returned by GetConsoleCP. All callers changed.
4741
88fb40b4
PE
47422012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4743
0aee6912
PE
4744 Update .PHONY listings in makefiles.
4745 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4746 bootstrap-clean, distclean, maintainer-clean, versioclean,
4747 extraclean, frc.
4748
88fb40b4
PE
4749 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4750 This is a bit clearer. Fix some commentary typos.
4751
0a763bd1
GM
47522012-07-30 Glenn Morris <rgm@gnu.org>
4753
32bac6d6
GM
4754 * s/netbsd.h: Let configure include signal.h if needed.
4755 Remove file, which is now empty.
4756
b65e7c46
GM
4757 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4758 Let configure set them.
4759 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4760 No more need to undefine.
0a763bd1 4761
169304bd
AS
47622012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4763
4764 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4765 non-single-byte char when adding meta modifier. (Bug#12090)
4766
6cd7a139
DA
47672012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4768
4769 Convert safe_call to use variable number of arguments.
4770 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4771 (safe_call2): Fix comment.
4772 * lisp.h (safe_call): Adjust prototype.
4773 * coding.c (encode_coding_object): Change to use safe_call2.
4774 * xfaces.c (merge_face_heights): Change to use safe_call1.
4775
d34d6ffc
GM
47762012-07-30 Glenn Morris <rgm@gnu.org>
4777
7b8a48e4 4778 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4779 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4780
d34d6ffc
GM
4781 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4782 Remove empty files.
4783
03a660a6
PE
47842012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 Export to GDB most of lisp.h's remaining object-like macros.
4787 * lisp.h (min, max): Move earlier, because they're used earlier now.
4788 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4789 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4790 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4791 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4792 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4793 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4794 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4795 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4796 Now constants, for GDB. They need not be macros.
4797 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4798 Now constants, for GDB, as well as macros, for static initializers.
4799 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4800 Move to after the definition of struct Lisp_Char_Table,
4801 since the former now needs that type defined.
4802 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4803 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4804 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4805 New enums, for gdb_make_enums_visible.
4806 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4807 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4808 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4809 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4810 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4811 enum maxargs, enum MAX_ALLOCA.
4812 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4813 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4814 no longer needed, now that they are done in lisp.h.
4815
e499d0ee
DA
48162012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4817
4818 Cleanup string bytes checking.
4819 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4820 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4821 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4822 (check_sblock, compact_small_strings): Simplify.
4823
d5040d2d
PE
48242012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4825
4826 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4827 These macros are confusing and no longer need to be defined, as
4828 the enum values now suffice. All uses replaced with definiens.
4829 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4830
7f259ae6
JB
48312012-07-29 Juanma Barranquero <lekktu@gmail.com>
4832
4833 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4834 ($(BLD)/w32console.$(O)): Update dependencies.
4835
7e63e0c3
DA
48362012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4837
4838 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4839 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4840 time. Adjust users.
4841 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4842
ffd817eb
JD
48432012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4844
4845 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4846 setting sitelisp (Bug#12010).
4847
417a7a0e
EZ
48482012-07-29 Eli Zaretskii <eliz@gnu.org>
4849
14ae4239 4850 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4851
4852 * w32heap.c (cache_system_info):
4853 * w32.c (sys_rename):
4854 * w32proc.c (find_child_console, sys_kill): All users changed.
4855
387d4d92
PE
48562012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4857
4858 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4859
55a6cca6
EZ
48602012-07-29 Eli Zaretskii <eliz@gnu.org>
4861
4862 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4863
dbcf001c
DA
48642012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4865
4866 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4867 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4868 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4869
e2688e4a
DA
48702012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4871
4872 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4873 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4874 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4875 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4876 (replace_range, replace_range_2, del_range_2): Change to eassert.
4877 * marker.c (byte_char_debug_check): Adjust style.
4878
b46a6a83
PE
48792012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4880
4881 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4882 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4883 long-ago-commented-out code that talks about "WIN32".
4884 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4885 All uses changed.
4886
e32a5799
PE
48872012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4888
4889 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4890 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4891 Simplify by using alignof.
4892 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4893 * lisp.h: Include <stdalign.h>.
4894 (GCALIGNMENT): New macro and constant.
4895 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4896 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4897 (stdalign): New macro, if not already defined.
4898
df81cd29
EZ
48992012-07-28 Eli Zaretskii <eliz@gnu.org>
4900
01bd1b0d
EZ
4901 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4902 * w32inevt.c: Include w32inevt.h.
4903 (w32_read_console_input): New inline function, calls either
4904 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4905 w32_console_unicode_input.
4906 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4907 (w32_kbd_patch_key, key_event): Use the codepage returned by
4908 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4909 (key_event): use uChar.UnicodeChar only if
4910 w32_console_unicode_input is non-zero.
4911
4912 * w32console.c: Include w32heap.h.
4913 <w32_console_unicode_input>: New global variable.
4914 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4915 family of Windows, zero otherwise.
4916
4917 * w32inevt.h: Declare w32_console_unicode_input.
4918
df81cd29
EZ
4919 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4920 --without-x. (Bug#11742)
4921
c20fdd9e
PE
49222012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 Adjust GDB to reflect pvec_type changes (Bug#12036).
4925 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4926 2012-07-04 changes to pseudovector representation.
4927 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4928
32770973 49292012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4930
4931 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4932 bus address.
4933 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4934
3438fe21
EZ
49352012-07-27 Eli Zaretskii <eliz@gnu.org>
4936
bcfbc9de
EZ
4937 * alloc.c (listn): Fix the order the arguments are consed onto the
4938 list.
4939
3438fe21
EZ
4940 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4941 enumeration constants, as PURE and HEAP are too general, and clash
4942 with other headers and sources, such as gmalloc.c and the
4943 MS-Windows system headers. All users changed.
4944
eeaea515
DA
49452012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4946
4947 Revert last save_excursion_save and save_excursion_restore changes.
4948 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4949 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4950
073c88c2
DA
49512012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4952
4953 Fix recently-introduced typos in Windows port.
4954 Reported by Martin Rudalics <rudalics@gmx.at>.
4955 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4956 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4957
4706125e
PE
49582012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4959
4960 Improve GDB symbol export (Bug#12036).
4961 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4962 arms of an 'if', not using conditional expressions; otherwise GDB
4963 complains about the types in the unevaluated arm when the argument
4964 is an integer literal.
4965 (xgetint): Simplify expression.
4966 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4967 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4968 Zaretskii in <http://bugs.gnu.org/12036#13>.
4969 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4970 needed now that we have gdb_make_enums_visible.
4971 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4972 (enum enum_USE_LSB_TAG):
4973 New enum types, packaging up enums that need to be exported to GDB.
4974
694b6c97
DA
49752012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4976
4977 Utility function to make a list from specified amount of objects.
4978 * lisp.h (enum constype): New datatype.
4979 (listn): New prototype.
4980 * alloc.c (listn): New function.
4981 (Fmemory_use_count, syms_of_alloc): Use it.
4982 * buffer.c (syms_of_buffer): Likewise.
4983 * callint.c (syms_of_callint): Likewise.
4984 * charset.c (define_charset_internal): Likewise.
4985 * coding.c (syms_of_coding): Likewise.
4986 * keymap.c (syms_of_keymap): Likewise.
4987 * search.c (syms_of_search): Likewise.
4988 * syntax.c (syms_of_syntax): Likewise.
4989 * w32.c (init_environment): Likewise.
4990 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4991 * xdisp.c (syms_of_xdisp): Likewise.
4992 * xfns.c (syms_of_xfns): Likewise.
4993
6195f384
DA
49942012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4995
4996 Fast save_excursion_save and save_excursion_restore.
4997 * lisp.h (struct Lisp_Excursion): New data type.
4998 (PVEC_EXCURSION): New pseudovector type.
4999 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5000 to deal with it. Adjust comments.
5001 (init_marker, attach_marker): New prototype.
5002 (unchain_marker): Adjust prototype.
5003 * marker.c (attach_marker): Change to global.
5004 (init_marker): New function.
5005 * alloc.c (Fmake_marker, build_marker): Use it.
5006 (build_marker): More easserts.
5007 (mark_object): Handle struct Lisp_Excursion.
5008 * editfns.c (save_excursion_save, save_excursion_restore):
5009 Reimplement to use struct Lisp_Excursion. Add comments.
5010
5eceb8fb
PE
50112012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 Fix export of symbols to GDB (Bug#12036).
5014 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5015 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5016 emacs.c, as this is a more-suitable home. Had this been done earlier
5017 the fix for 12036 would have avoided some of the problems noted in
5018 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5019 would have been more obvious.
562157c8
PE
5020 * emacs.c: Do not include <verify.h>; no longer needed.
5021 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
5022 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5023 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5024 Remove; now done in lisp.h.
5025 * lisp.h (PUBLISH_TO_GDB): New macro.
5026 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5027 (DATA_SEG_BITS): Use it.
5028 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5029 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5030 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5031 not be usable in #if. This simplifies things.
5032
d6749401
JB
50332012-07-26 Juanma Barranquero <lekktu@gmail.com>
5034
5035 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5036
1781b9e9
PE
50372012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5038
d89518db 5039 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
5040 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5041 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5042 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5043 Adjust to changes in lisp.h and emacs.c, by using
5044 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5045 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5046 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5047 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5048 instead of gdb_valbits.
5049 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5050 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5051 instead of gdb_array_mark_flag.
5052 (xboolvector): Get size from $->size, not $->header.size.
5053 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5054 (xreload, hook-run, hookpost-run): Remove.
5055 * emacs.c: Include <verify.h>.
5056 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5057 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5058 Remove.
5059 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5060 (gdb_USE_LSB_TAG): New enum constants.
5061 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5062 Also define these as enum constants, so they're visible to GDB.
5063 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5064 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5065 as constants, so they're visible to GDB.
5066 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5067 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5068 Now enum constants, not macros, so they're visible to GDB.
5069 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5070 more convenient now. All uses changed.
5071 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5072 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5073
3628596a
DA
50742012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 Explicitly free restriction data that are not needed anymore.
5077 * editfns.c (save_restriction_restore): Free restriction data.
5078
7abaf5cc
SM
50792012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5080
5081 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5082 add argument, tune behavior, and adjust all callers.
5083
71f88e00
PE
50842012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5085
5086 Use typedef for EMACS_INT, EMACS_UINT.
5087 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5088 than macros. This simplifies debugging in the usual case, since
5089 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5090 and it allows expressions involving EMACS_INT casts.
5091 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5092
57ec3034
JD
50932012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5094
5095 * nsterm.m (ns_read_socket): Return early if there is a modal
5096 window (Bug#12043).
5097
8137e7b3
MR
50982012-07-25 Martin Rudalics <rudalics@gmx.at>
5099
5100 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5101 that FOCUS-FRAME can be omitted.
5102
04e9897c
DA
51032012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5104
5105 Adjust buffer text indirection counters at the end of Fkill_buffer.
5106 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5107 buffer is definitely dead. This should really fix an issue reported
5108 by Christoph Scholtes again. (Bug#12007).
5109 (init_buffer_once): Initialize indirection counters of
5110 buffer_defaults and buffer_local_symbols (for sanity and safety).
5111
8a0484e1
EZ
51122012-07-24 Eli Zaretskii <eliz@gnu.org>
5113
5114 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5115 and continuation glyphs on tooltip frames, leave them at zero.
5116 Avoids continued lines in tooltips. (Bug#11832)
5117
fa691a83
DA
51182012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5119
5120 Simplify copy_overlay.
04e9897c 5121 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
5122 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5123
436bc8e0
EZ
51242012-07-23 Eli Zaretskii <eliz@gnu.org>
5125
5126 * print.c (print_object): Don't crash when a frame's name is nil
5127 or invalid. (Bug#12025)
5128
5129 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5130 it signals an error when a tooltip frame is being created.
5131
d7a7fda3
DA
51322012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 Cleanup miscellaneous objects allocation and initialization.
5135 * alloc.c (allocate_misc): Change to static. Add argument to
5136 specify the subtype. Adjust comment and users.
5137 (build_overlay): New function.
5138 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5139 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5140 (allocate_misc): Remove prototype.
5141 (build_overlay): Add prototype.
5142
51432012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
5144
5145 Swap buffer text indirection counters in Fbuffer_swap_text.
5146 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5147 This avoids crash reported by Christoph Scholtes at
5148 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5149
9d7fa573
JD
51502012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5151
5152 * nsmenu.m (Popdown_data): New struct.
5153 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5154 free Popdown_data.
5155 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5156 (initWithContentRect): Make imgView and contentView non-static
5157 and autorelease them. Also autorelease img and matrix (Bug#12005).
5158 (dealloc): Remove (Bug#12005).
5159
0dd6d66d
DA
51602012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5161
5162 Adjust consing_since_gc when objects are explicitly freed.
5163 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5164 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5165 (free_cons, free_misc): Subtract object size from consing_since_gc.
5166
d36d71df
DA
51672012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5168
5169 Simplify and cleanup markers positioning code.
5170 * marker.c (attach_marker): More useful eassert.
5171 (live_buffer, set_marker_internal): New function.
5172 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5173 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5174
fb9ea40f
PE
51752012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5176
5177 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5178 as it's limited by the amount of memory, not by INT_MAX.
5179
2d5c5f7d
EZ
51802012-07-21 Eli Zaretskii <eliz@gnu.org>
5181
07fb592e
EZ
5182 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5183 in special-event-map. See the discussion at
5184 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5185 for the reasons.
5186
37a9eac8 5187 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
5188 info.dwItemData. Fixes crashes on 64-bit Windows.
5189 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 5190
c4328746
JD
51912012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5192
fc0c31f8 5193 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 5194 (conversationIdentifier): Return value is NSInteger.
784051c4 5195 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 5196
6e5d1c12
CY
51972012-07-21 Chong Yidong <cyd@gnu.org>
5198
5199 * window.c (decode_any_window): Signal an error if the window is
5200 on a dead frame (Bug#11984).
5201
9928463d
DA
52022012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5203
5204 Add indirection counting to speed up Fkill_buffer.
5205 * buffer.h (struct buffer): New member.
5206 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5207 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5208 base buffer indirection counter.
5209 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5210 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5211 through buffer list if indirection counter is 0.
5212
f8643a6b
DA
52132012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5214
5215 Extend the value returned by Fgarbage_collect with heap statistics.
5216 * alloc.c (Qheap): New symbol.
5217 (syms_of_alloc): DEFSYM it.
5218 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5219 (Fmemory_free): Remove.
5220 (syms_of_alloc): Don't defsubr it.
5221 * buffer.c (Fcompact_buffer): Remove.
5222 (syms_of_buffer): Don't defsubr it.
5223
dac616ff
DA
52242012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5225
5226 Make maybe_gc inline.
5227 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5228 * lisp.h (consing_since_gc, gc_relative_threshold)
5229 (memory_full_cons_threshold): Revert declaration.
5230 (maybe_gc): Remove prototype, define as inline.
5231 * alloc.c: Remove old commented-out code.
5232 (consing_since_gc, gc_relative_threshold)
5233 (memory_full_cons_threshold): Revert to global.
5234 (maybe_gc): Remove.
5235
d7ea76b4
DA
52362012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5237
5238 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5239 * lisp.h (build_unibyte_string): New function.
5240 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5241 * sysdep.c, w32fns.c, xfns.c: Use it.
5242 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5243 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5244 Adjust users accordingly.
5245 * font.h (font_open_by_name): Adjust prototype.
5246
765e61e3
DA
52472012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5248
5249 Cleanup calls to Fgarbage_collect.
5250 * lisp.h (maybe_gc): New prototype.
5251 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5252 Remove declarations.
5253 * alloc.c (maybe_gc): New function.
5254 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5255 Make them static.
5256 * bytecode.c (MAYBE_GC): Use maybe_gc.
5257 * eval.c (eval_sub, Ffuncall): Likewise.
5258 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5259 to avoid dependency from auto-save feature.
5260
52b852c7
PE
52612012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5262
5263 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5264 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5265 'for_each_per_buffer_object_at'.
5266 All uses changed. It's better to use upper-case for macros that
5267 cannot be implemented as functions, to give the reader a clue
5268 that they're special.
5269
5db81e33
SM
52702012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5271
5272 * alloc.c (Fgarbage_collect): Tweak docstring.
5273
5b835e1d
DA
52742012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5275
5276 Tweak the value returned from Fgarbage_collect again.
5277 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5278 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5279 Adjust documentation.
5280 (total_vector_bytes): Rename to total_vector_slots, adjust
5281 accounting.
5282 (total_free_vector_bytes): Rename to total_free_vector_slots,
5283 adjust accounting.
5284 (Qstring_bytes, Qvector_slots): New symbols.
5285 (syms_of_alloc): DEFSYM them.
5286
9cd47b72
DA
52872012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5288
5289 Buffer compaction primitive which may be used from Lisp.
5290 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5291 (syms_of_buffer): Register Fcompact_buffer.
5292 * alloc.c (Fgarbage_collect): Use compact_buffer.
5293 * buffer.h (compact_buffer): New prototype.
5294 (struct buffer_text): New member.
5295
d17337e5
DA
52962012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5297
5298 New macro to iterate over all buffers, miscellaneous cleanups.
5299 * lisp.h (all_buffers): Remove declaration.
5300 * buffer.h (all_buffers): Add declaration, with comment.
5301 (for_each_buffer): New macro.
5302 * alloc.c (Fgarbage_collect, mark_object): Use it.
5303 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5304 (init_buffer): Likewise.
5305 * data.c (Fset_default): Likewise.
5306 * coding.c (code_conversion_restore): Remove redundant check
5307 for dead buffer.
5308 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5309
60cfd278
AS
53102012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5311
5312 Fix bug that created negative-length intervals.
5313 * intervals.c (merge_interval_right, merge_interval_left):
5314 Do not zero out this interval if it is absorbed by its children,
5315 as this interval's total length doesn't change in that case. See
5316 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5317
d06714cb
PE
53182012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5319
83713154
PE
5320 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5321 when invoking (make-bool-vector N t) and N is a positive
5322 multiple of 8 -- the last 8 bits were mistakenly cleared.
5323
d06714cb
PE
5324 Remove some struct layout assumptions in bool vectors.
5325 * alloc.c (bool_header_size): New constant.
5326 (header_size, word_size): Move earlier, as they're now used earlier.
5327 Use 'word_size' in a few more places, where it's appropriate.
5328 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5329 padding before the data member of a bool vector.
5330 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5331 than doing the check by hand with an abort ().
5332
464d5a5e
SM
53332012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5334
5fbc0409
SM
5335 * eval.c (Fdefvar): Don't check constants since we only set the var if
5336 it's not yet defined anyway (bug#11904).
5337
464d5a5e
SM
5338 * lisp.h (last_undo_boundary): Declare new var.
5339 * keyboard.c (command_loop_1): Set it.
5340 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5341 were auto-added by the command loop (bug#11774).
5342
8dc2e44a
AS
53432012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5344
5345 * w32font.c (Qsymbol): Remove local definition.
5346 (syms_of_w32font): Don't DEFSYM it.
5347
169925ec
DA
53482012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5349
5350 Fix sweep_vectors to handle large bool vectors correctly.
5351 * alloc.c (sweep_vectors): Account total_vector_bytes for
5352 bool vectors larger than VBLOCK_BYTES_MAX.
5353
5fbfb018
CY
53542012-07-18 Chong Yidong <cyd@gnu.org>
5355
5356 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5357 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5358
3ab6e069
DA
53592012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5360
5361 Return more descriptive data from Fgarbage_collect.
5362 Suggested by Stefan Monnier in
5363 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5364 * alloc.c (bounded_number): New function.
5365 (total_buffers, total_vectors): New variable.
5366 (total_string_size): Rename to total_string_bytes, adjust users.
5367 (total_vector_size): Rename to total_vector_bytes, adjust users.
5368 (sweep_vectors): Account total_vectors and total_vector_bytes.
5369 (Fgarbage_collect): New return value. Adjust documentation.
5370 (gc_sweep): Account total_buffers.
5371 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5372 (VECTOR_SIZE): Remove.
5373 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5374 (Qinterval, Qmisc): New symbols.
5375 (syms_of_data): Initialize them.
5376 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5377 (Qcons, Qbuffer): New declarations.
5378
6d02fe5b
PE
53792012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5382 Round up, not down. Improve doc.
5383
b7ffe040
DA
53842012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5385
5386 Restore old code in allocate_string_data to avoid Faset breakage.
5387 Reported by Julien Danjou <julien@danjou.info> in
5388 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5389 * alloc.c (allocate_string_data): Restore old code with minor
5390 adjustments, fix comment to explain this subtle issue.
5391
4dc7c8d5
SM
53922012-07-17 Eli Zaretskii <eliz@gnu.org>
5393
5394 Remove FILE_SYSTEM_CASE.
5395 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5396
5397 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5398 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5399 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5400 call-process-region passes it through expand-file-name.
5401
5402 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5403
54042012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5405
5406 Fix crash when creating indirect buffer (Bug#11917)
5407 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5408 Don't handle unbound variables specially if non-zero.
5409 (Fbuffer_local_variables): Pass zero.
5410 (clone_per_buffer_values): Pass non-zero.
5411
54122012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5413
5414 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5415 to make the loop interruptible.
5416
54172012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5418
5419 * gnutls.c (emacs_gnutls_handshake): Only retry if
5420 GNUTLS_E_INTERRUPTED.
5421
cce7fefc
DA
54222012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Cleanup and convert miscellaneous checks to eassert.
5425 * alloc.c (mark_interval): Fix comment, partially rephrase
5426 old comment from intervals.h (see below).
5427 * intervals.c (find_interval, adjust_intervals_for_insertion)
5428 (delete_interval, adjust_intervals_for_deletion)
5429 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5430 Convert to eassert.
5431 (adjust_intervals_for_insertion, make_new_interval):
5432 Remove obsolete and unused code.
5433 * intervals.h (struct interval): Remove obsolete comment.
5434 * textprotp.c (erase_properties): Remove unused code.
5435 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5436 (Fremove_list_of_text_properties): Convert to eassert.
5437
9ea10cc3
CY
54382012-07-17 Chong Yidong <cyd@gnu.org>
5439
5440 * editfns.c (Finsert_char): Doc fix.
5441
3900d5de
DA
54422012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 Fix previous change to make Fmemory_free always accurate.
5445 * alloc.c (make_interval): Update total_free_intervals.
5446 (make_float): Likewise for total_free_floats.
5447 (free_cons, Fcons): Likewise for total_free_conses.
5448 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5449 Likewise for total_free_vector_bytes.
5450 (Fmake_symbol): Likewise for total_free_symbols.
5451 (bytes_free): Remove.
5452
7098646f
DA
54532012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 Simple free memory accounting feature.
5456 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5457 (sweep_vectors): Accumulate size of free vectors.
5458 (Fgarbage_collect): Setup bytes_free.
5459 (Fmemory_free): New function.
5460 (syms_of_alloc): Register it.
5461
22657b40
DA
54622012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5463
5464 Cleanup overlays checking.
5465 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5466 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5467 eassert and OVERLAYP.
5468 (sort_overlays): Change to use OVERLAYP.
5469
ddfc8813
RK
54702012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5471
5472 * editfns.c (Finsert_char): Make it interactive, and make the
5473 second arg optional. Copy interactive spec and docstring from
5474 ucs-insert.
5475
7c26cf3c
PE
54762012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5477
5478 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5479 Unlike the other wrapped functions, fabs has an unspecified
5480 effect on errno.
5481
5d127af9
JD
54822012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5483
5484 * nsterm.m (keyDown): Interpret flags without left/right bits
5485 as the left key (Bug#11670).
5486
6a0dd1d7
DA
54872012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5488
5489 Remove empty and useless init functions.
5490 * lisp.h (init_character_once, init_fns, init_image)
5491 (init_filelock, init_sound): Remove prototype.
5492 * character.c (init_character_once): Remove.
5493 * filelock.c (init_filelock): Likewise.
5494 * fns.c (init_fns): Likewise.
5495 * image.c (init_image): Likewise.
5496 * sound.c (init_sound): Likewise.
5497 * emacs.c (main): Adjust accordingly.
5498
7a6136fd
DA
54992012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5500
5501 * gtkutil.h: Tiny cleanups.
5502 (use_old_gtk_file_dialog): Remove useless declaration.
5503 (xg_uses_old_file_dialog): Add suggested const attribute.
5504
ce811ad9
EZ
55052012-07-15 Eli Zaretskii <eliz@gnu.org>
5506
5507 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5508 (bidi_paragraph_init): Use it to limit search forward for a strong
5509 directional character in abnormally large paragraphs full of
5510 neutral or weak characters. (Bug#11943)
5511
c9adfeaa
SF
55122012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5513
5514 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5515 the toolbar (Bug#9451).
5516 (xg_make_tool_item): Give the widget event box a transparent
5517 background.
5518
fff62aa9
DA
55192012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5520
5521 Cleanup basic allocation variables and functions.
5522 * alloc.c (ignore_warnings, init_intervals, init_float)
5523 (init_cons, init_symbol, init_marker): Remove.
5524 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5525 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5526 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5527 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5528 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5529 (staticidx, init_alloc_once, init_strings, free_ablock):
5530 Remove redundant initialization.
5531 * fns.c (init_weak_hash_tables): Remove.
5532 * lisp.h (init_weak_hash_tables): Remove prototype.
5533
9730daca
DA
55342012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5535
5536 Use zero_vector where appropriate.
5537 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5538 accordingly.
5539 * lisp.h (zero_vector): New declaration.
5540 * font.c (null_vector): Remove.
5541 (syms_of_font): Remove initialization and staticpro.
5542 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5543 * keymap.c (Faccessible_keymaps): Likewise.
5544
2e2d2a13
LL
55452012-07-15 Leo Liu <sdl.web@gmail.com>
5546
5547 * fringe.c: Fix typo in comments.
5548
cd276f6e
LL
55492012-07-14 Leo Liu <sdl.web@gmail.com>
5550
5551 * fringe.c: Add a new bitmap exclamation-mark.
5552
5a1131d9
EZ
55532012-07-14 Eli Zaretskii <eliz@gnu.org>
5554
5555 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5556
5557 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5558 (HAVE_MENUS): Don't define, defined by editing config.in with
5559 msdos/sed2v2.inp.
5560 (GMALLOC_INHIBIT_VALLOC): Don't define.
5561 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5562
22e983b7
JB
55632012-07-14 Juanma Barranquero <lekktu@gmail.com>
5564
5565 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5566
5b3f250f
GM
55672012-07-14 Glenn Morris <rgm@gnu.org>
5568
5569 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5570 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5571 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5572
33d63ff4
GM
55732012-07-13 Glenn Morris <rgm@gnu.org>
5574
5b633342
GM
5575 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5576
33d63ff4
GM
5577 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5578 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5579
b55b9f85
JD
55802012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5581
0dc8cf50
JD
5582 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5583 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5584 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5585 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5586 where appropriate.
5587 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5588 as boolean expression.
5589 (x_set_window_size): Remove unused variable toolbar.
5590 (ns_get_color_default, ns_mod_to_lisp): Remove.
5591 (ns_mouse_position): Remove unused variables xchar and ychar.
5592 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5593 (ns_set_vertical_scroll_bar): Remove unused variable count.
5594 (ns_delete_terminal): Remove unused variable i.
5595 (ns_term_init): Remove unused variables r, g and b.
5596 (mouseDown): Remove unused variable window.
5597 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5598 (initFrameFromEmacs): Remove unused variable vbextra.
5599 (mouseEntered): Remove unused variables p and dpyinfo.
5600 (mouseExited): Remove unused variables p and r.
5601 (ns_define_frame_cursor, ns_clear_frame_area)
5602 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5603 (menuDown): Assign [sender tag] to variable and cast the variable.
5604
5605 * nsterm.h (menuDown): Add id as type to argument sender.
5606 (ns_display_info_for_name): Add Lisp_Object argument.
5607 (ns_term_init): Add Lisp_Object argument.
5608 (ns_map_event_to_object): Add void argument.
5609 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5610 prototype with arguments and only declare if __OBJC__.
5611 (nxatoms_of_nsselect): Add void argument.
5612 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5613 (ns_alloc_autorelease_pool): Add void argument.
5614 (ns_release_autorelease_pool): Add void* argument.
5615 (ns_get_defaults_value): Add const char* argument.
5616
5617 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5618 (initFromContents): Use SSDATA where appropriate.
5619 (ns_update_menubar): Add braces to ambigous if-else.
5620 (initWithTitle): Put () around assignment in if statement.
5621 (ns_menu_show): Remove unused variables window and keymap.
5622 (update_frame_tool_bar): Remove unused variable selected_p.
5623 (initWithContentRect): Remove unused variable this_cmd_name.
5624
5625 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5626 appropriate.
5627 (setXBMColor): Remove unused variable len.
5628 (setPixmapData): Put () around assignment in loop statement.
5629
5630 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5631 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5632 where appropriate.
5633 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5634 around assignment in loop statement.
5635 (nsfont_open): Remove unused variable i.
5636 (nsfont_open): Remove unused variable len.
5637 (nsfont_draw): Remove unused variable cs.
5638
5639 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5640 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5641 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5642 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5643 (Fns_font_name, Fns_perform_service)
5644 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5645 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5646 (ns_set_name): Remove unused variable view.
5647 (x_set_menu_bar_lines): Remove unused variable olines.
5648 (x_set_tool_bar_lines): Remove unused variable root_window.
5649 (Fns_list_colors): Put () around assignment in while statement.
5650 (Fns_perform_service): Remove unused variable len.
5651 (Fns_display_usable_bounds): Remove unused variable top.
5652 (syms_of_nsfns): Remove unused variable i.
5653
b55b9f85
JD
5654 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5655 memcpy (Bug#11907).
5656
ed9265fc 56572012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5658
5659 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5660 and free it with DestroyExceptionInfo (Bug#11558).
5661
ef099b57
JB
56622012-07-13 Juanma Barranquero <lekktu@gmail.com>
5663
5664 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5665 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5666 Set here, not in nt/config.nt.
5667
ea814a5d
EZ
56682012-07-13 Eli Zaretskii <eliz@gnu.org>
5669
5670 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5671 cursor overflow into the last glyph on display line when the right
5672 fringe is off. (Bug#11832)
5673
1a952767
PE
56742012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 * xdisp.c (produce_special_glyphs): Now static.
5677 * dispextern.h (produce_special_glyphs): Remove decl.
5678
983188fd
GM
56792012-07-13 Glenn Morris <rgm@gnu.org>
5680
8d7c7eed 5681 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5682 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5683
983188fd
GM
5684 * s/usg5-4-common.h (USG, USG5):
5685 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5686 * s/sol2-6.h (SOLARIS2):
5687 * s/irix6-5.h (IRIX6_5):
5688 * s/hpux10-20.h (USG, USG5, HPUX):
5689 * s/gnu-linux.h (USG, GNU_LINUX):
5690 * s/freebsd.h (BSD_SYSTEM):
5691 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5692 * s/cygwin.h (CYGWIN):
5693 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5694 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5695
d1e68667 56962012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5697
5698 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5699
6de0e799
GM
57002012-07-13 Glenn Morris <rgm@gnu.org>
5701
739ae010
GM
5702 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5703
dbee5793
GM
5704 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5705
6de0e799
GM
5706 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5707 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5708
b82da769
GM
57092012-07-12 Glenn Morris <rgm@gnu.org>
5710
4fae5a7a 5711 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5712
5713 * process.c (init_process_emacs): Rename from init_process.
5714 The old name is also the name of a Mach system call.
5715 * lisp.h, emacs.c: Update for this name change.
5716 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5717 longer needed.
5718
5a979817
EZ
57192012-07-12 Eli Zaretskii <eliz@gnu.org>
5720
5721 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5722 memmove call that removes glyphs covered by the left truncation
5723 glyph. Improve commentary.
5724 (display_line): Fix display of continuation glyphs on GUI frames
5725 when the right fringe is turned off and variable-size fonts are
5726 used in the window. Move the code that appends a stretch glyph to
5727 produce_special_glyphs, so that it could be used for truncation
5728 and continuation glyphs alike.
5729 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5730 glyph of a suitably computed width, to align the special glyphs at
5731 the window margin. Code moved from display_line. (Bug#11832)
5732
3e91a053
GM
57332012-07-12 Glenn Morris <rgm@gnu.org>
5734
ba9e4b84
GM
5735 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5736
5737 * s/gnu-linux.h, s/hpux10-20.h:
5738 Do not unconditionally define HAVE_XRMSETDATABASE.
5739
3e91a053
GM
5740 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5741
b300b1f4
PE
57422012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5743
5744 Fix typos that broke OS X build.
5745 Reported by Randal L. Schwartz in
5746 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5747 * nsterm.m (ns_timeout): Add missing local decl.
5748 (ns_get_color): snprintf -> sprintf, to fix typo.
5749
6e777848
GM
57502012-07-12 Glenn Morris <rgm@gnu.org>
5751
3f922c37
GM
5752 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5753 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5754 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5755 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5756
0ab7b23a
GM
5757 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5758 Move PTY_OPEN to configure.
5759
6e777848
GM
5760 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5761 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5762 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5763
4a7edc24
DA
57642012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5765
5766 Use empty_unibyte_string where applicable.
5767 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5768 * lread.c (read1): Likewise.
5769 * xsettings.c (syms_of_xsettings): Likewise.
5770
308aab79
GM
57712012-07-12 Glenn Morris <rgm@gnu.org>
5772
42bd1719
GM
5773 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5774 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5775 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5776 * s/hpux10-20.h (RUN_TIME_REMAP):
5777 * s/bsd-common.h (TABDLY): Move to configure.
5778
5779 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5780
5781 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5782
ea0bbd17 5783 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5784 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5785
5786 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5787
308aab79
GM
5788 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5789 * s/template.h: Move NARROWPROTO to configure.
5790
ee1cf5cf
GM
57912012-07-11 Glenn Morris <rgm@gnu.org>
5792
30fe9bf4
GM
5793 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5794 unused since 2011-01-17 change to systty.h.
5795
ee1cf5cf
GM
5796 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5797 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5798 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5799
63e47e07
PE
58002012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5803
c43fb4c3
GM
58042012-07-11 Glenn Morris <rgm@gnu.org>
5805
5806 * s/darwin.h, s/gnu-linux.h, s/template.h:
5807 Move INTERRUPT_INPUT to configure.
5808
e8df9267
DA
58092012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 Minor adjustments to interning code.
5812 * lisp.h (intern, intern_c_string): Redefine as static inline
5813 wrappers for intern_1 and intern_c_string_1, respectively.
5814 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5815 * lread.c (intern_1, intern_c_string_1, oblookup):
5816 Simplify Vobarray checking.
e8df9267
DA
5817 * font.c (font_intern_prop): Likewise. Adjust comment.
5818 * w32font.c (intern_font_name): Likewise.
5819
34348bd4
AS
58202012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5821
d96a1e0c
AS
5822 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5823
34348bd4
AS
5824 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5825 of Fcar/Fcdr if possible.
5826 * font.c (check_otf_features): Likewise.
5827 * fontset.c (Fnew_fontset): Likewise.
5828 * gnutls.c (Fgnutls_boot): Likewise.
5829 * minibuf.c (read_minibuf): Likewise.
5830 * msdos.c (IT_set_frame_parameters): Likewise.
5831 * xmenu.c (Fx_popup_dialog): Likewise.
5832 * w32menu.c (Fx_popup_dialog): Likewise.
5833
c8add24e
GM
58342012-07-11 Glenn Morris <rgm@gnu.org>
5835
4b575b3c
GM
5836 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5837 since nothing has defined it on these platforms.
5838
09f4e3b0
GM
5839 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5840 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5841
172bedef
GM
5842 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5843 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5844 Move CLASH_DETECTION to configure.
5845
249685df
GM
5846 * s/gnu.h: Remove file, which is now empty.
5847
c8add24e
GM
5848 * s/gnu.h, s/gnu-linux.h:
5849 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5850
b41253a3
JW
58512012-07-11 John Wiegley <johnw@newartisans.com>
5852
5853 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5854 function attribute, so we only use it if it exists in the
5855 compiler.
5856
d923b542
DA
58572012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5858
5859 Avoid call to strlen in fast_c_string_match_ignore_case.
5860 * search.c (fast_c_string_match_ignore_case): Change to use
5861 length argument. Adjust users accordingly.
5862 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5863
5ebbef1d
PE
58642012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5865
bb352260
PE
5866 Assume mkdir, rmdir.
5867 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5868 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5869
57054ddd
PE
5870 Assume rename.
5871 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5872
b747d3f7
PE
5873 Assume perror.
5874 * s/hpux10-20.h (HAVE_PERROR): Remove.
5875 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5876 Remove dummy definition, as this problem was obsolete long ago.
5877
5ebbef1d
PE
5878 Assume strerror.
5879 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5880
984e7f30
DA
58812012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5882
5883 Avoid calls to strlen in font processing functions.
5884 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5885 (font_open_by_name): Change to use length argument.
5886 Adjust users accordingly.
d923b542
DA
5887 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5888 Adjust prototypes.
5889 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5890 Change to return ptrdiff_t.
984e7f30
DA
5891 (xfont_list_pattern, xfont_match): Use length returned by
5892 xfont_decode_coding_xlfd.
5893 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5894
20e94fdd
GM
58952012-07-11 Glenn Morris <rgm@gnu.org>
5896
9d596af3
GM
5897 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5898 Move DONT_REOPEN_PTY to configure.
5899
20e94fdd
GM
5900 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5901 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5902
e99a530f
PE
59032012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5904
22ffb973
PE
5905 Remove "#define unix" that is no longer needed (Bug#11905).
5906 * s/aix4-2.h (unix): Remove; no longer needed.
5907
e9a9ae03
PE
5908 EMACS_TIME simplification (Bug#11875).
5909 This replaces macros (which typically do not work in GDB)
5910 with functions, typedefs and enums, making the code easier to debug.
5911 The functional style also makes code easier to read and maintain.
5912 * systime.h: Include <sys/time.h> on all hosts, not just if
5913 WINDOWSNT, since 'struct timeval' is needed in general.
5914 (EMACS_TIME): Now a typedef, not a macro.
5915 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5916 not macros.
5917 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5918 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5919 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5920 (EMACS_TIME_LE): Now functions, not macros.
5921 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5922 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5923 which are not functions. All uses rewritten to use:
5924 (make_emacs_time): New function.
5925 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5926 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5927 not functions. All uses rewritten to use the following, respectively:
5928 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5929 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5930 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5931 * fileio.c (Fcopy_file):
5932 * xterm.c (XTflash): Get the current time closer to when it's used.
5933 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5934
ffacb126
PE
5935 * bytecode.c (targets): Suppress -Woverride-init warnings.
5936
e99a530f
PE
5937 Simplify by avoiding confusing use of strncpy etc.
5938 * doc.c (Fsnarf_documentation):
5939 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5940 * frame.c (Fmake_terminal_frame):
5941 * gtkutil.c (get_utf8_string):
5942 * lread.c (openp):
5943 * nsmenu.m (ns_update_menubar):
5944 * regex.c (regerror):
5945 Prefer memcpy to strncpy and strncat when either will do.
5946 * fileio.c (Fsubstitute_in_file_name):
5947 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5948 (menu_separator_name_p):
5949 * nsmenu.m (ns_update_menubar):
5950 Prefer memcmp to strncmp when either will do.
5951 * nsterm.m: Include <ftoastr.h>.
5952 (ns_get_color):
5953 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5954 Prefer snprintf to strncpy.
5955 * nsterm.m (ns_term_init):
5956 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5957 * nsterm.m (ns_term_init):
5958 Avoid the need for strncpy, by using build_string or
5959 make_unibyte_string directly. Use dtoastr, not snprintf.
5960 * process.c (Fmake_network_process): Diagnose service names that
5961 are too long, rather than silently truncating them or creating
5962 non-null-terminated names.
5963 (Fnetwork_interface_info): Likewise, for interface names.
5964 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5965 Prefer sprintf to strncat.
5966 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5967 Prefer vsnprintf to vsprintf + strncpy.
5968
c59592b3
GM
59692012-07-10 Glenn Morris <rgm@gnu.org>
5970
5971 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5972 Clarify fallback case.
5973
7d7bbefd
DA
59742012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5975
5976 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5977 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5978 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5979 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5980 where argument type is known to be a Lisp_Cons.
5981
3a4c8000
TT
59822012-07-10 Tom Tromey <tromey@redhat.com>
5983
5984 * bytecode.c (BYTE_CODE_THREADED): New macro.
5985 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5986 (enum byte_code_op): New type.
5987 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5988 (exec_byte_code): Use them. Use token threading when applicable.
5989
2a0213a6
DA
59902012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5991
5992 Optimize pure C strings initialization.
5993 * lisp.h (make_pure_string): Fix prototype.
5994 (build_pure_c_string): New function, defined as static inline. This
5995 provides a better opportunity to optimize away calls to strlen when
5996 the function is called with compile-time constant argument.
5997 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5998 argument, adjust users accordingly. Use build_pure_c_string where
5999 appropriate.
6000 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6001 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6002 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6003
cb1caeaf
DA
60042012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6005
6006 Avoid calls to strlen in miscellaneous functions.
6007 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6008 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6009 * lread.c (openp): Likewise.
6010
c293e30c
DA
60112012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6012
6013 Avoid calls to strlen in path processing functions.
6014 * fileio.c (file_name_as_directory): Add comment. Change to add
6015 srclen argument and return the length of result. Adjust users
6016 accordingly.
6017 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
6018 swap 1st and 2nd arguments to obey the common convention.
6019 Adjust users accordingly.
c293e30c
DA
6020 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6021
9e059e3f
GM
60222012-07-10 Glenn Morris <rgm@gnu.org>
6023
d02eb359
GM
6024 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6025 Move PENDING_OUTPUT_COUNT definition to configure.
6026
882cf227
GM
6027 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6028 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6029 * s/gnu.h (DATA_START): Move definitions to configure.
6030
af6e839f
GM
6031 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6032 We include usg5-4-common.h, which defines them both.
6033
40289a12
GM
6034 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6035 O_RDONLY already includes it).
6036
9e059e3f
GM
6037 Stop ns builds setting the EMACSLOADPATH environment variable.
6038 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6039 Now it does not set EMACSLOADPATH, just returns the load-path string.
6040 * nsterm.h: Update accordingly.
6041 * lread.c [HAVE_NS]: Include nsterm.h.
6042 (init_lread) [HAVE_NS]: Use ns_load_path.
6043 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6044
7c4e8ec0
GM
60452012-07-09 Glenn Morris <rgm@gnu.org>
6046
d4f600ff
GM
6047 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6048 since the included bsd-common.h does so.
6049
cbb31951
GM
6050 Stop ns builds setting the EMACSPATH environment variable.
6051 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6052 (ns_init_paths): Do not set EMACSPATH.
6053 * nsterm.h (ns_exec_path): Add it.
6054 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6055 Use ns_exec_path.
6056
7c4e8ec0
GM
6057 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6058
26bccfae
PE
60592012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6060
a0bee46f
PE
6061 * process.c (wait_reading_process_output): 'waitchannels' was unset
6062 when read_kbd || !NILP (wait_for_cell); fix this.
6063
5994c183
PE
6064 Add GCC-style 'const' attribute to functions that can use it.
6065 * character.h (char_resolve_modifier_mask):
6066 * keyboard.h (make_ctrl_char):
6067 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6068 (init_character_once, next_almost_prime, init_fns, init_image)
6069 (flush_pending_output, init_sound):
6070 * mem-limits.h (start_of_data):
6071 * menu.h (finish_menu_items):
6072 Add ATTRIBUTE_CONST.
6073 * emacs.c (DEFINE_DUMMY_FUNCTION):
6074 Declare the dummy function with ATTRIBUTE_CONST.
6075 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6076 Add decls with ATTRIBUTE_CONST.
6077
26bccfae
PE
6078 Minor improvements to make_formatted_string.
6079 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6080 where int is good enough, as vsprintf returns an int.
6081 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6082
a8290ec3
DA
60832012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6084
6085 Use make_formatted_string to avoid double length calculation.
6086 * lisp.h (make_formatted_string): New prototype.
6087 * alloc.c (make_formatted_string): New function.
6088 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 6089 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
6090 * editfns.c (Fcurrent_time_zone): Likewise.
6091 * filelock.c (get_boot_time): Likewise.
6092 * frame.c (make_terminal_frame, set_term_frame_name)
6093 (x_report_frame_params): Likewise.
6094 * image.c (gs_load): Likewise.
6095 * minibuf.c (get_minibuffer): Likewise.
6096 * msdos.c (dos_set_window_size): Likewise.
6097 * process.c (make_process): Likewise.
6098 * xdisp.c (ensure_echo_area_buffers): Likewise.
6099 * xsettings.c (apply_xft_settings): Likewise.
6100
d01ba2f1
GM
61012012-07-09 Glenn Morris <rgm@gnu.org>
6102
6103 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6104 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6105 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6106 * nsterm.h (ns_etc_directory): Add it.
6107 * callproc.c [HAVE_NS]: Include nsterm.h.
6108 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6109
f1f924b6
DA
61102012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6111
6112 Move marker debugging code under MARKER_DEBUG.
6113 * marker.c (MARKER_DEBUG): Move marker debugging code under
6114 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6115 for bootstrap with --enable-checking (~3x slowdown reported
6116 by Juanma Barranquero <lekktu@gmail.com>).
6117 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6118
ab531b66
PE
61192012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6122 See <http://bugs.gnu.org/11825#29>.
6123
c4b3bc8a
EZ
61242012-07-08 Eli Zaretskii <eliz@gnu.org>
6125
6126 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6127 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
6128 (display_line): Add commentary about displaying truncation glyphs
6129 on GUI frames.
6130 (produce_special_glyphs): Move here from term.c.
6131
6132 * term.c (produce_special_glyphs): Move to xdisp.c.
6133
6134 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6135 section.
c4b3bc8a 6136
b676b881
AS
61372012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6138
f17c5273
AS
6139 * xdisp.c (display_line): Avoid warning about implicit declaration
6140 of FRAME_FONT.
6141
298819b9
AS
6142 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6143
b676b881
AS
6144 * lisp.h: Remove empty conditional.
6145
6045c4fd
PE
61462012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6147
b3350bf9
PE
6148 * lread.c (load_path_check): Now static.
6149
6045c4fd
PE
6150 Fix some minor --with-ns problems found by static checking.
6151 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6152 (x_set_font) [!HAVE_X_WINDOWS]:
6153 * image.c (xpm_load_image) [HAVE_NS]:
6154 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6155 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6156 Remove unused local.
6157 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6158 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6159 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6160 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6161 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6162 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6163 Fix pointer signedness problem.
6164 * xfaces.c (FRAME_X_FONT_TABLE):
6165 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6166
929e7845
GM
61672012-07-07 Glenn Morris <rgm@gnu.org>
6168
6169 * lread.c (load_path_check): New function, split from init_lread.
6170 (init_lread): Reorganize. Motivation:
6171 If EMACSLOADPATH is set, check/warn about that rather than the
6172 defaults, which we are not going to use. Hence we can remove
6173 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6174 Don't warn if site-lisp directories are missing.
6175 If not installed, start from a blank load-path, since
6176 PATH_LOADSEARCH refers to the eventual installation directories.
6177
58dd0aa4
EZ
61782012-07-07 Eli Zaretskii <eliz@gnu.org>
6179
6180 Support truncation and continuation glyphs on GUI frames, when
6181 fringes are disabled. (Bug#11832)
6182 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
6183 continuation glyphs even if on GUI frames.
6184 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
6185 or both, are absent.
6186 (start_display, move_it_in_display_line_to): Handle the case of a
6187 GUI frame without a fringe to display continuation or truncation
6188 glyphs.
6189 (insert_left_trunc_glyphs): Support GUI frames: make sure
6190 truncation glyphs overwrite enough glyphs from the current line to
6191 have sufficient space in pixels.
6192 (display_line): Support truncation and continuation glyphs on GUI
6193 frames. If some spare pixels are left on the line after inserting
6194 the truncation glyphs, fill that space with a stretch glyph of a
6195 suitably computed width.
6196
6197 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6198 produce_glyphs, to support GUI sessions.
6199
31571fd7
PE
62002012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6201
5a16b9bc
PE
6202 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6203
f3047c75
PE
6204 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6205
31571fd7
PE
6206 Do not require float-time's arg to fit in time_t (Bug#11825).
6207 This works better on hosts where time_t is unsigned, and where
6208 float-time is applied to the (negative) difference between two times.
6209 * editfns.c (decode_time_components): Last arg is now double *,
6210 not int *, and means to store all the result as a double, without
6211 worrying about whether the seconds part fits in time_t.
6212 All callers changed.
6213 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6214 All callers changed.
6215 (Ffloat_time): Do not fail merely because the specified time falls
6216 outside of time_t range.
6217
4516fbef
GM
62182012-07-07 Glenn Morris <rgm@gnu.org>
6219
6220 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6221 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6222 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6223
07adc2c6
JB
62242012-07-07 Juanma Barranquero <lekktu@gmail.com>
6225
6226 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6227 Update dependencies.
6228
6229 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6230
fd573f31
PE
62312012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6232
fee5959d
PE
6233 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6234 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6235 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6236 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6237 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6238 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6239
fd573f31
PE
6240 * xfont.c (compare_font_names): Redo to omit the need for casts.
6241
ddadbc0e
AS
62422012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6243
fca8d6b6
AS
6244 * xfns.c (Fx_change_window_property): Doc fix.
6245 * w32fns.c (Fx_change_window_property): Doc fix.
6246
ddadbc0e
AS
6247 * w32fns.c (Fx_window_property): Accept the same arguments as the
6248 X Windows version. Doc fix.
6249 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6250
ed9265fc 62512012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
6252 Eli Zaretskii <eliz@gnu.org>
6253
6254 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6255 Windows-specific code from nt/config.nt moved here.
6256 Obsolete settings removed.
6257
216ee680
PE
62582012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6259
6260 * process.c: Avoid unnecessary calls to gettime.
6261 (wait_reading_process_output): Don't get the time of day
6262 when gobbling data immediately and not waiting, as there's no need
6263 for it in that case. This removes a FIXME.
6264
bdd091e4
JD
62652012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6266
6267 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6268 is defined (Bug#11768).
6269
9d44f8ce
DA
62702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6271
6272 Fix marker debugging code.
6273 * marker.c (byte_char_debug_check): Do not perform the check
6274 if buffer is not multibyte.
090bd7cb
JB
6275 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6276 Call byte_char_debug_check with correct arguments.
9d44f8ce 6277
90fc4786
DA
62782012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6279
6280 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6281 * marker.c (byte_char_debug_check, count_markers):
6282 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6283 (byte_debug_flag): Remove.
6284 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6285 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6286
7b7ae965
DA
62872012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6288
4e57b342
DA
6289 Avoid code repetition in marker-related functions.
6290 * marker.c (attach_marker): New function.
6291 (Fset_marker, set_marker_restricted, set_marker_both)
6292 (set_marker_restricted_both): Use it.
6293 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6294 Consistently rename charno to charpos.
6295 (marker_position): Add eassert.
6296 (marker_byte_position): Convert to eassert.
6297
62982012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6299
6300 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6301 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6302 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6303
657924ff
DA
63042012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6305
6306 Introduce fast path for the widely used marker operation.
6307 * alloc.c (build_marker): New function.
6308 * lisp.h (build_marker): New prototype.
6309 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6310 * composite.c (autocmp_chars): Likewise.
6311 * editfns.c (buildmark): Remove.
6312 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6313 (save_restriction_save): Use build_marker.
6314 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6315 * window.c (save_window_save): Likewise.
6316
041a49a6
DA
63172012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6318
6319 Do not use Fdelete_overlay in delete_all_overlays
6320 to avoid redundant calls to unchain_overlay.
6321 * buffer.c (drop_overlay): New function.
6322 (delete_all_overlays, Fdelete_overlay): Use it.
6323 * minibuf.c (get_minibuffer): Fix comment.
6324
7dca65a4
PE
63252012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6326
6327 Port to OpenBSD 5.1 amd64.
6328 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6329 This is needed for OpenBSD, and should be harmless on all BSD systems.
6330 Also, include <sys/sysctl.h>, as it should be available on all
6331 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6332 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6333 use p_pid member, not kp_proc.pid.
6334
8eb876e2
GM
63352012-07-06 Glenn Morris <rgm@gnu.org>
6336
6337 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6338
38182d90
PE
63392012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 More xmalloc and related cleanup.
6342 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6343 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6344 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6345 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6346 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6347 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6348 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6349 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6350 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6351 * xterm.c:
6352 Omit needless casts involving void * pointers and allocation.
6353 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6354 as the former is more robust if P's type is changed.
6355 Prefer xzalloc to xmalloc + memset 0.
6356 Simplify malloc-or-realloc to realloc.
6357 Don't worry about xmalloc returning a null pointer.
6358 Prefer xstrdup to xmalloc + strcpy.
6359 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6360 growing it.
6361 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6362 alloca of a constant.
6363
6dd5a677
EZ
63642012-07-05 Eli Zaretskii <eliz@gnu.org>
6365
6366 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6367 hscroll is larger than the line width. Fixes long and futile
6368 looping inside extend_face_to_end_of_line (on a TTY) producing
6369 glyphs that are not needed and thrown away.
6370
6b312f0f
DA
63712012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6372
6373 * marker.c (set_marker_restricted_both): Simplify by using
6374 clip_to_bounds.
6375
f520ef9b
PE
63762012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6377
6378 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6379
383b7c95
JD
63802012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6381
6382 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6383 not defined (Bug#11768).
6384 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6385 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6386 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6387 followed by gtk_box_set_homogeneous (Bug#11768).
6388 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6389 (update_theme_scrollbar_width, xg_create_scroll_bar):
6390 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6391 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6392 (is_box_type): New function (Bug#11768).
6393 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6394 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6395 with default display (Bug#11768).
6396
d6e7bf45
EZ
63972012-07-05 Eli Zaretskii <eliz@gnu.org>
6398
6399 * xdisp.c (window_hscroll_limited): New function.
6400 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6401 coordinates when window's hscroll is set to insanely large
6402 values. (Bug#11857)
6403
431391ec
JB
64042012-07-05 Juanma Barranquero <lekktu@gmail.com>
6405
6406 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6407 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6408
23f86fce
DA
64092012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6410
6411 Cleanup xmalloc.
6412 * lisp.h (xzalloc): New prototype. Omit needless casts.
6413 * alloc.c (xzalloc): New function. Omit needless casts.
6414 * charset.c: Omit needless casts. Convert all calls to
6415 xmalloc with following memset to xzalloc.
6416 * dispnew.c: Likewise.
6417 * fringe.c: Likewise.
6418 * image.c: Likewise.
6419 * sound.c: Likewise.
6420 * term.c: Likewise.
6421 * w32fns.c: Likewise.
6422 * w32font.c: Likewise.
6423 * w32term.c: Likewise.
6424 * xfaces.c: Likewise.
6425 * xfns.c: Likewise.
6426 * xterm.c: Likewise.
6427 * atimer.c: Omit needless casts.
6428 * buffer.c: Likewise.
6429 * callproc.c: Likewise.
6430 * ccl.c: Likewise.
6431 * coding.c: Likewise.
6432 * composite.c: Likewise.
6433 * doc.c: Likewise.
6434 * doprnt.c: Likewise.
6435 * editfns.c: Likewise.
6436 * emacs.c: Likewise.
6437 * eval.c: Likewise.
6438 * filelock.c: Likewise.
6439 * fns.c: Likewise.
6440 * gtkutil.c: Likewise.
6441 * keyboard.c: Likewise.
6442 * lisp.h: Likewise.
6443 * lread.c: Likewise.
6444 * minibuf.c: Likewise.
6445 * msdos.c: Likewise.
6446 * print.c: Likewise.
6447 * process.c: Likewise.
6448 * region-cache.c: Likewise.
6449 * search.c: Likewise.
6450 * sysdep.c: Likewise.
6451 * termcap.c: Likewise.
6452 * terminal.c: Likewise.
6453 * tparam.c: Likewise.
6454 * w16select.c: Likewise.
6455 * w32.c: Likewise.
6456 * w32reg.c: Likewise.
6457 * w32select.c: Likewise.
6458 * w32uniscribe.c: Likewise.
6459 * widget.c: Likewise.
6460 * xdisp.c: Likewise.
6461 * xmenu.c: Likewise.
6462 * xrdb.c: Likewise.
6463 * xselect.c: Likewise.
6464
0497dc44
PE
64652012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6466
6467 * fileio.c (time_error_value): Check the right error number.
6468 Problem reported by Troels Nielsen in
6469 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6470
356e7178
PE
64712012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6472
4e71fd89
PE
6473 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6474 This should be fixed in a better way; see Eli Zaretskii in
6475 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6476 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6477
f0941253
PE
6478 * fileio.c (time_error_value): Rename from special_mtime.
6479 The old name's problems were noted by Eli Zaretskii in
6480 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6481
065c9eb4
PE
6482 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6483 This variable's comment says Emacs needs at least one GDB-visible
6484 symbol of type enum pvec_type, to work around GDB problems.
6485 The symbol's value doesn't matter.
6486
356e7178
PE
6487 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6488 that causes compilation to fail on pre-C99 compilers.
6489
ed9265fc 64902012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6491
6492 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6493 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6494
3884d954
DA
64952012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6496
d209e2fb 6497 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6498 headers for buffer_defaults and buffer_local_symbols.
6499 Reported by Juanma Barranquero <lekktu@gmail.com>.
6500
ee28be33
SM
65012012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6502
6503 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6504 * lisp.h (enum pvec_type): Use fewer bits.
6505 (PSEUDOVECTOR_SIZE_BITS): New constant.
6506 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6507 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6508 change in pvec_type.
6509 (PSEUDOVECTOR_TYPEP): New macro.
6510 (TYPED_PSEUDOVECTORP): Use it.
6511 * fns.c (internal_equal): Adapt code to extract pvectype.
6512 * emacs.c (gdb_pvec_type): Update type.
6513 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6514 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6515 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6516 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6517 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6518 abusing vector->header.next.nbytes.
6519 (live_vector_p): Use PVEC_TYPE.
6520 (mark_object): Adapt code to extract pvectype. Use switch.
6521
c7f2cd7f
PE
65222012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6523
6524 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6525 Tighten new eassert a bit.
6526
8ce70ed2
DA
65272012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6528
6529 Fix compilation with --enable-gcc-warnings and -O1
6530 optimization level.
6531 * doprnt.c (doprnt): Change type of tem to int, initialize
6532 to avoid compiler warning. Add eassert.
6533 * search.c (simple_search): Initialize match_byte to avoid
6534 compiler warning. Add eassert.
6535
dea7f1e5
PE
65362012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6537
24a212eb
PE
6538 Avoid weird behavior with large horizontal scrolls.
6539 Without this change, for example, large hscroll values would
6540 mess up Emacs's display on Fedora 15 x86, presumably due to
6541 overflows in int calculations in the display code.
6542 Also, if buffers had long lines, Emacs would freeze.
6543 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6544 (set_window_hscroll): New function, containing the old guts of
6545 Fset_window_hscroll. Return the clipped value.
6546 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6547 This avoids the need to check against PTRDIFF_MAX.
6548
dea7f1e5
PE
6549 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6550
76046526
DA
65512012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6552
6553 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6554
39adff0d
PE
65552012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6556
63807d47
PE
6557 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6558 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6559 since GCC 4.4.6 issues a bogus warning for them.
6560
39adff0d
PE
6561 Fix bugs in file timestamp newness comparisons.
6562 * fileio.c (Ffile_newer_than_file_p):
6563 * lread.c (Fload): Use full timestamp resolution of files,
6564 not just the 1-second resolution, so that files that are only
6565 slightly newer still count as newer.
6566 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6567 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6568
dbeed9a6
PE
65692012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * fileio.c: Improve handling of file time marker. (Bug#11852)
6572 (special_mtime): New function.
6573 (Finsert_file_contents, Fverify_visited_file_modtime):
6574 Use it to set special mtime values consistently.
6575
636334d6
AS
65762012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6577
6578 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6579 marker for non-existing file. (Bug#11852)
6580
e2017fe2
GM
65812012-07-03 Glenn Morris <rgm@gnu.org>
6582
6583 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6584 and did not make it into globals.h).
6585
404dbd37
TT
65862012-07-03 Tom Tromey <tromey@redhat.com>
6587
6588 * window.c (Fset_window_margins, Fset_window_fringes)
6589 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6590 * textprop.c (Fprevious_property_change): No longer static.
6591 * syntax.c (Fsyntax_table_p): No longer static.
6592 * process.c (Fget_process, Fprocess_datagram_address): No longer
6593 static.
6594 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6595 * keyboard.c (Fcommand_execute): No longer static.
6596 Remove EXFUN.
6597 * insdel.c (Fcombine_after_change_execute): No longer static.
6598 * image.c (Finit_image_library): No longer static.
6599 * fileio.c (Fmake_symbolic_link): No longer static.
6600 * eval.c (Ffetch_bytecode): No longer static.
6601 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6602 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6603 No longer static.
404dbd37
TT
6604 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6605 static.
6606 * dired.c (Ffile_attributes): No longer static.
6607 * composite.c (Fcomposition_get_gstring): No longer static.
6608 * callproc.c (Fgetenv_internal): No longer static.
6609
6610 * ccl.h: Remove EXFUNs.
6611 * buffer.h: Remove EXFUNs.
6612 * dispextern.h: Remove EXFUNs.
6613 * intervals.h: Remove EXFUNs.
6614 * fontset.h: Remove EXFUN.
6615 * font.h: Remove EXFUNs.
6616 * dosfns.c (system_process_attributes): Remove EXFUN.
6617 * keymap.h: Remove EXFUNs.
6618 * lisp.h: Remove EXFUNs.
6619 * w32term.h: Remove EXFUNs.
6620 * window.h: Remove EXFUNs.
6621 * xsettings.h: Remove EXFUN.
6622 * xterm.h: Remove EXFUN.
6623
8e4fd1e1
GM
66242012-07-03 Glenn Morris <rgm@gnu.org>
6625
6626 * lisp.h (Frandom): Make it visible to C.
6627 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6628 buffer for invisible buffers. (Bug#1229)
6629
ca95b3eb
DA
66302012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6631
6632 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6633 values which aren't power of 2.
14ae4239 6634 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 6635 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6636 accordingly.
6637
7555c33f
SM
66382012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6639
6640 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6641
6642 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6643
d12e8f5a
DA
66442012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6645
6646 * alloc.c (allocate_vector_block): Remove redundant
6647 calls to mallopt if DOUG_LEA_MALLOC is defined.
6648 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6649 avoid calls to mallopt if zero_vector is returned.
6650
296094c3
DA
66512012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6652
6653 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6654 is enabled, avoid dereferencing NULL current_sblock if
6655 running undumped.
6656
36429c89
DA
66572012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6658
6659 Cleanup basic buffer management.
6660 * buffer.h (struct buffer): Change layout to use generic vector
6661 marking code. Fix some comments. Change type of 'clip_changed'
6662 to bitfield. Remove unused #ifndef old.
6663 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6664 (GET_OVERLAYS_AT): Fix indentation.
6665 (for_each_per_buffer_object_at): New macro.
6666 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6667 (Fbuffer_local_variables): Use it.
6668 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6669 * alloc.c (allocate_buffer): Adjust to match new layout of
6670 struct buffer. Fix comment.
6671 (mark_overlay): New function.
6672 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6673 Lisp area of struct buffer.
6674 (mark_object): Use it. Adjust marking of misc objects
6675 and related comments.
6676
3b3e4cac
PE
66772012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6680 wrapper that is not needed because the wrapped code is a no-op (zero
6681 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6682 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6683
cf5c0175
DA
66842012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6685
6686 * alloc.c (mark_buffer): Simplify. Remove prototype.
6687 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6688 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6689 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6690 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6691
ca26824c
GM
66922012-06-30 Glenn Morris <rgm@gnu.org>
6693
2e4c5312
GM
6694 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6695
ca26824c
GM
6696 * epaths.in (PATH_SITELOADSEARCH): New.
6697 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6698 This is rather than relying on --enable-locallisppath elements
6699 having "site-lisp" in their names. (Bug#10208#25, 11658)
6700
0d23c240
EZ
67012012-06-30 Eli Zaretskii <eliz@gnu.org>
6702
c9240d7a
EZ
6703 * w32proc.c (sys_select): Accept and ignore one more argument.
6704
6705 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6706
0d23c240 6707 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6708 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6709
6710 * sysdep.c: Don't include dos.h and dosfns.h.
6711
6712 * process.c (sys_select):
6713 * msdos.c (sys_select): Accept one more argument and ignore it.
6714
6715 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6716 adapt data types and code to that.
6717
6718 * dosfns.c:
6719 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6720 which clashes with the gnulib function of the same name.
6721
af5a5a98
AS
67222012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6723
c5e4379c
AS
6724 * font.c (font_style_to_value, font_style_symbolic)
6725 (font_prop_validate_style): Add type checks for values in
6726 font_style_table.
6727
af5a5a98
AS
6728 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6729 argument.
6730 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6731 uses.
6732
8d38f461
EZ
67332012-06-29 Eli Zaretskii <eliz@gnu.org>
6734
2e5a6631
EZ
6735 * xdisp.c (try_window_id): Undo last change.
6736
8d38f461
EZ
6737 * w32.c (getwd): Adjust commentary about startup_dir.
6738 (init_environment): Always call sys_access, even in non-MSVC
6739 builds. Don't chdir to the directory of the Emacs executable.
6740 This undoes code from 1997 which was justified by the need to
6741 "avoid conflicts when removing and renaming directories". But its
6742 downside was that every relative file name was being interpreted
6743 relative to the directory of the Emacs executable, which can never
6744 be TRT. In particular, it broke sys_access when called with
6745 relative file names.
6746 (sys_access): Map GetLastError to errno.
6747
2af3565e
DA
67482012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6749
6750 * window.h (struct window): Change type of 'fringes_outside_margins'
6751 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6752 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6753 Adjust comment.
6754 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6755 to ptrdiff_t.
6756
c8d3a25c 67572012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6758
c8d3a25c
GM
6759 * gnutls.c (emacs_gnutls_handshake):
6760 Add QUIT to make the loop interruptible.
57570cd3 6761
c8d3a25c 67622012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6763
c8d3a25c
GM
6764 * charset.c (init_charset): Make lack of etc/charsets fatal.
6765
3e984ee8
DA
67662012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 * editfns.c (region_limit): Fix type mismatch.
6769
ef884f23
DA
67702012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6771
6772 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6773 undefined. Convert from xassert to eassert.
6774 * nsmenu.m: Convert from xassert to eassert.
6775 * nsterm.m: Likewise.
6776
7d7e0027
SM
67772012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6778
6779 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6780
aa754e6a
PE
67812012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 Avoid integer overflow on scroll-left and scroll-right.
6784 * window.c (HSCROLL_MAX): New macro.
6785 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6786 overflow when requested scroll falls outside ptrdiff_t range.
6787
80b00b08
DA
67882012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6789
6790 * window.h (struct window): Change type of 'hscroll',
6791 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6792 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6793 Adjust users accordingly.
6794 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6795 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6796 from EMACS_INT to ptrdiff_t.
6797 (make_window): Omit redundant initialization.
6798
62b2bcf6
JB
67992012-06-28 Juanma Barranquero <lekktu@gmail.com>
6800
6801 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6802
45942c7d
DA
68032012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6804
6805 * window.h (struct window): Change type of 'use_time' and
6806 'sequence_number' from Lisp_Object to int.
6807 * frame.c (make_frame): Adjust users accordingly.
6808 * print.c (print_object): Likewise.
6809 * window.c (select_window, Fwindow_use_time, make_parent_window)
6810 (make_window): Likewise.
6811
e509cfa6
DA
68122012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6813
6814 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6815 enabled with --enable-checking=[all,glyphs] configure option.
6816 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6817 adjust comments accordingly.
6818 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6819 undefined, adjust comments accordingly.
6820 * image.c: Likewise.
6821 * scroll.c: Likewise.
6822 * w32fns.c: Likewise.
6823 * w32term.c: Likewise.
6824 * xdisp.c: Likewise.
6825 * xfaces.c: Likewise.
6826 * xfns.c: Likewise.
6827 * xterm.c: Likewise.
6828
a54e2c05
DA
68292012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6830
6831 Generalize run-time debugging checks.
6832 * dispextern.h (XASSERTS): Remove.
6833 * fontset.c (xassert): Remove.
6834 Convert from xassert to eassert.
6835 * alloc.c: Convert from xassert to eassert.
6836 * bidi.c: Likewise.
6837 * dispnew.c: Likewise.
6838 * fns.c: Likewise.
6839 * fringe.c: Likewise.
6840 * ftfont.c: Likewise.
6841 * gtkutil.c: Likewise.
6842 * image.c: Likewise.
6843 * keyboard.c: Likewise.
6844 * menu.c: Likewise.
6845 * process.c: Likewise.
6846 * scroll.c: Likewise.
6847 * sound.c: Likewise.
6848 * term.c: Likewise.
6849 * w32console.c: Likewise.
6850 * w32fns.c: Likewise.
6851 * w32term.c: Likewise.
6852 * window.c: Likewise.
6853 * xdisp.c: Likewise.
6854 * xfaces.c: Likewise.
6855 * xfns.c: Likewise.
6856 * xselect.c: Likewise.
6857 * xterm.c: Likewise.
6858
1ec4b7b2
SM
68592012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6860
6861 * fns.c (maybe_resize_hash_table): Output message when growing the
6862 purify-hashtable.
6863
2014308a
DA
68642012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6865
6866 * alloc.c (allocate_string_data): Remove dead code.
6867 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6868 avoid GCC warning about unused macro.
6869
246155eb
DA
68702012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6871
6872 * alloc.c (allocate_string): Omit intervals initialization.
6873 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6874 as in make_pure_string and make_pure_c_string.
6875
43184b7b
DA
68762012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6877
d209e2fb 6878 * alloc.c (allocate_string): Fix last change.
43184b7b 6879
3fe6dd74
DA
68802012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6881
d209e2fb 6882 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6883 to memset, add explicit initialization where appropriate.
6884
1ba6038a
GM
68852012-06-27 Glenn Morris <rgm@gnu.org>
6886
6887 * lisp.mk (lisp): Remove paths.elc.
6888
c89926a5
CY
68892012-06-27 Chong Yidong <cyd@gnu.org>
6890
6891 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6892
ed6b3510
JW
68932012-06-26 John Wiegley <johnw@newartisans.com>
6894
1ec4b7b2 6895 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6896 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6897
ed6b3510
JW
6898 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6899 when building with Clang.
6900
8edd4a2b
SM
69012012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6902
6903 * eval.c (Fapply): Allow calling it with a single argument.
6904
f6f62d1b
EZ
69052012-06-26 Eli Zaretskii <eliz@gnu.org>
6906
6907 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6908 _stricmp and _strnicmp.
6909 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6910
62efea5e
DA
69112012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6912
6913 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6914 allocated window.
6915 (allocate_process): Likewise for new process.
8edd4a2b 6916 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6917 (allocate_frame): Likewise.
6918 * frame.c (make_frame): Omit redundant initialization.
6919 * window.c (make_parent_window): Use memset.
6920 (make_window): Omit redundant initialization.
6921 * process.c (make_process): Omit redundant initialization.
6922 * terminal.c (create_terminal): Likewise.
6923
42997f4d
DA
69242012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6925
6926 * term.c (delete_tty): Remove redundant call to memset.
6927
1130ecfc
DA
69282012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6929
6930 * alloc.c: Remove build_string.
6931 * lisp.h: Define build_string as static inline. This provides
6932 a better opportunity to optimize away calls to strlen when the
6933 function is called with compile-time constant argument.
6934 * image.c (imagemagick_error): Convert to build_string.
6935 * w32proc.c (sys_spawnve): Likewise.
6936 * xterm.c (x_term_init): Likewise.
6937
cf38a720
PE
69382012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6939
99027bdd
PE
6940 Use sprintf return value instead of invoking strlen on result.
6941 In the old days this wasn't portable, since some sprintf
6942 implementations returned char *. But they died out years ago and
6943 Emacs already assumes sprintf returns int.
6944 Similarly for float_to_string.
6945 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6946 * ccl.c (ccl_driver):
6947 * character.c (string_escape_byte8):
6948 * data.c (Fnumber_to_string):
6949 * doprnt.c (doprnt):
6950 * print.c (print_object):
6951 * xdisp.c (message_dolog):
6952 * xfns.c (syms_of_xfns):
6953 Use sprintf or float_to_string result to avoid need to call strlen.
6954 * data.c (Fnumber_to_string):
6955 Use make_unibyte_string, since the string must be ASCII.
6956 * lisp.h, print.c (float_to_string): Now returns int length.
6957 * term.c (produce_glyphless_glyph):
6958 Use sprintf result rather than recomputing it.
6959
cf38a720
PE
6960 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6961 * Makefile.in (ALL_CFLAGS):
6962 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6963 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6964
3511c784
DA
69652012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6966
0a08eb21 6967 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6968 strcasecmp if available.
6969 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6970
fb7da12e
AS
69712012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6972
6973 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6974 Avoid comma operator.
6975 * menu.c (push_submenu_start, push_submenu_end)
6976 (push_left_right_boundary, push_menu_pane): Likewise.
6977 * msdos.c (dos_rawgetc): Likewise.
6978
afa2ffd8
DA
69792012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6980
6981 * xfns.c (xic_create_fontsetname): Remove redundant calls
6982 to memset.
6983
b3b4476b
PE
69842012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6985
4495ff38
PE
6986 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6987 sprintf already null-terminates its output.
6988
b3b4476b
PE
6989 * xfns.c (x_window): Remove redundant cast.
6990
b00876c9
DA
69912012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6992
6993 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6994 `const char *' to `char *' to avoid compiler warning.
6995
d188e26b
PE
69962012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6997
885d1d74
PE
6998 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6999 instead of truncating it to 63 (admittedly a generous limit).
7000
d188e26b
PE
7001 * process.c: Fix spelling and caps in comments.
7002
e2f560b1
DN
70032012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7004
e86db54b 7005 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
7006 * sysdep.c (setpgrp): Remove definition, not used in this file.
7007
7583a3a1
JB
70082012-06-24 Juanma Barranquero <lekktu@gmail.com>
7009
7010 * makefile.w32-in: Update dependencies.
7011
696056c2
EZ
70122012-06-24 Eli Zaretskii <eliz@gnu.org>
7013
7014 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7015 (SYSTIME_H): Add nt/inc/sys/time.h.
7016
7017 * systime.h [WINDOWSNT]: Include sys/time.h.
7018
7019 * s/ms-w32.h (struct timespec): Definition moved from
7020 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7021
845ca893
PE
70222012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7023
7024 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7025 * buffer.h (buffer_slot_type_mismatch):
7026 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7027 * eval.c (unwind_to_catch):
7028 * image.c (my_png_error, my_error_exit):
7029 * keyboard.c (quit_throw_to_read_char, user_error)
7030 (Fexit_recursive_edit, Fabort_recursive_edit):
7031 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7032 (wrong_type_argument, buffer_overflow, __executable_start)
7033 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7034 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7035 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7036 (fatal):
7037 (child_setup) [!DOS_NT]:
7038 * lread.c (end_of_file_error, invalid_syntax):
7039 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7040 * puresize.h (pure_write_error):
7041 * search.c (matcher_overflow):
7042 * sound.c (sound_perror, alsa_sound_perror):
7043 * sysdep.c, syssignal.h (croak):
7044 * term.c (maybe_fatal, vfatal):
7045 * textprop.c (text_read_only):
7046 * undo.c (user_error):
7047 * unexmacosx.c (unexec_error):
7048 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7049 Use _Noreturn rather than NO_RETURN.
7050 No need for separate decl merely because of _Noreturn.
7051 * sound.c (sound_warning, parse_sound):
7052 Remove unnecessary forward decls.
7053
f1dd8073
PE
70542012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7055
7056 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7057 * lisp.h (WAIT_READING_MAX): New macro.
7058 * dispnew.c (Fsleep_for, sit_for):
7059 * keyboard.c (kbd_buffer_get_event):
7060 * process.c (Faccept_process_output):
7061 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7062 This improves on the previous patch, which introduced a bug
7063 when time_t is unsigned and as wide as intmax_t.
7064 See <http://bugs.gnu.org/9000#51>.
7065
b82c1755
EZ
70662012-06-23 Eli Zaretskii <eliz@gnu.org>
7067
7068 * dispnew.c (sit_for, Fsleep_for):
7069 * keyboard.c (kbd_buffer_get_event):
7070 * process.c (Faccept_process_output): Avoid compiler warnings when
7071 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7072
ca300656
JB
70732012-06-23 Juanma Barranquero <lekktu@gmail.com>
7074
049ec95b
JB
7075 * makefile.w32-in: Update dependencies.
7076
ca300656
JB
7077 * w32.c (ltime): Add return type and declare static.
7078 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7079
db7b8d06
PE
70802012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7081
7082 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7083 Privately reported by Herbert J. Skuhra.
7084 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7085 All uses changed.
7086 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7087 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7088
0bd8297f
EZ
70892012-06-23 Eli Zaretskii <eliz@gnu.org>
7090
96512555
EZ
7091 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7092 last argument of make_unibyte_string.
7093
0bd8297f
EZ
7094 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7095 language ID in the event parameters.
7096
7097 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7098 event.code, not the obscure "character set ID".
7099
63def6b6
CY
71002012-06-23 Chong Yidong <cyd@gnu.org>
7101
7102 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7103
e8a02204
EZ
71042012-06-23 Eli Zaretskii <eliz@gnu.org>
7105
388cdec0
EZ
7106 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7107 * w32.c (fdutimens): New function.
7108
7109 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7110
7111 * s/ms-w32.h (pselect): Redirect to sys_select.
7112
7113 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7114
e8a02204
EZ
7115 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7116 in the logic of incrementing and decrementing the value of
7117 use_relocatable_buffers.
7118
d054f3fb
PE
71192012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7120
7121 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7122 Privately reported by Herbert J. Skuhra.
7123 [__FreeBSD__]: Remove "*/" typo after "#include".
7124 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7125 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7126 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7127 Don't assume EMACS_TIME and struct timeval are the same type.
7128
d35af63c
PE
71292012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7130
7131 Support higher-resolution time stamps (Bug#9000).
7132 The time stamps are only nanosecond-resolution at the C level,
7133 since that's the best that any real-world system supports now.
7134 But they are picosecond-resolution at the Lisp level, as that's
7135 easy, and leaves room for future OS improvements.
7136
7137 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7138 (LIBES): Use it.
7139
7140 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7141 Don't get current time unless it's needed.
7142
7143 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7144 now provides it if it's absent.
7145 (start_atimer): Port to higher-res time stamps.
7146 Check for time stamp overflow. Don't get current time more
7147 often than is needed.
7148
7149 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7150 Include systime.h, not time.h.
7151 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7152
7153 * dired.c: Include stat-time.h.
7154 (Ffile-attributes): File times now have higher resolution.
7155
7156 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7157 (struct image): Timestamp now has higher resolution.
7158
7159 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7160 has at least microseconds now. All uses removed.
7161 (update_frame, update_single_window, update_window, update_frame_1)
7162 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 7163 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
7164
7165 * editfns.c (time_overflow): Now extern.
7166 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7167 (float-time, Fformat_time_string, Fcurrent_time_string)
7168 (Fcurrent_time_zone): Accept and generate higher-resolution
7169 time stamps.
7170 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7171 (decode_time_components, lisp_seconds_argument): New functions.
7172 (make_time): Now static.
7173 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7174 Report an error if the time is invalid, rather than having the caller
7175 do that.
7176
7177 * fileio.c: Include <stat-time.h>
7178 (Fcopy_file): Copy higher-resolution time stamps.
7179 Prefer to set the time stamp via a file descriptor if that works.
7180 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7181 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7182 (Fvisited_file_modtime, Fset_visited_file_modtime):
7183 Support higher-resolution time stamps.
7184
7185 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7186
7187 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7188
7189 * image.c (prepare_image_for_display, clear_image_cache)
7190 (lookup_image): Port to higer-resolution time stamps.
7191
7192 * keyboard.c (start_polling, bind_polling_period):
7193 Check for time stamp overflow.
7194 (read_char, kbd_buffer_get_event, timer_start_idle)
7195 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7196 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7197 Port to higher-resolution time stamps. Do not assume time_t is signed.
7198 (decode_timer): New function. Timers are now vectors of length 9,
7199 not 8, to accommodate the picosecond component.
7200 (timer_check_2): Use it.
7201
7202 * nsterm.m (select_timeout, timeval_subtract): Remove.
7203 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7204 as they're a bit more accurate and handle overflow better.
7205 (ns_select): Change prototype to be compatible with pselect.
7206 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7207 * nsterm.h (ns_select): Adjust prototype.
7208
7209 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7210 us-resolution time stamps.
7211 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7212
7213 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7214
7215 * lisp.h (time_overflow): New decl.
7216 (wait_reading_process_output): First arg is now intmax_t, not int,
7217 to accommodate larger waits.
7218
7219 * process.h (struct Lisp_Process.read_output_delay):
7220 Now counts nanoseconds, not microseconds.
7221 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7222 EMACS_HAS_USECS.
7223 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7224 (wait_reading_process_output):
7225 Port to ns-resolution time stamps.
7226 (Faccept_process_output, wait_reading_process_output):
7227 Check for time stamp overflow. Do not assume time_t is signed.
7228 (select_wrapper): Remove; we now use pselect.
7229 (Fprocess_attributes): Now generates ns-resolution time stamps.
7230
7231 * sysdep.c: Include utimens.h. Don't include utime.h
7232 or worry about struct utimbuf; gnulib does that for us now.
7233 (gettimeofday): Remove; gnulib provides a substitute.
7234 (make_timeval): New function.
7235 (set_file_times): Now sets ns-resolution time stamps.
7236 New arg FD; all uses changed.
7237 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7238 (system_process_attributes):
7239 Now returns ns-resolution time stamp. All uses changed.
7240 Check for time stamp overflow.
7241
7242 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7243 provides a substitute now.
7244
7245 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7246 since it guarantees struct timespec.
7247 (EMACS_TIME): Now struct timespec, so that we can support
7248 ns-resolution time stamps.
7249 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7250 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7251 (EMACS_USECS): Remove.
7252 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7253 so multiply the arg by 1000 before storing it.
7254 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7255 New macros.
7256 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7257 Port to ns-resolution time stamps.
7258 (EMACS_TIME_NEG_P): Remove; replaced by....
7259 (EMACS_TIME_SIGN): New macro.
7260 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7261 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7262 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7263 (make_timeval, make_lisp_time, decode_time_components): New decls.
7264 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7265 that it mishandled time_t overflow. You can't compare by subtracting!
7266 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7267 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7268
7269 * term.c: Include <sys/time.h>.
7270 (timeval_to_Time): New function, for proper overflow wraparound.
7271 (term_mouse_position, term_mouse_click): Use it.
7272
7273 * undo.c (record_first_change): Support higher-resolution time stamps
7274 in the undo buffer.
7275 (Fprimitive_undo): Use them when restoring time stamps.
7276
7277 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7278 (w32_get_internal_run_time):
7279 Port to higher-resolution Emacs time stamps.
7280 (ltime): Now accepts single 64-bit integer, as that's more convenient
7281 for callers.
7282
7283 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7284
7285 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7286 for compatibility with pselect. Support ns-resolution time stamps.
7287
7288 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7289
7290 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7291 Check for time stamp overflow, and support ns-resolution time stamps.
7292
7293 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7294 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7295 (timeval_subtract): Remove; no longer needed.
7296 (XTflash, XTring_bell, x_wait_for_event):
7297 Port to ns-resolution time stamps. Don't assume time_t is signed.
7298
b6a92dfe
CY
72992012-06-22 Chong Yidong <cyd@gnu.org>
7300
7301 * xdisp.c (x_consider_frame_title): Revert last change.
7302
d251c37c
EZ
73032012-06-22 Eli Zaretskii <eliz@gnu.org>
7304
7305 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7306 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7307 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7308 staticidx goes up to 1597 out of 1600 = 0x640.)
7309
f10deafb
PE
73102012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7311
7312 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7313 Otherwise, the umask might be mistakenly 0 while handling input signals.
7314
ec6de1e2
SM
73152012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7316
7317 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7318
28be1ada
DA
73192012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7320
7321 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7322 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7323 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7324 access to `contents' member of Lisp_Vector objects with AREF and ASET
7325 where appropriate.
7326
c6bf3022
CY
73272012-06-19 Chong Yidong <cyd@gnu.org>
7328
7329 * frame.c (delete_frame): When selecting a frame on a different
7330 text terminal, do not alter the terminal's top-frame.
7331
7332 * xdisp.c (format_mode_line_unwind_data): Record the target
7333 frame's selected window and its terminal's top-frame.
7334 (unwind_format_mode_line): Restore them.
7335 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7336 Callers changed.
7337 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7338 since tty frames can be explicitly named.
7339 (prepare_menu_bars): Likewise.
7340
7341 * term.c (Ftty_top_frame): New function.
7342
defd4196
PE
73432012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 Port byte-code-meter to modern targets.
7346 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7347 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7348 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7349 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7350 (METER_1, METER_2): Simplify.
7351
1053a871
SM
73522012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7353
7354 * data.c (Fdefalias): Return `symbol' (bug#11686).
7355
b7e8d081
MR
73562012-06-18 Martin Rudalics <rudalics@gmx.at>
7357
7358 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7359 gets killed during executing of this function (Bug#11665).
7360 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7361 (Vkill_buffer_query_functions): In doc-string say that functions
7362 run by this hook should not change the current buffer.
7363
7ea2b339
PE
73642012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7365
7366 Fix recently-introduced process.c problems found by static checking.
7367 * process.c (write_queue_push, write_queue_pop, send_process):
7368 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7369 (write_queue_pop): Fix pointer signedness problem.
7370 (send_process): Remove unused local.
7371
96a313a1
CY
73722012-06-17 Chong Yidong <cyd@gnu.org>
7373
7374 * xdisp.c (redisplay_internal): No need to redisplay terminal
7375 frames that are not on top.
7376
20ca2e94
TN
73772012-06-17 Troels Nielsen <bn.troels@gmail.com>
7378
7379 * process.c (make_process): Initialize write_queue.
7380 (write_queue_push, write_queue_pop): New functions.
7381 (send_process): Use them to maintain correct ordering of process
7382 writes (Bug#10815).
7383
9a900ca9
PE
73842012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7385
310fbfa8
PE
7386 * lisp.h (eassert): Assume C89 or later.
7387 This removes the need for CHECK.
7388 (CHECK): Remove. Its comments about always evaluating its
7389 argument were confusing, as 'eassert' typically does not evaluate
7390 its argument.
7391
27bb1ca4
PE
7392 * coding.c (produce_chars): Use ptrdiff_t, not int.
7393
9a900ca9
PE
7394 * xterm.c (x_draw_underwave): Check for integer overflow.
7395 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7396
41b7f8bc 73972012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7398
7399 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7400 referenced (Bug#11583).
7401
9b0e3eba
AA
74022012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7403
7404 Implement wave-style variant of underlining.
7405 * dispextern.h (face_underline_type): New enum.
7406 (face): Add field for underline type.
7407 * nsterm.m (ns_draw_underwave): New function.
7408 (ns_draw_text_decoration): Use it.
7409 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7410 New functions.
7411 (x_draw_glyph_string): Use them.
7412 * xfaces.c (Qline, Qwave): New Lisp objects.
7413 (check_lface_attrs, merge_face_ref)
1053a871
SM
7414 (Finternal_set_lisp_face_attribute, realize_x_face):
7415 Handle wave-style underline face attributes.
9b0e3eba
AA
7416 * xterm.c (x_draw_underwave): New function.
7417 (x_draw_glyph_string): Use it.
7418
0fb52f11
JB
74192012-06-16 Juanma Barranquero <lekktu@gmail.com>
7420
7421 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7422 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7423 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7424 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7425 ($(BLD)/w32select.$(O)): Update dependencies.
7426
e5560ff7
AS
74272012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7428
7429 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7430 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7431 * character.c (_fetch_multibyte_char_p): Remove.
7432 * alloc.c: Include "character.h" before "buffer.h".
7433 * bidi.c: Likewise.
7434 * buffer.c: Likewise.
7435 * bytecode.c: Likewise.
7436 * callint.c: Likewise.
7437 * callproc.c: Likewise.
7438 * casefiddle.c: Likewise.
7439 * casetab.c: Likewise.
7440 * category.c: Likewise.
7441 * cmds.c: Likewise.
7442 * coding.c: Likewise.
7443 * composite.c: Likewise.
7444 * dired.c: Likewise.
7445 * dispnew.c: Likewise.
7446 * doc.c: Likewise.
7447 * dosfns.c: Likewise.
7448 * editfns.c: Likewise.
7449 * emacs.c: Likewise.
7450 * fileio.c: Likewise.
7451 * filelock.c: Likewise.
7452 * font.c: Likewise.
7453 * fontset.c: Likewise.
7454 * fringe.c: Likewise.
7455 * indent.c: Likewise.
7456 * insdel.c: Likewise.
7457 * intervals.c: Likewise.
7458 * keyboard.c: Likewise.
7459 * keymap.c: Likewise.
7460 * lread.c: Likewise.
7461 * macros.c: Likewise.
7462 * marker.c: Likewise.
7463 * minibuf.c: Likewise.
7464 * nsfns.m: Likewise.
7465 * nsmenu.m: Likewise.
7466 * print.c: Likewise.
7467 * process.c: Likewise.
7468 * regex.c: Likewise.
7469 * region-cache.c: Likewise.
7470 * search.c: Likewise.
7471 * syntax.c: Likewise.
7472 * term.c: Likewise.
7473 * textprop.c: Likewise.
7474 * undo.c: Likewise.
7475 * unexsol.c: Likewise.
7476 * w16select.c: Likewise.
7477 * w32fns.c: Likewise.
7478 * w32menu.c: Likewise.
7479 * window.c: Likewise.
7480 * xdisp.c: Likewise.
7481 * xfns.c: Likewise.
7482 * xmenu.c: Likewise.
7483 * xml.c: Likewise.
7484 * xselect.c: Likewise.
7485
2f07e6af
EZ
74862012-06-16 Eli Zaretskii <eliz@gnu.org>
7487
1053a871
SM
7488 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7489 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7490 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7491 row.
7492 (handle_face_prop): Use chunk-relative overlay string index when
7493 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7494 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7495 the rightmost. (Bug#11720)
2f07e6af 7496
29b83cec
AS
74972012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7498
7499 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7500 (CATEGORY_MEMBER): Enforce 1/0 value.
7501 * category.c (_temp_category_set): Remove.
7502
4c5501e9
EZ
75032012-06-16 Eli Zaretskii <eliz@gnu.org>
7504
7505 * window.c (Fdelete_other_windows_internal)
7506 (Fdelete_window_internal): Don't access frame's mouse highlight
7507 info of the initial frame. (Bug#11677)
7508
2b570124
PE
75092012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7510
e93864f9
PE
7511 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7512 Assume USE_2_TAGS_FOR_INTS.
7513 (xreload): Adjust $tagmask width to match recent lisp.h change.
7514
2b570124
PE
7515 Simplify lisp.h in minor ways that should not affect code.
7516 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7517 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7518 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7519 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7520 (INTTYPEBITS): New macro, for clarity.
7521 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7522 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7523 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7524 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7525 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7526
81755f69
JB
75272012-06-13 Juanma Barranquero <lekktu@gmail.com>
7528
7529 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7530
16192a57
GM
75312012-06-13 Glenn Morris <rgm@gnu.org>
7532
7533 * s/bsd-common.h (BSD4_3):
7534 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7535
646b5f55
AS
75362012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7537
7538 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7539 instead of union.
7540 (XLI, XIL): Define.
1053a871
SM
7541 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7542 Use them.
7543 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7544 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7545 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7546 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7547 * frame.c (delete_frame): Remove outdated comment.
7548 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7549 USE_LISP_UNION_TYPE.
7550 (Fw32_unregister_hot_key): Likewise.
7551 (Fw32_toggle_lock_key): Likewise.
7552 * w32menu.c (add_menu_item): Likewise.
7553 (w32_menu_display_help): Use XIL instead of checking
7554 USE_LISP_UNION_TYPE.
7555 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7556 (init_heap): Likewise.
7557 * w32term.c (w32_read_socket): Update comment.
7558
1d3823c9
GM
75592012-06-13 Glenn Morris <rgm@gnu.org>
7560
c62ff706
GM
7561 * s/usg5-4-common.h, src/s/unixware.h:
7562 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7563
1d3823c9
GM
7564 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7565
bfe3e0a2
PE
75662012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7569 * alloc.c (make_number) [!defined make_number]:
7570 Remove, as lisp.h always defines this now.
7571 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7572 (roundup_size): Verify that it is a power of 2.
7573 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7574 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7575 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7576 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7577 USE_LSB_TAG now is always defined to be either 0 or 1.
7578 All uses changed.
7579 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7580 code works fine either way, and efficiency is not a concern here,
7581 as the union type is for debugging, not for production.
7582 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7583 Use an inline function on all platforms when using the union type,
7584 since this is simpler and 'static inline' can be used portably
7585 within Emacs now.
7586 (LISP_INITIALLY_ZERO): New macro.
7587 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7588 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7589
45fa9c0f
GM
75902012-06-12 Glenn Morris <rgm@gnu.org>
7591
b4492cba
GM
7592 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7593
7594 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7595
45fa9c0f
GM
7596 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7597 Move BROKEN_SIGIO to configure.
7598
7599 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7600 Move NO_TERMIO to configure.
7601
0e25d334
CY
76022012-06-12 Chong Yidong <cyd@gnu.org>
7603
7604 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7605 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7606 MagickExportImagePixels is undefined.
7607
43682bb6
PE
76082012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * image.c (imagemagick_load_image): Remove unused label.
7611
a9be7d2b
GM
76122012-06-11 Glenn Morris <rgm@gnu.org>
7613
7614 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7615 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7616 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7617 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7618
3017f87f
SM
76192012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7620
7621 * alloc.c (make_byte_code): New function.
7622 (Fmake_byte_code): Use it. Don't purify here.
7623 * lread.c (read1): Use it as well to avoid extra allocation.
7624
1b9b4cf4
CY
76252012-06-11 Chong Yidong <cyd@gnu.org>
7626
7627 * image.c (imagemagick_load_image): Implement transparency.
7628
95988fcf
AS
76292012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7630
7631 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7632 account for preceding backslashes. (Bug#11663)
7633
cd4eb164
CY
76342012-06-09 Chong Yidong <cyd@gnu.org>
7635
7636 * term.c: Support italics in capable terminals (Bug#9652).
7637 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7638 (turn_on_face): Output using TS_enter_italic_mode if available.
7639 Don't handle unused blinking and alt-charset cases.
7640 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7641 and tty_alt_charset_p cases.
7642 (tty_capable_p, init_tty): Support italics.
7643
7644 * termchar.h (struct tty_display_info): Add field for italics.
7645 Remove unused blink field.
7646
7647 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7648 Handle slant.
7649
7650 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7651 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7652 tty_alt_charset_p. Add tty_italic_p.
7653
ff88beb8
MA
76542012-06-09 Michael Albinus <michael.albinus@gmx.de>
7655
7656 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7657 dbus_type_is_basic if available.
7658 (xd_extract_signed, xd_extract_unsigned): Rename from
7659 extract_signed and extract_unsigned, respectively. Adapt callers.
7660
44286096
CY
76612012-06-09 Chong Yidong <cyd@gnu.org>
7662
1682701f
CY
7663 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7664
44286096
CY
7665 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7666 case (Bug#9752).
7667
d86feb17
PE
76682012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7669
7670 * xdisp.c (vmessage): Treat frame message as multibyte.
7671 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7672 would generate the diagnostic "Making \302\247 buffer-local while
7673 let-bound!".
7674
d5c20fe8
EZ
76752012-06-08 Eli Zaretskii <eliz@gnu.org>
7676
7677 * dispnew.c (showing_window_margins_p): Undo last change, which
7678 was done due to an inadvertent commit.
7679 (adjust_frame_glyphs_for_frame_redisplay): Do call
7680 showing_window_margins_p.
7681
513749ee
SM
76822012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7683
7684 * eval.c (Fmake_var_non_special): New primitive.
7685 (syms_of_eval): Defsubr it.
7686 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7687
d4a8f5c1
JB
76882012-06-08 Juanma Barranquero <lekktu@gmail.com>
7689
7690 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7691 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7692
8bbbc977
EZ
76932012-06-08 Eli Zaretskii <eliz@gnu.org>
7694
7695 * alloc.c (allocate_vectorlike): Fix last change.
7696
f3372c87
DA
76972012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7698
7699 Block-based vector allocation of small vectors.
7700 * lisp.h (struct vectorlike_header): New field `nbytes',
7701 adjust comment accordingly.
7702 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7703 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7704 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7705 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7706 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7707 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7708 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7709 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7710 (roundup_size): New constant.
7711 (struct vector_block): New data type.
7712 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7713 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7714 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7715 (sweep_vectors): New functions.
7716 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7717 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7718 or equal to VBLOCK_BYTES_MAX.
7719 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7720 (init_alloc_once): Add call to init_vectors.
7721
4f18a4ed
SM
77222012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7723
7724 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7725
86f158bc
PE
77262012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7727
7728 * doprnt.c (doprnt): Truncate multibyte char correctly.
7729 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7730 would mishandle a string argument "Xc" if X was a multibyte
7731 character of length 2: it would truncate after X's first byte
7732 rather than including all of X.
7733
c5cfcbe0
CY
77342012-06-06 Chong Yidong <cyd@gnu.org>
7735
7736 * buffer.c (word_wrap): Doc fix.
7737
c05cf390
PE
77382012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7739
7740 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7741
0c3461de
GM
77422012-06-03 Glenn Morris <rgm@gnu.org>
7743
7744 * xdisp.c (tool-bar-style): Doc fix.
7745
c71232db
UM
77462012-06-03 Ulrich Müller <ulm@gentoo.org>
7747
7748 * Makefile.in (PAXCTL): Define.
7749 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7750 binary via PaX flags if the paxctl utility is available.
7751 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7752 Restore PaX flags to their default. (Bug#11398)
7753
383f7350
CY
77542012-06-03 Chong Yidong <cyd@gnu.org>
7755
7756 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7757 buffer (Bug#11226).
7758
5f2c76c6
CY
77592012-06-03 Chong Yidong <cyd@gnu.org>
7760
7761 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7762 (note_mode_line_or_margin_highlight): If there is no help echo,
7763 use mode-line-default-help-echo. Handle the case where the mouse
7764 position is past the end of the mode line string.
7765
7766 * buffer.c (buffer_local_value_1): New function, split from
7767 Fbuffer_local_value; can return Qunbound.
7768 (Fbuffer_local_value): Use it.
7769 (Vmode_line_format): Docstring tweaks.
7770
773d47f6
PE
77712012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7772
7773 * sysdep.c (system_process_attributes): Improve comment.
7774
f2d6a3df
SM
77752012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7776
7777 * keyboard.c: Export real-this-command to Elisp.
7778 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7779 and DEFVAR it. Update all users.
7780
63810350
PE
77812012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7782
7bd5c1f4
PE
7783 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7784
63810350
PE
7785 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7786 Convert pctcpu and pctmem to Lisp float properly.
7787 Let the compiler fold better, as 100.0/0x8000 is exact.
7788
a2821611
AS
77892012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7790
7791 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7792 cons_block.
7793
5fceba1d
PE
77942012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7795
7796 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7797
c98ff5dd
DA
77982012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7799
7800 For a 'struct window', replace some Lisp_Object fields to
7801 bitfields where appropriate, remove unused fields.
7802 * window.h (struct window): Remove unused 'last_mark_x' and
7803 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 7804 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
7805 Change type of 'force_start', 'optional_new_start',
7806 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7807 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7808
ca34e0be
PE
78092012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7810
7811 Pacify gcc -Wdouble-precision when using Xaw.
7812 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7813 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7814 Use 'float' consistently, rather than 'float' in most places
7815 and 'double' in a couple of places.
7816
efc00ab1 78172012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7818
7819 * xdisp.c (handle_stop): Detect whether we have overlay strings
7820 loaded by testing it->current.overlay_string_index to be
7821 non-negative, instead of checking whether n_overlay_strings is
7822 positive. (Bug#11587)
7823
efc00ab1 78242012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7825
7826 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7827
7828 * doc.c (Fsubstitute_command_keys): Doc fix.
7829
efc00ab1 78302012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7831
7832 * search.c (search_buffer): Remove calls to
7833 r_alloc_inhibit_buffer_relocation, as it is now called by
7834 maybe_unify_char, which was the cause of relocation of buffer text
7835 in bug#11519.
7836
efc00ab1 78372012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7838
7839 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7840 for the duration of call to load_charset, to avoid problems with
7841 callers of maybe_unify_char that access buffer text through C
7842 pointers.
7843
7844 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7845 decrement the inhibition flag, instead of just setting or
7846 resetting it.
7847
ba93a187
PE
78482012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7849
7850 Remove obsolete '#define static' cruft.
7851 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7852 This #undef was "temporary" in 2000; it is no longer needed
7853 now that '#define static' has gone away.
7854 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7855 (gray_bitmap_bits): Remove; no longer needed.
7856 All uses replaced with definiens.
7857 * xterm.c: Include "bitmaps/gray.xbm".
7858
9e4bf381
PE
78592012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 Clean up __executable_start, monstartup when --enable-profiling.
7862 The following changes affect the code only when profiling.
7863 * dispnew.c (__executable_start): Rename from safe_bcopy.
7864 Define only on platforms that need it.
7865 * emacs.c: Include <sys/gmon.h> when profiling.
7866 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7867 (__executable_start): Remove decl, since lisp.h does it now.
7868 (safe_bcopy): Remove decl; no longer has that name.
7869 (main): Coalesce #if into single bit of code, for simplicity.
7870 Cast pointers to uintptr_t, since standard libraries want integers
7871 and not pointers.
7872 * lisp.h (__executable_start): New decl.
7873
32d72c2f
GM
78742012-05-31 Glenn Morris <rgm@gnu.org>
7875
7876 * image.c (Fimagemagick_types): Doc fix.
7877
baac5bc7
JM
78782012-05-30 Jim Meyering <meyering@redhat.com>
7879
7880 * callproc.c (Fcall_process_region): Include directory component
7881 in mkstemp error message (Bug#11586).
7882
72cb32cf
PE
78832012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7884
7885 * alloc.c, lisp.h (make_pure_vector): Now static.
7886
61b108cc
SM
78872012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7888
7889 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7890 Move to byte-run.el.
7891 (Fautoload): Do the hash-doc more carefully.
7892 * data.c (Fdefalias): Purify definition, except for keymaps.
7893 (Qdefun): Move from eval.c.
7894 * lisp.h (Qdefun): Remove.
7895 * lread.c (read1): Tiny simplification.
7896
471fe23d
TN
78972012-05-29 Troels Nielsen <bn.troels@gmail.com>
7898
934f3f58 7899 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7900 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7901 Bug#9642, but explicitly check that the buffer the overlay would
7902 be moved to is live and rearrange lines to make sure that errors
7903 will not put the overlay in an inconsistent state.
7904 (Fdelete_overlay): Cosmetics.
7905
85d0efd1
EZ
79062012-05-28 Eli Zaretskii <eliz@gnu.org>
7907
7908 * w32term.c (my_bring_window_to_top): New function.
7909 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7910 could be different from the original one.
7911 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7912 (Bug#11513)
7913
7914 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7915 by calling BringWindowToTop.
7916
7917 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7918 (WM_EMACS_END): Increase by one.
7919
da92a98c
PE
79202012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7921
7922 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7923 This avoids undefined behavior that might cause the eassert
7924 to not catch an out-of-range value.
7925
74d1f848
JB
79262012-05-28 Juanma Barranquero <lekktu@gmail.com>
7927
7928 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7929 Update dependencies.
7930
9e1a06fc
EZ
79312012-05-27 Eli Zaretskii <eliz@gnu.org>
7932
7933 * bidi.c (bidi_mirror_char): Fix last change.
7934
f3dd7312
AS
79352012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7936
7937 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7938 when referring to sectname field in printf format.
7939
81899c91
PE
79402012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7941
57b81a9f
PE
7942 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7943 Only r_alloc_inhibit_buffer_relocation needed to be added;
7944 the others were already declared.
7945
81899c91
PE
7946 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7947 before checking whether it's out of range. Put the check inside
7948 eassert. See
7949 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7950
33017faf 79512012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7952
7953 * callproc.c (Fcall_process): Restore a line that was accidentally
7954 commented out in the 2011-02-13 change (bug#11547).
7955
33017faf 79562012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7957
7958 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7959 defined on ralloc.c.
7960
7961 * buffer.c [REL_ALLOC]: Remove prototypes of
7962 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7963 they are now on lisp.h.
7964
7965 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7966
7967 * search.c (search_buffer): Use it to inhibit relocation of buffer
7968 text while re_search_2 is doing its job, because re_search_2 is
7969 passed C pointers to buffer text. (Bug#11519)
7970
23415acf
EZ
7971 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7972 Update value to 24.
7973
44e27368
EZ
7974 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7975 state after an additional call to move_it_in_display_line_to, keep
7976 the values of it->max_ascent and it->max_descent found for the
7977 entire line.
7978 (pos_visible_p): Revert the comparison against bottom_y to what it
7979 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7980 (Bug#11464)
7981
c1892f11
PE
79822012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7983
7984 Fix coding-related core dumps with gcc -ftrapv.
7985 The code was computing A - B, where A and B are pointers, and B is
7986 random garbage. This can lead to core dumps on platforms that
7987 have special pointer registers, and it also leads to core dumps on
7988 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7989 A - B only when B is initialized properly.
7990 * coding.c (coding_set_source, coding_set_destination): Return void.
7991 (coding_change_source, coding_change_destinations): New functions,
7992 with the old behaviors of coding_set_source and coding_set_destination.
7993 All callers that need an offset changed to use these new functions.
7994
eb7afdad
GM
79952012-05-26 Glenn Morris <rgm@gnu.org>
7996
7997 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7998
f12fdf02
EZ
79992012-05-26 Eli Zaretskii <eliz@gnu.org>
8000
53a63be6 8001 Extend mouse support on W32 text-mode console.
61b108cc
SM
8002 * xdisp.c (draw_row_with_mouse_face):
8003 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 8004
eb3f6f01 8005 * w32console.c: Include window.h.
61b108cc
SM
8006 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8007 New functions.
eb3f6f01
EZ
8008 (initialize_w32_display): Initialize mouse-highlight data.
8009
53a63be6
EZ
8010 * w32inevt.c: Include termchar.h and window.h.
8011 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8012 moves, call note_mouse_highlight. If help_echo changed, call
8013 gen_help_event to produce help-echo message in the echo area.
8014 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8015 highlight info.
8016
4cfd81f6
PE
80172012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8018
8019 * lread.c (read1): Simplify slightly to avoid an overflow warning
8020 with GCC 4.7.0 on x86-64.
8021
4446092a
EZ
80222012-05-26 Eli Zaretskii <eliz@gnu.org>
8023
8024 * bidi.c (bidi_mirror_char): Revert last change: an int is
8025 definitely wide enough here.
8026
42b2a986 80272012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 8028
42b2a986 8029 Fix integer width and related bugs (Bug#9874).
eb106a49 8030 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
8031 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8032 (string_bytes, check_sblock, allocate_string_data):
8033 (compact_small_strings, Fmake_bool_vector, make_string)
8034 (make_unibyte_string, make_multibyte_string)
8035 (make_string_from_bytes, make_specified_string)
8036 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8037 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8038 (mark_vectorlike):
8039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8040 (allocate_pseudovector):
8041 Use int, not EMACS_INT, where int is wide enough.
8042 (inhibit_garbage_collection, Fgarbage_collect):
8043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8044 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8045 int might not be wide enough.
8046 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8047 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8048 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8049 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8050 (bidi_level_of_next_char, bidi_move_to_visually_next):
8051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8052 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8053 (Fkill_buffer, Fset_buffer_major_mode)
8054 (advance_to_char_boundary, Fbuffer_swap_text)
8055 (Fset_buffer_multibyte, overlays_at, overlays_in)
8056 (overlay_touches_p, struct sortvec, record_overlay_string)
8057 (overlay_strings, recenter_overlay_lists)
8058 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8059 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8060 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8061 (Foverlay_recenter, last_overlay_modification_hooks_used)
8062 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
8064 (validate_region): Omit unnecessary test for b <= e,
8065 since that's guaranteed by the previous test.
d311d28c
PE
8066 (adjust_overlays_for_delete): Avoid pos + length overflow.
8067 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8068 (report_overlay_modification):
8069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8070 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8071 Omit pointer cast, which isn't needed anyway, and doesn't work
8072 after the EMACS_INT -> ptrdiff_t change.
02481186 8073 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
8074 * buffer.h: Adjust decls to match defn changes elsewhere.
8075 (struct buffer_text, struct buffer):
8076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8077 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
8078 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8079 not int, to avoid needless 32-bit limit on 64-bit hosts.
8080 (exec_byte_code): Use tighter memory-full test, one that checks
8081 for alloca overflow. Don't compute the address of the object just
8082 before an array, as that's not portable. Use EMACS_INT, not
8083 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
8084 * callint.c (Fcall_interactively):
8085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8086 * callproc.c (call_process_kill, Fcall_process):
8087 Don't assume pid_t fits into an Emacs fixnum.
8088 (call_process_cleanup, Fcall_process, child_setup):
8089 Don't assume pid_t fits into int.
8090 (call_process_cleanup, Fcall_process, delete_temp_file)
8091 (Fcall_process_region):
8092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8093 (Fcall_process): Simplify handling of volatile integers.
8094 Use int, not EMACS_INT, where int will do.
8095 * casefiddle.c (casify_object, casify_region, operate_on_word)
8096 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8098 (casify_object): Avoid integer overflow when overallocating buffer.
8099 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 8100 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
8101 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8102 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8103 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8104 integers are now checked earlier. All uses replaced with XINT.
8105 (ccl_driver):
8106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8107 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
8108 (ccl_driver, Fregister_code_conversion_map):
8109 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
8110 (resolve_symbol_ccl_program): Check that vector header is in range.
8111 Always copy the vector, so that we can check its contents reliably
8112 now rather than having to recheck each instruction as it's being
8113 executed. Check that vector words fit in 'int'.
8114 (ccl_get_compiled_code, Fregister_ccl_program)
8115 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8116 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8117 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8118 contents are in range.
8119 (Fccl_execute_on_string): Check that status is in range.
8120 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8121 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8122 Accept and return EMACS_INT, not int, because callers can pass values
8123 out of 'int' range.
8124 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8125 (multibyte_chars_in_text, parse_str_as_multibyte)
8126 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8127 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8128 (string_escape_byte8, Fget_byte):
8129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 8130 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
8131 avoid mishandling large integers.
8132 * character.h: Adjust decls to match defn changes elsewhere.
8133 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8134 (Ffind_charset_region):
8135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8136 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8137 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 8138 Don't assume fixnum fits in int.
d311d28c
PE
8139 (load_charset_map_from_vector, Fmap_charset_chars):
8140 Remove now-unnecessary CHECK_NATNUMs.
8141 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
8142 Don't rely on undefined behavior with signed left shift overflow.
8143 Don't assume unsigned int fits into fixnum, or that fixnum fits
8144 into unsigned int. Don't require max_code to be a valid fixnum;
8145 that's not true for gb10830 4-byte on a 32-bit host. Allow
8146 invalid_code to be a cons, for the same reason. Require code_offset
8147 to be a character. Avoid int overflow if max_char is close
8148 to INT_MAX.
8149 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8150 this is intended anyway and avoids some undefined behavior.
8151 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8152 INDEX_TO_CODE_POINT, as that's what it expects.
8153 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
8154 * charset.h (DECODE_CHAR): Return int, not unsigned;
8155 this is what was intended anyway, and it avoids undefined behavior.
8156 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8157 integer-overflow issues.
8158 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8159 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8160 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
8161 * chartab.c (Fmake_char_table, Fset_char_table_range)
8162 (uniprop_get_decoder, uniprop_get_encoder):
8163 Don't assume fixnum fits in int.
8164 * cmds.c (move_point): New function, that does the gist of
8165 Fforward_char and Fbackward_char, but does so while checking
8166 for integer overflow more accurately.
c96e5d6a 8167 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
8168 (Fforward_line, Fend_of_line, internal_self_insert)
8169 (internal_self_insert):
8170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8171 Fix a FIXME, by checking for integer overflow when calculating
8172 target_clm and actual_clm.
8173 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 8174 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
8175 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8176 (coding_alloc_by_making_gap, alloc_destination)
8177 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8178 (encode_coding_utf_16, detect_coding_emacs_mule)
8179 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8180 (detect_coding_iso_2022, decode_coding_iso_2022)
8181 (encode_invocation_designation, encode_designation_at_bol)
8182 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8183 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8184 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8185 (encode_coding_ccl, encode_coding_raw_text)
8186 (detect_coding_charset, decode_coding_charset)
8187 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8188 (produce_composition, produce_charset, produce_annotation)
8189 (decode_coding, handle_composition_annotation)
8190 (handle_charset_annotation, consume_chars, decode_coding_gap)
8191 (decode_coding_object, encode_coding_object, detect_coding_system)
8192 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8193 (code_convert_region, code_convert_string)
8f50130c
PE
8194 (Fdefine_coding_system_internal)
8195 (coding_set_source, coding_set_destination):
d311d28c
PE
8196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8197 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8198 (Fdefine_coding_system_internal):
8199 Don't assume fixnums fit in int.
8200 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 8201 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
8202 (Funencodable_char_position, Fcheck_coding_systems_region)
8203 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 8204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 8205 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 8206 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 8207 Don't access memory outside of the args array.
d311d28c 8208 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
8209 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8210 result of ENCODE_CHAR.
d311d28c
PE
8211 * coding.h: Adjust decls to match defn changes elsewhere.
8212 (struct coding_system):
8213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8214 * composite.c (get_composition_id, find_composition)
8215 (run_composition_function, update_compositions)
8216 (compose_text, composition_gstring_put_cache)
8217 (composition_gstring_p, composition_gstring_width)
8218 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8219 (composition_compute_stop_pos, composition_reseat_it)
8220 (composition_update_it, struct position_record)
8221 (find_automatic_composition, composition_adjust_point)
8222 (Fcomposition_get_gstring, Ffind_composition_internal):
8223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8224 (update_compositions):
8225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8226 * composite.h: Adjust decls to match defn changes elsewhere.
8227 (struct composition):
8228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8229 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8230 Do not attempt to compute the address of the object just before a
8231 buffer; this is not portable.
8232 (Faref, Faset):
8233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8234 (Faset): Use int, not EMACS_INT, where int is wide enough.
8235 (Fstring_to_number): Don't assume fixnums fit in int.
8236 (Frem): Don't assume arg is nonnegative.
8237 * dbusbind.c (xd_append_arg): Check for integers out of range.
8238 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 8239 (extract_signed, extract_unsigned): New functions.
243e0530
PE
8240 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8241 (xd_get_connection_references): Return ptrdiff_t, not int.
8242 All uses changed.
8243 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8244 (xd_read_message_1):
8245 Use int, not unsigned, where the dbus API uses int.
8246 (Fdbus_message_internal): Don't overflow mtype.
8247 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
8248 * dired.c (directory_files_internal, file_name_completion, scmp)
8249 (file_name_completion_stat):
8250 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8251 (file_name_completion): Don't overflow matchcount.
8252 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8253 * dispextern.h: Adjust decls to match defn changes elsewhere.
8254 (struct text_pos, struct glyph, struct bidi_saved_info)
8255 (struct bidi_string_data, struct bidi_it, struct composition_it)
8256 (struct it):
8257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8258 (struct display_pos, struct composition_it, struct it):
8259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8260 * dispnew.c (increment_matrix_positions)
8261 (increment_row_positions, mode_line_string)
8262 (marginal_area_string):
8263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 8264 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
8265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8266 (duration_to_sec_usec): New function, to check for overflow better.
8267 (Fsleep_for, sit_for): Use it.
8268 * doc.c (get_doc_string, store_function_docstring):
8269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8270 (get_doc_string, Fsnarf_documentation):
8271 Use int, not EMACS_INT, where int is wide enough.
8272 (get_doc_string):
8273 Use SAFE_ALLOCA, not alloca.
8274 Check for overflow when converting EMACS_INT to off_t.
8275 * doprnt.c (doprnt):
8276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8277 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8278 Don't assume uid_t fits into fixnum.
8279 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8280 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8281 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8282 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8283 (general_insert_function)
8284 (Finsert_char, make_buffer_string, make_buffer_string_both)
8285 (update_buffer_properties, Fbuffer_substring)
8286 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8287 (Fsubst_char_in_region, check_translation)
8288 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8289 (transpose_markers, Ftranspose_regions):
8290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8291 (clip_to_bounds): Move to lisp.h as an inline function).
8292 (Fconstrain_to_field): Don't assume integers are nonnegative.
8293 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8294 (Fsubst_char_in_region, Fsave_restriction):
8295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8296 (Femacs_pid): Don't assume pid_t fits into fixnum.
8297 (lo_time): Use int, not EMACS_INT, when int suffices.
8298 (lisp_time_argument): Check for usec out of range.
8299 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8300 (Fuser_login_name, Fuser_full_name): Signal an error
8301 if a uid argument is out of range, rather than relying on
8302 undefined behavior.
c8d5c857
PE
8303 (Fformat_time_string): Remove now-unnecessary check.
8304 lisp_time_argument checks for out-of-range usec now.
243e0530 8305 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8306 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8307 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8308 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8309 (init_cmdargs, Fdump_emacs):
8310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8311 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8312 the bottom (typically) 32 bits of the fixnum.
8313 * eval.c (specpdl_size, call_debugger):
8314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8315 (when_entered_debugger, Fbacktrace_debug):
8316 Don't assume fixnum can fit in int.
8317 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8318 the object just before a buffer; this is not portable.
8319 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8320 (grow_specpdl, unbind_to):
8321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8322 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8323 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8324 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8325 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8326 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8328 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8329 (a_write, e_write):
8330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8331 (Fcopy_file, non_regular_nbytes, read_non_regular)
8332 (Finsert_file_contents):
8333 Use int, not EMACS_INT, where int is wide enough.
8334 (READ_BUF_SIZE): Verify that it fits in int.
8335 (Finsert_file_contents): Check that counts are in proper range,
8336 rather than assuming fixnums fit into ptrdiff_t etc.
8337 Don't assume fixnums fit into int.
125b3835 8338 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8339 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8340 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8341 (string_char_to_byte, string_byte_to_char)
8342 (string_make_multibyte, string_to_multibyte)
8343 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8344 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8345 (substring_both, Fdelete, internal_equal, Ffillarray)
8346 (Fclear_string, mapcar1)
8347 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8348 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8349 (larger_vector, make_hash_table, maybe_resize_hash_table)
8350 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8351 (Fmaphash, secure_hash):
8352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8353 (concat): Check for string index and length overflow.
8354 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8355 (Frequire):
8356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8357 (larger_vector): New API (vec, incr_min, size_max) replaces old
8358 one (vec, new_size, init). This catches size overflow.
8359 INIT was removed because it was always Qnil.
8360 All callers changed.
8361 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8362 the upper bound on a hash table index size.
8363 (make_hash_table, maybe_resize_hash_table): Use it.
8364 (secure_hash): Computer start_byte and end_byte only after
8365 they're known to be in ptrdiff_t range.
8366 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8367 (Ffont_get_glyphs, Ffont_at):
8368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8369 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8370 (Flist_fonts, Fopen_font):
8371 Don't assume fixnum can fit in int.
8372 (check_gstring): Don't assume index can fit in int.
8373 (font_match_p): Check that fixnum is a character, not a nonnegative
8374 fixnum, since the later code needs to stuff it into an int.
8375 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8376 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8377 conversion overflow issues.
8378 (Fopen_font): Check for integer out of range.
8379 (Ffont_get_glyphs): Don't assume index can fit in int.
8380 * font.h: Adjust decls to match defn changes elsewhere.
8381 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8382 integer overflow.
8383 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8384 printmax_t, where ptrdiff_t is wide enough.
8385 (Finternal_char_font):
8386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8387 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8388 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8389 (Fset_frame_position, x_set_frame_parameters)
8390 (x_set_line_spacing, x_set_border_width)
8391 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8392 Check that fixnums are in proper range for system types.
8393 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8395 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8396 Use SAFE_ALLOCA_LISP, not alloca.
8397 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8398 intptr_t is wide enough.
8399 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8400 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8401 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8402 Check for fixnum out of range.
8403 * ftfont.c (ftfont_list): Don't assume index fits in int.
8404 Check that fixnums are in proper range for system types.
8405 (ftfont_shape_by_flt):
8406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8407 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8409 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8410 Check that fixnums are in proper range for system types.
8411 * gnutls.h: Adjust decls to match defn changes elsewhere.
8412 * gtkutil.c (xg_dialog_run):
8413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8414 (update_frame_tool_bar):
8415 Check that fixnums are in proper range for system types.
8416 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8417 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8418 * indent.c (last_known_column, last_known_column_point):
8419 (current_column_bol_cache):
8420 (skip_invisible, current_column, check_display_width):
8421 (check_display_width, scan_for_column, current_column_1)
8422 (Findent_to, Fcurrent_indentation, position_indentation)
8423 (indented_beyond_p, Fmove_to_column, compute_motion):
8424 (Fcompute_motion, Fvertical_motion):
8425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8426 (last_known_column_modified): Use EMACS_INT, not int.
8427 (check_display_width):
8428 (Fcompute_motion):
8429 Check that fixnums and floats are in proper range for system types.
8430 (compute_motion): Don't assume index or fixnum fits in int.
8431 (compute_motion, Fcompute_motion):
8432 Use int, not EMACS_INT, when it is wide enough.
8433 (vmotion): Omit local var start_hpos that is always 0; that way
8434 we don't need to worry about overflow in expressions involving it.
8435 * indent.h: Adjust decls to match defn changes elsewhere.
8436 (struct position):
8437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8438 Use int, not EMACS_INT, where int is wide enough.
8439 Remove unused members ovstring_chars_done and tab_offset;
8440 all uses removed.
8441 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8442 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8443 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8444 (make_gap, copy_text, insert, insert_and_inherit)
8445 (insert_before_markers, insert_before_markers_and_inherit)
8446 (insert_1, count_combining_before, count_combining_after)
8447 (insert_1_both, insert_from_string)
8448 (insert_from_string_before_markers, insert_from_string_1)
8449 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8450 (adjust_after_replace, adjust_after_insert, replace_range)
8451 (replace_range_2, del_range, del_range_1, del_range_byte)
8452 (del_range_both, del_range_2, modify_region)
8453 (prepare_to_modify_buffer, signal_before_change)
8454 (signal_after_change, Fcombine_after_change_execute):
8455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8456 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8457 (balance_an_interval, split_interval_right, split_interval_left)
8458 (find_interval, next_interval, update_interval)
8459 (adjust_intervals_for_insertion, delete_node, delete_interval)
8460 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8461 (static_offset_intervals, offset_intervals)
8462 (merge_interval_right, merge_interval_left, make_new_interval)
8463 (graft_intervals_into_buffer, temp_set_point_both)
8464 (temp_set_point, set_point, adjust_for_invis_intang)
8465 (set_point_both, move_if_not_intangible, get_property_and_range)
8466 (get_local_map, copy_intervals, copy_intervals_to_string)
8467 (compare_string_intervals, set_intervals_multibyte_1):
8468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8469 * intervals.h: Adjust decls to match defn changes elsewhere.
8470 (struct interval):
8471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8472 * keyboard.c (this_command_key_count, this_single_command_key_start)
8473 (before_command_key_count, before_command_echo_length, echo_now)
8474 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8475 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8476 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8477 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8479 (last_non_minibuf_size, last_point_position, echo_truncate)
8480 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8481 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8482 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8483 (stuff_buffered_input):
8484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8485 (last_auto_save, command_loop_1, read_char):
8486 Use EMACS_INT, not int, to avoid integer overflow.
8487 (record_char): Avoid overflow in total_keys computation.
8488 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8489 * keyboard.h: Adjust decls to match defn changes elsewhere.
8490 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8491 (Fkey_description, Fdescribe_vector, Flookup_key):
8492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8493 (click_position): New function, to check that positions are in range.
8494 (Fcurrent_active_maps):
8495 (describe_command):
8496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8497 (Faccessible_keymaps, Fkey_description):
8498 (preferred_sequence_p):
8499 Don't assume fixnum can fit into int.
8500 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8501 Check for integer overflow in size calculations.
8502 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8503 avoid mishandling large integers.
8504 * lisp.h: Adjust decls to match defn changes elsewhere.
8505 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8506 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8507 (struct Lisp_Marker):
8508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8509 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8510 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8511 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8512 All callers changed.
8513 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8514 Assume the arg has valid form, since it always does.
8515 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8516 unsigned integer system type.
8517 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8518 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8520 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8521 (duration_to_sec_usec): New decl.
8522 * lread.c (read_from_string_index, read_from_string_index_byte)
8523 (read_from_string_limit, readchar, unreadchar, openp)
8524 (read_internal_start, read1, oblookup):
8525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8526 (Fload, readevalloop, Feval_buffer, Feval_region):
8527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8528 (openp): Check for out-of-range argument to 'access'.
8529 (read1): Use int, not EMACS_INT, where int is wide enough.
8530 Don't assume fixnum fits into int.
6efdadfd 8531 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8532 (read_filtered_event): Use duration_to_sec_usec
8533 to do proper overflow checking on durations.
d311d28c
PE
8534 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8535 in size calculation.
8536 (Fexecute_kbd_macro):
8537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8538 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8539 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8540 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8541 (set_marker_both, set_marker_restricted_both, marker_position)
8542 (marker_byte_position, Fbuffer_has_markers_at):
8543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8544 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8545 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8546 It now merely ensures that the menu is large enough, without
8547 necessarily growing it, as this avoids some integer overflow issues.
8548 All callers changed.
8549 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8551 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8552 Use SAFE_ALLOCA_LISP, not alloca.
8553 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8554 to EMACS_INT. Check that fixnums are in proper range for system types.
8555 * minibuf.c (minibuf_prompt_width, string_to_object)
8556 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8557 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8559 (get_minibuffer, read_minibuf_unwind):
8560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8561 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8562 this simplifies overflow checking. All callers changed.
8563 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8564 (Ftest_completion):
8565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8566 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8567 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8568 Check that fixnums are in proper range for system types.
8569 (Fx_create_frame, Fx_show_tip):
8570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8571 * nsfont.m (ns_findfonts, nsfont_list_family):
8572 Don't assume fixnum fits in long.
8573 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8575 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8576 wide enough.
17fdb222 8577 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8579 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8580 (PRINTDECLARE, PRINTPREPARE):
8581 (strout, print_string):
8582 (print, print_preprocess, print_check_string_charset_prop)
8583 (print_object):
8584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8585 (PRINTDECLARE):
8586 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8588 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8589 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8590 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8591 (print_error_message): Use SAFE_ALLOCA, not alloca.
8592 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8593 (print_depth, new_backquote_output, print_number_index):
8594 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8595 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8596 (Fset_process_window_size, Fformat_network_address)
8597 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8598 (sigchld_handler):
d311d28c 8599 Check that fixnums are in proper range for system types.
d44287d4 8600 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8601 Check for process-ids out of pid_t range rather than relying on
8602 undefined behavior.
e4d81efc 8603 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8604 (Fformat_network_address, read_process_output, send_process)
8605 (Fprocess_send_region, status_notify):
8606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8607 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8608 (wait_reading_process_output, read_process_output, exec_sentinel):
8609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8610 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8611 (Faccept_process_output): Use duration_to_sec_usec to do proper
8612 overflow checking on durations.
dde14581
PE
8613 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8614 Don't assume pid_t fits in int.
02481186
PE
8615 * process.h (struct Lisp_Process): Members tick and update_tick
8616 are now of type EMACS_INT, not int.
b62b53e8
PE
8617 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8618 configured --with-wide-int.
d311d28c
PE
8619 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8620 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8621 * search.c (looking_at_1, string_match_1):
8622 (fast_string_match, fast_c_string_match_ignore_case)
8623 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8624 (scan_newline, find_before_next_newline, search_command)
8625 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8626 (set_search_regs, wordify):
8627 (Freplace_match):
8628 (Fmatch_data):
8629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8630 (string_match_1, search_buffer, set_search_regs):
8631 (Fmatch_data):
8632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8633 (wordify): Check for overflow in size calculation.
8634 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8635 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8636 Check that fixnums are in proper range for system types.
8637 * sound.c (struct sound_device)
8638 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8640 (Fplay_sound_internal):
8641 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8642 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8643 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8644 (Fparse_partial_sexp):
8645 Don't assume fixnums can fit in int.
8646 (struct lisp_parse_state, find_start_pos, find_start_value)
8647 (find_start_value_byte, find_start_begv)
8648 (update_syntax_table, char_quoted, dec_bytepos)
8649 (find_defun_start, prev_char_comend_first, back_comment):
8650 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8651 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8653 (Finternal_describe_syntax_value): Check that match_lisp is a
8654 character, not an integer, since the code stuffs it into int.
8655 (scan_words, scan_sexps_forward):
8656 Check that fixnums are in proper range for system types.
8657 (Fforward_word):
8658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8659 (scan_sexps_forward):
8660 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8661 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8662 * syntax.h: Adjust decls to match defn changes elsewhere.
8663 (struct gl_state_s):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8665 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8666 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8667 * sysdep.c (wait_for_termination_1, wait_for_termination)
8668 (interruptible_wait_for_termination, mkdir):
8669 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8670 (emacs_read, emacs_write):
8671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8672 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8673 and double all fit in int.
d311d28c
PE
8674 * term.c (set_tty_color_mode):
8675 Check that fixnums are in proper range for system types.
8676 * termhooks.h (struct input_event):
8677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8678 * textprop.c (validate_interval_range, interval_of)
8679 (Fadd_text_properties, set_text_properties_1)
8680 (Fremove_text_properties, Fremove_list_of_text_properties)
8681 (Ftext_property_any, Ftext_property_not_all)
8682 (copy_text_properties, text_property_list, extend_property_ranges)
8683 (verify_interval_modification):
8684 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8685 (Fnext_single_char_property_change)
8686 (Fprevious_single_char_property_change):
8687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8688 (copy_text_properties):
8689 Check for integer overflow in index calculation.
d311d28c
PE
8690 * undo.c (last_boundary_position, record_point, record_insert)
8691 (record_delete, record_marker_adjustment, record_change)
8692 (record_property_change):
8693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8694 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8696 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8697 (Fx_hide_tip, Fx_file_dialog):
8698 * w32menu.c (set_frame_menubar):
8699 Use ptrdiff_t, not int, for consistency with rest of code.
8700 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8701 (select_window, Fdelete_other_windows_internal)
8702 (window_scroll_pixel_based, window_scroll_line_based)
8703 (Frecenter, Fset_window_configuration):
8704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8705 (Fset_window_hscroll, run_window_configuration_change_hook)
8706 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8707 (Fscroll_other_window, Frecenter):
d311d28c
PE
8708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8709 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8710 Don't assume fixnum fits in int.
8711 (Fset_window_scroll_bars):
8712 Check that fixnums are in proper range for system types.
8713 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8714 (string_pos, c_string_pos, number_of_chars, init_iterator)
8715 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8716 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8717 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8718 (face_before_or_after_it_pos, handle_invisible_prop)
8719 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8720 (display_prop_intangible_p, string_buffer_position_lim)
8721 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8722 (get_overlay_strings_1, get_overlay_strings)
8723 (iterate_out_of_display_property, forward_to_next_line_start)
8724 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8725 (get_next_display_element, set_iterator_to_next)
8726 (get_visually_first_element, compute_stop_pos_backwards)
8727 (handle_stop_backwards, next_element_from_buffer)
8728 (move_it_in_display_line_to, move_it_in_display_line)
8729 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8730 (add_to_log, message_dolog, message_log_check_duplicate)
8731 (message2, message2_nolog, message3, message3_nolog
8732 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8733 (current_message_1, truncate_echo_area, truncate_message_1)
8734 (set_message, set_message_1, store_mode_line_noprop)
8735 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8736 (text_outside_line_unchanged_p, check_point_in_composition)
8737 (reconsider_clip_changes)
8738 (redisplay_internal, set_cursor_from_row, try_scrolling)
8739 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8740 (redisplay_window, find_last_unchanged_at_beg_row)
8741 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8742 (trailing_whitespace_p, find_row_edges, display_line)
8743 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8744 (display_mode_element, store_mode_line_string)
8745 (pint2str, pint2hrstr, decode_mode_spec)
8746 (display_count_lines, display_string, draw_glyphs)
8747 (x_produce_glyphs, x_insert_glyphs)
8748 (rows_from_pos_range, mouse_face_from_buffer_pos)
8749 (fast_find_string_pos, mouse_face_from_string_pos)
8750 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8752 (safe_call, init_from_display_pos, handle_fontified_prop)
8753 (handle_single_display_spec, load_overlay_strings)
8754 (with_echo_area_buffer, setup_echo_area_for_printing)
8755 (display_echo_area, echo_area_display)
8756 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8757 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8758 (redisplay_window, dump_glyph_row, display_mode_line)
8759 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8760 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8762 (handle_single_display_spec, build_desired_tool_bar_string)
8763 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8764 (get_specified_cursor_type):
8765 Check that fixnums are in proper range for system types.
8766 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8767 (Flookup_image_map):
8768 Don't assume fixnums fit in int.
8769 (compare_overlay_entries):
8770 Avoid mishandling comparisons due to subtraction overflow.
8771 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8772 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8773 (handle_tool_bar_click):
8774 Use int, not unsigned, since we prefer signed and the signedness
8775 doesn't matter here.
8776 (get_next_display_element, next_element_from_display_vector):
8777 Use int, not EMACS_INT, when int is wide enough.
8778 (start_hourglass): Use duration_to_sec_usec to do proper
8779 overflow checking on durations.
8780 * xfaces.c (Fbitmap_spec_p):
8781 Check that fixnums are in proper range for system types.
8782 (compare_fonts_by_sort_order):
8783 Avoid mishandling comparisons due to subtraction overflow.
8784 (Fx_family_fonts, realize_basic_faces):
8785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8786 (Fx_family_fonts):
8787 Don't assume fixnum fits in int.
8788 Use SAFE_ALLOCA_LISP, not alloca.
8789 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8790 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8791 (face_at_buffer_position, face_for_overlay_string)
8792 (face_at_string_position):
8793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8794 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8795 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8796 (Fx_show_tip):
8797 Check that fixnums are in proper range for system types.
8798 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8799 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8801 (Fx_change_window_property): Don't assume fixnums fit in int.
8802 * xfont.c (xfont_chars_supported):
8803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8804 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8805 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8807 * xml.c (parse_region):
8808 * xrdb.c (magic_file_p):
8809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8810 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8811 (x_get_local_selection, x_reply_selection_request)
8812 (x_handle_selection_request, wait_for_property_change):
8813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8814 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8815 short is wide enough.
8816 (x_send_client_event): Don't assume fixnum fits in int.
8817 * xterm.c (x_x_to_emacs_modifiers):
8818 Don't assume EMACS_INT overflows nicely into int.
8819 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8820 may come from Lisp.
8821 (handle_one_xevent): NATNUMP can eval its arg twice.
8822 (x_connection_closed):
8823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8824 * xterm.h: Adjust decls to match defn changes elsewhere.
8825 (struct scroll_bar): Use struct vectorlike_header
8826 rather than rolling our own approximation.
8827 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8828
c6574eb5
GM
88292012-05-25 Glenn Morris <rgm@gnu.org>
8830
8831 * lisp.mk (lisp): Update for more files being compiled now.
8832
e8d32c7e
SM
88332012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8834
48def666
SM
8835 * lread.c: Remove `read_pure' which makes no difference.
8836 (read_pure): Remove var.
8837 (unreadpure): Remove function.
8838 (readevalloop): Don't call read_list with -1 flag.
8839 (read1, read_vector): Don't test read_pure any more.
8840 (read_list): Simplify.
8841
e8d32c7e
SM
8842 * fileio.c, character.h: Minor style tweaks.
8843
4b2addb7
DA
88442012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8845
8846 * window.h (clip_changed): Remove useless declaration.
8847
584461b2
JB
88482012-05-22 Juanma Barranquero <lekktu@gmail.com>
8849
8850 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8851 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8852
34374650
PE
88532012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8854
8855 Remove src/m/*.
8856 This directory predates autoconf and is no longer needed nowadays.
8857 Move its few remaining bits of functionality to where they're needed.
8858 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8859 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8860 * m/template.h: Remove.
8861 * Makefile.in (M_FILE): Remove. All uses removed.
8862 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8863 * lisp.h (USE_LSB_TAG):
8864 * mem-limits.h (EXCEEDS_LISP_PTR):
8865 Use VAL_MAX, not VALBITS, in #if.
8866 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8867 (EMACS_UINT): Define unconditionally now.
8868 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8869 (BITS_PER_EMACS_INT): New constants, replacing
8870 what used to be in config.h, but not useful in #if.
8871 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8872 define them any more.
8873 (VAL_MAX): New macro.
8874 (VALMASK): Use it.
8875 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8876 BITS_PER_EMACS_INT, in #if.
8877 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8878 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8879 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8880 * s/ms-w32.h (DATA_START):
8881 Move here from removed file m/intel386.h.
8882 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8883 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8884
261cb4bb
PE
88852012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8886
8887 Assume C89 or later.
8888 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8889 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8890 (xrealloc):
8891 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8892 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8893 * textprop.c, tparam.c (NULL): Remove.
8894 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8895 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8896 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8897 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8898 * xterm.c (input_signal_count): Assume volatile works.
8899
ff23cd9f
KB
89002012-05-21 Ken Brown <kbrown@cornell.edu>
8901
8902 * xgselect.c (xg_select): Fix first argument in call to 'select'
8903 (bug#11508).
8904
1b170bc6
KB
89052012-05-20 Ken Brown <kbrown@cornell.edu>
8906
8907 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8908 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8909
b2f4d39f
KB
89102012-05-19 Ken Brown <kbrown@cornell.edu>
8911
8912 * xfns.c (x_in_use): Remove `static' qualifier.
8913 * xterm.h (x_in_use): Declare.
8914 * xgselect.c: Include xterm.h.
8915 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8916 and `display_arg' (bug#9754).
8917
003fdae2
PE
89182012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8919
9232a6d9
PE
8920 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8921
003fdae2
PE
8922 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8923 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8924
784b56e2
EZ
89252012-05-18 Eli Zaretskii <eliz@gnu.org>
8926
8927 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8928
8929 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8930 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8931
8932 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8933 reference to image_cache->refcount.
8934 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8935
a0a79cde
JL
89362012-05-17 Juri Linkov <juri@jurta.org>
8937
8938 * search.c (Fword_search_regexp, Fword_search_backward)
8939 (Fword_search_forward, Fword_search_backward_lax)
8940 (Fword_search_forward_lax): Move functions to isearch.el
8941 (bug#10145, bug#11381).
8942
b0572523
PE
89432012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8946
9660f5fc
SM
89472012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8948
8949 * lread.c (init_obarray): Declare Qt and Qnil as special.
8950
4374de83
GM
89512012-05-14 Glenn Morris <rgm@gnu.org>
8952
8953 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8954 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8955
dc44c39a
PE
89562012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8957
078c97cb
PE
8958 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8959
dc44c39a
PE
8960 * unexaix.c: Port to more-recent AIX compilers.
8961 (report_error, report_error_1, make_hdr, copy_sym)
8962 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8963 Make arguments const char *, not char *, to avoid violations of C
8964 standard and to fix some AIX warnings reported by Gilles Pion.
8965
e18afed7 89662012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8967
8968 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8969 already have overlays loaded.
8970 (handle_single_display_spec): Before returning without displaying
8971 fringe bitmap, synchronize the bidi iterator with the main display
8972 iterator, by calling iterate_out_of_display_property.
8973 (iterate_out_of_display_property): Detect buffer iteration by
8974 testing that it->string is a Lisp string.
8975 (get_next_display_element): When the current object is exhausted,
8976 and there's something on it->stack, call set_iterator_to_next to
8977 proceed with what's on the stack, instead of returning zero.
8978 (set_iterator_to_next): If called at the end of a Lisp string,
8979 proceed to consider_string_end without incrementing string
8980 position. Don't increment display vector index past the end of
8981 the display vector. (Bug#11417)
c8fb9dc6
EZ
8982 (pos_visible_p): Don't report a position visible when move_it_to
8983 stopped at the last line of window, which happens to be scanned
8984 backwards by the bidi iteration. (Bug#11464)
ac268e67 8985
e18afed7 89862012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8987
8988 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8989 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8990 are on a TTY, and thus unable to display on the fringes.
8991 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8992 so we need to signal to the caller that this is a "replacing"
8993 display spec. This fixes display when the spec is invalid or we
8994 are on a TTY.
8995
e18afed7 89962012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8997
8998 * unexaix.c (make_hdr): Fix typo in prototype.
8999 This bug broke the build on AIX. Problem reported by Gilles Pion.
9000
9d0a235a
MA
90012012-05-14 Michael Albinus <michael.albinus@gmx.de>
9002
9003 * keyboard.c (kbd_buffer_get_event): Read special events also in
9004 batch mode. (Bug#11415)
9005
9e6b06ed
GM
90062012-05-12 Glenn Morris <rgm@gnu.org>
9007
9008 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9009
c1a1d7a3
EZ
90102012-05-12 Eli Zaretskii <eliz@gnu.org>
9011
9012 * lisp.mk (lisp): Add newcomment.elc.
9013
3fe7cdc8
GM
90142012-05-12 Glenn Morris <rgm@gnu.org>
9015
9016 * Makefile.in (MKDIR_P): New, set by configure.
9017 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9018
53f7d2c0
PE
90192012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9020
9021 Remove unused function hourglass_started.
9022 * dispextern.h (hourglass_started):
9023 * w32fns.c (hourglass_started):
9024 * xdisp.c (hourglass_started): Remove.
9025
75aafb17
JB
90262012-05-10 Juanma Barranquero <lekktu@gmail.com>
9027
9028 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9029 Update dependencies.
9030
12959e8e
PE
90312012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9032
97107e2e
PE
9033 * xgselect.c (xg_select): Put maxfds+1 into a var.
9034 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9035
12959e8e
PE
9036 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9037
836d29b3
DA
90382012-05-10 Dave Abrahams <dave@boostpro.com>
9039
9040 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9041 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9042
5cb67954
MA
90432012-05-09 Michael Albinus <michael.albinus@gmx.de>
9044
9045 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9046 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9047 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9048 Initialize xd_registered_buses.
9049
3478ec45
PE
90502012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9051
b263a6b0
PE
9052 Untag more efficiently if USE_LSB_TAG.
9053 This is based on a proposal by YAMAMOTO Mitsuharu in
9054 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9055 For an admittedly artificial (nth 8000 longlist) benchmark on
9056 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9057 Emacs's overall text size by 1%.
9058 * lisp.h (XUNTAG): New macro.
9059 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9060 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9061 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9062 * eval.c (Fautoload):
9063 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9064 * frame.h (XFRAME): Use XUNTAG.
9065
3478ec45
PE
9066 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9067 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9068 Remove unportable assumptions about print widths of types like
9069 dbus_uint32_t.
9070 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9071 intptr_t when converting between pointer and integer, to avoid GCC
9072 warnings about wrong width.
9073
666b903b 90742012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
9075
9076 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9077 stack for each reader_thread, instead of defaulting to 8MB
9078 determined by the linker. This avoids failures in creating
9079 subprocesses on Windows 7, see the discussion in this thread:
9080 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9081
b120cc17
JC
90822012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9083
9084 Fix up display of the *Minibuf-0* buffer in the mini window.
9085 * keyboard.c (read_char): Don't clear the echo area if there's no
9086 message to clear.
9087 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 9088 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 9089
9a4b36f8
MA
90902012-05-07 Michael Albinus <michael.albinus@gmx.de>
9091
9092 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9093 batch mode.
9094
e5f9458f
CY
90952012-05-06 Chong Yidong <cyd@gnu.org>
9096
9097 * lisp.mk (lisp): Update.
9098
eceeb5fc 90992012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
9100
9101 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9102
71873e2b
SM
91032012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9104
9105 * data.c (PUT_ERROR): New macro.
9106 (syms_of_data): Use it. Add new error type `user-error'.
9107 * undo.c (user_error): New function.
9108 (Fprimitive_undo): Use it.
9109 * print.c (print_error_message): Adjust print style for `user-error'.
9110 * keyboard.c (user_error): New function.
9111 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9112
ab0fa4e4
PE
91132012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9114
9115 Do not limit current-time-string to years 1000..9999.
9116 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9117 (Fcurrent_time_string): Support any year that is supported by the
9118 underlying localtime representation. Don't use asctime, as it
9119 has undefined behavior for years outside the range -999..9999.
9120
7ed806a7
PE
91212012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 Fix race conditions involving setenv, gmtime, localtime, asctime.
9124 Without this fix, interrupts could mess up code that uses these
9125 nonreentrant functions, since setting TZ invalidates existing
9126 tm_zone or tzname values, and since most of these functions return
9127 pointers to static storage.
9128 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9129 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9130 Grow the critical sections to include not just invoking
9131 localtime/gmtime, but also accessing these functions' results
9132 including their tm_zone values if any, and any related TZ setting.
9133 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
9134 so that the struct tm is saved in the critical section.
9135 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
9136 motivated by the fact that memory allocation needs to be outside
9137 the critical section.
9138
0c16dfed
DA
91392012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9140
9141 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9142 with RESET_INTERVAL.
9143
9144 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9145 Remove duplicated buffer name initialization.
9146
3f83ace8
JM
91472012-05-02 Jim Meyering <jim@meyering.net>
9148
9149 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9150
c7b8541e
JM
9151 * xfns.c (x_window): Use xstrdup (Bug#11375).
9152
90207a15 91532012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
9154
9155 * xdisp.c (pos_visible_p): If already at a newline from the
9156 display string before the 'while' loop, don't walk back the glyphs
9157 from it3.glyph_row. Solves assertion violation when the display
9158 string begins with a newline (egg.el). (Bug#11367)
9159
b593d6a9
AH
91602012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9161
9162 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9163 Move to simple.el.
9164
4737362e
GM
91652012-05-01 Glenn Morris <rgm@gnu.org>
9166
99cf43f9
GM
9167 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9168 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9169 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9170 All were removed before 23.1.
9171
9311dcff
GM
9172 * dispnew.c: Remove HAVE_LIBNCURSES test;
9173 it is always true on relevant platforms.
9174
4d5c6349
GM
9175 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9176 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9177
4737362e
GM
9178 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9179
74dd3a6b
AS
91802012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9181
9182 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9183 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9184 Remove.
9185
13c379ee
PE
91862012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9187
9188 Do not avoid creating empty evaporating overlays (Bug#9642).
9189 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9190 That is, do not delete an evaporating overlay if it becomes
9191 empty after its bounds are adjusted to fit within its buffer.
9192 This fix caused other problems, and I'm reverting it until we get
9193 to the bottom of them.
9194
a8e7d6d7 91952012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
9196
9197 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9198
a8e7d6d7 91992012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
9200
9201 * xdisp.c (pos_visible_p): If the window start position is beyond
9202 ZV, start the display from buffer beginning. Prevents assertion
9203 violation in init_iterator when the minibuffer window is scrolled
9204 via the scroll bar.
9205
9206 * window.c (window_scroll_pixel_based): Likewise.
9207
a8e7d6d7 92082012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
9209
9210 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9211
a8e7d6d7 92122012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
9213
9214 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9215 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9216
a8e7d6d7 92172012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 9218
b593d6a9
AH
9219 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9220 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 9221
1c6900d9
EZ
92222012-04-26 Eli Zaretskii <eliz@gnu.org>
9223
4c3fa1d9
EZ
9224 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9225 display element, check also the underlying string or buffer
9226 character. (Bug#11341)
9227
1c6900d9
EZ
9228 * w32menu.c: Include w32heap.h.
9229 (add_menu_item): If the call to AppendMenuW (via
9230 unicode_append_menu) fails, disable Unicode menus only if we are
9231 running on Windows 9X/Me.
9232
42bf8205
AS
92332012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9234
9235 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9236 (xgetint): Add missing shift for LSB tags.
9237
b1bac16e
MR
92382012-04-24 Martin Rudalics <rudalics@gmx.at>
9239
9240 * keyboard.c (read_char): Don't wipe echo area for select window
9241 events: These might get delayed via `mouse-autoselect-window'
9242 (Bug#11304).
9243
d69621cc
JB
92442012-04-24 Juanma Barranquero <lekktu@gmail.com>
9245
9246 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9247 manipulation of :loaded-from data.
9248
02fd101b
JB
92492012-04-23 Juanma Barranquero <lekktu@gmail.com>
9250
9251 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9252 now a cons (bug#11311).
9253
888bec30
PE
92542012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9255
89a438bd
PE
9256 Do not create empty overlays with the evaporate property (Bug#9642).
9257 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9258 if it becomes empty after its bounds are adjusted to fit within
9259 its buffer. Without this fix, in a nonempty buffer (let ((o
9260 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9261 yields an empty overlay that has the evaporate property, which is
9262 not supposed to happen.
9263
1068fe4d
PE
9264 Fix minor GTK3 problems found by static checking.
9265 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9266 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9267 (struct _EmacsFixedClass, emacs_fixed_get_type):
9268 Move decls here from emacsgtkfixed.h, since they needn't be public.
9269 (emacs_fixed_get_type): Now static.
9270 (emacs_fixed_class_init): Omit unused local.
9271 (emacs_fixed_child_type): Remove; unused.
9272 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9273 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9274 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9275 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9276 (EMACS_FIXED_GET_CLASS): Remove; unused.
9277 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9278
888bec30
PE
9279 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9280 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9281
de85e130
PE
92822012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9283
d0baac98 9284 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9285 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9286 (__malloc_size_t, __malloc_ptrdiff_t):
9287 Remove. All uses removed, replaced by the definiens if needed,
9288 since we can assume C89 or better now.
9289 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9290 (protect_malloc_state, align, get_contiguous_space)
9291 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9292 (malloc_atfork_handler_child, malloc_enable_thread)
9293 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9294 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9295 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9296 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9297 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9298 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9299 Define using prototypes, not old style.
9300 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9301 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9302 (align): Don't assume that signed integer overflow wraps around.
9303 Omit unused local var.
9304 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9305 (_free_internal_nolock, memalign, mallochook, reallochook):
9306 Omit no-longer-needed casts.
9307 (valloc): Use getpagesize, not __getpagesize.
9308 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9309 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9310
de85e130
PE
9311 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9312
dcbf5805
MA
93132012-04-22 Michael Albinus <michael.albinus@gmx.de>
9314
9315 Move functions from C to Lisp. Make non-blocking method calls
9316 the default. Implement further D-Bus standard interfaces.
9317
9318 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9319 (QCdbus_request_name_allow_replacement)
9320 (QCdbus_request_name_replace_existing)
9321 (QCdbus_request_name_do_not_queue)
9322 (QCdbus_request_name_reply_primary_owner)
9323 (QCdbus_request_name_reply_in_queue)
9324 (QCdbus_request_name_reply_exists)
9325 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9326 (QCdbus_registered_serial, QCdbus_registered_method)
9327 (QCdbus_registered_signal): New Lisp objects.
9328 (XD_DEBUG_MESSAGE): Use sizeof.
9329 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9330 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9331 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9332 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9333 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9334 (xd_signature, xd_append_arg): Allow float for integer types.
9335 (xd_get_connection_references): New function.
b593d6a9
AH
9336 (xd_get_connection_address): Rename from xd_initialize.
9337 Return cached address.
dcbf5805
MA
9338 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9339 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9340 level.
9341 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9342 Return number of refcounts.
dcbf5805
MA
9343 (Fdbus_get_unique_name): Make stronger parameter check.
9344 (Fdbus_message_internal): New defun.
9345 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9346 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9347 (Fdbus_send_signal, Fdbus_register_service)
9348 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9349 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9350 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9351 (Vdbus_compiled_version, Vdbus_runtime_version)
9352 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9353 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9354 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9355 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9356 Adapt docstring.
dcbf5805 9357
52828e02
PE
93582012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9359
da05bc4c
PE
9360 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9361 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9362 Do not assume ptrdiff_t is the same width as 'int'.
9363
52828e02
PE
9364 * alloc.c: Handle unusual debugging option combinations.
9365 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9366 since the two debugging options are incompatible.
9367 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9368 is defined.
9369 (mem_init, mem_insert, mem_insert_fixup):
9370 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9371 (NEED_MEM_INSERT): Remove; no longer needed.
9372
f01769f9
LL
93732012-04-22 Leo Liu <sdl.web@gmail.com>
9374
9375 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9376
5790543d
PE
93772012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9378
9379 * sysdep.c [__FreeBSD__]: Minor cleanups.
9380 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9381 Use Emacs indenting style more consistently. Avoid some casts.
9382 Use 'double' consistently rather than mixing 'float' and 'double'.
9383
b91b7e4d
EW
93842012-04-21 Eduard Wiebe <usenet@pusto.de>
9385
b593d6a9
AH
9386 * sysdep.c (list_system_processes, system_process_attributes):
9387 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9388
6114eb15
AS
93892012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9390
9391 * lisp.mk (lisp): Update.
9392
2f38dff7
PE
93932012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9396 It is never used otherwise.
9397
4ae29f89
SM
93982012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9399
9400 * print.c (print_preprocess): Only check print_depth if print-circle
9401 is nil.
9402 (print_object): Check for cycles even when print-circle is nil and
9403 print-gensym is t, but only check print_depth if print-circle is nil.
9404
f30d612a
CY
94052012-04-20 Chong Yidong <cyd@gnu.org>
9406
9407 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9408 set the status to "failed" and ensure that sentinel is run.
9409
c07a4c0b 94102012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9411
9412 * process.c (Fset_process_inherit_coding_system_flag)
9413 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9414 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9415
c07a4c0b 94162012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9417
9418 * xdisp.c (string_buffer_position_lim): Limit starting position to
9419 BEGV.
9420 (set_cursor_from_row): If called for a mode-line or header-line
9421 row, return zero immediately.
9422 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9423 farther than the first row after the header line, if any.
9424 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9425 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9426
c07a4c0b 94272012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9428
4ae29f89
SM
9429 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9430 (bug#11238).
ad3a2b41 9431
c07a4c0b 94322012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 94332012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9434
9435 configure: new option --enable-gcc-warnings (Bug#11207)
9436 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9437 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9438 (ALL_CFLAGS): Use new macros rather than old.
9439 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9440 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9441 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9442 -Wunused-result, -Wunused-variable. This should go away once
9443 the Emacs and Gnulib regex code is merged.
9444 (xmalloc, xrealloc): Now static.
9445
aba027e8
PE
94462012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 * dired.c (Fsystem_groups): Remove unused local.
9449
e5a36063
GM
94502012-04-17 Glenn Morris <rgm@gnu.org>
9451
9452 * dired.c (Fsystem_users): Doc fix.
9453
316411f0
DA
94542012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9455
9456 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9457 (syms_of_dired): Add them.
9458
9426aba4
PE
94592012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9460
b62a57be
PE
9461 Fix minor alloc.c problems found by static checking.
9462 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9463 New extern decls, to avoid calling undeclared functions.
9464 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9465 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9466 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9467 (NEED_MEM_INSERT): New macro.
9468 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9469 Remove one incorrect comment and fix another.
b62a57be 9470
3539f31f
PE
9471 Fix minor ralloc.c problems found by static checking.
9472 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9473 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9474 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9475 (r_alloc_sbrk): Now static.
9476
a041960a
PE
9477 Improve ralloc.c interface checking.
9478 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9479 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9480 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9481 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9482 [REL_ALLOC]: ... to here, to check interface.
9483 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9484 Remove decls. This fixes an "It stinks!".
9485
9426aba4
PE
9486 * alloc.c (which_symbols): Fix alignment issue / type clash.
9487
d55c12ed
AS
94882012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9489
9490 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9491 (struct Lisp_Misc_Any): Likewise.
9492 (struct Lisp_Free): Likewise.
9493 * alloc.c (union aligned_Lisp_Symbol): Define.
9494 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9495 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9496 (union aligned_Lisp_Misc): Define.
9497 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9498 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9499 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9500
b948ce8b
PE
95012012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9502
9503 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9504 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9505 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9506 * s/netbsd.h, s/sol2-6.h:
9507 Remove definition of GC_MARK_STACK, since the default now works.
9508 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9509 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9510 no longer the default.
9511 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9512
35dc09a1 95132012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9514
35dc09a1
GM
9515 * lread.c (lisp_file_lexically_bound_p):
9516 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9517
35dc09a1
GM
95182012-04-14 Eli Zaretskii <eliz@gnu.org>
9519
9520 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9521 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9522
95232012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9524
9525 * nsterm.m (constrainFrameRect): Always constrain when there is only
9526 one screen (Bug#10962).
9527
bcd86815
KB
95282012-04-13 Ken Brown <kbrown@cornell.edu>
9529
9530 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9531
c25df26e
RT
95322012-04-13 Reuben Thomas <rrt@sc3d.org>
9533
9534 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9535
0fc59f1e
DC
95362012-04-11 Daniel Colascione <dancol@dancol.org>
9537
9538 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9539 against is gone. It's better to use vfork now so that when Cygwin
9540 gains a new, working vfork, we use it automatically (bug#10398).
9541
de8c03dc
SM
95422012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9543
9544 * window.c (save_window_save): Obey window-point-insertion-type.
9545
2f097256
GM
95462012-04-11 Glenn Morris <rgm@gnu.org>
9547
9548 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9549
453b951e
SM
95502012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9551
9552 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9553
75f1671a 95542012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9555
9556 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9557 (force_quit_count): New var.
9558 (handle_interrupt): Use it.
9559
2a8ce227
JB
95602012-04-10 Juanma Barranquero <lekktu@gmail.com>
9561
9562 * w32.c (w32_delayed_load): Record the full path of the library
9563 being loaded (bug#10424).
9564
935396c0
GM
95652012-04-09 Glenn Morris <rgm@gnu.org>
9566
05920a43
GM
9567 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9568 not just in the obarray, before snarfing them. (Bug#11036)
9569
935396c0
GM
9570 * Makefile.in ($(leimdir)/leim-list.el):
9571 Pass EMACS rather than BUILT_EMACS.
9572
a18ecafa
TZ
95732012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9574
9575 * process.c (make_process):
9576 * process.h: Add integer `gnutls_handshakes_tried' member to
9577 process struct.
9578
6bbef4e5
JC
9579 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9580 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9581
9582 * gnutls.c (gnutls_log_function2i): Convenience log function.
9583 (emacs_gnutls_read): Use new log functions,
9584 `gnutls_handshakes_tried' process member, and
9585 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9586 attempts per process (connection).
9587
b4d3bc10
CY
95882012-04-09 Chong Yidong <cyd@gnu.org>
9589
9590 * eval.c (Fuser_variable_p, user_variable_p_eh)
9591 (lisp_indirect_variable): Functions deleted.
9592 (Fdefvar): Caller changed.
9593
9594 * callint.c (Finteractive, Fcall_interactively):
9595 * minibuf.c (Fread_variable): Callers changed.
9596
70f4d973
EZ
95972012-04-09 Eli Zaretskii <eliz@gnu.org>
9598
9599 * xdisp.c (set_cursor_from_row): If the display string appears in
9600 the buffer at position that is closer to point than the position
9601 after the display string, display the cursor on the first glyph of
9602 the display string. Fixes cursor display when a 'display' text
9603 property immediately follows invisible text. (Bug#11094)
9604
cb3c2e3e
PE
96052012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 composite.c: use 'double' consistently
9608 * composite.c (get_composition_id): Use 'double' consistently
9609 instead of converting 'float' to 'double' and vice versa; this is
9610 easier to understand and avoids a GCC warning.
9611
fd06db5d
GM
96122012-04-09 Glenn Morris <rgm@gnu.org>
9613
50fe702a
GM
9614 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9615 preparation for dumping it with emacs. (Bug#4789)
9616 (leimdir): New variable.
9617 ($(leimdir)/leim-list.el): New rule.
9618 (emacs$(EXEEXT)): Depend on leim-list.el.
9619
fd06db5d
GM
9620 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9621 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9622 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9623
55c131ee
AS
96242012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9625
9626 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9627 proper alignment.
9628
9209588f
JB
96292012-04-07 Juanma Barranquero <lekktu@gmail.com>
9630
9631 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9632 Remove unused local variable.
9633
e3fb2efb
PE
96342012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9637 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9638 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9639 objects, as mark_maybe_pointer will catch them otherwise.
9640 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9641 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9642
b5385551
PE
96432012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9644
9645 Fix typo that broke non-Windows builds.
9646 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9647
9078ead6
EZ
96482012-04-07 Eli Zaretskii <eliz@gnu.org>
9649
9650 Support building on MS-Windows with libxml2.
9651
9652 * makefile.w32-in (OBJ2): Add xml.$(O).
9653 (GLOBAL_SOURCES): Add xml.c.
9654 ($(BLD)/xml.$(O)): New dependency list.
9655
9656 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9657 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9658 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9659 [!WINDOWSNT]: New macros.
9660 (init_libxml2_functions, libxml2_loaded_p): New functions.
9661 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9662 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9663 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9664 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9665 linked in).
6bbef4e5
JC
9666 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9667 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9668 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9669
9670 * emacs.c: Don't include libxml/parser.h.
9671 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9672 xmlCleanupParser directly.
9673
9674 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9675
3811fdf3
EZ
96762012-04-07 Eli Zaretskii <eliz@gnu.org>
9677
9678 * indent.c (Fvertical_motion): If there is a display string at
9679 point, use it.vpos to compute how many lines to backtrack after
9680 move_it_to point. (Bug#11133)
9681
2f8e16b2
EZ
96822012-04-06 Eli Zaretskii <eliz@gnu.org>
9683
9684 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9685 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9686 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9687 macros related to unification of CJK characters. For the details,
9688 see the discussion following the message here:
9689 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9690
3d439cd1
CY
96912012-04-04 Chong Yidong <cyd@gnu.org>
9692
9693 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9694
8bc53d00
EZ
96952012-04-01 Eli Zaretskii <eliz@gnu.org>
9696
9697 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9698 instead of alloca. (Bug#11138)
9699
3b0512a3
AS
97002012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9701
9702 * w32menu.c (is_simple_dialog): Properly check lisp types.
9703 (Bug#11141)
9704
8427ddd2
EZ
97052012-03-31 Eli Zaretskii <eliz@gnu.org>
9706
979022ef
EZ
9707 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9708 position we get to after a call to move_it_to fails the
9709 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9710 only if we wind up in a string from display property. (Bug#11063)
9711
a6b1c7cc
EZ
9712 * window.c (Fdelete_other_windows_internal): Invalidate the row
9713 and column information about mouse highlight, so that redisplay
9714 restores it after reallocating the glyph matrices. (Bug#7464)
9715
8427ddd2
EZ
9716 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9717 string comes from a `display' text property, use the buffer
9718 position of that property as if we actually saw that position in
9719 the row's glyphs.
697ba24b
EZ
9720 (move_it_by_lines): Remove the assertion that
9721 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9722 violated when there's a before-string at the beginning of a line.
9723 (Bug#11063)
8427ddd2 9724
65a0a738
EZ
97252012-03-30 Eli Zaretskii <eliz@gnu.org>
9726
9727 * xdisp.c (append_space_for_newline): If the default face was
9728 remapped, use the remapped face for the appended newline.
9729 (extend_face_to_end_of_line): Use the remapped default face for
9730 extending the face to the end of the line.
9731 (display_line): Call extend_face_to_end_of_line when the default
9732 face was remapped. (Bug#11068)
9733
581355cc
EZ
97342012-03-29 Eli Zaretskii <eliz@gnu.org>
9735
9736 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9737
e8fc049f
SM
97382012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9739
9740 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9741
4fb9a543
GM
97422012-03-27 Glenn Morris <rgm@gnu.org>
9743
9744 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9745 Doc fixes.
9746
679910f1
KH
97472012-03-26 Kenichi Handa <handa@m17n.org>
9748
9749 * dispextern.h (struct glyph): Fix previous change. Change the
9750 bit length of glyphless.ch to 25 (Bug#11082).
9751
90d49b7f
CY
97522012-03-26 Chong Yidong <cyd@gnu.org>
9753
9754 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9755 (command_loop_1): Use it; inhibit selection update for
9756 handle-select-window too (Bug#8996).
9757
f514f6f0
FP
97582012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9759
e8fc049f 9760 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9761
bf43fa51
KH
97622012-03-25 Kenichi Handa <handa@m17n.org>
9763
9764 * dispextern.h (struct glyph): Change the bit length of
9765 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9766
8a0c01dd
EZ
97672012-03-24 Eli Zaretskii <eliz@gnu.org>
9768
9769 * s/ms-w32.h (tzname): Include time.h before redirecting to
9770 _tzname. Fixes the MSVC build. (Bug#9960)
9771
7d1c3a76
AS
97722012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9773
8ed79523
AS
9774 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9775 characters.
9776
7d1c3a76
AS
9777 * xterm.c (XTread_socket): Only modify handling_signal if
9778 !SYNC_INPUT. (Bug#11080)
9779
e99a9b8b
EZ
97802012-03-23 Eli Zaretskii <eliz@gnu.org>
9781
9782 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9783 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9784 when fetching a multibyte character consumes more bytes than
9785 CHAR_BYTES returns, due to unification of CJK characters in
9786 string_char. (Bug#11073)
9787
5063c0e1
TN
97882012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9789
9790 * process.c (wait_reading_process_output): Handle pty disconnect
9791 by refraining from sending oneself a SIGCHLD (bug#10933).
9792
9f851fbd
CY
97932012-03-22 Chong Yidong <cyd@gnu.org>
9794
9795 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9796
5063c0e1 9797 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9798 Mark string as coming from a prefix property.
9799 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9800 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9801
fb5b8aca
CY
98022012-03-21 Chong Yidong <cyd@gnu.org>
9803
9804 * xfaces.c (Vface_remapping_alist): Doc fix.
9805
62356a1b
EZ
98062012-03-20 Eli Zaretskii <eliz@gnu.org>
9807
9808 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9809 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9810 Doc fixes.
62356a1b 9811
025de85b
CY
98122012-03-20 Chong Yidong <cyd@gnu.org>
9813
9814 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9815 to reflect default non-nil value of redisplay-dont-pause.
9816
4827f94e
KH
98172012-03-19 Kenichi Handa <handa@m17n.org>
9818
9819 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9820 it fit in a valid range (Bug#11003).
9821
e50a24a2
EZ
98222012-03-18 Eli Zaretskii <eliz@gnu.org>
9823
9824 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9825 that is not from display property, accept the row as a "cursor
9826 row" if one of the string's character has a non-nil `cursor'
9827 property. Fixes cursor positioning when there are newlines in
9828 overlay strings, e.g. in icomplete.el. (Bug#11035)
9829
9af5ed87
PE
98302012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9831
9832 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9833
d1f55f16
CY
98342012-03-12 Chong Yidong <cyd@gnu.org>
9835
9836 * eval.c (inhibit_lisp_code): Rename from
9837 inhibit_window_configuration_change_hook; move from window.c.
9838
9839 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9840 * window.c (run_window_configuration_change_hook)
9841 (syms_of_window): Callers changed.
9842
66c5eebd
CY
98432012-03-11 Chong Yidong <cyd@gnu.org>
9844
413df973
CY
9845 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9846
66c5eebd
CY
9847 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9848
1de11f56
CY
98492012-03-10 Chong Yidong <cyd@gnu.org>
9850
9851 * frame.c (other_visible_frames): Don't assume the selected frame
9852 is visible (Bug#10955).
9853
cae07000
SM
98542012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9855
9856 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9857
89c94350
JD
98582012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9859
9860 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9861 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9862 zero (Bug#10954).
9863
999dd333
GM
98642012-03-03 Glenn Morris <rgm@gnu.org>
9865
01a6dcc8 9866 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9867
de0100f2
EZ
98682012-03-02 Eli Zaretskii <eliz@gnu.org>
9869
9870 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9871 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9872 (redisplay_window, next_element_from_string): Fix typos in
9873 comments.
3e441275
EZ
9874 (redisplay_window): Pass to move_it_vertically the margin in
9875 pixels, not in screen lines.
de0100f2 9876
96a72ee9
GM
98772012-03-02 Glenn Morris <rgm@gnu.org>
9878
9879 * buffer.c (buffer-list-update-hook): Doc fix.
9880
312508d7
EZ
98812012-02-29 Eli Zaretskii <eliz@gnu.org>
9882
9883 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9884 push_it before setting up the iterator for the first overlay
9885 string, even if we have an empty string loaded.
9886 (next_overlay_string): If there's an empty string on the iterator
9887 stack, pop the stack. (Bug#10903)
9888
27f3c637
PE
98892012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9892 Suggested by Stefan Monnier in
9893 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9894 * alloc.c (widen_to_Lisp_Object): New static function.
9895 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9896 and widening them to Lisp_Objects. This would work even if
9897 USE_LSB_TAG is defined and wide integers are used, which might
9898 happen in a future version of Emacs.
9899
3c9dfce6
CY
99002012-02-25 Chong Yidong <cyd@gnu.org>
9901
fa74b241
CY
9902 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9903 Doc fix.
9904
3c9dfce6
CY
9905 * xselect.c (Fx_selection_exists_p): Doc fix.
9906 (x_clipboard_manager_save_all): Print an informative message
9907 before saving to clipboard manager.
9908
9486df08
CY
99092012-02-24 Chong Yidong <cyd@gnu.org>
9910
9911 * keyboard.c (process_special_events): Handle all X selection
9912 requests in kbd_buffer, not just the next one (Bug#8869).
9913
f01d3321
CY
99142012-02-23 Chong Yidong <cyd@gnu.org>
9915
9916 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9917 call when setting menu-bar-lines and tool-bar-lines parameters.
9918 (unwind_create_frame_1): New helper function.
9919
9920 * window.c (inhibit_window_configuration_change_hook): New var.
9921 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9922 (syms_of_window): Initialize it.
f01d3321 9923
86b847b6
CY
99242012-02-22 Chong Yidong <cyd@gnu.org>
9925
9926 * xterm.c (x_draw_image_relief): Add missing type check for
9927 Vtool_bar_button_margin (Bug#10743).
9928
a59225b1
CY
99292012-02-21 Chong Yidong <cyd@gnu.org>
9930
9931 * fileio.c (Vfile_name_handler_alist): Doc fix.
9932
9933 * buffer.c (Fget_file_buffer): Protect against invalid file
9934 handler return value.
9935
310f5bd4
PE
99362012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9937
cb3a28cc
PE
9938 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9939 when computing $valmask.
9940
310f5bd4
PE
9941 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9942 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9943 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9944 It's useless in that case, and it can cause problems on hosts
9945 that allocate halves of EMACS_INT values separately.
9946 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9947 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9948 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9949 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9950 it avoids undefined behavior on hosts where shifting right by more
9951 than the word width has undefined behavior.
9952
2375c96a
CY
99532012-02-19 Chong Yidong <cyd@gnu.org>
9954
9955 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9956 (Funhandled_file_name_directory, Ffile_name_as_directory)
9957 (Fdirectory_file_name, Fexpand_file_name)
9958 (Fsubstitute_in_file_name): Protect against invalid file handler
9959 return values (Bug#10845).
9960
3eb49e71
EZ
99612012-02-18 Eli Zaretskii <eliz@gnu.org>
9962
9963 * .gdbinit (pitx): Fix incorrect references to fields of the
9964 iterator stack.
9965
7b926f3f
CY
99662012-02-17 Chong Yidong <cyd@gnu.org>
9967
9968 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9969
11273115
PE
99702012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9971
9972 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9973 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9974
c3a70e2b
CY
99752012-02-15 Chong Yidong <cyd@gnu.org>
9976
9977 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9978 marked as special. Also, starting docstrings with * is obsolete.
9979
0ca43699
AS
99802012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9981
9982 * gnutls.c (emacs_gnutls_write): Fix last change.
9983
2e8f3c56
LI
99842012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9985
9986 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9987 send_process.
9988
af70074f
SM
99892012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9990
9991 * keymap.c (Fsingle_key_description): Handle char ranges.
9992
95986d52
CY
99932012-02-12 Chong Yidong <cyd@gnu.org>
9994
afd83bd1
CY
9995 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9996 as that creates a dangerous corner case.
9997
95986d52
CY
9998 * window.c (Fdelete_window_internal): Invalidate the mouse
9999 highlight (Bug#9904).
10000
bd7da63e
GM
100012012-02-12 Glenn Morris <rgm@gnu.org>
10002
10003 * xselect.c (Fx_own_selection_internal)
10004 (Fx_get_selection_internal, Fx_disown_selection_internal)
10005 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10006 * nsselect.m (Fx_own_selection_internal)
10007 (Fx_disown_selection_internal, Fx_selection_exists_p)
10008 (Fx_selection_owner_p, Fx_get_selection_internal):
10009 Sync docs and argument specs with the xselect.c versions.
10010
77abcbc2
LI
100112012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10012
10013 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10014
90b671e2
EZ
100152012-02-11 Eli Zaretskii <eliz@gnu.org>
10016
1c0ca0b7
EZ
10017 * w32select.c (Fx_selection_exists_p): Sync doc string and
10018 argument list with xselect.c. (Bug#10783)
10019
10020 * w16select.c (Fx_selection_exists_p): Sync doc string and
10021 argument list with xselect.c. (Bug#10783)
90b671e2 10022
49241268
GM
100232012-02-10 Glenn Morris <rgm@gnu.org>
10024
10025 * fns.c (Fsecure_hash): Doc fix.
10026
f998bbe7 100272012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
10028
10029 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10030
0992bd9c
CY
100312012-02-07 Chong Yidong <cyd@gnu.org>
10032
10033 * buffer.c (Fbuffer_local_variables)
10034 (buffer_lisp_local_variables): Handle unbound vars correctly;
10035 don't let Qunbound leak into Lisp.
10036
af008560
GM
100372012-02-07 Glenn Morris <rgm@gnu.org>
10038
dd605cc4
GM
10039 * image.c (Fimagemagick_types): Doc fix.
10040
af008560
GM
10041 * image.c (imagemagick-render-type): Change it from a lisp object
10042 to an integer. Move the doc here from the lisp manual.
10043 Treat all values not equal to 0 the same.
10044
1449fa1d
CY
100452012-02-06 Chong Yidong <cyd@gnu.org>
10046
10047 * doc.c (store_function_docstring): Avoid applying docstring of
10048 alias to base function (Bug#2603).
10049
3723ec07
AS
100502012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10051
10052 * .gdbinit (pp1, pv1): Remove redundant defines.
10053 (pr): Use pp.
10054
79c1cc1e
CY
100552012-02-04 Chong Yidong <cyd@gnu.org>
10056
10057 * nsterm.m: Declare a global (Bug#10694).
10058
d7f29f8e
EZ
100592012-02-04 Eli Zaretskii <eliz@gnu.org>
10060
cae07000
SM
10061 * w32.c (get_emacs_configuration_options):
10062 Include --enable-checking, if specified, in the return value.
d7f29f8e 10063
3b95a6f9
MR
100642012-02-04 Martin Rudalics <rudalics@gmx.at>
10065
10066 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10067 after rounding frame sizes. (Bug#9723)
10068
d6fa96a6
EZ
100692012-02-04 Eli Zaretskii <eliz@gnu.org>
10070
10071 * keyboard.c (adjust_point_for_property): Don't position point
10072 before BEGV. (Bug#10696)
10073
df0b2940
PE
100742012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10075
10076 Handle overflow when computing char display width (Bug#9496).
10077 * character.c (char_width): Return EMACS_INT, not int.
10078 (char_width, c_string_width): Check for overflow when
10079 computing the width; this is possible now that individual
10080 characters can have unbounded width. Problem introduced
10081 by merge from Emacs 23 on 2012-01-19.
10082
6bee44d6
MA
100832012-02-02 Michael Albinus <michael.albinus@gmx.de>
10084
10085 * dbusbind.c (Fdbus_register_method): Mention the return value
10086 :ignore in the docstring.
10087
44f92739
GM
100882012-02-02 Glenn Morris <rgm@gnu.org>
10089
1b9f60cc
GM
10090 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10091
44f92739
GM
10092 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10093 Unconditionally set to t. (Bug#10673)
10094 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10095 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10096 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10097
c5d3843c
KH
100982012-02-02 Kenichi Handa <handa@m17n.org>
10099
10100 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10101 0, do not call append_composite_glyph.
10102
159462d4 101032012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
10104
10105 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10106 NULL (Bug#6988).
10107 (x_produce_glyphs): If the component of a composition is a null
10108 string, set it->pixel_width to 1 to avoid zero-width glyph.
10109
78cef877
EZ
101102012-02-01 Eli Zaretskii <eliz@gnu.org>
10111
10112 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10113 first 2 arguments are identical. This makes inserting large
10114 output from a subprocess an order of magnitude faster on
10115 MS-Windows, where all sbrk'ed memory is always contiguous.
10116
97897668
GM
101172012-01-31 Glenn Morris <rgm@gnu.org>
10118
10119 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 10120 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
10121 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10122
31fd3586
GM
101232012-01-29 Glenn Morris <rgm@gnu.org>
10124
10125 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10126
0e24a8b2
CY
101272012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10128
10129 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10130
cc0adcb0
CY
101312012-01-28 Chong Yidong <cyd@gnu.org>
10132
10133 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10134
acc28cb9
CY
101352012-01-26 Chong Yidong <cyd@gnu.org>
10136
9c69cfb7
CY
10137 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10138
acc28cb9
CY
10139 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10140 repeat counts (Bug#10507).
10141
48da7392
GM
101422012-01-26 Glenn Morris <rgm@gnu.org>
10143
10144 * lread.c (syms_of_lread): Doc fix.
10145
14af5f7f
CY
101462012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10147
10148 * coding.c (encode_designation_at_bol): Change return value to
10149 EMACS_INT.
10150
0b21c100
CY
101512012-01-25 Chong Yidong <cyd@gnu.org>
10152
10153 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10154
3c2907f7
CY
101552012-01-21 Chong Yidong <cyd@gnu.org>
10156
10157 * floatfns.c (Fcopysign): Make the second argument non-optional,
10158 since nil is not allowed anyway.
10159
959ad23f
AS
101602012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10161
10162 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10163 (send_process): Likewise.
10164
34a02f46
MR
101652012-01-19 Martin Rudalics <rudalics@gmx.at>
10166
10167 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
10168 (Vwindow_persistent_parameters): Do not use Qstate.
10169 Rewrite doc-strings.
34a02f46 10170
1259009a 101712012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
10172
10173 * character.c (char_width): New function.
70d4fdf6
GM
10174 (Fchar_width, c_string_width, lisp_string_width):
10175 Use char_width (Bug#9496).
25ed9e61 10176
6a6ee00d
MR
101772012-01-16 Martin Rudalics <rudalics@gmx.at>
10178
10179 * window.c (Vwindow_persistent_parameters): New variable.
10180 (Fset_window_configuration, save_window_save): Handle persistent
10181 window parameters.
10182
c85efaf7
EZ
101832012-01-14 Eli Zaretskii <eliz@gnu.org>
10184
10185 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10186 thrashing the stack of the thread. (Bug#9087)
10187
5944709e
PE
101882012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10189
10190 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10191
e71f5d99
EZ
101922012-01-11 Eli Zaretskii <eliz@gnu.org>
10193
10194 * xdisp.c (rows_from_pos_range): Handle the case where the
10195 highlight ends on a newline. (Bug#10464)
10196 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10197 he end column for display of highlight that ends on a newline
10198 before a R2L line.
10199
ce316182
GM
102002012-01-11 Glenn Morris <rgm@gnu.org>
10201
10202 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10203 from load-path also when installation-directory is nil. (Bug#10208)
10204
5b43da69
GM
102052012-01-10 Glenn Morris <rgm@gnu.org>
10206
74cc8ff9
GM
10207 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10208
7d8d6e4e
GM
10209 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10210 Update template values to be closer to their typical values these days.
5b43da69 10211
a0db8d43
EZ
102122012-01-09 Eli Zaretskii <eliz@gnu.org>
10213
10214 * xdisp.c (rows_from_pos_range): Accept additional argument
10215 DISP_STRING, and accept any glyph in a row whose object is that
10216 string as eligible for mouse highlight. Fixes mouse highlight of
10217 display strings from overlays. (Bug#10464)
10218
9a0115ab 102192012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 10220
b9110d6a 10221 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
10222 * fileio.c (auto_saving_dir_umask): New static var.
10223 (Fmake_directory_internal): Use it.
10224 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10225 creating the directory. The old code temporarily assigns
10226 too-generous permissions to the directory.
10227 (do_auto_save_eh): Clear it.
b9110d6a 10228 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
10229 that the var is always cleared.
10230
6c1bd3f3
EZ
102312012-01-07 Eli Zaretskii <eliz@gnu.org>
10232
10233 * search.c (scan_buffer): Pass character positions to
10234 know_region_cache, not byte positions. (Bug#6540)
10235
069d2b50
L
102362012-01-07 LynX <_LynX@bk.ru> (tiny change)
10237
10238 * w32.c (sys_rename): Report EXDEV when rename of a directory
10239 fails because the target is on another logical disk. (Bug#10284)
10240
75bf0d33
DB
102412012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10242
10243 * xterm.c (x_embed_request_focus): New function.
10244
10245 * xterm.h: Add prototype.
10246
10247 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10248
1c6e5a32
GM
102492012-01-05 Glenn Morris <rgm@gnu.org>
10250
10251 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10252
651e947e
EZ
102532012-01-01 Eli Zaretskii <eliz@gnu.org>
10254
10255 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10256 Load gnutls_transport_set_lowat only if GnuTLS version is below
10257 2.11.1.
10258 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10259 GnuTLS versions below 2.11.1.
10260
3778cdd8
AL
102612011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10262
10263 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10264 to the doc string advising against its use for altering the way
10265 windows are scrolled.
10266
0e5317f7
KH
102672011-12-28 Kenichi Handa <handa@m17n.org>
10268
10269 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10270 coding-system ASCII compatible only when it does not produce BOM
10271 on encoding (Bug#10383).
10272
93d5ca1f
JD
102732011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10274
10275 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10276 can scroll.
10277 (create_and_show_popup_menu): Always use menu_position_func for
10278 Gtk3 (Bug#10361).
10279
ca22b785
AS
102802011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10281
10282 * callint.c (Fcall_interactively): Don't truncate prompt string.
10283
d048e1e6
EZ
102842011-12-23 Eli Zaretskii <eliz@gnu.org>
10285
10286 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10287 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10288 resumed from there (after widening). (Bug#10360)
d048e1e6 10289
5ccaba1f
JD
102902011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10291
10292 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10293
204ee57f
JD
102942011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10295
b81d40f0
JB
10296 * nsterm.m (x_free_frame_resources):
10297 Release f->output_data.ns->miniimage.
204ee57f
JD
10298 (ns_index_color): Fix indentation. Do not retain
10299 color_table->colors[i].
10300
10301 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10302 before returning.
10303
10304 * nsfns.m (x_set_background_color): Assign return value from
10305 ns_index_color to face-background instead of NSColor*.
10306 (ns_implicitly_set_icon_type): Fix indentation.
10307 Change assignment in for loop to comparison.
10308
10309 * emacs.c (ns_pool): New variable.
10310 (main): Assign ns_pool.
10311 (Fkill_emacs): Call ns_release_autorelease_pool.
10312
10313 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10314 autorelease fdesc, release fdAttrs and tdict.
10315 (ns_get_covering_families): Release charset.
10316 (ns_findfonts): Release NSFontDescriptor created with new.
10317 (ns_uni_to_glyphs): Fix indentation.
10318 (setString): Release attrStr before assigning new value.
10319
c803b2b7
JD
103202011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10321
678f4426
JD
10322 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10323 and NS_IMPL_COCOA.
10324 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10325 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10326
cd394be1 103272011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10328
5fecd5fc
JD
10329 * nsterm.m (ns_term_init): Subscribe for notifications
10330 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10331 to method trackingNotification in EmacsMenu.
10332
10333 * nsmenu.m (trackingMenu): New variable.
3771cb17 10334 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10335 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10336 from Aquamacs (Bug#7030).
678f4426
JD
10337
103382011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10339
c803b2b7
JD
10340 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10341 (symbol_to_nsstring): Fix indentation.
10342 (ns_symbol_to_pb): New function.
cae07000
SM
10343 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10344 (Fns_rotate_cut_buffers_internal): Remove.
10345 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10346 Fns_store_cut_buffer_internal.
10347 (ns_get_foreign_selection, Fx_own_selection_internal)
10348 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10349 (Fns_get_selection_internal, Fns_store_selection_internal):
10350 Use ns_symbol_to_pb and check if return value is nil.
10351 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10352 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10353 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10354 renamed to Sns_store_selection_internal.
10355 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10356 and remove this function.
10357 (ns_handle_selection_clear): Remove, never used.
10358 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10359 here.
10360
e1b01a3a
KB
103612011-12-17 Ken Brown <kbrown@cornell.edu>
10362
10363 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10364 GID is unknown (Bug#10257).
10365
2adb6e85
PE
103662011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10367
10368 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10369 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10370 which caused a build failure on GNU/Linux IA-64. This problem was
10371 introduced by my 2011-10-07 patch.
10372
d1d7b339
JL
103732011-12-15 Juri Linkov <juri@jurta.org>
10374
10375 * image.c (imagemagick_error): New function. (Bug#10112)
10376 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10377 Use `imagemagick_error' where ImageMagick functions return
10378 `MagickFalse'.
10379 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10380 proper order.
10381
100d5755
KH
103822011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10383
10384 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10385 fill background (Bug#8992).
10386
454592a6
MR
103872011-12-13 Martin Rudalics <rudalics@gmx.at>
10388
10389 * window.c (Vwindow_combination_resize)
10390 (Vwindow_combination_limit): Use t instead of non-nil in
10391 doc-strings.
61d4b438
MR
10392 (Vrecenter_redisplay): Add first sentence of doc-string on
10393 separate line.
53524d93 10394 (Frecenter): Fix doc-string typo.
454592a6 10395
3633e3aa
KH
103962011-12-11 Kenichi Handa <handa@m17n.org>
10397
10398 * coding.c (Funencodable_char_position): Pay attention to the
10399 buffer text relocation (Bug#9389).
10400
7b9d523a 104012011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10402
7b9d523a
JD
10403 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10404 gtk_init (Bug#10100).
10405
b73189c6
EZ
104062011-12-10 Eli Zaretskii <eliz@gnu.org>
10407
10408 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10409 IT->string is nil. (Bug#10263)
10410
f7dfe5d6
JD
104112011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10412
83faebb4
JD
10413 * nsterm.h (x_free_frame_resources): Declare.
10414
f7dfe5d6
JD
10415 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10416 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10417
10418 * nsterm.h (ns_get_defaults_value): Declare.
10419
10420 * nsterm.m (ns_default): Call ns_get_defaults_value.
10421
7cd4e72c
EZ
104222011-12-09 Eli Zaretskii <eliz@gnu.org>
10423
10424 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10425 (Bug#10170)
10426
b34d7317
YM
104272011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10428
10429 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10430 that where the value of an _OBJC_* symbol points to is in the .bss
10431 section (Bug#10240).
10432
76470ad1
KH
104332011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10434
10435 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10436 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10437
745fff94
KH
104382011-12-08 Kenichi Handa <handa@m17n.org>
10439
10440 * ftfont.c (get_adstyle_property): Fix previous change
10441 (Bug#10233).
10442
6e44397c
JB
104432011-12-07 Juanma Barranquero <lekktu@gmail.com>
10444
10445 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10446 dirs from the default value of EMACSLOADPATH (bug#10208).
10447
7efa6272
GM
104482011-12-07 Glenn Morris <rgm@gnu.org>
10449
10450 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10451 installation and source directories as well. (Bug#10208)
10452
f6fc4d87
CY
104532011-12-06 Chong Yidong <cyd@gnu.org>
10454
10455 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10456
2bf26180
GM
104572011-12-06 Glenn Morris <rgm@gnu.org>
10458
10459 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10460 as an error, not just -1. (Bug#10217)
10461
3a6ad4f0
CY
104622011-12-05 Chong Yidong <cyd@gnu.org>
10463
10464 * keyboard.c (process_special_events): New function.
10465 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10466
75a3b399
PE
104672011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 * coding.c (encode_designation_at_bol): Don't use uninitialized
10470 local variable (Bug#9318).
10471
c3c9e25e
KH
104722011-12-05 Kenichi Handa <handa@m17n.org>
10473
10474 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10475 return Qnil (Bug#8046, Bug#10193).
10476
5eb05ea3
KH
104772011-12-05 Kenichi Handa <handa@m17n.org>
10478
10479 * coding.c (encode_designation_at_bol): New args charbuf_end and
10480 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10481 (coding_set_source): Return how many bytes coding->source was
10482 relocated.
10483 (coding_set_destination): Return how many bytes
10484 coding->destination was relocated.
10485 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10486 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10487
104882011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10489
10490 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10491 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10492 macro (Bug#9318).
10493
104942011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10495
10496 The following changes are to fix Bug#9318.
10497
a79703f5 10498 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10499 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10500 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10501 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10502
7dbda6df
JB
105032011-12-05 Juanma Barranquero <lekktu@gmail.com>
10504
10505 * lisp.h (process_quit_flag): Fix external declaration.
10506
6d5eb5b0
SM
105072011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10508
10509 Don't macro-inline non-performance-critical code.
10510 * eval.c (process_quit_flag): New function.
10511 * lisp.h (QUIT): Use it.
10512
a0c3fad0
JD
105132011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10514
10515 * nsfns.m (get_geometry_from_preferences): New function.
10516 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10517
6c07aac2
AS
105182011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10519
10520 * emacs.c (Qkill_emacs): Define.
10521 (syms_of_emacs): Initialize it.
10522 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10523 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10524 (quit_throw_to_read_char): Add parameter `from_signal'.
10525 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10526 * lisp.h (QUIT): Call Fkill_emacs if requested.
10527
c052ead4
JD
105282011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10529
10530 * widget.c (update_wm_hints): Return if wmshell is null.
10531 (widget_update_wm_size_hints): New function.
10532
10533 * widget.h (widget_update_wm_size_hints): Declare.
10534
10535 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10536 widget_update_wm_size_hints (Bug#10104).
10537
9e49252b
EZ
105382011-12-03 Eli Zaretskii <eliz@gnu.org>
10539
10540 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10541 before a newline, prepare the bidi iterator for consuming the
10542 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10543 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10544
02b16839
JL
105452011-12-02 Juri Linkov <juri@jurta.org>
10546
10547 * search.c (Fword_search_regexp): New Lisp function created from
10548 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10549 (Fword_search_backward, Fword_search_forward)
10550 (Fword_search_backward_lax, Fword_search_forward_lax):
10551 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10552 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10553
0068070e
SM
105542011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10555
10556 * fileio.c (Finsert_file_contents): Move after-change-function call
10557 to before the "handled:" label, since all "goto handled" appear in
10558 cases where the *-change-functions have already been properly called
10559 (bug#10117).
10560
3360a3fc
AS
105612011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10562
10563 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10564 waiting for input. (Bug#10169)
10565
73d6c093
EZ
105662011-11-30 Eli Zaretskii <eliz@gnu.org>
10567
10568 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10569 verifies glyph row's hash code--we have just reallocated the
10570 glyphs, so their contents can be complete garbage. (Bug#10164)
10571
febe6bea
JB
105722011-11-30 Juanma Barranquero <lekktu@gmail.com>
10573
10574 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10575
801a4313
EZ
105762011-11-30 Eli Zaretskii <eliz@gnu.org>
10577
10578 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10579 attributes are tested _before_ calling verify_row_hash, to protect
10580 against GCC re-ordering of the tests. (Bug#10164)
10581
2b56b87e
JD
105822011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10583
10584 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10585
10586 * xterm.c (handle_one_xevent): Only set async_visible and friends
10587 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10588 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10589 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10590
dbf31225
PE
105912011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10592
10593 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10594 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10595 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10596 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10597 All uses changed to use GCPRO1 etc.
10598 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10599 Revert to old implementation (i.e., before 2011-03-11).
10600
1305621b
YM
106012011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10602
10603 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10604 of scroll runs so as to avoid assigning disabled bogus rows and
10605 unnecessary graphics copy operations.
10606
8c9afb46
EZ
106072011-11-27 Eli Zaretskii <eliz@gnu.org>
10608
10609 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10610 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10611 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10612 (malloc, free, realloc, calloc): Redirect to e_* only when
10613 compiling Emacs.
10614
10615 * lisp.h (GCTYPEBITS): Move before first use.
10616 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10617 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10618 this macro definition.
10619
10620 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10621 _MSC_VER.
10622
54e9e3bf
JD
106232011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10624
6d5eb5b0
SM
10625 * gtkutil.c (xg_create_frame_widgets):
10626 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10627 present with Gtk+ 2.0.
10628
83aca1cb
PE
106292011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10630
10631 * fileio.c (Finsert_file_contents): Undo previous change; see
10632 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10633
5b76caa4
PE
106342011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 Rename locals to avoid shadowing.
10637 * fileio.c (Finsert_file_contents):
10638 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10639 * process.c (wait_reading_process_output):
10640 Rename inner 'proc' to 'p' to avoid shadowing.
10641 Indent for consistency with usual Emacs style.
10642
8c535114
EZ
106432011-11-25 Eli Zaretskii <eliz@gnu.org>
10644
10645 * xdisp.c (redisplay_window): If cursor row is not fully visible
10646 after recentering, and scroll-conservatively is set to a large
10647 number, scroll window by a few more lines to make the cursor fully
10648 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10649 (start_display): Don't move to the next line if the display should
10650 start at a newline that is part of a display vector or an overlay
10651 string. (Bug#10119)
8c535114 10652
fa4fdb5c
JL
106532011-11-24 Juri Linkov <juri@jurta.org>
10654
10655 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10656 after the `MagickPingImage' call. (Bug#10112)
10657
90ec88df
CY
106582011-11-23 Chong Yidong <cyd@gnu.org>
10659
10660 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10661
56e2e794
MR
106622011-11-23 Martin Rudalics <rudalics@gmx.at>
10663
10664 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10665 making another buffer current. (Bug#10114)
10666
b6e64c41
GM
106672011-11-23 Glenn Morris <rgm@gnu.org>
10668
10669 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10670
6b21de18
CY
106712011-11-23 Chong Yidong <cyd@gnu.org>
10672
10673 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10674 using it (Bug#5984).
10675
b12cd789
EZ
106762011-11-22 Eli Zaretskii <eliz@gnu.org>
10677
10678 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10679 and header-lines, as they don't have one computed for them.
10680 (Bug#10098)
10681
10682 * .gdbinit (prow): Make displayed values more self-explaining.
10683 Add row's hash code.
10684
261b6fd4
LMI
106852011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10686
10687 * process.c (wait_reading_process_output): Fix asynchrounous
10688 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10689 (wait_reading_process_output): Add comment and URL.
261b6fd4 10690
e7cfd277
JD
106912011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10692
10693 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10694
a9b9b7f5
CY
106952011-11-21 Chong Yidong <cyd@gnu.org>
10696
10697 * window.c (Fnext_window, Fprevious_window): Doc fix.
10698
b0d15b4f
SM
106992011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10700
10701 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10702
fe7a3057
JB
107032011-11-20 Juanma Barranquero <lekktu@gmail.com>
10704
10705 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10706
d2999b1a
MR
107072011-11-20 Martin Rudalics <rudalics@gmx.at>
10708
10709 * window.c (Fset_window_combination_limit): Rename argument
10710 STATUS to LIMIT.
10711 (Vwindow_combination_limit): Remove "status" from doc-string.
10712
d5ff9cd0
AS
107132011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10714
10715 * m/ibms390.h: Remove.
10716 * m/ibms390x.h: Don't include "ibms390.h".
10717
a5bb9bd3
SM
107182011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10719
10720 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10721 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10722
cd1181db
JB
107232011-11-20 Juanma Barranquero <lekktu@gmail.com>
10724
10725 * casetab.c (Fset_case_table):
10726 * charset.c (Fcharset_after): Fix typos.
10727
615a3b8d 107282011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10729
17e845af
PE
10730 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10731 Otherwise, valgrind does not work on some platforms.
10732 Problem reported by Andreas Schwab in
6a0bf43d
PE
10733 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10734 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10735 is set, removing the need for VIRT_ADDRESS_VARIES.
10736 (PURE_P): Use a more-efficient implementation that needs just one
10737 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10738 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10739 to 4 (xorl, subq, cmpq, setbe).
10740 * alloc.c (pure): Always extern now, since that's the
10741 VIRT_ADDR_VARIES behavior.
10742 (PURE_POINTER_P): Use a single comparison, not two, for
10743 consistency with the new puresize.h.
10744 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10745 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10746 Remove VIRT_ADDR_VARIES no longer needed.
10747
f8fe6f96
EZ
107482011-11-19 Eli Zaretskii <eliz@gnu.org>
10749
10750 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10751 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10752 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10753 behave as if the cursor position were at the window margin.
10754
10755 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10756 and the cursor position is out of bounds, behave as if the cursor
10757 position were at the window margin. (Bug#10075)
10758
df05a53c
CY
107592011-11-18 Chong Yidong <cyd@gnu.org>
10760
10761 * window.c (Fwindow_combination_limit): Make first argument
10762 non-optional, since it is meaningless for live windows like the
10763 selected window.
61ccba97 10764
2071918e
DA
107652011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10766
10767 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10768
b50a28de
SM
107692011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10770
10771 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10772 (graft_intervals_into_buffer): Simplify.
10773
015137db
EZ
107742011-11-18 Eli Zaretskii <eliz@gnu.org>
10775
10776 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10777 hash values of the two rows.
10778 (copy_row_except_pointers): Preserve the used[] arrays and the
10779 hash values of the two rows. (Bug#10035)
68c95424 10780 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10781
10782 * xdisp.c (row_hash): New function, body extracted from
10783 compute_line_metrics.
10784 (compute_line_metrics): Call row_hash, instead of computing the
10785 hash code inline.
10786
10787 * dispnew.c (verify_row_hash): Call row_hash for computing the
10788 hash code of a row, instead of duplicating code from xdisp.c.
10789
10790 * dispextern.h (row_hash): Add prototype.
10791
a2addb04
TH
107922011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10793
10794 * frame.c (delete_frame): Don't delete the terminal when the last
10795 X frame is closed if emacs is built with GTK toolkit.
10796
df85d315
JB
107972011-11-17 Juanma Barranquero <lekktu@gmail.com>
10798
10799 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10800
a0c2d0ae
MR
108012011-11-17 Martin Rudalics <rudalics@gmx.at>
10802
10803 * window.c (Vwindow_splits): Rename to
10804 Vwindow_combination_resize. Suggested by Juri Linkov.
10805 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10806 of Vwindow_splits.
10807
58179cce
JB
108082011-11-16 Juanma Barranquero <lekktu@gmail.com>
10809
7877f373
JB
10810 * nsfns.m (Fns_font_name):
10811 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10812
b6f67890
MR
108132011-11-16 Martin Rudalics <rudalics@gmx.at>
10814
10815 * window.h (window): Rename slot "nest" to "combination_limit".
10816 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10817 (Fset_window_nest): Rename to Fset_window_combination_limit.
10818 (Vwindow_nest): Rename to Vwindow_combination_limit.
10819 (recombine_windows, make_parent_window, make_window)
10820 (Fsplit_window_internal, saved_window)
10821 (Fset_window_configuration, save_window_save): Rename all
10822 occurrences of window_nest to window_combination_limit.
10823
c7015153
JB
108242011-11-15 Juanma Barranquero <lekktu@gmail.com>
10825
10826 * image.c (imagemagick_load_image): Fix typo.
10827
322ad6ec
EZ
108282011-11-14 Eli Zaretskii <eliz@gnu.org>
10829
10830 * xdisp.c (display_line): Move the call to
10831 highlight_trailing_whitespace before the call to
10832 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10833 faces of all the glyphs to compute ROW's hash value.
10834 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10835
f067b8ec
JB
108362011-11-14 Juanma Barranquero <lekktu@gmail.com>
10837
10838 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10839 just return (bug#10044).
10840
1e5b2111
EZ
108412011-11-12 Eli Zaretskii <eliz@gnu.org>
10842
7ef3cbd5
EZ
10843 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10844 with user-defined heap size. Bump the default size of the temacs
10845 heap to 27MB, to avoid memory warning when running temacs.
10846 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10847
1e5b2111
EZ
10848 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10849 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10850 (verify_row_hash) [XASSERTS]: New function.
10851 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10852 that the hash value of glyph rows is correct.
1e5b2111 10853
89d61221
MR
108542011-11-12 Martin Rudalics <rudalics@gmx.at>
10855
10856 * window.h (window): Remove splits slot.
10857 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10858 (Fdelete_other_windows_internal, make_parent_window)
10859 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10860 (Fset_window_configuration, save_window_save): Don't deal with
10861 split status of windows.
10862 (saved_window): Remove splits slot.
10863 (Vwindow_splits): Rewrite doc-string.
10864
97f18cc8
JD
108652011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10866
10867 * xfns.c (unwind_create_frame):
10868 * nsfns.m (unwind_create_frame):
10869 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10870 Vframe_list (Bug#9999).
10871
22a648b4
DA
108722011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10873
0b381c7e 10874 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10875
659afede
KH
108762011-11-11 Kenichi Handa <handa@m17n.org>
10877
10878 * callproc.c (Fcall_process): Set the member dst_multibyte of
10879 process_coding.
10880
9ac0394b
KH
108812011-11-11 Johan Bockgård <bojohan@gnu.org>
10882
10883 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10884 avoid a crash (bug#9496).
10885
2fbdc249
CY
108862011-11-09 Chong Yidong <cyd@gnu.org>
10887
10888 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10889 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10890
ac6b1f81
PE
108912011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10892
10893 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10894
09db192c
PE
108952011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10896
10897 Avoid some portability problems by eschewing 'extern inline' functions.
10898 The trivial performance wins aren't worth the portability hassles; see
10899 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10900 et seq.
10901 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10902 (window_box_width, window_box_left, window_box_left_offset)
10903 (window_box_right, window_box_right_offset): Undo previous change,
10904 by removing the "extern"s.
10905 * intervals.c (adjust_intervals_for_insertion)
10906 (adjust_intervals_for_deletion): Undo previous change,
10907 making these static again.
10908 (offset_intervals, temp_set_point_both, temp_set_point)
10909 (copy_intervals_to_string): No longer inline.
10910 * xdisp.c (window_text_bottom_y, window_box_width)
10911 (window_box_height, window_box_left_offset)
10912 (window_box_right_offset, window_box_left, window_box_right)
10913 (window_box): No longer inline.
10914
105216ed
CY
109152011-11-08 Chong Yidong <cyd@gnu.org>
10916
10917 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10918 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10919 Signal an error if not a live window.
105216ed
CY
10920 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10921 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10922
ae9e237f
JB
109232011-11-07 Juanma Barranquero <lekktu@gmail.com>
10924
10925 * lisp.h (syms_of_abbrev): Remove declaration.
10926 Reported by CHENG Gao <chenggao@royau.me>.
10927
c7aa8333
EZ
109282011-11-07 Eli Zaretskii <eliz@gnu.org>
10929
10930 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10931 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10932 of temacs in GUI mode.
10933
be7f5545
MR
109342011-11-07 Martin Rudalics <rudalics@gmx.at>
10935
10936 * window.h: Declare delete_all_child_windows instead of
10937 delete_all_subwindows.
10938 * window.c (Fwindow_nest, Fset_window_nest)
10939 (Fset_window_new_total, Fset_window_new_normal)
10940 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10941 (delete_all_subwindows): Rename to delete_all_child_windows.
10942 (Fdelete_other_windows_internal, Fset_window_configuration):
10943 Call delete_all_child_windows instead of delete_all_subwindows.
10944 * frame.c (delete_frame): Call delete_all_child_windows instead
10945 of delete_all_subwindows.
10946
ca78dc43
PE
109472011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10948
10949 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10950 This is also needed for porting to any host where GC_MARK_STACK is
10951 not GC_MAKE_GCPROS_NOOPS.
10952 (which_symbols): Use it.
10953
a0241d01
KH
109542011-11-07 Kenichi Handa <handa@m17n.org>
10955
10956 * coding.c (coding_set_destination): Check coding->src_pos only
10957 when coding->src_object is a buffer (bug#9910).
10958
10959 * process.c (send_process): Set the member src_multibyte of coding
10960 to 0 (bug#9911) when sending a unibyte text.
10961
10962 * callproc.c (Fcall_process): Set the member src_multibyte of
10963 process_coding to 0 (bug#9912).
10964
a64bfdfa 109652011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10966
10967 * xmenu.c (cleanup_widget_value_tree): New function.
10968 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10969 calling free_menubar_widget_value_tree directly (Bug#9830).
10970
cb41b32a
PE
109712011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10972
10973 Fix some portability problems with 'inline'.
10974 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10975 (window_box_width, window_box_left, window_box_left_offset)
10976 (window_box_right, window_box_right_offset): Declare extern.
10977 Otherwise, these inline functions do not conform to C99 and
10978 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10979 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10980 * intervals.c (adjust_intervals_for_insertion)
10981 (adjust_intervals_for_deletion): Now extern, because otherwise the
10982 extern inline functions 'offset_intervals' couldn't refer to it.
10983 (static_offset_intervals): Remove.
10984 (offset_intervals): Rewrite using the old contents of
10985 static_offset_intervals. The old version didn't conform to C99
10986 because an extern inline function contained a reference to an
10987 identifier with static linkage.
10988
b7041366
AS
109892011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10990
10991 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10992 GC.
10993
88a37c4d
EZ
109942011-11-06 Eli Zaretskii <eliz@gnu.org>
10995
10996 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10997 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10998 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10999 return Qleft_to_right.
11000
49745b39
CY
110012011-11-06 Chong Yidong <cyd@gnu.org>
11002
11003 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11004 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11005 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11006 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11007 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11008 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11009 (Fwindow_vscroll): Doc fix.
11010 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11011 argument, since it makes no sense to pass a live window and for
11012 consistency with window-child.
11013
1f05cd82
CS
110142011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11015
11016 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11017 support MSVC.
11018
22610910
JR
110192011-11-05 Jason Rumney <jasonr@gnu.org>
11020
11021 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11022 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11023 fonts (Bug#6029).
11024 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11025 bitwise arithmetic preventing use of unicode-sip and non-truetype
11026 opentype fonts.
11027
a06776b2
EZ
110282011-11-05 Eli Zaretskii <eliz@gnu.org>
11029
3ad924ba
EZ
11030 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11031 "emacs"-only part.
11032
a06776b2
EZ
11033 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11034 initialization code to keep similarity to xfns.c after changes
11035 from 2011-11-05.
11036
c9e7db78
JD
110372011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11038
a97f8f3f
JD
11039 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11040 (unwind_create_frame): New function (Bug#9943).
11041 (Fx_create_frame): Restructure code to be more similar to the one in
11042 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11043 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11044 Move terminal->reference_count++ just before making the frame official
11045 (Bug#9943).
11046
11047 * nsterm.m (x_free_frame_resources): New function.
11048 (x_destroy_window): Move code to x_free_frame_resources.
11049
c9e7db78 11050 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
11051 (Fx_create_frame, x_create_tip_frame):
11052 Move terminal->reference_count++ just before making the frame
75f1671a 11053 official. Move initialization of image_cache_refcount and
c9e7db78
JD
11054 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11055
a6fc3b5c
EZ
110562011-11-05 Eli Zaretskii <eliz@gnu.org>
11057
11058 Support MSVC build with newer versions of Visual Studio.
11059 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11060 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11061 nt/gmake.defs.
11062
11063 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11064 which are not supported by MSVC.
11065 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11066 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11067 bitfields.
11068 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11069 types in bitfields.
11070 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11071
11072 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11073
58179cce 110742011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
11075
11076 Support MSVC build with newer versions of Visual Studio.
11077 * w32.c: Don't include w32api.h for MSVC.
11078 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11079
11080 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11081 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11082 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11083 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11084 e_* cousins.
11085 (alloca) [_MSC_VER]: Define to _alloca.
11086
11087 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11088
11089 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11090
a58c13ed
EZ
110912011-11-04 Eli Zaretskii <eliz@gnu.org>
11092
11093 * xdisp.c (note_mouse_highlight): If either of
11094 previous/next-single-property-change returns nil, treat that as
11095 the beginning or the end of the buffer. (Bug#9955)
11096
fe0b6370
JD
110972011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11098
a58c13ed 11099 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
11100 label is not null (Bug#9951).
11101 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11102 may be NULL.
11103
89bd5ee1
EZ
111042011-11-04 Eli Zaretskii <eliz@gnu.org>
11105
11106 * window.c (Fwindow_body_size): Mention in the doc string that the
11107 return value is in frame's canonical units. (Bug#9949)
11108
84c3edb9
EZ
111092011-11-03 Eli Zaretskii <eliz@gnu.org>
11110
4e2fb5c7
EZ
11111 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11112
84c3edb9 11113 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 11114 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 11115 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 11116
bc17a887
EZ
111172011-11-01 Eli Zaretskii <eliz@gnu.org>
11118
11119 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11120 Don't stop backward scan on the continuation glyph, even though
11121 its CHARPOS is positive.
6d5eb5b0
SM
11122 (mouse_face_from_buffer_pos, note_mouse_highlight):
11123 Rename cover_string to disp_string.
bc17a887 11124
4ee88440
MR
111252011-11-01 Martin Rudalics <rudalics@gmx.at>
11126
11127 * window.c (temp_output_buffer_show): Don't use
11128 Vtemp_buffer_show_specifiers.
11129 (Vtemp_buffer_show_specifiers): Remove unused variable.
11130
c2ff3c02
EZ
111312011-10-30 Eli Zaretskii <eliz@gnu.org>
11132
11133 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11134 past the beginning of the current glyph matrix.
11135
58179cce 111362011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
11137
11138 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11139 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11140 HAVE_GTK3 (Bug#9869).
b77a6a7f 11141
3b574623
JD
11142 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11143 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11144
b77a6a7f
JD
11145 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11146
11147 * xterm.c: Declare x_handle_net_wm_state to return int.
11148 (handle_one_xevent): Check if we are iconified but don't have
11149 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11150 (get_current_wm_state): Return non-zero if not hidden,
11151 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11152 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11153 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11154 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11155
196e41e4
PE
111562011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11159 so that this new function doesn't get optimized away by a
11160 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11161
021f2e1a
AS
111622011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11163
11164 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11165
8b058d44
EZ
111662011-10-29 Eli Zaretskii <eliz@gnu.org>
11167
11168 Fix the `xbytecode' command.
11169 * .gdbinit (xprintbytestr): New command.
b50a28de 11170 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
11171 (xbytecode): Print the byte-code string as well.
11172
4452fb80
EZ
111732011-10-29 Kim Storm <storm@cua.dk>
11174
8b058d44
EZ
11175 * alloc.c (which_symbols): New function.
11176
21b72067
AS
111772011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11178
11179 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11180 line. (Bug#9903)
11181
83ed7b5c
GM
111822011-10-29 Glenn Morris <rgm@gnu.org>
11183
11184 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11185 Not clear what it was for, and it causes various bugs. (Bug#9839)
11186
5a7a728b
EZ
111872011-10-28 Eli Zaretskii <eliz@gnu.org>
11188
11189 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11190 possible random value that matches one of those tested as
11191 condition to clear the mouse face.
11192
d3d0842f
CY
111932011-10-28 Chong Yidong <cyd@gnu.org>
11194
11195 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11196
31b39d13
DN
111972011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11198
11199 * window.c (make_window): Initialize phys_cursor_on_p.
11200
9aba6043
SM
112012011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11202
11203 * lisp.h (struct Lisp_Symbol): Update comments.
11204
c20992f4
JB
112052011-10-28 Juanma Barranquero <lekktu@gmail.com>
11206
11207 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11208
db4f02f2
EZ
112092011-10-28 Eli Zaretskii <eliz@gnu.org>
11210
11211 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11212 <oslsachem@gmail.com> for helping to debug this.
11213
11214 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11215 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11216 (g_b_init_get_glyph_outline_w): New static variables.
11217 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11218 (GetGlyphOutlineW_Proc): New typedefs.
11219 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
11220 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11221 New functions.
11222 (w32font_open_internal, compute_metrics):
11223 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
11224 instead of calling the "wide" APIs directly.
11225
11226 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11227
11228 * w32.h (syms_of_w32font): Add prototype.
11229
87e68db4
JB
112302011-10-27 Juanma Barranquero <lekktu@gmail.com>
11231
11232 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11233 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11234 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11235 (Fmove_to_window_line): Doc fix.
11236
435c1d67
CY
112372011-10-27 Chong Yidong <cyd@gnu.org>
11238
11239 * process.c (make_process): Set gnutls_state to NULL.
11240
11241 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11242 non-NULL, regardless of GNUTLS_INITSTAGE.
11243 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11244 an error. Set process slots as soon as we allocate them.
11245
11246 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11247
9c6c6f49
CY
112482011-10-27 Chong Yidong <cyd@gnu.org>
11249
9aba6043
SM
11250 * gnutls.c (emacs_gnutls_deinit): New function.
11251 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
11252 (Fgnutls_deinit, Fgnutls_boot): Use it.
11253
11254 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11255 (deactivate_process): Call emacs_gnutls_deinit.
11256
657d08d3
JB
112572011-10-27 Juanma Barranquero <lekktu@gmail.com>
11258
11259 * image.c (x_create_x_image_and_pixmap):
11260 * w32.c (sys_rename, w32_delayed_load):
11261 * w32font.c (fill_in_logfont):
11262 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11263
5430d399
JB
112642011-10-26 Juanma Barranquero <lekktu@gmail.com>
11265
11266 * w32fns.c (w32_default_color_map): New function,
11267 extracted from Fw32_default_color_map.
a7ef684b 11268 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 11269
fe0055fa
PE
112702011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11271
11272 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11273
e6346438
SM
112742011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11275
11276 * keyboard.c (test_undefined): New function (bug#9751).
11277 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11278
e112cc37
ET
112792011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11280
11281 * sysdep.c (init_sys_modes): Fix the check for the controlling
11282 terminal (Bug#6649).
11283
7b5d6677
EZ
112842011-10-20 Eli Zaretskii <eliz@gnu.org>
11285
11286 * dispextern.h (struct bidi_it): New member next_en_type.
11287
11288 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11289 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11290 current character, check also for next_en_type being WEAK_EN.
11291 (bidi_resolve_weak): Don't enter the expensive loop if the current
11292 position is before next_en_pos. Record the bidi type of the first
11293 non-ET, non-BN character we find, in addition to its position.
11294 (bidi_level_of_next_char): Invalidate next_en_type when
11295 next_en_pos is over-stepped.
11296
7da0b018
PE
112972011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11298
11299 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11300 * editfns.c: Rewrite current-time-zone so that it invokes
11301 the equivalent of (format-time-string "%Z") to get the time zone name.
11302 This fixes a bug when the time zone name contains characters that
11303 need converting from the system time locale to Emacs internal format.
11304 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11305 that patch fixed format-time-string to do the conversion, but
11306 I forgot to fix current-time-zone.
11307 (format_time_string): New function, containing most of
11308 what Fformat_time_string used to contain.
11309 (Fformat_time_string): Rewrite in terms of format_time_string.
11310 This doesn't change this function's behavior.
11311 (current-time-zone): Rewrite to use format_time_string.
11312 This fixes the bug reported by Michael Schierl in
11313 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11314 Jason Rumney's 2007-06-07 change worked around this bug, but
11315 didn't fix it.
11316 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11317
8547b010
EZ
113182011-10-19 Eli Zaretskii <eliz@gnu.org>
11319
11320 * xdisp.c (start_display): If the character at POS is displayed
11321 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11322 (try_window_reusing_current_matrix): If a line ends in a display
11323 vector or the next line starts in a display vector, continue
11324 redrawing the window even though the character position of
11325 start_row was reached.
8547b010
EZ
11326 (Bug#9771, part 2)
11327
4e948d15
CY
113282011-10-18 Chong Yidong <cyd@gnu.org>
11329
11330 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11331 with nobreak-char-display too.
11332
4787455f
EZ
113332011-10-18 Eli Zaretskii <eliz@gnu.org>
11334
11335 Fix part 3 of bug#9771.
11336 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11337 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11338 non-neutral characters if the current character is a paragraph
11339 separator (a.k.a. Newline). This avoids running the same
11340 expensive loop twice, once when we consume the preceding newline
11341 and the other time when the line actually needs to be displayed.
11342 Avoid the loop when we see neutrals on the base embedding level
11343 following a character whose directionality is the same as the
11344 paragraph's. This avoids running the expensive loop when a line
11345 ends in a long sequence of neutrals, like control characters.
11346 Add assertion against STRONG_AL type. Slightly rearrange code
11347 that determines the type of a neutral given the first non-neutral
11348 that follows it.
11349 (bidi_level_of_next_char): Set next_en_pos to zero when
11350 invalidating its info.
11351
2c91f553
EZ
113522011-10-17 Eli Zaretskii <eliz@gnu.org>
11353
11354 * xdisp.c (push_display_prop): Determine whether to record string
11355 or buffer position by IT->string, not by IT->method. Allow
11356 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11357 (move_it_vertically_backward): Don't look for character position
11358 immediately after the newline when in a continuation line.
11359 (Bug#9771, part 1)
2c91f553 11360
c7b08b0d
MR
113612011-10-15 Martin Rudalics <rudalics@gmx.at>
11362
11363 * window.c (coordinates_in_window): Rewrite and delabelize
11364 vertical border check. (Bug#5357) (Bug#9618)
11365
6b02f655
SM
113662011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11367
11368 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11369 errors in XSetWindowBorder (bug#9310).
11370
81d40c92
DA
113712011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11372
11373 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11374 avoid crash when xmalloc overrun checking is enabled.
11375
d4172c3b
EZ
113762011-10-13 Eli Zaretskii <eliz@gnu.org>
11377
11378 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11379 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11380 cursor motion with <left> and <right> arrow keys.
11381
11382 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11383 some callers set that themselves.
11384
b00eea75
EZ
113852011-10-12 Eli Zaretskii <eliz@gnu.org>
11386
11387 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11388 display string and the previous row comes from the same string and
11389 is empty. (Bug#9739) (Bug#9738)
11390
8fe012c4
SM
113912011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11392
11393 * doc.c (get_doc_string): Encode file name (bug#9735).
11394
0074aef2
EZ
113952011-10-12 Eli Zaretskii <eliz@gnu.org>
11396
79beb178
EZ
11397 * bidi.c (bidi_level_of_next_char):
11398 * xdisp.c (get_visually_first_element): Remove old incorrect
11399 comments regarding the Unicode Line Separator character.
11400
0074aef2
EZ
11401 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11402
6e4b3fbe
DA
114032011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11404
11405 * alloc.c (Fgc_status): Do not access beyond zombies array
11406 boundary if nzombies > MAX_ZOMBIES.
11407 * alloc.c (dump_zombies): Add missing format specifier.
11408
0324f3af
PE
114092011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11410
b5525cac
PE
11411 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11412 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11413
0324f3af
PE
11414 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11415 Some packages use them to denote characters with modifiers.
11416
e9b5f888
AS
114172011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11418
11419 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11420 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11421 matching a pp-number. Rename parameter var to var1.
11422
127827c0
SM
114232011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11424
11425 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11426
c8fd3bd0
GM
114272011-10-08 Glenn Morris <rgm@gnu.org>
11428
11429 * callint.c (Fcall_interactively): Give a more explicit error for the
11430 'c' case with a non-character input. (Bug#8479)
11431
352ec8ff
EZ
114322011-10-08 Eli Zaretskii <eliz@gnu.org>
11433
03669ccb
EZ
11434 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11435 lines.
7061c986
EZ
11436 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11437 lines that are hscrolled on the left.
03669ccb 11438
352ec8ff
EZ
11439 * dispnew.c (buffer_posn_from_coords): Account for a possible
11440 presence of header-line. (Bug#4426)
11441
a66cfb1c
SM
114422011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11443
6b02f655
SM
11444 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11445 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11446
7c5ee88e
PE
114472011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11448
11449 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11450 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11451 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11452 this makes Emacs dump core during garbage collection on rare
11453 occasions. sizeof is obviously inferior to offsetof here, so
11454 stick with offsetof.
11455 (GC_POINTER_ALIGNMENT): New macro.
11456 (mark_memory): Omit 3rd (offset) arg; caller changed.
11457 Don't assume EMACS_INT alignment is the same as pointer alignment.
11458
df1bbe5b
SM
114592011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11460
11461 * keyboard.c (read_key_sequence_remapped): New var.
11462 (read_key_sequence): Compute remapping in the right buffer.
11463 (command_loop_1): Use read_key_sequence's remapping directly.
11464
51553db6
SM
114652011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11466
32c1fffd
SM
11467 * dired.c (file_name_completion): Don't expand file name.
11468 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11469 before checking file name handler.
11470
51553db6
SM
11471 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11472 they've been requested explicitly (bug#9591).
11473
b6bd1599 114742011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11475
11476 * keymap.c (Fsingle_key_description): Use make_specified_string
11477 instead of build_string to build string from push_key_description.
11478 (Bug#5193)
11479
f701dc2a
PE
114802011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11481
4222c55d
PE
11482 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11483 This fixes a Y2038 bug on 64-bit hosts.
11484 * buffer.c (reset_buffer):
11485 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11486 (Fclear_buffer_auto_save_failure):
11487 Use 0, not -1, to represent an unset failure time, since time_t
11488 might not be signed.
11489
f701dc2a
PE
11490 Remove dependency on glibc malloc internals.
11491 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11492 Move back here from lisp.h, but with their new implementations.
11493 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11494 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11495 * charset.c (charset_table_init): New static var.
11496 (syms_of_charset): Use it instead of xmalloc. This removes a
11497 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11498 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11499 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11500 Move back to alloc.c.
11501 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11502 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11503
9ceebf39
JD
115042011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11505
11506 * nsterm.m (windowDidResize): Call x_set_window_size only when
11507 ns_in_resize is true. Otherwise set pixelwidth/height and
11508 call change_frame_size (Bug#9628).
11509
cb993c58
PE
115102011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11511
3930c88b
PE
11512 Port --enable-checking=all to Fedora 14 x86-64.
11513 * charset.c (syms_of_charset): Also account for glibc malloc's
11514 internal overhead when calculating the initial malloc maximum.
11515
cb993c58
PE
11516 Port --enable-checking=all to Fedora 14 x86.
11517 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11518 Move to lisp.h.
11519 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11520 (overrun_check_realloc, overrun_check_free):
11521 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11522 That way, xmalloc returns a properly-aligned pointer even if
11523 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11524 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11525 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11526 into account when calculating the initial malloc maximum.
11527 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11528 Move here from alloc.c, so that charset.c can use it too.
11529 Properly align; the old code wasn't right for common 32-bit hosts
11530 when configured with --enable-checking=all.
11531 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11532 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11533
31bed486
EZ
115342011-09-29 Eli Zaretskii <eliz@gnu.org>
11535
04c70788 11536 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11537 use EDOM.
11538
fbcaa2f3
EZ
115392011-09-28 Eli Zaretskii <eliz@gnu.org>
11540
11541 * xdisp.c (compute_display_string_end): If there's no display
11542 string at CHARPOS, return -1.
11543
11544 * bidi.c (bidi_fetch_char): When compute_display_string_end
11545 returns a negative value, treat the character as a normal
11546 character not covered by a display string. (Bug#9624)
11547
a239d4e9
JB
115482011-09-28 Juanma Barranquero <lekktu@gmail.com>
11549
11550 * lread.c (Fread_from_string): Fix typo in docstring.
11551
88652fd5
EZ
115522011-09-27 Eli Zaretskii <eliz@gnu.org>
11553
11554 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11555 newline, reseat the iterator instead of bidi-iterating there one
11556 character at a time. (Bug#9610)
32c1fffd
SM
11557 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11558 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11559
ed497dd4
AS
115602011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11561
11562 * lread.c (readevalloop): Use correct code for NBSP.
11563 (read1): Likewise. (Bug#9608)
11564
b2bf61aa
MA
115652011-09-25 Michael Albinus <michael.albinus@gmx.de>
11566
11567 * dbusbind.c (Fdbus_register_signal): When service is not
11568 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11569
32bbb17c
GM
115702011-09-25 Glenn Morris <rgm@gnu.org>
11571
11572 * buffer.c (truncate-lines): Doc fix.
11573
94e0933e
CY
115742011-09-24 Chong Yidong <cyd@stupidchicken.com>
11575
11576 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11577 (Fset_window_next_buffers): Doc fix.
11578
cddde921
GM
115792011-09-24 Glenn Morris <rgm@gnu.org>
11580
11581 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11582
1260aef1
PE
115832011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11584
25b4bfa0
PE
11585 Fix minor problems found by static checking.
11586 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11587 * indent.c (Fvertical_motion): Fix == vs = typo.
11588
e3cbd34b
EZ
115892011-09-24 Eli Zaretskii <eliz@gnu.org>
11590
a66cfb1c
SM
11591 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11592 Default value is now t. Doc fix.
6bf7006f 11593
e3cbd34b 11594 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11595 logic when moving up, not only when moving down. Fix the
e3cbd34b 11596 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11597 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11598
11599 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11600 CHARPOS is covered by a display string which includes newlines.
11601 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11602 is covered by a display string with embedded newlines.
11603
a3de0cbd
MA
116042011-09-24 Michael Albinus <michael.albinus@gmx.de>
11605
11606 * dbusbind.c (Fdbus_register_signal): Add match rule to
11607 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11608 (Fdbus_register_method, Vdbus_registered_objects_table):
11609 Fix docstring.
a3de0cbd 11610
b260039d
JM
116112011-09-24 Jim Meyering <meyering@redhat.com>
11612
32c1fffd 11613 do not ignore write error for any output size
b260039d
JM
11614 The previous change was incomplete.
11615 While it makes emacs --batch detect the vast majority of stdout
11616 write failures, errors were still ignored whenever the output size is
11617 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11618 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11619 && echo FAIL: ignored write error
11620 FAIL: ignored write error
11621 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11622 && echo FAIL: ignored write error
11623 FAIL: ignored write error
11624 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11625
8eca8a7c
AS
116262011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11627
11628 * emacs.c (Fkill_emacs): In noninteractive mode exit
11629 non-successfully if a write error occurred on stdout. (Bug#9574)
11630
3341db62
EZ
116312011-09-21 Eli Zaretskii <eliz@gnu.org>
11632
11633 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11634 the xassert test.
11635
11636 * dispextern.h (struct it): Update the comment documenting what
11637 can it->OBJECT be.
11638
8c203dbf
EZ
116392011-09-20 Eli Zaretskii <eliz@gnu.org>
11640
11641 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11642 a display string, extend search for cursor position to end of row.
11643 (find_row_edges): If the row ends in a newline from a display
11644 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11645 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11646 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11647 non-empty line. Fixes confusing cursor motion with arrow keys at
11648 the beginning of a line that starts with whitespace.
8c203dbf 11649
a4824228
LMI
116502011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11651
11652 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11653 (bug#9493).
11654
33ed493b
CY
116552011-09-18 Chong Yidong <cyd@stupidchicken.com>
11656
11657 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11658 boolean (Bug#9154).
11659
56cd55c8
EZ
116602011-09-18 Eli Zaretskii <eliz@gnu.org>
11661
11662 * xdisp.c (display_line): Record maximum and minimum buffer
11663 positions even if no glyphs were produced (e.g., by a zero-width
11664 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11665 buffer positions that will be removed from the glyph row because
11666 they don't fit.
c02dcedf
EZ
11667 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11668 column is beyond frame width: don't subtract 1 "pixel" when
11669 computing width of the stretch.
3e62b7e0
EZ
11670 (reseat_at_next_visible_line_start): Undo the change made on
11671 2011-09-17 that saved paragraph information and restored it after
11672 the call to `reseat'. (Bug#9545)
56cd55c8 11673
5ed99d36 116742011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11675
11676 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11677 and turn window cursor on if cleared (Bug#9415).
11678
5ed99d36 116792011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11680
11681 * search.c (boyer_moore): Take unibyte characters from pattern
11682 literally. (Bug#9458)
11683
9bade7b2
EZ
116842011-09-18 Eli Zaretskii <eliz@gnu.org>
11685
11686 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11687
e5e9d610
PE
116882011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11689
87e4427a
PE
11690 Fix minor problem found by static checking.
11691 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11692 initialized, to pacify gcc -Wuninitialized.
11693
e5e9d610
PE
11694 * fileio.c: Report proper errno when syscall falls.
11695 (Finsert_file_contents): Save and restore errno,
11696 so that report_file_error outputs the correct diagnostic.
11697 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11698
a1674f0b
EZ
116992011-09-18 Eli Zaretskii <eliz@gnu.org>
11700
11701 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11702
fbfb6dd4
EZ
117032011-09-17 Eli Zaretskii <eliz@gnu.org>
11704
11705 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11706 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11707
bb187662
EZ
117082011-09-17 Eli Zaretskii <eliz@gnu.org>
11709
1137e8b8 11710 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11711 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11712
11713 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11714 (bidi_find_paragraph_start): Search back for paragraph beginning
11715 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11716 (bidi_move_to_visually_next): Only trigger paragraph-related
11717 computations when the last character is a newline or at EOB, not
11718 just any NEUTRAL_B. (Bug#9470)
11719
bb187662
EZ
11720 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11721 truncated lines if point is covered by a display string. (Bug#9524)
11722
2e621251
PE
117232011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11724
11725 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11726 (cons_to_x_long): New function.
11727 (lisp_data_to_selection_data): Use it. Correct the test for
11728 short-versus-long data; it was negated. Break out of vector
11729 loop, for efficiency, when a long datum is discovered.
11730
91a15bc6
SM
117312011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11732
11733 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11734
b41c3a35
EZ
117352011-09-16 Eli Zaretskii <eliz@gnu.org>
11736
11737 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11738 GCC PR/17406) by declaring this function with external scope.
11739
7812ba2d
PE
117402011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11741
11742 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11743 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11744
cf7edc2a
AS
117452011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11746
11747 * editfns.c (Fformat): Correctly handle text properties on "%%".
11748
bd01620e
EZ
117492011-09-15 Eli Zaretskii <eliz@gnu.org>
11750
11751 * xterm.c (x_draw_composite_glyph_string_foreground):
11752 * w32term.c (x_draw_composite_glyph_string_foreground):
11753 * term.c (encode_terminal_code):
11754 * composite.c (composition_update_it, get_composition_id):
11755 * xdisp.c (get_next_display_element)
11756 (fill_composite_glyph_string): Add comments about special meaning
11757 of TAB characters in a composition.
11758
a02719a3
PE
117592011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11760
11761 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11762 This occurs when processing a multibyte format.
11763 Problem reported by Wolfgang Jenker.
a02719a3 11764
72589a3c
JB
117652011-09-15 Johan Bockgård <bojohan@gnu.org>
11766
11767 * xdisp.c (try_cursor_movement): Only check for exact match if
11768 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11769
1c14176c
PE
117702011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11771
11772 Remove unused external symbols.
11773 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11774 * xdisp.c (calc_pixel_width_or_height): Now static.
11775 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11776 * indent.c (check_display_width):
11777 * w32term.c: Fix comment to match code.
11778 * xterm.c, xterm.h (x_catching_errors): Remove.
11779
d2eea5b5
PE
117802011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11781
11782 * xselect.c: Use signed conversions more consistently (Bug#9498).
11783 (selection_data_to_lisp_data): Assume incoming selection data are
11784 signed integers, not unsigned. This is to be consistent with
11785 outgoing selection data, which was modified to use signed integers
11786 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11787 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11788 expects long, not unsigned long.
11789
46888499
EZ
117902011-09-14 Eli Zaretskii <eliz@gnu.org>
11791
11792 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11793 computation of loop end. Reported by Johan Bockgård
11794 <bojohan@gnu.org>.
11795
ef8ef9fb
CY
117962011-09-13 Chong Yidong <cyd@stupidchicken.com>
11797
11798 * frame.c (Fother_visible_frames_p): Function deleted.
11799
fa819fed
EZ
118002011-09-12 Eli Zaretskii <eliz@gnu.org>
11801
11802 * indent.c (compute_motion): Process display vector front to back
11803 rather than the other way around. (Bug#2496)
11804
2ba8e008
SM
118052011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11806
11807 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11808
20f53c69
CY
118092011-09-11 Chong Yidong <cyd@stupidchicken.com>
11810
11811 * minibuf.c (Fread_from_minibuffer): Doc fix.
11812
d562d7a4
EZ
118132011-09-11 Eli Zaretskii <eliz@gnu.org>
11814
11815 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11816 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11817
1c4d7f3d
LMI
118182011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11819
11820 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11821 value for non-existent files.
11822
b885bf36
EZ
118232011-09-11 Eli Zaretskii <eliz@gnu.org>
11824
11825 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11826 set its "size" to -1. This will set the modtime_size field of
11827 the corresponding buffer to -1, which is what
11828 verify-visited-file-modtime expects for files that do not exist.
11829 (Bug#9139)
11830
6612f0bf
PE
118312011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11832
11833 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11834 here ...
11835 * lisp.h: ... from here. push_key_description is no longer
11836 defined in keyboard.c, so its declaration should not be in
11837 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11838 logically belongs with push_key_description.
11839
dfb3f755
PE
118402011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11841
11842 * buffer.h: Include <sys/types.h> instead of <time.h>.
11843 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11844 Problem reported by Herbert J. Skuhra.
11845
3134906c
LMI
118462011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11847
11848 * xml.c (parse_region): Make the parsing work for
11849 non-comment-starting XML files again (bug#9144).
11850
8d903f4e
AS
118512011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11852
11853 * image.c (gif_load): Fix calculation of bottom and right corner.
11854 (Bug#9468)
11855
80ad64f4
EZ
118562011-09-10 Eli Zaretskii <eliz@gnu.org>
11857
11858 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11859 redisplay in small windows.
11860
208a048d
EZ
118612011-09-09 Eli Zaretskii <eliz@gnu.org>
11862
11863 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11864
9b1c252e
MR
118652011-09-08 Martin Rudalics <rudalics@gmx.at>
11866
11867 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11868 Operate on live windows only.
11869
2949f33b
JB
118702011-09-08 Juanma Barranquero <lekktu@gmail.com>
11871
11872 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11873
e08dcafd
EZ
118742011-09-07 Eli Zaretskii <eliz@gnu.org>
11875
11876 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11877 only under bidi iteration.
11878
115b96bd
JD
118792011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11880
11881 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11882
c8199d0f
PE
118832011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11884
11885 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11886 Without this fix, the command to link temacs failed due to an
11887 undefined symbol __builtin_isnan. This is because
11888 /usr/include/iso/math_c99.h #defines isnan(x) to
11889 __builtin_isnan(x), but the bundled gcc, which identifies itself
11890 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11891 a __builtin_isnan.
11892 * floatfns.c (isnan): #undef, and then #define to a clone of
11893 what's in data.c.
11894 (Fisnan): Always define, since it's always available now.
11895 (syms_of_floatfns): Always define isnan at the Lisp level.
11896
e39b275c 118972011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11898
11899 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11900
b2db44d9 119012011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11902
f4af5137 11903 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11904 The previous code assumed that file offsets (off_t values) fit in
11905 EMACS_INT variables, which is not true on typical 32-bit hosts.
11906 The code messed up by falsely reporting buffer overflow in cases
11907 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11908 when "big" contains more than 2**29 bytes, even though this
11909 inserts just one byte and does not overflow the buffer.
11910 (Finsert_file_contents): Store file offsets as off_t
11911 values, not as EMACS_INT values. Check for overflow when
11912 converting between EMACS_INT and off_t. When checking for
11913 buffer overflow or for overlap, take the offsets into account.
11914 Don't use EMACS_INT for small values where int suffices.
11915 When checking for overlap, fix a typo: ZV was used where
11916 ZV_BYTE was intended.
11917 (Fwrite_region): Don't assume off_t fits into 'long'.
11918 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11919
ecfc0a49
MA
119202011-09-05 Michael Albinus <michael.albinus@gmx.de>
11921
11922 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11923
6511acf2 119242011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11925
0999621a 11926 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11927
11928 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11929 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11930 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11931 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11932 (modify_event_symbol): Do not assume that the length of
11933 name_alist_or_stem is safe to alloca and fits in int.
11934 (Fexecute_extended_command): Likewise for function name and binding.
11935 (Frecursion_depth): Wrap around reliably on integer overflow.
11936 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11937 since some callers pass EMACS_INT values.
11938 (Fsingle_key_description): Don't crash if symbol name contains more
11939 than MAX_ALLOCA bytes.
11940 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11941 (get_minibuffer): Arg is now EMACS_INT, not int.
11942 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11943 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11944 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11945
2be7d702
PE
11946 * dbusbind.c (signature_cat): New function.
11947 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11948 Do not overrun buffer; instead, report string overflow.
11949
9d1df220
PE
11950 * dispnew.c (add_window_display_history): Don't overrun buffer.
11951 Truncate instead; this is OK since it's just a log.
11952
33ef5c64
PE
11953 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11954 even if the time zone offset is outlandishly large.
11955 Don't mishandle offset == INT_MIN.
11956
66c6fdd5
PE
11957 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11958 when creating daemon; the previous buffer-overflow check was incorrect.
11959
d749b01b
PE
11960 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11961 which has the guts of the old verror function.
11962
b5cd1905
PE
11963 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11964 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11965
6e1a67fb
PE
11966 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11967 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11968 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11969 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11970 length of string rather than counting it via multiple sprintfs;
11971 that's simpler and more reliable.
c21721cc
PE
11972 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11973 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11974 sprintf, in case result does not fit in int.
11975
c57b67fc
PE
11976 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11977 (fontset_from_font): Print it.
11978
8a401434
PE
11979 * frame.c (tty_frame_count): Now printmax_t, not int.
11980 (make_terminal_frame, set_term_frame_name): Print it.
11981 (x_report_frame_params): In X, window IDs are unsigned long,
11982 not signed long, so print them as unsigned.
11983 (validate_x_resource_name): Check for implausibly long names,
11984 and don't assume name length fits in 'int'.
11985 (x_get_resource_string): Don't blindly alloca invocation name;
11986 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11987 not fit in int.
11988
6e1a67fb
PE
11989 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11990 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11991 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11992
0df02bf3
PE
11993 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11994 Use esprintf, not sprintf, in case result does not fit in int.
11995
48e30793
PE
11996 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11997 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11998 it as a large positive number.
11999 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12000 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12001
a66ff6d8
PE
12002 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12003 in case result does not fit in int.
12004
aca216ff
PE
12005 * print.c (float_to_string): Detect width overflow more reliably.
12006 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12007 buffer overrun. Don't assume list length fits in 'int'. Treat
12008 print length of 0 as 0, not as infinity; to be consistent with other
12009 uses of print length in this function. Don't overflow print length
12010 index. Don't assume hash table size fits in 'long', or that
12011 vectorlike size fits in 'unsigned long'.
12012
31c286f7
PE
12013 * process.c (make_process): Use printmax_t, not int, to format
12014 process-name gensyms.
12015
55e5faa1
PE
12016 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12017
80f2e268
PE
12018 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12019 to avoid potential buffer overrun.
12020
670741ab
PE
12021 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12022 if X resource line is longer than 512 bytes.
12023
b7163a50
PE
12024 * xfns.c (x_window): Make sprintf buffer a bit bigger
12025 to avoid potential buffer overrun.
12026
ae58ff1f
PE
12027 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12028
c43c8a6a
PE
12029 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12030
3f8236f4
PE
120312011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12032
53e9fe90 12033 Integer overflow fixes for scrolling, etc.
6511acf2
PE
12034 Without these, Emacs silently mishandles large integers sometimes.
12035 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
12036 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12037
6511acf2
PE
12038 * xdisp.c (try_window_id): Check Emacs fixnum range before
12039 converting to 'int'.
806add1d 12040
6511acf2 12041 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
12042 Check that an Emacs fixnum is in range before assigning it to 'int'.
12043 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12044 values converted from Emacs fixnums.
12045 (Frecenter): Don't wrap around a line count if it is out of 'int'
12046 range; instead, treat it as an extreme value.
12047 (Fset_window_configuration, compare_window_configurations):
12048 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12049
6511acf2
PE
12050 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12051 that can exceed INT_MAX. Check that EMACS_INT value is in range
12052 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
12053 (match_limit): Don't assume that a fixnum can fit in 'int'.
12054
6511acf2 12055 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
12056 exceed INT_MAX.
12057
6511acf2 12058 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
12059 (Fvertical_motion): Don't wrap around LINES values that don't fit
12060 in 'int'. Instead, treat them as extreme values. This is good
12061 enough for windows, which can't have more than INT_MAX lines anyway.
12062
fcb901a7
LMI
120632011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12064
0f2f6b6d
LMI
12065 * Require libxml/parser.h to avoid compilation warning.
12066
fcb901a7
LMI
12067 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12068
12069 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12070 since this reportedly can destroy thread storage.
12071
6e20a0d4
CY
120722011-08-30 Chong Yidong <cyd@stupidchicken.com>
12073
12074 * syntax.c (find_defun_start): Update all cache variables if
12075 exiting early (Bug#9401).
12076
148ae00e
EZ
120772011-08-30 Eli Zaretskii <eliz@gnu.org>
12078
f6cfbd8f
EZ
12079 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12080
148ae00e
EZ
12081 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12082 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12083 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12084
12085 * term.c (tty_append_glyph): New function.
12086 (produce_stretch_glyph): Static function and its prototype deleted.
12087
a66cfb1c
SM
12088 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12089 Add prototypes.
148ae00e 12090
c4a07a4c
PE
120912011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12094 when checking :margin (Bug#9390).
12095 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 12096 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
12097 so that the name doesn't mislead. All uses changed.
12098
6bc8cd65
JB
120992011-08-28 Johan Bockgård <bojohan@gnu.org>
12100
12101 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12102 set_tty_hooks.
12103
dca4927e
EZ
121042011-08-27 Eli Zaretskii <eliz@gnu.org>
12105
12106 * xdisp.c (move_it_to): Don't bail out early when reaching
12107 position beyond to_charpos, if we are scanning backwards.
12108 (move_it_vertically_backward): When DY == 0, make sure we get to
12109 the first character in the line after the newline.
12110
f2cad773
PE
121112011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12112
12113 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12114 (ccl_driver): Do not generate an out-of-range pointer.
12115 (Fccl_execute_on_string): Remove unnecessary check for
12116 integer overflow, noted by Stefan Monnier in
12117 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12118 Remove a FIXME that didn't need fixing.
12119 Simplify the newly-introduced buffer reallocation code.
12120
0cae2cdb
JB
121212011-08-27 Juanma Barranquero <lekktu@gmail.com>
12122
12123 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12124
5fc295a4 121252011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 12126
70c60eb2 12127 Integer and memory overflow issues (Bug#9196).
726e0ab1 12128
d31850da
PE
12129 * doc.c (get_doc_string): Rework so that
12130 get_doc_string_buffer_size is the actual buffer size, rather than
12131 being 1 less than the actual buffer size; this makes xpalloc more
12132 convenient.
12133
a69fbedb
PE
12134 * image.c (x_allocate_bitmap_record, cache_image):
12135 * xselect.c (Fx_register_dnd_atom):
12136 Simplify previous changes by using xpalloc.
12137
fe5c5d37
PE
12138 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12139 since either will do and ptrdiff_t is convenient with xpalloc.
12140
0065d054
PE
12141 * charset.c (charset_table_size)
12142 (struct charset_sort_data.priority): Now ptrdiff_t.
12143 (charset_compare): Don't overflow if priorities differ greatly.
12144 (Fsort_charsets): Don't assume list length fits in int.
12145 Check for size-calculation overflow when allocating sort data.
12146 (syms_of_charset): Allocate an initial charset table that is
12147 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12148
12149 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12150
12151 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12152 The actual value is always <= INT_MAX, and leaving it unsigned made
12153 overflow checking harder.
12154
12155 * dispextern.h (struct glyph_matrix.rows_allocated)
12156 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12157 with xpalloc. The values are still always <= INT_MAX.
12158
12159 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12160
12161 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12162 (SAFE_NALLOCA): New macro.
12163
12164 * region-cache.c (struct boundary.pos, find_cache_boundary)
12165 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12166 (set_cache_region, invalidate_region_cache)
12167 (revalidate_region_cache, know_region_cache, region_cache_forward)
12168 (region_cache_backward, pp_cache):
12169 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12170 so that ptrdiff_t * can be passed to xpalloc.
12171 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12172 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12173 (pp_cache): Don't assume cache_len fits in int.
12174 * region-cache.h: Adjust extern decls to match.
12175
12176 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12177 EMACS_INT, since either will do, for xpalloc.
12178
12179 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12180 (xnmalloc, xnrealloc, xpalloc): New functions.
12181
726e0ab1
PE
12182 * bidi.c (bidi_shelve_header_size): New constant.
12183 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12184 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12185
51f30bc5 12186 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
12187 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12188 (overlay_strings):
12189 Don't update size of array until after memory allocation succeeds,
12190 because xmalloc/xrealloc may not return.
0065d054
PE
12191 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12192 now that we have proper integer overflow checking.
12193 (record_overlay_string, overlay_strings): Catch overflows when
12194 calculating size of overlay_str_buf.
726e0ab1 12195
0065d054
PE
12196 * callproc.c (Fcall_process): Check for size overflow when
12197 calculating size of args2.
12198 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12199 Normally we prefer signed values, but sticking with ptrdiff_t would
12200 require adding more-complicated checks.
726e0ab1
PE
12201
12202 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12203 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12204 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 12205 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
12206
12207 * character.c (Fstring): Check for size-calculation overflow.
12208
12209 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12210 unnecessary integer overflow. Check for size overflow.
12211 (encode_coding_object): Don't update size until xmalloc succeeds.
12212
12213 * composite.c (get_composition_id): Check for overflow in glyph
12214 length calculations.
12215
12216 Integer and memory overflow fixes for display code.
12217 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12218 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12219 (scrolling_window): Check for overflow in size calculations.
12220 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12221 Don't assume glyph table len fits in int.
12222 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12223 (row_table_size): Now ptrdiff_t, not int.
12224 (scrolling_window): Avoid overflow in size calculations.
12225 Don't update size until allocation succeeds.
12226 * fns.c (concat): Check for overflow in size calculations.
12227 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12228 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12229 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12230
12231 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12232 (get_doc_string): Check for size calculation overflow.
12233 Don't update size until allocation succeeds.
12234 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12235 EMACS_INT, where ptrdiff_t will do.
12236 (Fsubstitute_command_keys): Check for string overflow.
12237
12238 * editfns.c (set_time_zone_rule): Don't assume environment length
12239 fits in int.
12240 (message_length): Now ptrdiff_t, not int.
12241 (Fmessage_box): Don't update size until allocation succeeds.
12242 Don't assume message length fits in int.
12243 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12244
0065d054
PE
12245 * emacs.c (main): Do not reallocate argv, since there is a null at
12246 the end that can be overwritten, and this way there's no need to
12247 worry about size-calculation overflow.
12248 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
12249
12250 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12251 alloc succeeds.
12252 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12253
12254 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12255 (x_set_scroll_bar_width, x_figure_window_size):
12256 Check for integer overflow.
12257 (x_set_alpha): Do not assume XINT fits in int.
12258
12259 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12260 This is for the members text_lines, text_cols, total_lines, total_cols,
12261 where the system imposes an 'int' limit.
12262
12263 * fringe.c (Fdefine_fringe_bitmap):
12264 Don't update size until alloc works.
12265
12266 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12267 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12268
12269 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12270 Check for size-calculation overflow.
12271 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12272 do, as we prefer signed integers.
12273 (id_to_widget.max_size, id_to_widget.used)
12274 (xg_store_widget_in_map, xg_remove_widget_from_map)
12275 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12276 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12277 Use and return ptrdiff_t, not int.
12278 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12279 * gtkutil.h: Change prototypes to match the above.
12280
12281 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12282 are duplicate now that they've been promoted to lisp.h.
12283 (x_allocate_bitmap_record, x_alloc_image_color)
12284 (make_image_cache, cache_image, xpm_load):
12285 Don't update size until alloc is done.
12286 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12287 (x_detect_edges):
3256efce 12288 Check for size calculation overflow.
726e0ab1
PE
12289 (ct_colors_allocated_max): New constant.
12290 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12291 overflow.
3256efce 12292
726e0ab1
PE
12293 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12294 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12295 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12296 Use ptrdiff_t, not int, to count maps.
12297 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12298 calculations. Don't update size until allocation succeeds.
12299 Redo calculations to avoid overflow.
726e0ab1
PE
12300 * keyboard.h: Change prototypes to match the above.
12301
12302 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12303 to count maps.
12304 (current_minor_maps): Check for size calculation overflow.
12305 * keymap.h: Change prototypes to match the above.
12306
12307 * lread.c (read1, init_obarray): Don't update size until alloc done.
12308
12309 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12310 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12311
726e0ab1
PE
12312 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12313 Now ptrdiff_t, not int.
12314 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12315 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12316
12317 * process.c (Fnetwork_interface_list): Check for overflow
12318 in size calculation.
12319
12320 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12321
12322 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12323 overflow. Don't bother calling xmalloc when xrealloc will do.
12324
12325 * search.c (Freplace_match): Check for size calculation overflow.
12326 (Fset_match_data): Don't assume list lengths fit in 'int'.
12327
12328 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12329 for command line length. Do not attempt to address one before the
12330 beginning of an array, as that's not portable.
12331
12332 * term.c (max_frame_lines): Remove; unused.
12333 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12334 not int.
12335 (encode_terminal_code, calculate_costs): Check for size
12336 calculation overflow.
12337 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12338 table lengths and related sizes. Don't update size until alloc
12339 done. Redo calculations to avoid overflow.
12340 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12341
12342 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12343 subtracting pointers.
12344 (gobble_line): Check for overflow more carefully. Don't update size
12345 until alloc done.
12346
12347 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12348 Don't update size until alloc done.
12349 Redo size calculations to avoid overflow.
12350 Check for size calculation overflow.
0065d054 12351 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12352
12353 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12354 Use ptrdiff_t, not int, for sizes.
12355 (store_mode_line_noprop_char): Don't update size until alloc done.
12356
0065d054
PE
12357 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12358 Use ptrdiff_t, not int, for sizes.
12359 (Finternal_make_lisp_face, cache_face):
12360 Check for size calculation overflow.
12361 (cache_face): Treat size calculation overflows as if they were
12362 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12363
12364 * xfns.c (x_encode_text, x_set_name_internal)
12365 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12366 sizes, since they can exceed INT_MAX in size. Check for size
12367 calculation overflow.
12368
0065d054
PE
12369 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12370 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12371 Don't update size until alloc done.
12372
0065d054 12373 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12374 as sprintf is limited to int lengths.
1d526e2f 12375
252c5ee1
PE
12376 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12377 (X_LONG_MIN): New macros.
864d7ce7
PE
12378 Use them to make the following changes clearer.
12379 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12380 This change doesn't affect the value now, but it may help remind
12381 future maintainers not to raise the value too much later.
12382 (SELECTION_QUANTUM): Remove, replacing with ...
12383 (selection_quantum): ... new function, which avoids overflow.
12384 All uses changed.
12385 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12386 assumption that selection length fits in 'int'.
12387 (x_reply_selection_request, x_handle_selection_request)
12388 (x_get_window_property, receive_incremental_selection)
12389 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12390 (lisp_data_to_selection_data, clean_local_selection_data):
12391 Use ptrdiff_t, not int, to record length of selection.
12392 (x_reply_selection_request, x_get_window_property)
12393 (receive_incremental_selection, x_property_data_to_lisp):
12394 Redo calculations to avoid overflow.
12395 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12396 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12397 something.
12398 (x_get_window_property, receive_incremental_selection)
12399 (lisp_data_to_selection_data, x_property_data_to_lisp):
12400 Check for size-calculation overflow.
12401 (x_get_window_property, receive_incremental_selection)
12402 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12403 Don't store size until memory allocation succeeds.
12404 (x_get_window_property): Plug memory leak on memory exhaustion.
12405 Don't double-block input; malloc is safe here. Don't assume 2**34
12406 - 4 fits in unsigned long. Add an xassert to check
12407 XGetWindowProperty overflow. Be more careful about overflow
12408 calculations, and distinguish size from memory overflow better.
12409 (receive_incremental_selection): When tracing, don't assume
12410 unsigned int is less than INT_MAX.
12411 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12412 harmful) conversions of unsigned short to int.
12413 (lisp_data_to_selection_data): Don't assume that integers
12414 in the range -65535 through -1 fit in an X unsigned short.
12415 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12416 result parameters unless successful. Rely on cons_to_unsigned
12417 to report problems with elements; the old code wasn't right anyway.
12418 (x_check_property_data): Check for int overflow; we cannot use
12419 a wider type due to X limits.
12420 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12421
726e0ab1 12422 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12423
0065d054
PE
12424 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12425 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12426 (x_color_cells): Don't store size until memory allocation succeeds.
12427 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12428 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12429 (x_term_init): Don't assume length fits in int (sprintf is limited
12430 to int size).
bc18e09d 12431
ebfa62c0
PE
12432 Use ptrdiff_t for composition IDs.
12433 * character.c (lisp_string_width):
12434 * composite.c (composition_table_size, n_compositions)
12435 (get_composition_id, composition_gstring_from_id):
12436 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12437 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12438 * window.c (Frecenter):
12439 Use ptrdiff_t, not int, for composition IDs.
12440 * composite.c (get_composition_id): Check for integer overflow.
12441 * composite.h: Adjust prototypes to match the above changes.
12442
d3411f89
PE
12443 Use ptrdiff_t for hash table indexes.
12444 * category.c (hash_get_category_set):
12445 * ccl.c (ccl_driver):
12446 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12447 * coding.c (coding_system_charset_list, detect_coding_system):
12448 * coding.h (struct coding_system.id):
12449 * composite.c (get_composition_id, gstring_lookup_cache):
12450 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12451 * image.c (xpm_get_color_table_h):
12452 * lisp.h (hash_lookup, hash_put):
12453 * minibuf.c (Ftest_completion):
12454 Use ptrdiff_t for hash table indexes, not int (which is too
12455 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12456 32-bit --with-wide-int hosts).
12457
e097a6fa
PE
12458 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12459 Add a FIXME comment about memory leaks.
12460 (syms_of_charset): Don't assume xmalloc returns.
12461
5637687f
PE
12462 Don't assume that stated character widths fit in int.
12463 * character.c (Fchar_width, c_string_width, lisp_string_width):
12464 * character.h (CHAR_WIDTH):
12465 * indent.c (MULTIBYTE_BYTES_WIDTH):
12466 Use sanitize_char_width to avoid undefined and/or bad behavior
12467 with outlandish widths.
a66cfb1c 12468 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12469 now that we have two such functions. All uses changed.
12470 (sanitize_char_width): New inline function.
12471
a2271ba2
PE
12472 Don't assume that tab-width fits in int.
12473 * character.h (sanitize_width): New inline function.
12474 (SANE_TAB_WIDTH): New macro.
12475 (ASCII_CHAR_WIDTH): Use it.
12476 * indent.c (sane_tab_width): Remove. All uses replaced by
12477 SANE_TAB_WIDTH (current_buffer).
12478 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12479
18c52557
PE
12480 * fileio.c: Integer overflow issues with file modes.
12481 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12482
caeeedc1
PE
12483 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12484 Remove unreachable code.
12485 (read_hex, load_charset_map_from_file): Check for integer overflow.
12486
6df6ae42 12487 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12488 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12489 (x_send_scroll_bar_event): Likewise. Check that the size does not
12490 exceed limits imposed by XClientMessageEvent, as well as the usual
12491 ptrdiff_t and size_t limits.
12492
b13995db
PE
12493 * keyboard.c: Overflow, signedness and related fixes.
12494 (make_lispy_movement): Use same integer type in forward decl
12495 that is used in the definition.
12496 (read_key_sequence, keyremap_step):
12497 Change bufsize argument back to int, undoing my 2011-03-30 change.
12498 We prefer signed types, and int is wide enough here.
12499 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12500 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12501 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12502 length, not size_t. Use ptrdiff_t for index, not int.
12503 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12504 possibility of integer overflow.
12505
13464394
PE
12506 Overflow, signedness and related fixes for images.
12507
12508 * dispextern.h (struct it.stack[0].u.image.image_id)
12509 (struct_it.image_id, struct image.id, struct image_cache.size)
12510 (struct image_cache.used, struct image_cache.ref_count):
12511 * gtkutil.c (update_frame_tool_bar):
12512 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12513 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12514 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12515 * nsmenu.m (update_frame_tool_bar):
12516 * xdisp.c (calc_pixel_width_or_height):
12517 * xfns.c (image_cache_refcount):
12518 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12519 on typical 64-bit hosts.
12520
12521 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12522 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12523 Omit unnecessary casts to int.
12524 (parse_image_spec): Check that integers fall into 'int' range
12525 when the callers expect that.
12526 (image_ascent): Redo ascent calculation to avoid int overflow.
12527 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12528 (lookup_image): Remove unnecessary tests.
12529 (xbm_image_p): Locals are now of int, not EMACS_INT,
12530 since parse_image_check makes sure they fit into int.
12531 (png_load, gif_load, svg_load_image):
12532 Prefer int to unsigned where either will do.
12533 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12534 old tiff_error_handler and tiff_warning_handler.
12535 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12536 stack buffer overflows. It uses only the features of vsnprintf
12537 that are common to both POSIX and native Microsoft.
12538 (tiff_error_handler, tiff_warning_handler): Use it.
12539 (tiff_load, gif_load, imagemagick_load_image):
12540 Don't assume :index value fits in 'int'.
12541 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12542 (imagemagick_load_image): Check that crop parameters fit into
12543 the integer types that MagickCropImage accepts. Don't assume
12544 Vimagemagick_render_type has a nonnegative value. Don't assume
12545 size_t fits in 'long'.
12546 (gs_load): Use printmax_t to print the widest integers possible.
12547 Check for integer overflow when computing image height and width.
12548
c11821d4
EZ
125492011-08-26 Eli Zaretskii <eliz@gnu.org>
12550
12551 * xdisp.c (redisplay_window): Don't force window start if point
12552 will be invisible in the resulting window. (Bug#9324)
12553
0c95fcf7
EZ
125542011-08-25 Eli Zaretskii <eliz@gnu.org>
12555
12556 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12557 the display spec is of the form `(space ...)'.
12558 (handle_display_spec): Return the value returned by
12559 handle_single_display_spec, not just 1 or zero.
12560 (handle_single_display_spec): If the display spec is of the form
12561 `(space ...)', and specifies display in the text area, return 2
12562 rather than 1.
fee65a97 12563 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12564 accurately, and prefer exact match for point under bidi.
12565 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12566
12567 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12568 into disp_prop; all users changed.
12569
12570 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12571 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12572 for the text covered by the display property.
12573
e4ed06f1
CY
125742011-08-25 Chong Yidong <cyd@stupidchicken.com>
12575
12576 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12577 Change return value to nil.
12578 (Frecord_buffer): Delete unused function.
12579
f67cdd7f
EZ
125802011-08-24 Eli Zaretskii <eliz@gnu.org>
12581
5980d4c6
EZ
12582 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12583 buffers, return left-to-right.
8610fe8b
EZ
12584 (set_cursor_from_row): Consider candidate row a win if its glyph
12585 represents a newline and point is on that newline. Fixes cursor
12586 positioning on the newline at EOL of R2L text within L2R
12587 paragraph, and vice versa.
12588 (try_cursor_movement): Check continued rows, in addition to
12589 continuation rows. Fixes unwarranted scroll when point enters a
12590 continued line of R2L text within an L2R paragraph, or vice versa.
12591 (cursor_row_p): Consider the case of point being equal to
12592 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12593 from the end of a short line to the beginning of a continued line
12594 of R2L text within L2R paragraph.
12595 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12596 composed characters.
5980d4c6 12597
f67cdd7f
EZ
12598 * bidi.c (bidi_check_type): Use xassert.
12599 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12600 members.
12601
bca633fb
EZ
126022011-08-23 Eli Zaretskii <eliz@gnu.org>
12603
12604 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12605 a character.
12606
4a5885a7
CY
126072011-08-23 Chong Yidong <cyd@stupidchicken.com>
12608
12609 * nsfont.m (ns_otf_to_script): Fix typo.
12610
0902a04e
KH
126112011-08-22 Kenichi Handa <handa@m17n.org>
12612
12613 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12614 extra slot even if the purpose is char-code-property-table.
12615
1a2e6670
EZ
126162011-08-23 Eli Zaretskii <eliz@gnu.org>
12617
8ddde651
EZ
12618 * xdisp.c (redisplay_window): When computing centering_position,
12619 account for the height of the header line. (Bug#8874)
12620
425cc014
EZ
12621 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12622 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12623 candidate is selected by the mouse, and that candidate has a
12624 composed character under the mouse.
12625
1a2e6670
EZ
12626 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12627 coordinates reported by pos-visible-in-window-p for a composed
12628 character in column zero.
12629
8b76d6f8
SM
126302011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12631
12632 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12633
dac347dd
EZ
126342011-08-22 Eli Zaretskii <eliz@gnu.org>
12635
12636 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12637 consider it a hit if to_charpos is anywhere in the range of the
12638 composed buffer positions.
12639
e013fb34
CY
126402011-08-22 Chong Yidong <cyd@stupidchicken.com>
12641
12642 * image.c (gif_load): Don't assume that each subimage has the same
12643 dimensions as the base image. Handle disposal method that is
12644 "undefined" by the gif spec (Bug#9335).
12645
bd1ba3e8
CY
126462011-08-20 Chong Yidong <cyd@stupidchicken.com>
12647
12648 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12649 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12650
54a1215b
EZ
126512011-08-19 Eli Zaretskii <eliz@gnu.org>
12652
823564e5
EZ
12653 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12654 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12655 from an Org mode buffer to a Speedbar frame.
12656
54a1215b
EZ
12657 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12658 a composition, take its buffer position from IT->cmp_it.charpos.
12659 Fixes cursor positioning at the beginning of a line that begins
12660 with a composed character.
12661
9778ebcc
EZ
126622011-08-18 Eli Zaretskii <eliz@gnu.org>
12663
0be6ee06
EZ
12664 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12665 character bidirectional type, use STRONG_L instead. Fixes crashes
12666 in a buffer produced by `describe-categories'.
12667
9778ebcc
EZ
12668 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12669 members before the level stack, so they would be saved and
12670 restored when copying iterator state. Fixes incorrect reordering
12671 around TABs covered by display properties.
12672
156bffbe
AS
126732011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12674
6b02f655 12675 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12676
72ad093b
CY
126772011-08-17 Chong Yidong <cyd@stupidchicken.com>
12678
12679 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12680 (internal_condition_case_2, internal_condition_case_n):
12681 Remove unnecessary aborts (Bug#9081).
72ad093b 12682
35774242
EZ
126832011-08-17 Eli Zaretskii <eliz@gnu.org>
12684
12685 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12686 has no `load' handler, try opening the file locally. (Bug#9311)
12687
db76dd85
KB
126882011-08-16 Ken Brown <kbrown@cornell.edu>
12689
12690 * gmalloc.c: Expand comment.
12691
b215eee5
EZ
126922011-08-16 Eli Zaretskii <eliz@gnu.org>
12693
12694 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12695 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12696
a4579d33
KB
126972011-08-16 Ken Brown <kbrown@cornell.edu>
12698
12699 Fix memory allocation problems in Cygwin build (Bug#9273).
12700
12701 * unexcw.c ( __malloc_initialized): Declare external variable.
12702 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12703
8b76d6f8
SM
12704 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12705 New variables.
a4579d33
KB
12706 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12707 dumped emacs.
12708 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12709 in the static heap.
12710 [CYGWIN] (special_realloc): New function.
12711 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12712 requests to realloc storage in the static heap.
12713
3ebec551
PE
127142011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12715
12716 * bidi.c (bidi_initialize): Remove unused local.
12717
9fd8be00
EZ
127182011-08-15 Eli Zaretskii <eliz@gnu.org>
12719
6b02f655
SM
12720 * bidimirror.h:
12721 * biditype.h: Remove file.
12722 * makefile.w32-in ($(BLD)/bidi.$(O)):
12723 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12724
12725 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12726
12727 * chartab.c: Improve commentary for the uniprop_table API.
12728
32413314
EZ
12729 * bidi.c (bidi_paragraph_init): Support zero value of
12730 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12731 (bidi_initialize): Use uniprop_table instead of including
12732 biditype.h and bidimirror.h.
32413314 12733
9fd8be00
EZ
12734 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12735 coordinates of the iterator when restoring from ppos_it.
12736 (Bug#9296)
12737
5cf2b69b
KH
127382011-08-14 Kenichi Handa <handa@m17n.org>
12739
12740 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12741 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12742
daf17d00
EZ
127432011-08-14 Eli Zaretskii <eliz@gnu.org>
12744
12745 * xdisp.c (move_it_in_display_line_to): Don't invoke
12746 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12747 ppos_it. Fixes vertical cursor motion when line beginning is
12748 covered by an image. (Bug#9296)
12749
08e3161a
JD
127502011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12751
12752 * nsterm.h (ns_run_ascript): Declare.
12753 (NSAPP_DATA2_RUNASSCRIPT): Define.
12754
12755 * nsfns.m (as_script, as_result, as_status): New static variables.
12756 (ns_run_ascript): New function.
5e617bc2 12757 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12758 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12759 the event loop. Get status from as_status (Bug#7276).
12760
12761 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12762 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12763 the event loop (Bug#7276).
12764
a3720aa2
AS
127652011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12766
12767 * gnutls.c (QCgnutls_bootprop_priority)
12768 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12769 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12770 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12771 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12772 (QCgnutls_bootprop_verify_hostname_error)
12773 (QCgnutls_bootprop_callbacks_verify): Rename from
12774 Qgnutls_bootprop_..., all uses changed.
12775
12776 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12777 uses changed.
12778
0a0d27fb
PE
127792011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12780
19d5c50c
PE
12781 * xfaces.c (Qframe_set_background_mode): Now static.
12782 * dispextern.h (Qframe_set_background_mode): Remove decl.
12783
0a0d27fb
PE
12784 * process.c (Fnetwork_interface_info): Declare local only if needed.
12785
377538cb
JD
127862011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12787
12788 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12789 (Fnetwork_interface_list): Allocate in increments of bytes instead
12790 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12791 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12792 sockaddr.
12793 (struct ifflag_def): notrailers is smart on OSX.
12794 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12795 Get hardware address with getifaddrs if available.
12796
08fff70c
EZ
127972011-08-12 Eli Zaretskii <eliz@gnu.org>
12798
12799 * xdisp.c (iterate_out_of_display_property): xassert that
12800 IT->position is set to within IT->object's boundaries. Break from
12801 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12802 when IT->position is set up wrongly due to some bug.
12803 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12804 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12805 entry. Force push_it to save on the stack the current
12806 buffer/string position, to be restored by pop_it. Fix flags in
12807 the iterator structure wrt the object coming from a display
12808 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12809 properties. (Bug#9284)
12810
7be1c708 128112011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12812
7be1c708
CY
12813 * fontset.c (fontset_get_font_group): Add proper type checks.
12814 (Bug#9172)
aac0c6e3 12815
7be1c708 128162011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12817
7be1c708
CY
12818 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12819 and LC_VERSION_MIN_MACOSX.
12820 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12821 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12822
97bb72a6
EZ
128232011-08-08 Eli Zaretskii <eliz@gnu.org>
12824
12825 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12826 no-display-properties-and-no-overlays under bidi display.
12827 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12828 properties and overlays.
97bb72a6 12829
d5617611
CY
128302011-08-08 Chong Yidong <cyd@stupidchicken.com>
12831
37e11a63
CY
12832 * editfns.c (Fset_time_zone_rule): Document relationship with the
12833 setenv function.
12834
d5617611
CY
12835 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12836 the font entity extracted from the cache (Bug#8109).
12837
58872834
CY
128382011-08-07 Chong Yidong <cyd@stupidchicken.com>
12839
12840 * composite.c (autocmp_chars): Don't reset point. That is done by
12841 restore_point_unwind (Bug#5984).
12842
75bfc667
JL
128432011-08-07 Juri Linkov <juri@jurta.org>
12844
12845 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12846 to show the arg `TIME' instead of `TIMEVAL'.
12847
d1410150
EZ
128482011-08-06 Eli Zaretskii <eliz@gnu.org>
12849
12850 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12851 display property strides EOL and includes a newline, as in
12852 longlines-mode. (Bug#9254)
75b771e4
EZ
12853 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12854 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12855
12856 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12857 is non-zero, even if the data buffer is NULL. Fixes a crash in
12858 vertical-motion with longlines-mode. (Bug#9254)
12859
35928349
EZ
128602011-08-05 Eli Zaretskii <eliz@gnu.org>
12861
ec7cc85b
EZ
12862 * bidi.c <bidi_cache_total_alloc>: Now static.
12863 (bidi_initialize): Initialize bidi_cache_total_alloc.
12864
8b76d6f8 12865 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12866 cache. (Bug#9221)
12867
12868 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12869 amount allocated this far in `bidi_cache_total_alloc'.
12870 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12871 non-zero, only free the data buffer without restoring the cache
12872 contents. All callers changed.
12873
12874 * dispextern.h (bidi_unshelve_cache): Update prototype.
12875
12876 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12877 (move_it_in_display_line, move_it_to)
12878 (move_it_vertically_backward, move_it_by_lines): Replace the call
12879 to xfree to an equivalent call to bidi_unshelve_cache.
12880 (move_it_in_display_line_to): Fix logic of returning
412b6358 12881 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12882
e2e2423b
EZ
128832011-08-05 Eli Zaretskii <eliz@gnu.org>
12884
12885 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12886 came from a string character with a `cursor' property. (Bug#9229)
12887
ae9e757a
JD
128882011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12889
12890 * Makefile.in (LIB_PTHREAD): New variable.
12891 (LIBES): Add LIB_PTHREAD (Bug#9216).
12892
12893 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12894 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12895
213bd7f2
AS
128962011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12897
6b02f655 12898 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12899
99aaf75f
JD
129002011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12901
12902 * xterm.c (x_find_topmost_parent): New function.
12903 (x_set_frame_alpha): Find topmost parent window with
12904 x_find_topmost_parent and set the property there also (bug#9181).
12905 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12906
c74e9d86
PE
129072011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12908
12909 * callproc.c (Fcall_process): Avoid vfork clobbering
12910 the local vars buffer, coding_systems, current_dir.
12911
640c8776
SM
129122011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12913
12914 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12915
f26d0e4c
PE
129162011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12917
8a10d76c
PE
12918 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12919 so that it is not optimized away.
12920
f26d0e4c
PE
12921 * xdisp.c (compute_display_string_pos): Remove unused local.
12922
55439c61
EZ
129232011-08-02 Eli Zaretskii <eliz@gnu.org>
12924
12925 Fix slow cursor motion and scrolling in large buffers with
12926 selective display, like Org Mode buffers. (Bug#9218)
12927
12928 * dispextern.h (struct bidi_it): New member disp_prop_p.
12929
12930 * xdisp.c: Remove one-slot cache of display string positions.
12931 (compute_display_string_pos): Accept an additional argument
5e617bc2 12932 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12933 for a display string or property. If found, set DISP_PROP_P
12934 non-zero.
12935
12936 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12937 DISP_PROP_P, and pass it to compute_display_string_pos.
12938 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12939 non-zero. All callers of bidi_fetch_char changed.
12940
fb33fa43
SM
129412011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12942
12943 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12944
b099e063
DM
129452010-12-03 Don March <don@ohspite.net>
12946
12947 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12948 last character M-[char] is translated to ESC [char] (bug#7541).
12949
5cc7f7af
KH
129502011-08-02 Kenichi Handa <handa@m17n.org>
12951
d0fffa3f 12952 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12953
12954 * chartab.c (uniprop_table): Make it non-static.
12955
525d5e6e
EZ
129562011-08-01 Eli Zaretskii <eliz@gnu.org>
12957
12958 * xdisp.c (forward_to_next_line_start): Accept additional argument
12959 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12960 on the newline.
12961 (reseat_at_next_visible_line_start): Use the bidi iterator state
12962 returned by forward_to_next_line_start to restore the state of
12963 it->bidi_it after backing up to previous newline. (Bug#9212)
12964
31011111
AS
129652011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12966
12967 * regex.c (re_comp): Protoize.
12968 (re_exec): Fix return type.
12969 (regexec): Fix type of `ret'. (Bug#9203)
12970
476371c4
PE
129712011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12972
e5d76069
PE
12973 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12974 This is needed if max-image-size is a floating-point number.
12975
9a79b20c
AS
129762011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12977
12978 * print.c (print_object): Print empty symbol as ##.
12979
12980 * lread.c (read1): Read ## as empty symbol.
12981
d8c2fa78
AA
129822011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12983
12984 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12985 setting frame foreground color (Bug#9175).
12986 (x_set_background_color): Likewise.
12987
ffe57a7a
AA
12988 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12989 contents (Bug#9176).
12990 (EmacsTooltip -init): Remove bezels and add shadows to
12991 tooltip windows.
12992
bf3492a5
AA
12993 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12994 or scroll bar (Bug#8470).
12995
d55e9c53
AA
12996 * nsfont.m (nsfont_open): Remove assignment to voffset and
12997 unnecessary vars hshink, expand, hd, full_height, min_height.
12998 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12999
13000 * nsterm.h (nsfont_info): Remove voffset field.
13001
d8c2fa78 130022011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
13003
13004 Implement strike-through and overline on NextStep (Bug#8863).
13005
13006 * nsfont.m (nsfont_open): Use underline position provided by font,
13007 instead of hard-coded value of 2.
13008 (nsfont_draw): Call ns_draw_text_decoration instead.
13009
13010 * nsterm.h: Add declaration for ns_draw_text_decoration.
13011
13012 * nsterm.m (ns_draw_text_decoration): New function for drawing
13013 underline, overline, and strike-through.
13014 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13015 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 13016 accommodate underlining, etc.
4843aac3 13017
4cc60b9b
EZ
130182011-07-28 Eli Zaretskii <eliz@gnu.org>
13019
bc7ece87
EZ
13020 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13021 default.
4cc60b9b 13022
476371c4
PE
130232011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13024
66606eea
PE
13025 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13026 Without this fix, if a signal arrives just after memory fills up,
13027 'malloc' might be invoked reentrantly.
13028
476371c4
PE
13029 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13030 In other words, assume that every image size is allowed, on non-X
13031 hosts. This assumption is probably wrong, but it lets Emacs compile.
13032
f3fcc40d
AS
130332011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13034
13035 * regex.c (re_iswctype): Convert return values to boolean.
13036
350c992f
EZ
130372011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13038
13039 * xdisp.c (compute_display_string_pos): Don't use cached display
13040 string position if the buffer had its restriction changed.
13041 (Bug#9184)
13042
5266b4bb
PE
130432011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13044
13045 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13046
2573a837 130472011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 13048
41f55ccd 13049 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 13050
39e378da
PE
13051 * bidi.c: Integer size and overflow fixes.
13052 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13053 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13054 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13055 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13056 (bidi_find_other_level_edge):
13057 Use ptrdiff_t instead of EMACS_INT where either will do.
13058 This works better on 32-bit hosts configured --with-wide-int.
13059 (bidi_cache_ensure_space): Check for size-calculation overflow.
13060 Use % rather than repeated addition, for better worst-case speed.
13061 Don't set bidi_cache_size until after xrealloc returns, because it
13062 might not return.
13063 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
13064 (bidi_cache_ensure_space): Also check that the bidi cache size
13065 does not exceed that of the largest Lisp string or buffer. See Eli
13066 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 13067
5e927815
PE
13068 * alloc.c (__malloc_size_t): Remove.
13069 All uses replaced by size_t. See Andreas Schwab's note
13070 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13071
ca4aa935
PE
13072 * image.c: Improve checking for integer overflow.
13073 (check_image_size): Assume that f is nonnull, since
13074 it is always nonnull in practice. This is one less thing to
13075 worry about when checking for integer overflow later.
13076 (x_check_image_size): New function, which checks for integer
13077 overflow issues inside X.
13078 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13079 This removes the need for a memory_full check.
13080 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13081 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13082 (xbm_read_bitmap_data): Change locals back to 'int', since
13083 their values must fit in 'int'.
13084 (xpm_load_image, png_load, tiff_load):
13085 Invoke x_create_x_image_and_pixmap earlier,
13086 to avoid much needless work if the image is too large.
13087 (tiff_load): Treat overly large images as if
13088 x_create_x_image_and_pixmap failed, not as malloc failures.
13089 (gs_load): Use x_check_image_size.
13090
5f8f9cc2
PE
13091 * gtkutil.c: Omit integer casts.
13092 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13093 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13094
5adf60bc
PE
13095 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13096
c8907a93
PE
13097 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13098 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13099 would wrongly return t on a 64-bit host.
13100
e3c25c68
PE
13101 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13102 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13103 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13104 and therefore cause GCC to emit a bogus diagnostic in some cases.
13105
3f791afe
PE
13106 * image.c: Integer signedness and overflow and related fixes.
13107 This is not an exhaustive set of fixes, but it's time to
13108 record what I've got.
13109 (lookup_pixel_color, check_image_size): Remove redundant decls.
13110 (check_image_size): Don't assume that arbitrary EMACS_INT values
13111 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13112 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13113 (tiff_load, imagemagick_load_image):
13114 Check for overflow in size calculations.
13115 (x_create_x_image_and_pixmap): Remove unnecessary test for
13116 xmalloc returning NULL; that can't happen.
13117 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13118 (xpm_color_bucket): Use better integer hashing function.
13119 (xpm_cache_color): Don't possibly over-allocate memory.
13120 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13121 (gif_memory_source):
13122 Use ptrdiff_t, not int or size_t, to record sizes.
13123 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13124 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13125 either works, as we prefer signed integers.
13126 (tiff_read_from_memory, tiff_write_from_memory):
13127 Return tsize_t, not size_t, since that's what the TIFF API wants.
13128 (tiff_read_from_memory): Don't fail simply because the read would
13129 go past EOF; instead, return a short read.
13130 (tiff_load): Omit no-longer-needed casts.
13131 (Fimagemagick_types): Don't assume size fits into 'int'.
13132
3cc5a532
PE
13133 Improve hashing quality when configured --with-wide-int.
13134 * fns.c (hash_string): New function, taken from sxhash_string.
13135 Do not discard information about ASCII character case; this
13136 discarding is no longer needed.
13137 (sxhash-string): Use it. Change sig to match it. Caller changed.
13138 * lisp.h: Declare it.
13139 * lread.c (hash_string): Remove, since we now use fns.c's version.
13140 The fns.c version returns a wider integer if --with-wide-int is
13141 specified, so this should help the quality of the hashing a bit.
13142
b312a492
PE
13143 * emacs.c: Integer overflow minor fix.
13144 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13145 Define only if GNU_LINUX.
13146 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13147
dfd153ae
PE
13148 * dispnew.c: Integer signedness and overflow fixes.
13149 Remove unnecessary forward decls, that were a maintenance hassle.
13150 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13151 All uses changed.
13152 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13153 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13154 (prepare_desired_row, line_draw_cost):
13155 Use int, not unsigned, where either works.
13156 (save_current_matrix, restore_current_matrix):
13157 Use ptrdiff_t, not size_t, where either works.
13158 (init_display): Check for overflow more accurately, and without
13159 relying on undefined behavior.
13160
a81d11a3
PE
13161 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13162 Remove, replacing with the new symbols in lisp.h. All uses changed.
13163 * fileio.c (make_temp_name):
13164 * filelock.c (lock_file_1, lock_file):
13165 * xdisp.c (message_dolog):
13166 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13167 Use pMd etc. instead.
13168 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13169 replacing the pWIDE etc. symbols removed from editfns.c.
13170
3300e6fd
PE
13171 * keyboard.h (num_input_events): Now uintmax_t.
13172 This is (very slightly) less likely to mess up due to wraparound.
13173 All uses changed.
13174
fd05c7e9
PE
13175 * buffer.c: Integer signedness fixes.
13176 (alloc_buffer_text, enlarge_buffer_text):
13177 Use ptrdiff_t rather than size_t when either will do, as we prefer
13178 signed integers.
13179
903fe15d
PE
13180 * alloc.c: Integer signedness and overflow fixes.
13181 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13182 (__malloc_size_t): Default to size_t, not to int.
13183 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13184 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13185 Prefer ptrdiff_t to size_t when either would do, as we prefer
13186 signed integers.
13187 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13188 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13189 Now const. Initialize with values that are in range even if char
13190 is signed.
13191 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13192 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13193 These functions do the right thing with sizes > 2**32.
13194 (check_depth): Now ptrdiff_t, not int.
13195 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13196 Adjust to new way of storing sizes. Check for size overflow bugs
13197 in rest of code.
13198 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13199 slightly wrong anyway, as it missed one instance of
13200 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13201 (refill_memory_reserve): Omit needless cast to size_t.
13202 (mark_object_loop_halt): Mark as externally visible.
13203
ac82cc6a
PE
13204 * xselect.c: Integer signedness and overflow fixes.
13205 (Fx_register_dnd_atom, x_handle_dnd_message):
13206 Use ptrdiff_t, not size_t, since we prefer signed.
13207 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13208 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13209 x_dnd_atoms_size and x_dnd_atoms_length.
13210
c2d1e36d
PE
13211 * doprnt.c: Prefer signed to unsigned when either works.
13212 * eval.c (verror):
13213 * doprnt.c (doprnt):
13214 * lisp.h (doprnt):
13215 * xdisp.c (vmessage):
13216 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13217 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13218 prefer signed arithmetic to avoid comparison confusion.
13219 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13220 but is a bit tricky.
13221
0e926e56
PE
13222 Assume freestanding C89 headers, string.h, stdlib.h.
13223 * data.c, doprnt.c, floatfns.c, print.c:
13224 Include float.h unconditionally.
13225 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13226 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13227 * regex.c: Likewise for stddef.h, string.h.
13228 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13229 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13230 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13231 (STDC_HEADERS): Remove obsolete defines.
13232 * sysdep.c: Include limits.h unconditionally.
13233
9cfdb3ec
PE
13234 Assume support for memcmp, memcpy, memmove, memset.
13235 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13236 * regex.c (memcmp, memcpy):
13237 Remove; we assume C89 now.
13238
13239 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13240 (__malloc_safe_bcopy): Remove; no longer needed.
13241
cf950e6b 13242 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
13243 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13244 well either way, and we prefer signed to unsigned.
13245
dbf38e02
LMI
132462011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13247
13248 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13249 closes the connection while we're reading (bug#9182).
13250
d6f0886c 132512011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 13252
d6f0886c
JD
13253 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13254 are specified (Bug#9168).
24e0f6b1 13255
2eb1f9e6
PE
132562011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13257
13258 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13259 Found by GCC static checking and --with-wide-int on a 32-bit host.
13260
22381272 132612011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
13262
13263 * xdisp.c (compute_display_string_pos): Fix logic of caching
13264 previous display string position. Initialize cached_prev_pos to
13265 -1. Fixes slow-down at the beginning of a buffer.
13266
f25e39b4
EZ
132672011-07-24 Eli Zaretskii <eliz@gnu.org>
13268
13269 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13270 for attrs[LFACE_FONTSET_INDEX].
13271
04c4b52e
PE
132722011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13273
13274 * xml.c (parse_region): Remove unused local
13275 that was recently introduced.
13276
c1734fbd
EZ
132772011-07-23 Eli Zaretskii <eliz@gnu.org>
13278
be18c5a5
EZ
13279 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13280 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13281
c1734fbd
EZ
13282 * xdisp.c (move_it_in_display_line_to): Record the best matching
13283 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13284 exit if none of the characters scanned was an exact match.
13285 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13286 when exact match is impossible due to invisible text, and the
13287 lines are truncated.
13288
a258d627
JD
132892011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13290
13291 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13292 for OSX >= 10.7.
13293
b6d5a689
EZ
132942011-07-22 Eli Zaretskii <eliz@gnu.org>
13295
0f74f785
EZ
13296 Fix a significant slow-down of cursor motion with C-n, C-p,
13297 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13298 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13299 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13300 (next_element_from_buffer): Call compute_stop_pos_backwards to
13301 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13302 base_level_stop.
13303 (reseat): Don't look for prev_stop, as that could mean a very long
13304 run.
13305 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13306 <cached_disp_overlay_modiff>: Cache for last found display string
13307 position.
551918c1 13308 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13309 about the same buffer in the same area of character positions, and
13310 the buffer wasn't changed since the time the display string
13311 position was cached.
551918c1 13312
b2d0c91a
EZ
133132011-07-22 Eli Zaretskii <eliz@gnu.org>
13314
13315 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13316 is an integer, which is important for empty lines. (Bug#9149)
13317
043604ee
CY
133182011-07-22 Chong Yidong <cyd@stupidchicken.com>
13319
13320 * frame.c (Fmodify_frame_parameters): In tty case, update the
13321 default face if necessary (Bug#4238).
13322
da4adb04
CY
133232011-07-21 Chong Yidong <cyd@stupidchicken.com>
13324
13325 * editfns.c (Fstring_to_char): No need to explain what a character
13326 is in the docstring (Bug#6576).
13327
9abd0532
LMI
133282011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13329
13330 * xml.c (parse_region): Make sure we always return a tree.
13331
36881d16
HK
133322011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13333
13334 * xml.c (parse_region): If a document contains only comments,
13335 return that, too.
13336
1e98674d
LMI
133372011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13338
13339 * xml.c (make_dom): Return comments, too.
13340
590bd467
PE
133412011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13342
13343 Port to OpenBSD.
13344 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13345 and the surrounding thread.
13346 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13347 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13348 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13349 timer goes off.
13350 * s/openbsd.h (BROKEN_SIGIO): Define.
13351 * unexelf.c (unexec) [__OpenBSD__]:
13352 Don't update the .mdebug section of the Alpha COFF symbol table.
13353
f41628b2
LMI
133542011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13355
13356 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13357 (bug#8460).
13358
b59b67c5
PE
133592011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13360
15e3a074
PE
13361 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13362 This fixes some race conditions on the permissions of any newly
13363 created file.
13364
41bed37d
PE
13365 * alloc.c (valid_pointer_p): Use pipe, not open.
13366 This fixes some permissions issues when debugging.
13367
b59b67c5
PE
13368 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13369 If fchown fails to set both uid and gid, try to set just gid,
13370 as that is sometimes allowed. Adjust the file's mode to eliminate
13371 setuid or setgid bits that are inappropriate if fchown fails.
13372
925a6be7
SM
133732011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13374
13375 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13376 to compare Lisp_Objects.
13377 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13378 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13379 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13380
52968808
AS
133812011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13382
0a6a104b
AS
13383 * lread.c (read_integer): Unread even EOF character.
13384 (read1): Likewise. Properly record start position of symbol.
13385
52968808
AS
13386 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13387 symbol character follows.
13388
9e381cdd
PE
133892011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13390
13391 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13392 This works around a problem with the previous change to Fcopy_file.
13393 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13394 and without this change, GCC might complain about discarding
13395 fchown's return value.
13396
b5641435
JB
133972011-07-16 Juanma Barranquero <lekktu@gmail.com>
13398
13399 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13400
a8031457
PE
134012011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13402
13403 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13404
dd889327
LMI
134052011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13406
750c33f7
LMI
13407 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13408 it's used from the C level.
13409
dd889327
LMI
13410 * process.c: Use the same condition for POLL_FOR_INPUT in both
13411 keyboard.c and process.c (bug#1858).
13412
87e86684
LM
134132011-07-09 Lawrence Mitchell <wence@gmx.li>
13414
13415 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13416 (Fgnutls_boot): Use it.
13417
64348f40
AS
134182011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13419
13420 * doc.c (Fsubstitute_command_keys): Revert last change.
13421
1d698799
LMI
134222011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13423
f863868c
LMI
13424 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13425 quotes the next character, and doesn't affect other longer
13426 sequences (bug#8935).
13427
1d698799
LMI
13428 * lread.c (syms_of_lread): Clarify that is isn't only
13429 `eval-buffer' and `eval-defun' that's affected by
13430 `lexical-binding' (bug#8460).
13431
aa4b6df6
EZ
134322011-07-15 Eli Zaretskii <eliz@gnu.org>
13433
13434 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13435 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13436
5d856da6
PE
134372011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13438
ad6042bb
PE
13439 Fix minor problems found by static checking.
13440 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13441 (elsz): Now a signed constant, not a size_t var. We prefer signed
13442 types to unsigned, to avoid integer comparison confusion. Without
13443 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13444 "cannot optimize loop, the loop counter may overflow", a symptom
13445 of the confusion.
f00bbb22 13446 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13447 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13448
6468f31c
LMI
134492011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13450
49080b10
LMI
13451 * search.c (Fre_search_backward): Mention `case-fold-search' in
13452 all the re_search_* functions (bug#8138).
13453
6468f31c
LMI
13454 * keyboard.c (Fopen_dribble_file): Document when the file is
13455 closed (bug#8056).
13456
c965adc5
EZ
134572011-07-14 Eli Zaretskii <eliz@gnu.org>
13458
df9733bf
EZ
13459 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13460 bidi_cache_idx.
13461
0bb23927
EZ
13462 Support bidi reordering of display and overlay strings.
13463 * xdisp.c (compute_display_string_pos)
13464 (compute_display_string_end): Accept additional argument STRING.
13465 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13466 (reseat_to_string): Initialize bidi_it->string.s and
13467 bidi_it->string.schars.
13468 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13469 NULL (avoids a crash in bidi_paragraph_init).
13470 Initialize itb.string.lstring.
0bb23927
EZ
13471 (init_iterator): Call bidi_init_it only of a valid
13472 buffer position was specified. Initialize paragraph_embedding to
13473 L2R.
13474 (reseat_to_string): Initialize the bidi iterator.
13475 (display_string): If we need to ignore text properties of
13476 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13477 original value of -1 will not work with bidi.)
13478 (compute_display_string_pos): First arg is now struct
13479 `text_pos *'; all callers changed. Support display properties on
13480 Lisp strings.
13481 (compute_display_string_end): Support display properties on Lisp
13482 strings.
13483 (init_iterator, reseat_1, reseat_to_string): Initialize the
13484 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13485 when iterating on a string not from display properties).
640c8776
SM
13486 (compute_display_string_pos, compute_display_string_end):
13487 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13488 arrow keys.
13489 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13490 base_level_stop; instead, set base_level_stop to BEGV.
13491 Fixes crashes in vertical-motion.
0bb23927
EZ
13492 (next_element_from_buffer): Improve commentary for when
13493 the iterator is before prev_stop.
13494 (init_iterator): Initialize bidi_p from the default value of
13495 bidi-display-reordering, not from buffer-local value. Use the
13496 buffer-local value only if initializing for buffer iteration.
13497 (handle_invisible_prop): Support invisible properties on strings
13498 that are being bidi-reordered.
13499 (set_iterator_to_next): Support bidi reordering of C strings and
13500 Lisp strings.
13501 (next_element_from_string): Support bidi reordering of Lisp
13502 strings.
13503 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13504 (display_string): Support display of R2L glyph rows.
13505 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13506 (init_iterator): Don't initialize it->bidi_p for strings
13507 here.
13508 (reseat_to_string): Initialize it->bidi_p for strings here.
13509 (next_element_from_string, next_element_from_c_string)
13510 (next_element_from_buffer): Add xassert's for correspondence
13511 between IT's object being iterated and it->bidi_it.string
13512 structure.
13513 (face_before_or_after_it_pos): Support bidi iteration.
13514 (next_element_from_c_string): Handle the case of the first string
13515 character that is not the first one in the visual order.
13516 (get_visually_first_element): New function, refactored from common
13517 parts of next_element_from_buffer, next_element_from_string, and
13518 next_element_from_c_string.
13519 (tool_bar_lines_needed, redisplay_tool_bar)
13520 (display_menu_bar): Force left-to-right direction. Add a FIXME
13521 comment for making that be controlled by a user option.
13522 (push_it, pop_it): Save and restore the state of the
13523 bidi iterator. Save and restore the bidi_p flag.
13524 (pop_it): Iterate out of display property for string iteration as
13525 well.
13526 (iterate_out_of_display_property): Support iteration over strings.
13527 (handle_single_display_spec): Set up it->bidi_it for iteration
13528 over a display string, and call bidi_init_it.
13529 (handle_single_display_spec, next_overlay_string)
13530 (get_overlay_strings_1, push_display_prop): Set up the bidi
13531 iterator for displaying display or overlay strings.
13532 (forward_to_next_line_start): Don't use the shortcut if
13533 bidi-iterating.
13534 (back_to_previous_visible_line_start): If handle_display_prop
13535 pushed the iterator stack, restore the internal state of the bidi
13536 iterator by calling bidi_pop_it same number of times.
13537 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13538 and we are bidi-iterating, don't decrement the iterator position;
13539 instead, set the first_elt flag in the bidi iterator, to produce
13540 the same effect.
13541 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13542 (push_display_prop): xassert that we are iterating a buffer.
13543 (push_it, pop_it): Save and restore paragraph_embedding member.
13544 (handle_single_display_spec, next_overlay_string)
13545 (get_overlay_strings_1, reseat_1, reseat_to_string)
13546 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13547 correctly. Don't assume unibyte strings are not bidi-reordered.
13548 (compute_display_string_pos)
13549 (compute_display_string_end): Fix handling the case of C string.
13550 (push_it, pop_it): Save and restore from_disp_prop_p.
13551 (handle_single_display_spec, push_display_prop): Set the
13552 from_disp_prop_p flag.
13553 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13554 (pop_it): Call iterate_out_of_display_property only if we are
13555 popping after iteration over a string that came from a display
13556 property. Fix a typo in popping stretch info. Add an assertion
13557 for verifying that the iterator position is in sync with the bidi
13558 iterator.
13559 (handle_single_display_spec, get_overlay_strings_1)
13560 (push_display_prop): Fix initialization of paragraph direction for
13561 string when that of the parent object is not yet determined.
13562 (reseat_1): Call bidi_init_it to resync the bidi
13563 iterator with IT's position. (Bug#7616)
13564 (find_row_edges): If ROW->start.pos gives position
13565 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13566 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13567 Reset the from_disp_prop_p flag.
13568 (SAVE_IT, RESTORE_IT): New macros.
13569 (pos_visible_p, face_before_or_after_it_pos)
13570 (back_to_previous_visible_line_start)
13571 (move_it_in_display_line_to, move_it_in_display_line)
13572 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13573 (try_scrolling, redisplay_window, display_line): Use them when
13574 saving a temporary copy of the iterator and restoring it back.
13575 (back_to_previous_visible_line_start, reseat_1)
13576 (init_iterator): Empty the bidi cache "stack".
13577 (move_it_in_display_line_to): If iterator ended up at
13578 EOL, but we never saw any buffer positions smaller than
13579 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13580 motion in bidi-reordered lines.
13581 (move_it_in_display_line_to): Record prev_method and prev_pos
13582 immediately before the call to set_iterator_to_next. Fixes cursor
13583 motion in bidi-reordered lines with stretch glyphs and strings
13584 displayed in margins. (Bug#8133) (Bug#8867)
13585 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13586 TO_CHARPOS.
640c8776
SM
13587 (pos_visible_p): Support positions in bidi-reordered lines.
13588 Save and restore bidi cache.
0bb23927
EZ
13589
13590 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13591 (bidi_paragraph_info): Delete unused struct.
13592 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13593 (bidi_cache_start): New variable.
13594 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13595 to zero.
13596 (bidi_cache_fetch_state, bidi_cache_search)
13597 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13598 (bidi_cache_find, bidi_peek_at_next_level)
13599 (bidi_level_of_next_char, bidi_find_other_level_edge)
13600 (bidi_move_to_visually_next): Compare cache index with
13601 bidi_cache_start rather than with zero.
13602 (bidi_fetch_char): Accept new argument STRING; all callers
13603 changed. Support iteration over a string. Support strings with
13604 display properties. Support unibyte strings. Fix the type of
13605 `len' according to what STRING_CHAR_AND_LENGTH expects.
13606 (bidi_paragraph_init, bidi_resolve_explicit_1)
13607 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13608 (bidi_level_of_next_char, bidi_move_to_visually_next):
13609 Support iteration over a string.
0bb23927
EZ
13610 (bidi_set_sor_type, bidi_resolve_explicit_1)
13611 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13612 can now be zero (for strings); special values 0 and -1 were
13613 changed to -1 and -2, respectively.
13614 (bidi_char_at_pos): New function.
13615 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13616 Call it instead of FETCH_MULTIBYTE_CHAR.
13617 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13618 initialized to valid values.
13619 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13620 values.
13621 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13622 the test for valid cached positions. Fix the logic for looking up
13623 the sentinel state in the cache. GCPRO the Lisp string we are
13624 iterating.
13625 (bidi_push_it, bidi_pop_it): New functions.
13626 (bidi_initialize): Initialize the bidi cache start stack pointer.
13627 (bidi_cache_ensure_space): New function, refactored from part of
13628 bidi_cache_iterator_state. Don't assume the required size is just
13629 one BIDI_CACHE_CHUNK away.
13630 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13631 (bidi_count_bytes, bidi_char_at_pos): New functions.
13632 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13633 always valid if bidi_cache_idx is valid.
13634 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13635 is valid if it's going to be used.
13636 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13637 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13638 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13639 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13640 (bidi_find_other_level_edge, bidi_cache_start_stack):
13641 All variables related to cache indices are now EMACS_INT.
c965adc5 13642
0bb23927
EZ
13643 * dispextern.h (struct bidi_string_data): New structure.
13644 (struct bidi_it): New member `string'. Make flag members be 1-bit
13645 fields, and put them last in the struct.
640c8776
SM
13646 (compute_display_string_pos, compute_display_string_end):
13647 Update prototypes.
0bb23927
EZ
13648 (bidi_push_it, bidi_pop_it): Add prototypes.
13649 (struct iterator_stack_entry): New members bidi_p,
13650 paragraph_embedding, and from_disp_prop_p.
13651 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13652 (bidi_shelve_cache, bidi_unshelve_cache):
13653 Declare prototypes.
0bb23927
EZ
13654
13655 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13656 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13657 and vector-like objects.
13658
13659 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13660 cache around display iteration.
13661
13662 * window.c (Fwindow_end, window_scroll_pixel_based)
13663 (displayed_window_lines, Frecenter): Save and restore the bidi
13664 cache around display iteration.
13665
3bbd2265
LMI
136662011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13667
13668 * editfns.c (Fdelete_region): Clarify the use of the named
13669 parameters (bug#6788).
13670
adc47434
MR
136712011-07-14 Martin Rudalics <rudalics@gmx.at>
13672
13673 * indent.c (Fvertical_motion): Set and restore w->pointm when
13674 saving and restoring the window's buffer (Bug#9006).
13675
837c31f8
LMI
136762011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13677
13678 * editfns.c (Fstring_to_char): Clarify just what is returned
13679 (bug#6576). Text by Eli Zaretskii.
13680
ac389d0c
JB
136812011-07-13 Juanma Barranquero <lekktu@gmail.com>
13682
13683 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13684
0be0ce47
EZ
136852011-07-13 Eli Zaretskii <eliz@gnu.org>
13686
13687 * buffer.c (mmap_find): Fix a typo.
13688
cd18e7e3
JB
136892011-07-13 Johan Bockgård <bojohan@gnu.org>
13690
13691 Fix execution of x selection hooks.
13692 * xselect.c (Qx_lost_selection_functions)
13693 (Qx_sent_selection_functions): New vars.
13694 (syms_of_xselect): DEFSYM them.
13695 (x_handle_selection_request): Pass Qx_sent_selection_functions
13696 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13697 (x_handle_selection_clear,x_clear_frame_selections):
13698 Pass Qx_lost_selection_functions rather than
13699 Vx_lost_selection_functions to Frun_hook_with_args.
13700
47ea7f44
PE
137012011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13702
ac389d0c 13703 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13704 The old code sometimes used this field without initializing it.
13705
47ea7f44
PE
13706 * alloc.c (gc_sweep): Don't read past end of array.
13707 In theory, the old code could also have corrupted Emacs internals,
13708 though it'd be very unlikely.
13709
bc985c87
AS
137102011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13711
13712 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13713 argument. (Bug#4026)
bc985c87 13714
0cf34688
LMI
137152011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13716
b3dadd76
LMI
13717 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13718 key" (bug#4257).
13719
0cf34688
LMI
13720 * window.c (Fset_window_start): Doc fix (bug#4199).
13721 (Fset_window_hscroll): Ditto.
13722
270768cd
PE
137232011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13724
077e3dda 13725 Fix minor new problems caught by GCC 4.6.1.
270768cd 13726 * term.c (init_tty): Remove unused local.
490011a6 13727 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13728 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13729 not used otherwise.
270768cd 13730
b1f58454
CY
137312011-07-12 Chong Yidong <cyd@stupidchicken.com>
13732
13733 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13734
22b9578d
LMI
137352011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13736
6e70ab07
LMI
13737 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13738 are the mini-buffer and the echo area (bug#3320).
13739
22b9578d
LMI
13740 * term.c (init_tty): Remove support for supdup, c10 and perq
13741 terminals, which are no longer supported (bug#1482).
13742
8974cc9f
JB
137432011-07-10 Johan Bockgård <bojohan@gnu.org>
13744
13745 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13746
a560d974
JD
137472011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13748
13749 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13750 for non-popups (Bug#3642).
13751
1dae0f0a
AS
137522011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13753
268c2c36 13754 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13755 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13756 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13757 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13758 * data.c (fmod): Likewise.
13759 * dispnew.c (swap_glyphs_in_rows): Likewise.
13760 * emacs.c (memory_warning_signal): Likewise.
13761 * floatfns.c (float_error): Likewise.
13762 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13763 (otf_open, font_otf_capability, generate_otf_features)
13764 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13765 Likewise.
13766 * image.c (pbm_read_file): Likewise.
13767 * indent.c (string_display_width): Likewise.
13768 * intervals.c (check_for_interval, search_for_interval)
13769 (inc_interval_count, count_intervals, root_interval)
13770 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13771 * lread.c (defalias): Likewise.
268c2c36 13772 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13773 * regex.c (set_image_of_range_1, set_image_of_range)
13774 (regex_grow_registers): Likewise.
13775 * sysdep.c (strerror): Likewise.
13776 * termcap.c (valid_filename_p, tprint, main): Likewise.
13777 * tparam.c (main): Likewise.
13778 * unexhp9k800.c (run_time_remap, save_data_space)
13779 (update_file_ptrs, read_header, write_header, calculate_checksum)
13780 (copy_file, copy_rest, display_header): Likewise.
13781 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13782 Likewise.
13783 * xdisp.c (check_it): Likewise.
13784 * xfaces.c (register_color, unregister_color, unregister_colors):
13785 Likewise.
13786 * xfns.c (print_fontset_result): Likewise.
13787 * xrdb.c (member, fatal, main): Likewise.
13788
99033785
PE
137892011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13790
13791 Fix minor problems found by static checking (Bug#9031).
13792 * chartab.c (char_table_set_range, map_sub_char_table):
13793 Remove unused locals.
13794 (uniprop_table): Now static.
13795 * composite.c (_work_char): Remove unused static var.
13796
9cb2ac56
JB
137972011-07-09 Juanma Barranquero <lekktu@gmail.com>
13798
13799 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13800
f25661f0
JD
138012011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13802
13803 * gtkutil.c (qttip_cb): Remove code without function.
13804
8278c4fe
EZ
138052011-07-09 Eli Zaretskii <eliz@gnu.org>
13806
13807 * w32.c (pthread_sigmask): New stub.
13808
1692ae2d 138092011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13810
8a6ebd58 13811 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13812 sigprocmask is portable only for single-threaded applications, and
13813 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13814 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13815 (LIBES): Use it.
13816 * callproc.c (Fcall_process):
13817 * process.c (create_process):
13818 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13819 Use pthread_sigmask, not sigprocmask.
123403e4 13820
1b854618
JD
138212011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13822
13823 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13824 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13825 wrong (Bug#8591).
13826
3fe4b549
JD
138272011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13828
0ce7e563
JD
13829 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13830 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13831 (xg_hide_tooltip): Fix comment.
13832
3fe4b549
JD
13833 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13834 in registerServicesMenuSendTypes.
13835 (validRequestorForSendType): Don't check ns_return_types.
13836
13837 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13838 ns_return_type.
13839
5df75e47
JR
138402011-07-08 Jason Rumney <jasonr@gnu.org>
13841
22610910
JR
13842 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13843 SH_SHOW for hidden windows (Bug#5482).
13844
5df75e47
JR
13845 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13846 frame struct members of non-existent frames (Bug#6284).
13847
699c10bd
JD
138482011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13849
4393663b
JD
13850 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13851 variable firstTime not needed on OSX >= 10.6.
13852 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13853 >= 10.5. Use setKnobProportion, setDoubleValue.
13854
13855 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13856 (MAC_OS_X_VERSION_10_5): Define if not defined.
13857 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13858 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13859 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13860
13861 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13862 cString and lossyCString on OSX >= 10.4.
4393663b 13863
58179cce 13864 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13865 sizeToFit on OSX >= 10.2.
13866
13867 * nsimage.m (allocInitFromFile): Don't use deprecated method
13868 bestRepresentationForDevice on OSX >= 10.6.
13869
13870 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13871 to avoid warning.
13872
13873 * emacs.c: Declare unexec_init_emacs_zone.
13874
a63e0781
JD
13875 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13876
699c10bd
JD
13877 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13878
13879 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13880 on svcsMenu (Bug#8842).
13881
13882 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13883 ns_return_types.
13884 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13885
13886 * nsterm.m (QUTF8_STRING): Declare.
13887 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13888 (validRequestorForSendType): Return type is (id).
13889 Change indexOfObjectIdenticalTo to indexOfObject.
13890 Check if we have local selection before returning self (Bug#8842).
13891 (writeSelectionToPasteboard): Put local selection into paste board
13892 if we have a local selection (Bug#8842).
13893 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13894
13895 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13896 (ns_get_local_selection): Declare.
13897
54e10184
LMI
138982011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13899
9888ff71
LMI
13900 * keymap.c (describe_map_tree): Don't insert a double newline at
13901 the end of the buffer (bug#1169) and return whether we inserted
13902 something.
13903
54e10184
LMI
13904 * callint.c (Fcall_interactively): Change "reading args" to
13905 "providing args" to try to clarify what it does (bug#1010).
13906
15fa4783
KH
139072011-07-07 Kenichi Handa <handa@m17n.org>
13908
13909 * composite.c (composition_compute_stop_pos): Ignore a static
13910 composition starting before CHARPOS (Bug#8915).
13911
13912 * xdisp.c (handle_composition_prop): Likewise.
13913
a8815b00
EZ
139142011-07-07 Eli Zaretskii <eliz@gnu.org>
13915
13916 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13917 (Bug#9015)
13918
ef7b981d 139192011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13920
13921 * character.h (unicode_category_t): New enum type.
13922
13923 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13924 (Qchar_code_property_table): New variable.
13925 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13926 (UNIPROP_COMPRESSED_FORM_P): New macros.
13927 (char_table_ascii): Uncompress the compressed values.
13928 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13929 Uncompress the compressed values.
ac389d0c 13930 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13931 (char_table_ref_and_range): Uncompress the compressed values.
13932 (sub_char_table_set): New arg is_uniprop. Callers changed.
13933 Uncompress the compressed values.
13934 (sub_char_table_set_range): Args changed. Callers changed.
13935 (char_table_set_range): Adjuted for the above change.
13936 (map_sub_char_table): Delete args default_val and parent. Add arg
13937 top. Give decoded values to a Lisp function.
640c8776 13938 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13939 values to a Lisp function. Gcpro more variables.
13940 (uniprop_table_uncompress)
13941 (uniprop_decode_value_run_length): New functions.
13942 (uniprop_decoder, uniprop_decoder_count): New variables.
13943 (uniprop_get_decoder, uniprop_encode_value_character)
13944 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13945 New functions.
13946 (uniprop_encoder, uniprop_encoder_count): New variables.
13947 (uniprop_get_encoder, uniprop_table)
13948 (Funicode_property_table_internal, Fget_unicode_property_internal)
13949 (Fput_unicode_property_internal): New functions.
13950 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13951 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13952 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13953 char-code-property-alist.
13954
640c8776 13955 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13956 Vunicode_category_table.
13957
640c8776 13958 * font.c (font_range): Adjust for the change of
c805dec0
KH
13959 Vunicode_category_table.
13960
76b397fb
DN
139612011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13962
13963 * m/iris4d.h: Remove file, move contents ...
13964 * s/irix6-5.h: ... here.
13965
22b4128e
PE
139662011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13967
13968 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13969 * alloc.c (mark_buffer):
13970 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13971 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13972 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13973 This isn't true in general, and it's particularly not true
13974 if Emacs is configured with --with-wide-int.
13975 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13976 New macros, used in the buffer.c change.
13977
869795d6
JD
139782011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13979
13980 * xsettings.c: Use both GConf and GSettings if both are available.
13981 (store_config_changed_event): Add comment.
13982 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13983 (store_tool_bar_style_changed): New functions.
5e617bc2 13984 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13985 (struct xsettings): Move font inside HAVE_XFT.
13986 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13987 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13988 Move inside HAVE_XFT.
640c8776 13989 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13990 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13991 also.
13992 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13993 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13994 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13995 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13996 (parse_settings): Move check for font inside HAVE_XFT.
13997 (read_settings, apply_xft_settings): Add comment.
13998 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13999 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14000 call store_font_name_changed.
14001 (xft_settings_event): Add comment.
14002 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14003 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14004 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14005 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14006 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
14007 (xsettings_get_system_font, xsettings_get_system_normal_font):
14008 Add comment.
869795d6 14009
d8ed26bd
PE
140102011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14011
14012 Random fixes. E.g., (random) never returned negative values.
14013 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14014 subseconds part to the entropy, as that's a bit more random.
14015 Prefer signed to unsigned, since the signedness doesn't matter and
14016 in general we prefer signed. When given a limit, use a
14017 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14018 latter isn't right if USE_2_TAGS_FOR_INTS.
14019 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14020 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14021
cabf1cac
SM
140222011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14023
14024 * textprop.c (text_property_stickiness):
14025 Obey Vtext_property_default_nonsticky.
14026 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14027 * w32fns.c (syms_of_w32fns):
14028 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14029
6e9b2be9
PE
140302011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14031
14032 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14033 This is more efficient than Ffile_directory_p and avoids a minor race.
14034
90186c68
LMI
140352011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14036
7c301272
LMI
14037 * buffer.c (Foverlay_put): Say what the return value is
14038 (bug#7835).
14039
c4f2d8d4
LMI
14040 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14041 is a directory before asking whether to use the file name
14042 (bug#7564).
ad637907
LMI
14043 (barf_or_query_if_file_exists): Make the "File is a directory"
14044 error be more correct.
c4f2d8d4 14045
90186c68
LMI
14046 * fns.c (Frequire): Remove the mention of the .gz files, since
14047 that's installation-specific, but keep the mention of
14048 `get-load-suffixes'.
14049
da64016e
PE
140502011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14051
14052 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14053 Report string overflow if the output is too long.
14054
7d47b580
JB
140552011-07-04 Juanma Barranquero <lekktu@gmail.com>
14056
a555cb87
JB
14057 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14058 (syms_of_gnutls): Remove duplicate DEFSYM for
14059 Qgnutls_bootprop_verify_hostname_error, an error for
14060 Qgnutls_bootprop_verify_error (which is no longer used).
14061
7d47b580
JB
14062 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14063 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14064 Also (re)move comments that are misplaced or no longer relevant.
14065
1e49bfab
LMI
140662011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14067
14068 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14069
1485f4c0
CY
140702011-07-03 Chong Yidong <cyd@stupidchicken.com>
14071
14072 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14073 and background color parameters if they have been changed.
14074
a9ab721e
LMI
140752011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14076
14077 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14078
cf7cff57
PE
140792011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14080
2e13213d
PE
14081 * xsettings.c (SYSTEM_FONT): Define only when used.
14082 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14083
cf7cff57
PE
14084 * keymap.c (access_keymap_1): Now static.
14085
7a8e04f7
CY
140862011-07-02 Chong Yidong <cyd@stupidchicken.com>
14087
14088 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14089 leave any prefix arg for the up event (Bug#1586).
14090
61352f62
LMI
140912011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14092
69bb1ef7
LMI
14093 * lread.c (syms_of_lread): Mention single symbols defined by
14094 `defvar' or `defconst' (bug#7154).
14095
61352f62 14096 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 14097 (Frequire): Mention get-load-suffixes.
61352f62 14098
28545e04
MR
140992011-07-02 Martin Rudalics <rudalics@gmx.at>
14100
14101 * window.h (window): Remove clone_number slot.
14102 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14103 Remove.
14104 (make_parent_window, make_window, saved_window)
14105 (Fset_window_configuration, save_window_save): Don't deal with
14106 clone numbers.
14107 * buffer.c (Qclone_number): Remove declaration.
14108 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14109
3349e122
SM
141102011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14111
14112 Add multiple inheritance to keymaps.
14113 * keymap.c (Fmake_composed_keymap): New function.
14114 (Fset_keymap_parent): Simplify.
14115 (fix_submap_inheritance): Remove.
14116 (access_keymap_1): New function extracted from access_keymap to handle
14117 embedded parents and handle lists of maps.
14118 (access_keymap): Use it.
14119 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14120 (Fcopy_keymap): Handle embedded parents.
14121 (Fcommand_remapping, define_as_prefix): Simplify.
14122 (Fkey_binding): Simplify.
14123 (syms_of_keymap): Move minibuffer-local-completion-map,
14124 minibuffer-local-filename-completion-map,
14125 minibuffer-local-must-match-map, and
14126 minibuffer-local-filename-must-match-map to Elisp.
14127 (syms_of_keymap): Defsubr make-composed-keymap.
14128 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14129 (parse_menu_item): Trivial simplification.
14130
3279eb87
GM
141312011-07-01 Glenn Morris <rgm@gnu.org>
14132
14133 * Makefile.in (SETTINGS_LIBS): Fix typo.
14134
39cb9e56 141352011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
14136
14137 * coding.c (Fencode_coding_string): Record the last coding system
14138 used, as the function doc string says (bug#8738).
14139
0949d2b6
JD
141402011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14141
14142 * xsettings.c (store_monospaced_changed): Take new font as arg and
14143 check for change against current_mono_font.
14144 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14145 (emacs_settings_constructor, emacs_settings_get_property)
14146 (emacs_settings_set_property, emacs_settings_class_init)
14147 (emacs_settings_init, gsettings_obj): Remove.
14148 (something_changedCB): New function for HAVE_GSETTINGS.
14149 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14150 with value as argument.
14151 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14152 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 14153 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
14154 "changed".
14155
14156 * xgselect.c: Add defined (HAVE_GSETTINGS).
14157 (xgselect_initialize): Ditto.
14158
14159 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14160 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14161 xg_select.
14162
bbc6b304
PE
141632011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14164
14165 * eval.c (struct backtrace): Simplify and port the data structure.
14166 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14167 signed bit field, as this assumption is not portable and it makes
14168 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14169 "char debug_on_exit : 1" as this is not portable either; instead,
14170 use the portable "unsigned int debug_on_exit : 1". Remove unused
14171 member evalargs. Remove obsolete comments about cc bombing out.
14172
9851bfc5
JD
141732011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14174
51bb811f 14175 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
14176 Let HAVE_GSETTINGS override HAVE_GCONF.
14177 (store_monospaced_changed): New function.
14178 (EMACS_SETTINGS): A new type derived from GObject to handle
14179 GSettings notifications.
14180 (emacs_settings_constructor, emacs_settings_get_property)
14181 (emacs_settings_set_property, emacs_settings_class_init):
14182 New functions.
14183 (gsettings_client, gsettings_obj): New variables.
14184 (GSETTINGS_SCHEMA): New define.
14185 (something_changedCB): Call store_monospaced_changed.
14186 (init_gsettings): New function.
14187 (xsettings_initialize): Call init_gsettings.
14188 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14189 to NULL.
14190
640c8776 14191 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
14192 GCONF_CFLAGS/LIBS.
14193
5386012d
MR
141942011-06-29 Martin Rudalics <rudalics@gmx.at>
14195
14196 * window.c (resize_root_window, grow_mini_window)
14197 (shrink_mini_window): Rename Qresize_root_window to
14198 Qwindow_resize_root_window and Qresize_root_window_vertically to
14199 Qwindow_resize_root_window_vertically.
14200
f13e0b08
PE
142012011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14202
14203 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14204
94515237
JB
142052011-06-27 Juanma Barranquero <lekktu@gmail.com>
14206
14207 * makefile.w32-in: Redesign dependencies so they reflect more
14208 clearly which files are directly included by each source file,
14209 and not through other includes.
14210
e43b6e43
MR
142112011-06-27 Martin Rudalics <rudalics@gmx.at>
14212
14213 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14214 (sort_overlays, overlay_strings): When an overlay's clone number
14215 matches the window's clone number process the overlay even if
14216 the overlay's window property doesn't match the current window.
14217
d68443dc
MR
14218 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14219 (Fwindow_hchild): Rename to Fwindow_left_child.
14220 (Fwindow_next): Rename to Fwindow_next_sibling.
14221 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
14222 (resize_window_check): Rename to window_resize_check.
14223 (resize_window_apply): Rename to window_resize_apply.
14224 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14225 (Fdelete_other_windows_internal, resize_frame_windows)
14226 (Fsplit_window_internal, Fdelete_window_internal)
14227 (grow_mini_window, shrink_mini_window)
14228 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 14229
c7e73be5
JD
142302011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14231
14232 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14233 (emacs_fixed_set_min_size): Remove.
14234 (emacs_fixed_new): Take frame as argument.
14235
14236 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14237 (_EmacsFixedPrivate): Remove minwidth/height.
14238 Add struct frame *f.
14239 (emacs_fixed_init): Initialize priv->f.
14240 (get_parent_class, emacs_fixed_set_min_size): Remove.
14241 (emacs_fixed_new): Set priv->f to argument.
14242 (emacs_fixed_get_preferred_width)
14243 (emacs_fixed_get_preferred_height): Use min_width/height from
14244 frames size_hint to set minimum and natural (Bug#8919).
14245 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14246 and use min_width/height from frames size_hint to set
14247 min_width/height (Bug#8919).
14248
14249 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
14250 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14251 Fix indentation.
c7e73be5 14252
cf99dcf8
EZ
142532011-06-26 Eli Zaretskii <eliz@gnu.org>
14254
14255 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14256 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14257 called at ZV.
14258
029529ac
CY
142592011-06-26 Chong Yidong <cyd@stupidchicken.com>
14260
14261 * process.c (wait_reading_process_output): Bypass select if
14262 waiting for a cell while ignoring keyboard input, and input is
14263 pending. Suggested by Jan Djärv (Bug#8869).
14264
7a7ef429
PE
142652011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14266
14267 Use gnulib's dup2 module instead of rolling our own.
14268 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14269
11fdef7d 142702011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
14271
14272 * dispnew.c (scrolling_window): Before scrolling, turn off a
14273 mouse-highlight in the window being scrolled.
14274
cd3520a4
JB
142752011-06-24 Juanma Barranquero <lekktu@gmail.com>
14276
14277 Move DEFSYM to lisp.h and use everywhere.
14278
14279 * character.h (DEFSYM): Move declaration...
14280 * lisp.h (DEFSYM): ...here.
14281
14282 * gnutls.c:
14283 * minibuf.c:
14284 * w32menu.c:
14285 * w32proc.c:
14286 * w32select.c: Don't include character.h.
14287
14288 * alloc.c (syms_of_alloc):
14289 * buffer.c (syms_of_buffer):
14290 * bytecode.c (syms_of_bytecode):
14291 * callint.c (syms_of_callint):
14292 * casefiddle.c (syms_of_casefiddle):
14293 * casetab.c (init_casetab_once):
14294 * category.c (init_category_once, syms_of_category):
14295 * ccl.c (syms_of_ccl):
14296 * cmds.c (syms_of_cmds):
14297 * composite.c (syms_of_composite):
14298 * dbusbind.c (syms_of_dbusbind):
14299 * dired.c (syms_of_dired):
14300 * dispnew.c (syms_of_display):
14301 * doc.c (syms_of_doc):
14302 * editfns.c (syms_of_editfns):
14303 * emacs.c (syms_of_emacs):
14304 * eval.c (syms_of_eval):
14305 * fileio.c (syms_of_fileio):
14306 * fns.c (syms_of_fns):
14307 * frame.c (syms_of_frame):
14308 * fringe.c (syms_of_fringe):
14309 * insdel.c (syms_of_insdel):
14310 * keymap.c (syms_of_keymap):
14311 * lread.c (init_obarray, syms_of_lread):
14312 * macros.c (syms_of_macros):
14313 * msdos.c (syms_of_msdos):
14314 * print.c (syms_of_print):
14315 * process.c (syms_of_process):
14316 * search.c (syms_of_search):
14317 * sound.c (syms_of_sound):
14318 * syntax.c (init_syntax_once, syms_of_syntax):
14319 * terminal.c (syms_of_terminal):
14320 * textprop.c (syms_of_textprop):
14321 * undo.c (syms_of_undo):
14322 * w32.c (globals_of_w32):
14323 * window.c (syms_of_window):
14324 * xdisp.c (syms_of_xdisp):
14325 * xfaces.c (syms_of_xfaces):
14326 * xfns.c (syms_of_xfns):
14327 * xmenu.c (syms_of_xmenu):
14328 * xsettings.c (syms_of_xsettings):
14329 * xterm.c (syms_of_xterm): Use DEFSYM.
14330
4228cf16
TZ
143312011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14332
cd3520a4 14333 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14334
7fcccf1e
PE
143352011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14336
7efb4e0e
PE
14337 Integer and buffer overflow fixes (Bug#8873).
14338
ff5844ad
PE
14339 * print.c (printchar, strout): Check for string overflow.
14340 (PRINTPREPARE, printchar, strout):
14341 Don't set size unless allocation succeeds.
14342
90532f02
PE
14343 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14344 for sizes. Check for string overflow more accurately.
14345 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14346
6d84508d
PE
14347 * macros.c: Integer and buffer overflow fixes.
14348 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14349 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14350 Use ptrdiff_t, not int, for sizes.
14351 Don't increment bufsize until after realloc succeeds.
14352 Check for size-calculation overflow.
14353 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14354
437b2cb4
PE
14355 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14356
8b9ac8b4
PE
14357 * lread.c: Integer overflow fixes.
14358 (read_integer): Radix is now EMACS_INT, not int,
14359 to improve quality of diagnostics for out-of-range radices.
14360 Calculate buffer size correctly for out-of-range radices.
14361 (read1): Check for integer overflow in radices, and in
14362 read-circle numbers.
82cb60d3
PE
14363 (read_escape): Avoid int overflow.
14364 (Fload, openp, read_buffer_size, read1)
14365 (substitute_object_recurse, read_vector, read_list, map_obarray):
14366 Use ptrdiff_t, not int, for sizes.
14367 (read1): Use EMACS_INT, not int, for sizes.
20270765 14368 Check for size overflow.
8b9ac8b4 14369
7fcccf1e
PE
14370 * image.c (cache_image): Check for size arithmetic overflow.
14371
bfbbd7e7
PE
14372 * lread.c: Integer overflow issues.
14373 (saved_doc_string_size, saved_doc_string_length)
14374 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14375 Now ptrdiff_t, not int.
14376 (read1): Don't assume doc string length fits in int. Check for
14377 out-of-range doc string lengths.
14378 (read_list): Don't assume file position fits in int.
39019e54 14379 (read_escape): Check for hex character overflow.
bfbbd7e7 14380
4e323265
LL
143812011-06-22 Leo Liu <sdl.web@gmail.com>
14382
14383 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14384 Move to minibuffer.el.
14385
85fece3e
PE
143862011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14387
20b84ce9 14388 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14389 The following patches are for when GLYPH_DEBUG && !XASSERT.
14390 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14391 * dispnew.c (flush_stdout):
14392 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14393 Mark as externally visible.
14394 * dispnew.c (check_window_matrix_pointers): Now static.
14395 * dispnew.c (window_to_frame_vpos):
14396 * xfns.c (unwind_create_frame):
14397 * xterm.c (x_check_font): Remove unused local.
14398 * scroll.c (CHECK_BOUNDS):
14399 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14400 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14401 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14402 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14403 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14404 Now static.
14405 (debug_method_add): Use va_list and vsprintf rather than relying
14406 on undefined behavior with wrong number of arguments.
14407 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14408 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14409 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14410 since we're not interested in debugging glyphs with old libraries.
14411 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14412 GCC 4.6.0's static checking.
14413
0766b489
PE
144142011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14415
31fd4b32
PE
14416 Integer overflow and signedness fixes (Bug#8873).
14417 A few related buffer overrun fixes, too.
14418
b79e8648
PE
14419 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14420
0766b489
PE
14421 * dispextern.h (struct face.stipple):
14422 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14423 (x_bitmap_mask, x_allocate_bitmap_record)
14424 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14425 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14426 (x_create_bitmap_from_xpm_data):
14427 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14428 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14429 (.bitmaps_last):
14430 * xfaces.c (load_pixmap):
14431 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14432 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14433 (.bitmaps_last, struct x_output.icon_bitmap):
14434 Use ptrdiff_t, not int, for bitmap indexes.
14435 (x_allocate_bitmap_record): Check for size overflow.
14436 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14437
b081724f
PE
14438 Use ptrdiff_t, not int, for overlay counts.
14439 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14440 * editfns.c (overlays_around, get_pos_property):
14441 * textprop.c (get_char_property_and_overlay):
14442 * xdisp.c (next_overlay_change, note_mouse_highlight):
14443 * xfaces.c (face_at_buffer_position):
21514da7
PE
14444 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14445 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14446 (Fnext_overlay_change, Fprevious_overlay_change)
14447 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14448 Use ptrdiff_t, not int, for sizes.
21514da7 14449 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14450
3de73e5e
PE
14451 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14452
2606c57b
PE
14453 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14454 (x_session_initialize): Do not assume string length fits in int.
14455
aaafe47a
PE
14456 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14457 This is unlikely, but can occur if DPI is outlandish.
14458
2674ddc8 14459 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14460 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14461
28154962
PE
14462 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14463 * xrdb.c (magic_file_p, search_magic_path):
14464 Omit last arg SUFFIX; it was always 0. All callers changed.
14465 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14466
7de51af5
PE
14467 * xfont.c (xfont_match): Avoid need for strlen.
14468
25ed6cc3
PE
14469 * xfns.c: Don't assume strlen fits in int.
14470 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14471
4eab31dd
PE
14472 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14473 not unsigned long, as we prefer signed integers. All callers changed.
14474 Detect integer overflow in repeat count.
14475 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14476 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14477
171e2a58
PE
14478 * termcap.c: Don't assume sizes fit in int and never overflow.
14479 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14480 (gobble_line): Check for size-calculation overflow.
14481
ad39faca 14482 * minibuf.c (Fread_buffer):
6e5bb2dc 14483 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14484 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14485 Don't assume string length fits in int.
14486
52c61c22 14487 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14488 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14489
b5b8c9e5
PE
14490 * font.c: Don't assume string length fits in int.
14491 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14492 Use ptrdiff_t, not int.
ccd6111c
PE
14493 (font_intern_prop): Don't assume string length fits in int.
14494 Don't assume integer property fits in fixnum.
14495 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14496
882f0d81 14497 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14498 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14499 Reformulate so as not to need the command string.
14500 Invoke gzip -cd rather than gunzip, as it's more portable.
14501 (lock_info_type, lock_file_1, lock_file):
14502 Don't assume pid_t and time_t fit in unsigned long.
14503 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14504 (current_lock_owner): Prefer signed type for sizes.
14505 Use memcpy, not strncpy, where memcpy is what is really wanted.
14506 Don't assume (via atoi) that time_t and pid_t fit in int.
14507 Check for time_t and/or pid_t out of range, e.g., via a network share.
14508 Don't alloca where an auto var works fine.
14509
93f4cf88
PE
14510 * fileio.c: Fix some integer overflow issues.
14511 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14512 Don't assume string length fits in int.
14513 (directory_file_name): Don't assume string length fits in long.
14514 (make_temp_name): Don't assume pid fits in int, or that its print
14515 length is less than 20.
14516
f3e92b69
PE
14517 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14518
1bfdaf10
PE
14519 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14520
35016e9a
PE
14521 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14522
3d1e65a1
PE
14523 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14524 We prefer signed integers, even for size calculations.
14525
0b963a93
PE
14526 * emacs.c: Don't assume string length fits in 'int'.
14527 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14528 (main): Don't invoke strlen when not needed.
14529
573f4b54
PE
14530 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14531 (XD_DEBUG_MESSAGE): Don't waste a byte.
14532
989f33ba
PE
14533 * callproc.c (getenv_internal_1, getenv_internal)
14534 (Fgetenv_internal):
965d34eb
PE
14535 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14536
e4d29b33
PE
14537 * lread.c (invalid_syntax): Omit length argument.
14538 All uses changed. This doesn't fix a bug, but it simplifies the
14539 code away from its former Hollerith-constant appearance, and it's
14540 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14541 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14542
eb49b136
PE
14543 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14544 This didn't break anything, but it didn't help either.
14545 It's confusing to put a bogus integer in a place where the actual
14546 value does not matter.
9f62aeb1 14547 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14548 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14549
15375a22
PE
14550 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14551 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14552 implementation.
b61cc01c
PE
14553 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14554 We prefer signed types, and the value cannot exceed the EMACS_INT
14555 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14556 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14557 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14558 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14559
53b2623d
PE
14560 * indent.c (sane_tab_width): New function.
14561 (current_column, scan_for_column, Findent_to, position_indentation)
14562 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14563 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14564
51cab52b 14565 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14566
f2ed8a70
PE
14567 * lisp.h (lint_assume): New macro.
14568 * composite.c (composition_gstring_put_cache):
14569 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14570
abe80cc6
PE
14571 * editfns.c, insdel.c:
14572 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14573
b02c740e
PE
14574 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14575
ebc96716
PE
14576 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14577
b4e50fa0 14578 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14579 Use much-faster test for byte-length change.
311d5d7c 14580 Don't assume string byte-length fits in 'int'.
a4cf38e4 14581 Check that character arg fits in 'int'.
85461888 14582 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14583
c0c1ee9f
PE
14584 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14585
a498d7f4
PE
14586 * fns.c (concat): Catch string overflow earlier.
14587 Do not rely on integer wraparound.
14588
51cab52b
PE
14589 * dispextern.h (struct it.overlay_strings_charpos)
14590 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14591 * xdisp.c (forward_to_next_line_start)
14592 (back_to_previous_visible_line_start)
14593 (reseat_at_next_visible_line_start, next_element_from_buffer):
14594 Don't arbitrarily truncate the value of 'selective' to int.
14595
76031fad
PE
14596 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14597
5eb55db9
PE
14598 * composite.c: Don't truncate sizes to 'int'.
14599 (composition_gstring_p, composition_reseat_it)
14600 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14601 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14602 not EMACS_UINT, for indexes.
5eb55db9 14603
0703a717
PE
14604 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14605
d6202519
PE
14606 * buffer.c: Include <verify.h>.
14607 (struct sortvec.priority, struct sortstr.priority):
8961a454 14608 Now EMACS_INT, not int.
c20998a7 14609 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14610 (struct sortstr.size, record_overlay_string)
14611 (struct sortstrlist.size, struct sortlist.used):
14612 Don't truncate size to int.
14613 (record_overlay_string): Check for size-calculation overflow.
d6202519 14614 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14615
d5a19415
JM
146162011-06-22 Jim Meyering <meyering@redhat.com>
14617
029529ac 14618 Don't leak an XBM-image-sized buffer
d5a19415
JM
14619 * image.c (xbm_load): Free the image buffer after using it.
14620
a9041e6c
PE
146212011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14622
14623 Port to Sun C.
14624 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14625 that Sun C diagnosed.
14626 * fns.c (secure_hash): Fix pointer signedness issue.
14627 * intervals.c (static_offset_intervals): New function.
14628 (offset_intervals): Use it.
14629
7f3f739f
LL
146302011-06-21 Leo Liu <sdl.web@gmail.com>
14631
14632 * deps.mk (fns.o):
14633 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14634 sha512.h.
14635
14636 * fns.c (secure_hash): Rename from crypto_hash_function and change
14637 the first arg to accept symbols.
5b66d427 14638 (Fsecure_hash): New primitive.
7f3f739f
LL
14639 (syms_of_fns): New symbols.
14640
76147d94
DD
146412011-06-20 Deniz Dogan <deniz@dogan.se>
14642
14643 * process.c (Fset_process_buffer): Clarify return value in
14644 docstring.
14645
7d7d0045
CY
146462011-06-18 Chong Yidong <cyd@stupidchicken.com>
14647
14648 * dispnew.c (add_window_display_history): Use BVAR.
14649
14650 * xdisp.c (debug_method_add): Use BVAR.
14651 (check_window_end, dump_glyph_matrix, dump_glyph)
14652 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14653
14654 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14655 Likewise.
14656
14657 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14658 check till after the cache is created in init_frame_faces.
14659
ff2bc410
SM
146602011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14661
14662 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14663
28177add
PE
146642011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14665
dd3482fe
PE
14666 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14667 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14668 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14669
393d71f3 14670 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14671 * fileio.c (Finsert_file_contents):
14672 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14673 Remove the old (too-loose) buffer overflow checks.
14674 They weren't needed, since make_gap checks for buffer overflow.
14675 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14676 The old code merely checked for Emacs fixnum overflow, and relied
14677 on undefined (wraparound) behavior. The new code avoids undefined
14678 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14679
2e6813b0 14680 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14681 Tune. Don't use wider integers than needed. Don't use alloca.
14682 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14683
599a9e4f
PE
14684 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14685
99561444
PE
14686 * insdel.c, lisp.h (buffer_overflow): New function.
14687 (insert_from_buffer_1, replace_range, replace_range_2):
14688 * insdel.c (make_gap_larger):
14689 * editfns.c (Finsert_char):
14690 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14691
28177add
PE
14692 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14693
e69dafad
PE
146942011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14695
4baa020d 14696 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14697
b1c46f02
PE
14698 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14699 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14700
e69dafad
PE
14701 * fileio.c: Don't assume EMACS_INT fits in off_t.
14702 (emacs_lseek): New static function.
14703 (Finsert_file_contents, Fwrite_region): Use it.
14704 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14705
566684ea
PE
14706 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14707
e6966cd6
PE
14708 * fns.c: Don't overflow int when computing a list length.
14709 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14710 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14711 truncation on 64-bit hosts. Check for QUIT every
14712 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14713 faster and is responsive enough.
14714 (Flength): Report an error instead of overflowing an integer.
14715 (Fsafe_length): Return a float if the value is not representable
14716 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14717 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14718 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14719
dd0b0efb
PE
14720 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14721 (header_size, word_size): New constants.
14722 (allocate_vectorlike): Don't check size overflow here.
14723 (allocate_vector): Check it here instead, since this is the only
14724 caller of allocate_vectorlike that could cause overflow.
14725 Check that the new vector's length is representable as a fixnum.
14726
86fe5cfe
PE
14727 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14728 The previous code was bogus. For example, next_almost_prime (32)
14729 returned 39, which is undesirable as it is a multiple of 3; and
14730 next_almost_prime (24) returned 25, which is a multiple of 5 so
14731 why was the code bothering to check for multiples of 7?
14732
80e88859
PE
14733 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14734
4a2f0ad6
PE
14735 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14736
f66c7cf8
PE
14737 Variadic C functions now count arguments with ptrdiff_t.
14738 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14739 Back then I didn't know that the Emacs coding style prefers signed int.
14740 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14741 were being counted with int, which may truncate counts on 64-bit
14742 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14743 * lisp.h (struct Lisp_Subr.function.aMANY)
14744 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14745 Arg counts are now ptrdiff_t, not size_t.
14746 All variadic functions and their callers changed accordingly.
14747 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14748 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14749 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14750 * callint.c (Fcall_interactively): Check arg count for overflow,
14751 to avoid potential buffer overrun. Use signed char, not 'int',
14752 for 'varies' array, so that we needn't bother to check its size
14753 calculation for overflow.
14754 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14755 * eval.c (apply_lambda):
14756 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14757 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14758 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14759
a1759b76
PE
14760 * callint.c (Fcall_interactively): Don't use index var as event count.
14761
d96be9fc
PE
14762 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14763 * mem-limits.h (SIZE): Remove; no longer used.
14764
a690a978 14765 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14766
578c21e6
PE
14767 Remove unnecessary casts.
14768 * xterm.c (x_term_init):
14769 * xfns.c (x_set_border_pixel):
14770 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14771 These aren't needed now that we assume ANSI C.
14772
96f53c6c
PE
14773 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14774 It's more likely to cause problems (due to unsigned overflow)
14775 than to cure them.
14776
83c77d31
PE
14777 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14778
ee2079f1
PE
14779 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14780
6da65536
PE
14781 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14782
7147c4a4
PE
14783 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14784
193e32d9
PE
14785 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14786
e5533da6
PE
14787 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14788
9910e595
PE
14789 GLYPH_CODE_FACE returns EMACS_INT, not int.
14790 * dispextern.h (merge_faces):
14791 * xfaces.c (merge_faces):
01103c44
PE
14792 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14793 Don't assume EMACS_INT fits in int.
9910e595 14794
2638320e
PE
14795 * character.h (CHAR_VALID_P): Remove unused parameter.
14796 * fontset.c, lisp.h, xdisp.c: All uses changed.
14797
045eb8d9
PE
14798 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14799
c1f134b5
PE
14800 * fns.c (concat): Minor tuning based on overflow analysis.
14801 This doesn't fix any bugs. Use int to hold character, instead
14802 of constantly refetching from Emacs object. Use XFASTINT, not
14803 XINT, for value known to be a character. Don't bother comparing
14804 a single byte to 0400, as it's always less.
14805
395fcb93 14806 * floatfns.c (Fexpt):
327eeec8
PE
14807 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14808
abbd3d23
PE
14809 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14810 for characters.
14811
684a03ef
PE
14812 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14813
0fed43f3
PE
14814 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14815 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14816 incorrectly succeed when S was a string, because 4294967386 was
14817 truncated before it was used.
14818
8fd02eb7
PE
14819 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14820 Otherwise, an out-of-range integer could cause undefined behavior
14821 on a 64-bit host.
14822
f8c86b69
PE
14823 * composite.c: Use int, not EMACS_INT, for characters.
14824 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14825 EMACS_INT, for values that are known to be in character range.
14826 This doesn't fix any bugs but is the usual style inside Emacs and
14827 may generate better code on 32-bit machines.
14828
34206dd2
PE
14829 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14830 This is for reasons similar to the recent CHAR_STRING fix.
14831 * charset.c (Fencode_char): Check that character arg is actually
14832 a character. Pass an int to ENCODE_CHAR.
14833 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14834 wider than 'int', as a compile-time check to prevent future regressions
14835 in this area.
14836
c5958d4c 14837 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14838
14839 Make sure a 64-bit char is never passed to CHAR_STRING.
14840 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14841 by silently ignoring the top 32 bits, allowing some values
14842 that were far too large to be valid characters.
14843 * character.h: Include <verify.h>.
14844 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14845 arguments are no wider than unsigned, as a compile-time check
14846 to prevent future regressions in this area.
14847 * data.c (Faset):
01103c44 14848 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14849 (Fsubst_char_in_region):
14850 * fns.c (concat):
14851 * xdisp.c (decode_mode_spec_coding):
14852 Adjust to CHAR_STRING's new requirement.
14853 * editfns.c (Finsert_char, Fsubst_char_in_region):
14854 * fns.c (concat): Check that character args are actually
14855 characters. Without this test, these functions did the wrong
14856 thing with wildly out-of-range values on 64-bit hosts.
14857
d37ca623
PE
14858 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14859 These casts should not be needed on 32-bit hosts, either.
14860 * keyboard.c (read_char):
14861 * lread.c (Fload): Remove casts to unsigned.
14862
ea204efb
PE
14863 * lisp.h (UNSIGNED_CMP): New macro.
14864 This fixes comparison bugs on 64-bit hosts.
14865 (ASCII_CHAR_P): Use it.
14866 * casefiddle.c (casify_object):
01103c44 14867 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14868 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14869 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14870 * dispextern.h (FACE_FROM_ID):
14871 * keyboard.c (read_char): Use UNSIGNED_CMP.
14872
41cb286c
PE
14873 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14874 not to EMACS_INT, to avoid GCC warning.
14875
4a1b9832
PE
14876 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14877
55daad71
PE
14878 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14879 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14880 isn't needed on 32-bit machines.
8f95c75c 14881
01103c44
PE
14882 * buffer.c (Fgenerate_new_buffer_name):
14883 Use EMACS_INT for count, not int.
0ceccced 14884 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14885
14886 * data.c (Qcompiled_function): Now static.
14887
c6f072e7
PE
14888 * window.c (window_body_lines): Now static.
14889
20ce5912
PE
14890 * image.c (gif_load): Rename local to avoid shadowing.
14891
9c4c5f81
PE
14892 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14893 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14894 * alloc.c (make_save_value): Integer argument is now of type
14895 ptrdiff_t, not int.
14896 (mark_object): Use ptrdiff_t, not int.
14897 * lisp.h (pD): New macro.
14898 * print.c (print_object): Use it.
14899
c0c5c8ae
PE
14900 * alloc.c: Use EMACS_INT, not int, to count objects.
14901 (total_conses, total_markers, total_symbols, total_vector_size)
14902 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14903 (total_free_floats, total_floats, total_free_intervals)
14904 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14905 Now EMACS_INT, not int. All uses changed.
14906 (Fgarbage_collect): Compute overall total using a double, so that
14907 integer overflow is less likely to be a problem. Check for overflow
14908 when converting back to an integer.
5a25e253
PE
14909 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14910 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14911 These were 'int' variables that could overflow on 64-bit hosts;
14912 they were never used, so remove them instead of repairing them.
211a0b2a 14913 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14914 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14915 Previously, this ceilinged at INT_MAX, but that doesn't work on
14916 64-bit machines.
e46bb31a 14917 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14918
c78baabf 14919 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14920 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14921 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14922 when a (possibly-narrower) signed value would do just as well.
14923 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14924
c9d624c6
PE
14925 * alloc.c: Catch some string size overflows that we were missing.
14926 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14927 for convenience in STRING_BYTES_MAX.
14928 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14929 The definition here is exact; the one in lisp.h was approximate.
14930 (allocate_string_data): Check for string overflow. This catches
14931 some instances we weren't catching before. Also, it catches
14932 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14933 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14934 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14935
c9d624c6
PE
14936 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14937 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14938 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14939
353032ce
PE
14940 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14941
2bccce07
PE
14942 * alloc.c (Fmake_string): Check for out-of-range init.
14943
0ac30604
SM
149442011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14945
14946 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14947
c195f2de
JD
149482011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14949
14950 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14951 xg_get_default_scrollbar_width.
14952
14953 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14954 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14955 (style_changed_cb): Call update_theme_scrollbar_width and call
14956 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14957 all frames (Bug#8505).
14958 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14959 Call gtk_window_set_resizable if HAVE_GTK3.
14960 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14961 and height if HAVE_GTK3 (Bug#8505).
14962 (scroll_bar_width_for_theme): New variable.
14963 (update_theme_scrollbar_width): New function.
14964 (xg_get_default_scrollbar_width): Move code to
14965 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14966 (xg_initialize): Call update_theme_scrollbar_width.
14967
14968 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14969
14970 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14971
e10ac9f1
MR
149722011-06-12 Martin Rudalics <rudalics@gmx.at>
14973
14974 * frame.c (make_frame): Call other_buffer_safely instead of
14975 other_buffer.
14976
14977 * window.c (temp_output_buffer_show): Call display_buffer with
14978 second argument Vtemp_buffer_show_specifiers and reset latter
14979 immediately after the call.
14980 (Vtemp_buffer_show_specifiers): New variable.
14981 (auto_window_vscroll_p, next_screen_context_lines)
14982 (Vscroll_preserve_screen_position): Remove leading asterisks from
14983 doc-strings.
14984
2d3c217e 149852011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14986
7b7f97e8 14987 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14988 * buffer.c (Qclone_number): Remove for now, as it's unused.
14989 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14990 (record_buffer): Remove unused local.
14991 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14992 (set_frame_buffer_list): Remove; unused.
14993 * frame.h (other_visible_frames): Remove decl.
14994 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14995 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14996 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14997 if HAVE_GPM.
14998 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14999 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15000 Define only if HAVE_GPM.
15001 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15002 (update_hints_inhibit): Remove; never set. All uses removed.
15003 * widgetprv.h (emacsFrameClassRec): Remove decl.
15004 * window.c (delete_deletable_window): Now returns void, since it
15005 wasn't returning anything.
15006 (compare_window_configurations): Remove unused locals.
15007 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15008 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
15009 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15010 the same widths as pointers. This follows up on the 2011-05-06 patch.
15011 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15012 * xterm.h: Likewise.
15013 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15014
1384b89e
JB
150152011-06-12 Juanma Barranquero <lekktu@gmail.com>
15016
15017 * makefile.w32-in: Update dependencies.
15018 (LISP_H): Add lib/intprops.h.
15019
1100a63c
CY
150202011-06-11 Chong Yidong <cyd@stupidchicken.com>
15021
15022 * image.c (gif_load): Add animation frame delay to the metadata.
15023 (syms_of_image): Use DEFSYM. New symbol `delay'.
15024
6198ccd0
MR
150252011-06-11 Martin Rudalics <rudalics@gmx.at>
15026
15027 * window.c (delete_deletable_window): Re-add.
15028 (Fset_window_configuration): Rewrite to handle dead buffers and
15029 consequently deletable windows.
15030 (window_tree, Fwindow_tree): Remove. Supply functionality in
15031 window.el.
15032 (compare_window_configurations): Simplify code.
15033
b6e3633c
AS
150342011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15035
1ab0dee5
AS
15036 * image.c (imagemagick_load_image): Fix type mismatch.
15037 (Fimagemagick_types): Likewise.
15038
b6e3633c
AS
15039 * window.h (replace_buffer_in_windows): Declare.
15040
9397e56f
MR
150412011-06-11 Martin Rudalics <rudalics@gmx.at>
15042
15043 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15044 Qclone_number. Remove external declaration of Qdelete_window.
15045 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15046 code.
640c8776
SM
15047 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15048 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
15049 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15050 buffer list implementation.
15051 (other_buffer_safely): New function.
15052 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15053 calls to replace_buffer_in_windows and
15054 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15055 if allowed.
15056 (record_buffer): Inhibit quitting and rewrite using quittable
15057 functions. Run Qbuffer_list_update_hook if allowed.
15058 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
15059 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15060 Move switch-to-buffer to window.el.
9397e56f
MR
15061 (bury-buffer): Move to window.el.
15062 (Vbuffer_list_update_hook): New variable.
15063
15064 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15065 section.
15066
15067 * window.h (resize_frame_windows): Move up in code.
15068 (Fwindow_frame): Remove EXFUN.
15069 (replace_buffer_in_all_windows): Remove prototype.
15070 (replace_buffer_in_windows_safely): Add prototype.
15071
15072 * window.c: Declare Qdelete_window static again. Move down
15073 declaration of select_count.
15074 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15075 (Fother_window): Move to window.el.
15076 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15077 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15078 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15079 window.el.
15080 (replace_buffer_in_windows): Implement by calling
15081 Qreplace_buffer_in_windows.
15082 (replace_buffer_in_all_windows): Remove with some functionality
15083 moved into replace_buffer_in_windows_safely.
15084 (replace_buffer_in_windows_safely): New function.
15085 (select_window_norecord, select_frame_norecord): Move in front
15086 of run_window_configuration_change_hook. Remove now obsolete
15087 declarations.
640c8776
SM
15088 (Fset_window_buffer): Rewrite doc-string.
15089 Call Qrecord_window_buffer.
9397e56f
MR
15090 (keys_of_window): Move binding for other-window to window.el.
15091
b50691aa
CY
150922011-06-11 Chong Yidong <cyd@stupidchicken.com>
15093
15094 * dispextern.h (struct image): Replace data member, whose int_val
15095 and ptr_val fields were not used by anything, with a single
15096 lisp_val object.
15097
15098 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15099 (gif_clear_image, gif_load, imagemagick_load_image)
15100 (gs_clear_image, gs_load): Callers changed.
15101
3f754b86
PE
151022011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15103
cca69397
PE
15104 * buffer.h: Include <time.h>, for time_t.
15105 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15106
109e28d0
PE
15107 Fix minor problems found by static checking.
15108
60737f02
PE
15109 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15110
4b66faf3
PE
15111 Make identifiers static if they are not used in other modules.
15112 * data.c (Qcompiled_function, Qframe, Qvector):
15113 * image.c (QimageMagick, Qsvg):
15114 * minibuf.c (Qmetadata):
15115 * window.c (resize_window_check, resize_root_window): Now static.
15116 * window.h (resize_window_check, resize_root_window): Remove decls.
15117
109e28d0
PE
15118 * window.c (window_deletion_count, delete_deletable_window):
15119 Remove; unused.
46a4ce9e
PE
15120 (window_body_lines): Now static.
15121 (Fdelete_other_windows_internal): Mark vars as initialized.
15122 Make sure 'resize_failed' is initialized.
15123 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15124 (resize_window_apply): Remove unused local.
15125 * window.h (delete_deletable_window): Remove decl.
15126
109e28d0 15127 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
15128 (imagemagick_load_image): Fix pointer signedness problem by changing
15129 last arg from unsigned char * to char *. All uses changed.
15130 Also, fix a local for similar reasons.
15131 Remove unused locals. Remove locals to avoid shadowing.
15132 (fn_rsvg_handle_free): Remove; unused.
15133 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 15134 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 15135
3f754b86
PE
15136 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15137
2547adb1
CY
151382011-06-10 Chong Yidong <cyd@stupidchicken.com>
15139
15140 * image.c (gif_load): Fix omitted cast error introduced by
15141 2011-06-06 change.
15142
2c8e37d4
MR
151432011-06-10 Martin Rudalics <rudalics@gmx.at>
15144
15145 * window.h (resize_proportionally, orig_total_lines)
15146 (orig_top_line): Remove from window structure.
15147 (set_window_height, set_window_width, change_window_heights)
15148 (Fdelete_window): Remove prototypes.
15149 (resize_frame_windows): Remove duplicate declaration.
15150
440a42e3
EZ
151512011-06-10 Eli Zaretskii <eliz@gnu.org>
15152
15153 * window.h (resize_frame_windows, resize_window_check)
15154 (delete_deletable_window, resize_root_window)
15155 (resize_frame_windows): Declare prototypes.
15156
15157 * window.c (resize_window_apply): Make definition be "static" to
15158 match the prototype.
15159
562dd5e9
MR
151602011-06-10 Martin Rudalics <rudalics@gmx.at>
15161
15162 * window.c: Remove declarations of Qwindow_size_fixed,
15163 window_min_size_1, window_min_size_2, window_min_size,
15164 size_window, window_fixed_size_p, enlarge_window, delete_window.
15165 Remove static from declaration of Qdelete_window, it's
15166 temporarily needed by Fbury_buffer.
15167 (replace_window): Don't assign orig_top_line and
15168 orig_total_lines.
15169 (Fdelete_window, delete_window): Remove. Window deletion is
15170 handled by window.el.
640c8776
SM
15171 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15172 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
15173 (Fdelete_other_windows): Remove. Deleting other windows is
15174 handled by window.el.
15175 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15176 handled in window.el.
15177 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15178 Window minimum sizes are handled in window.el.
15179 (shrink_windows, size_window, set_window_height)
15180 (set_window_width, change_window_heights, window_height)
15181 (window_width, CURBEG, CURSIZE, enlarge_window)
15182 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15183 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15184 handled in window.el.
15185 (make_dummy_parent): Rename to make_parent_window and give it a
15186 second argument horflag.
15187 (make_window): Don't set resize_proportionally any more.
15188 (Fsplit_window): Remove. Windows are split in window.el.
15189 (save_restore_action, save_restore_orig_size)
15190 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15191 Resize mini windows in window.el.
15192 (grow_mini_window, shrink_mini_window): Implement by calling
15193 Qresize_root_window_vertically, resize_window_check and
15194 resize_window_apply.
640c8776
SM
15195 (saved_window, Fset_window_configuration, save_window_save):
15196 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
15197 resize_proportionally.
15198 (window_min_height, window_min_width): Move to window.el.
15199 (keys_of_window): Move bindings for delete-other-windows,
15200 split-window, delete-window and enlarge-window to window.el.
15201
15202 * buffer.c: Temporarily extern Qdelete_window.
15203 (Fbury_buffer): Temporarily call Qdelete_window instead of
15204 Fdelete_window (Fbury_buffer will move to window.el soon).
15205
15206 * frame.c (set_menu_bar_lines_1): Remove code handling
15207 orig_top_line and orig_total_lines.
15208
15209 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15210 set_window_height but set heights directly.
15211 (change_frame_size_1): Use resize_frame_windows.
15212
15213 * xdisp.c (init_xdisp): Don't use set_window_height but set
15214 heights directly.
15215
640c8776
SM
15216 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15217 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
15218 run_window_configuration_change_hook.
15219
15220 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15221 instead of change_window_heights and run
15222 run_window_configuration_change_hook.
15223
1a13852e
MR
152242011-06-09 Martin Rudalics <rudalics@gmx.at>
15225
15226 * window.c (replace_window): Rename second argument REPLACEMENT to
15227 NEW. New third argument SETFLAG. Rewrite.
15228 (delete_window, make_dummy_parent): Call replace_window with
15229 third argument 1.
15230 (window_list_1): Move down in code.
15231 (run_window_configuration_change_hook): Move set_buffer part
15232 before select_frame_norecord part in order to unwind correctly.
15233 Rename count1 to count.
15234 (recombine_windows, delete_deletable_window, resize_root_window)
15235 (Fdelete_other_windows_internal)
15236 (Frun_window_configuration_change_hook, make_parent_window)
15237 (resize_window_check, resize_window_apply, Fresize_window_apply)
15238 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
15239 (Fdelete_window_internal, Fresize_mini_window_internal):
15240 New functions.
1a13852e
MR
15241 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15242
f3d1777e
MR
152432011-06-08 Martin Rudalics <rudalics@gmx.at>
15244
496e208e
MR
15245 * window.h (window): Add some new members to window structure -
15246 normal_lines, normal_cols, new_total, new_normal, clone_number,
15247 splits, nest, prev_buffers, next_buffers.
15248 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 15249 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 15250
f3d1777e
MR
15251 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15252 Remove.
496e208e
MR
15253 (make_dummy_parent): Set new members of windows structure.
15254 (make_window): Move down in code. Handle new members of window
15255 structure.
15256 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15257 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15258 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15259 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
15260 (Fset_window_next_buffers, Fset_window_clone_number):
15261 New functions.
496e208e
MR
15262 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15263 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15264 Doc-string fixes.
15265 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15266 Argument WINDOW can be now internal window too.
15267 (Fwindow_use_time): Move up in code.
15268 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15269 Rewrite doc-string.
15270 (Fset_window_configuration, saved_window)
15271 (Fcurrent_window_configuration, save_window_save): Handle new
15272 members of window structure.
b9e809c2
MR
15273 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15274 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15275 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15276 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15277 Qget_mru_window, Qresize_root_window,
15278 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15279 Qauto_buffer_name; staticpro them.
f3d1777e 15280
abde8f8c
MR
152812011-06-07 Martin Rudalics <rudalics@gmx.at>
15282
15283 * window.c (Fwindow_total_size, Fwindow_left_column)
15284 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15285 (Fwindow_list_1): New functions.
15286 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15287 (Fwindow_width, Fscroll_left, Fscroll_right):
15288 Use window_body_cols instead of window_box_text_cols.
15289 (delete_window, Fset_window_configuration):
15290 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15291 (delete_all_subwindows): Take a window as argument and not a
15292 structure. Rewrite.
190b47e6
MR
15293 (window_loop): Remove handling of GET_LRU_WINDOW and
15294 GET_LARGEST_WINDOW.
15295 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15296
15297 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15298 window_box_text_cols. delete_all_subwindows now takes a
15299 Lisp_Object as argument.
abde8f8c 15300
640c8776
SM
15301 * indent.c (compute_motion, Fcompute_motion):
15302 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15303
fa8a67e6
MR
15304 * frame.c (delete_frame): Call delete_all_subwindows with root
15305 window as argument.
15306
a54e3482
DC
153072011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15308
15309 * fns.c (Fputhash): Document return value.
15310
60002bf5
CY
153112011-06-06 Chong Yidong <cyd@stupidchicken.com>
15312
15313 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15314
0c671da6 153152011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15316
b862a52a 15317 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15318
be44ca6c
PE
15319 Check for overflow when converting integer to cons and back.
15320 * charset.c (Fdefine_charset_internal, Fdecode_char):
15321 Use cons_to_unsigned to catch overflow.
15322 (Fencode_char): Use INTEGER_TO_CONS.
15323 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15324 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15325 * data.c (long_to_cons, cons_to_long): Remove.
15326 (cons_to_unsigned, cons_to_signed): New functions.
15327 These signal an error for invalid or out-of-range values.
15328 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15329 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15330 * font.c (Ffont_variation_glyphs):
15331 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15332 * lisp.h: Include <intprops.h>.
15333 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15334 (cons_to_signed, cons_to_unsigned): New decls.
15335 (long_to_cons, cons_to_long): Remove decls.
15336 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15337 (Fprimitive_undo): Use CONS_TO_INTEGER.
15338 * xfns.c (Fx_window_property): Likewise.
15339 * xselect.c: Include <limits.h>.
15340 (x_own_selection, selection_data_to_lisp_data):
15341 Use INTEGER_TO_CONS.
15342 (x_handle_selection_request, x_handle_selection_clear)
15343 (x_get_foreign_selection, Fx_disown_selection_internal)
15344 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15345 (lisp_data_to_selection_data): Use cons_to_unsigned.
15346 (x_fill_property_data): Use cons_to_signed.
15347 Report values out of range.
15348
d1f3d2af
PE
15349 Check for buffer and string overflow more precisely.
15350 * buffer.h (BUF_BYTES_MAX): New macro.
15351 * lisp.h (STRING_BYTES_MAX): New macro.
15352 * alloc.c (Fmake_string):
15353 * character.c (string_escape_byte8):
15354 * coding.c (coding_alloc_by_realloc):
15355 * doprnt.c (doprnt):
15356 * editfns.c (Fformat):
15357 * eval.c (verror):
15358 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15359 since they may not be the same number.
15360 * editfns.c (Finsert_char):
15361 * fileio.c (Finsert_file_contents):
15362 Likewise for BUF_BYTES_MAX.
15363
dd52fcea
PE
15364 * image.c: Use ptrdiff_t, not int, for sizes.
15365 (slurp_file): Switch from int to ptrdiff_t.
15366 All uses changed.
15367 (slurp_file): Check that file size fits in both size_t (for
15368 malloc) and ptrdiff_t (for sanity and safety).
15369
7f9bbdbb
PE
15370 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15371 if b->modtime has its maximal value.
15372
dfe18f82
PE
15373 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15374
84acfcf0
PE
15375 Don't assume time_t can fit into int.
15376 * buffer.h (struct buffer.modtime): Now time_t, not int.
15377 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15378 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15379
ccd9a01a
PE
15380 Minor fixes for signed vs unsigned integers.
15381 * character.h (MAYBE_UNIFY_CHAR):
15382 * charset.c (maybe_unify_char):
15383 * keyboard.c (read_char, reorder_modifiers):
15384 XINT -> XFASTINT, since the integer must be nonnegative.
15385 * ftfont.c (ftfont_spec_pattern):
15386 * keymap.c (access_keymap, silly_event_symbol_error):
15387 XUINT -> XFASTINT, since the integer must be nonnegative.
15388 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15389 since it makes no difference and we prefer signed.
15390 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15391 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15392 nonnegative.
15393
d6d100dd
SM
153942011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15395
15396 * window.h (Fwindow_frame): Declare.
15397
2b6148e4
PE
153982011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15399
15400 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15401 (SPARE_MEMORY): Always define.
15402 (LARGE_REQUEST): Remove.
15403 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15404
f230ecc9
MR
154052011-06-06 Martin Rudalics <rudalics@gmx.at>
15406
727e958e
MR
15407 * lisp.h: Move EXFUNS for Fframe_root_window,
15408 Fframe_first_window and Fset_frame_selected_window to window.h.
15409
15410 * window.h: Move EXFUNS for Fframe_root_window,
15411 Fframe_first_window and Fset_frame_selected_window here from
15412 lisp.h.
15413
15414 * frame.c (Fwindow_frame, Fframe_first_window)
15415 (Fframe_root_window, Fframe_selected_window)
15416 (Fset_frame_selected_window): Move to window.c.
15417 (Factive_minibuffer_window): Move to minibuf.c.
15418 (Fother_visible_frames_p): New function.
15419
15420 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15421
f230ecc9
MR
15422 * window.c (decode_window, decode_any_window): Move up in code.
15423 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15424 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15425 (Fwindow_buffer): Move up and rewrite doc-string.
15426 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15427 (Fwindow_prev): New functions.
727e958e
MR
15428 (Fwindow_frame): Move here from frame.c. Accept any window as
15429 argument.
15430 (Fframe_root_window, Fframe_first_window)
15431 (Fframe_selected_window): Move here from frame.c. Accept frame
15432 or arbitrary window as argument. Update doc-strings.
15433 (Fminibuffer_window): Move up in code.
15434 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15435 (Fset_frame_selected_window): Move here from frame.c.
15436 Marginal rewrite.
727e958e
MR
15437 (Fselected_window, select_window, Fselect_window): Move up in
15438 code. Minor doc-string fixes.
f230ecc9 15439
4d09bcf6
PE
154402011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15441
15442 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15443 Do not assume that spare memory exists; that assumption is valid
15444 only if SYSTEM_MALLOC.
15445 (LARGE_REQUEST): New macro, so that the issue of large requests
15446 is separated from the issue of spare memory.
15447
810928a2
AS
154482011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15449
172418ad
AS
15450 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15451 format. (Bug#8806)
15452
43f862f7
AS
15453 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15454
810928a2
AS
15455 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15456 before statements.
15457
a059fe24
JD
154582011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15459
15460 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15461
15462 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15463
15464 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15465 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15466
989bf368
JB
154672011-06-05 Juanma Barranquero <lekktu@gmail.com>
15468
15469 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15470
4b80f674
CY
154712011-06-04 Chong Yidong <cyd@stupidchicken.com>
15472
15473 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15474 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15475 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15476 New error handlers.
4b80f674
CY
15477 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15478 Obey Vx_select_enable_clipboard_manager. Catch errors in
15479 x_clipboard_manager_save (Bug#8779).
15480 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15481 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15482
99a33b77 154832011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15484
15485 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15486
99a33b77 154872011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15488
15489 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15490 in the current matrix if keep_current_p is non-zero.
15491
8264569d
EZ
154922011-06-04 Eli Zaretskii <eliz@gnu.org>
15493
15494 * bidi.c (bidi_level_of_next_char): Fix last change.
15495
57f97249
EZ
154962011-06-03 Eli Zaretskii <eliz@gnu.org>
15497
fec2107c 15498 Support bidi reordering of text covered by display properties.
57f97249 15499
fec2107c
EZ
15500 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15501 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15502 (bidi_cache_search, bidi_cache_iterator_state)
15503 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15504 (bidi_level_of_next_char, bidi_move_to_visually_next):
15505 Support character positions inside a run of characters covered by a
fec2107c
EZ
15506 display string.
15507 (bidi_paragraph_init, bidi_resolve_explicit_1)
15508 (bidi_level_of_next_char): Call bidi_fetch_char and
15509 bidi_fetch_char_advance instead of FETCH_CHAR and
15510 FETCH_CHAR_ADVANCE.
15511 (bidi_init_it): Initialize new members.
15512 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15513 definitions.
15514 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15515 instead of using explicit *_CHAR codes.
d6d100dd
SM
15516 (bidi_resolve_explicit, bidi_resolve_weak):
15517 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15518 bidirectional text is supported only in multibyte buffers.
15519 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15520 it to initialize the frame_window_p member of struct bidi_it.
15521 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15522 (bidi_resolve_explicit, bidi_resolve_weak)
15523 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15524 bidi_it->nchars is non-positive.
15525 (bidi_level_of_next_char): Don't try to lookup the cache for the
15526 next/previous character if nothing is cached there yet, or if we
15527 were just reseat()'ed to a new position.
c40e2fb2 15528
0e14fe90
EZ
15529 * xdisp.c (set_cursor_from_row): Set start and stop points
15530 according to the row's direction when priming the loop that looks
15531 for the glyph on which to display cursor.
15532 (single_display_spec_intangible_p): Function deleted.
15533 (display_prop_intangible_p): Reimplement to call
15534 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15535 Accept 3 additional arguments needed by handle_display_spec.
15536 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15537 values: lists, `(when COND...)' forms, etc.
15538 (single_display_spec_string_p): Support property values that are
15539 lists with the argument STRING its top-level element.
15540 (display_prop_string_p): Fix the condition for processing a
15541 property that is a list to be consistent with handle_display_spec.
fec2107c 15542 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15543 last portion of handle_display_prop.
15544 (compute_display_string_pos): Accept additional argument
15545 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15546 value of a `display' property is a "replacing spec".
15547 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15548 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15549 the display property, but just return a value indicating whether
15550 the display property will replace the characters it covers.
15551 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15552 frame_window_p members of struct bidi_it.
d6d100dd
SM
15553 (compute_display_string_pos, compute_display_string_end):
15554 New functions.
fec2107c
EZ
15555 (push_it): Accept second argument POSITION, where pop_it should
15556 jump to continue iteration.
15557 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15558
fec2107c
EZ
15559 * keyboard.c (adjust_point_for_property): Adjust the call to
15560 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15561
15562 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15563 (bidi_init_it): Update prototypes.
15564 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15565 (compute_display_string_pos, compute_display_string_end):
15566 Declare prototypes.
fec2107c
EZ
15567 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15568 EMACS_INT.
fc6f18ce 15569
40087514 155702011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15571
57f53182
PE
15572 Malloc failure behavior now depends on size of allocation.
15573 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15574 * lisp.h: Change signatures accordingly.
15575 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15576 All callers changed. (Bug#8762)
15577
15578 * gnutls.c: Use Emacs's memory allocators.
15579 Without this change, the gnutls library would invoke malloc etc.
15580 directly, which causes problems on non-SYNC_INPUT hosts, and which
15581 runs afoul of improving memory_full behavior. (Bug#8761)
15582 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15583 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15584 xfree instead of the default malloc, realloc, free.
15585 (Fgnutls_boot): No need to check for memory allocation failure,
15586 since xmalloc does that for us.
15587
ac32cd99 15588 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15589 * category.c (hash_get_category_set):
15590 * ccl.c (ccl_driver):
15591 * charset.c (Fdefine_charset_internal):
15592 * charset.h (struct charset.hash_index):
15593 * composite.c (get_composition_id, gstring_lookup_cache)
15594 (composition_gstring_put_cache):
15595 * composite.h (struct composition.hash_index):
15596 * dispextern.h (struct image.hash):
15597 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15598 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15599 (hashfn_equal, hashfn_user_defined, make_hash_table)
15600 (maybe_resize_hash_table, hash_lookup, hash_put)
15601 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15602 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15603 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15604 * image.c (make_image, search_image_cache, lookup_image)
15605 (xpm_put_color_table_h):
15606 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15607 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15608 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15609 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15610 * alloc.c (allocate_vectorlike):
15611 Check for overflow in vector size calculations.
15612 * ccl.c (ccl_driver):
15613 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15614 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15615 need to be updated by these changes.
40087514
PE
15616 * fns.c (make_hash_table, maybe_resize_hash_table):
15617 Check for integer overflow with large hash tables.
0de4bb68
PE
15618 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15619 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15620 (SXHASH_REDUCE): New macro.
15621 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15622 Use it instead of discarding useful hash info with large hash values.
15623 (sxhash_float): New function.
15624 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15625 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15626 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15627 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15628 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15629 Adjust signatures to match updated version of code.
15630 (consing_since_gc): Now EMACS_INT, since a single hash table can
15631 use more than INT_MAX bytes.
15632
698d32e2
DN
156332011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15634
15635 Make it possible to build with GCC-4.6+ -O2 -flto.
15636
15637 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15638
fd6fa53f
SM
156392011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15640
15641 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15642 Call minibuffer-inactive-mode.
15643
864db017
JB
156442011-05-31 Juanma Barranquero <lekktu@gmail.com>
15645
15646 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15647 Update dependencies.
15648
2ad0baf4
DN
156492011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15650
15651 * data.c (init_data): Remove code for UTS, this system is not
15652 supported anymore.
15653
4fcc2638
DN
156542011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15655
15656 Don't force ./temacs to start in terminal mode.
15657
15658 * frame.c (make_initial_frame): Initialize faces in all cases, not
15659 only when CANNOT_DUMP is defined.
15660 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15661
c56e0fd5
DN
156622011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15663
15664 * dispnew.c (add_window_display_history): Use const for the string
15665 pointer. Remove declaration, not needed.
15666
333d54da 156672011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15668
55d4c1b2 15669 Use 'inline', not 'INLINE'.
333d54da 15670 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15671 * alloc.c, fontset.c (INLINE): Remove.
15672 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15673 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15674 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15675 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15676 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15677
738db178
DN
156782011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15679
15680 Make it possible to run ./temacs.
15681
15682 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15683 syms_of_callproc does the same thing. Remove test for
15684 "initialized", do it in the caller.
15685 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15686
620c53a6
SM
156872011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15688
15689 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15690 (read_minibuf): Use get_minibuffer.
15691 (syms_of_minibuf): Use DEFSYM.
15692 (Qmetadata): New var.
15693 * data.c (Qbuffer): Don't make it static.
15694 (syms_of_data): Use DEFSYM.
15695
e003a292
PE
156962011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15697
15698 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15699 (CCL_CODE_MIN): New macro.
15700
ed008a6d
PE
157012011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15702
3687c2ef
PE
15703 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15704
ed008a6d
PE
15705 * eval.c (Qdebug): Now static.
15706 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15707 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15708 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15709
d66c4c7c
CY
157102011-05-29 Chong Yidong <cyd@stupidchicken.com>
15711
15712 * image.c: Various fixes to ImageMagick code comments.
15713 (Fimagemagick_types): Doc fix.
15714
5fbc2025
PE
157152011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15716
0196f88a
PE
15717 Minor fixes prompted by GCC 4.6.0 warnings.
15718
15719 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15720
5fbc2025
PE
15721 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15722 (x_clipboard_manager_save_all): Move extern decl to ...
15723 * xterm.h: ... here, so that it can be checked for consistency.
15724
1dd3c2d9
CY
157252011-05-29 Chong Yidong <cyd@stupidchicken.com>
15726
15727 * xselect.c (x_clipboard_manager_save_frame)
15728 (x_clipboard_manager_save_all): New functions.
15729 (Fx_clipboard_manager_save): Lisp function deleted.
15730
15731 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15732 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15733
15734 * xterm.h: Update prototype.
15735
5ba6571d
WX
157362011-05-28 William Xu <william.xwl@gmail.com>
15737
15738 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15739 exiting (Bug#8239).
15740
3eaff834
JM
157412011-05-28 Jim Meyering <meyering@redhat.com>
15742
e1900994 15743 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15744 * fns.c (to_uchar): Define.
15745 (crypto_hash_function): Use it to convert some newly-signed
15746 variables to unsigned, to avoid sign-extension bugs. For example,
15747 without this change, (md5 "truc") would evaluate to
15748 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15749 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15750 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15751
0f6990a7
PE
157522011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15753
15754 Integer overflow fixes.
c8a9ca5a 15755
08686060
PE
15756 * dbusbind.c: Serial number integer overflow fixes.
15757 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15758 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15759 to hold a serial number that is too large for a fixnum.
15760 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15761 Check for serial numbers out of range. Decode any serial number
59568bf0 15762 that was so large that it became a float. (Bug#8722)
08686060 15763
2d1fc3c7
PE
15764 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15765 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15766 Use XFASTINT rather than XUINT when numbers are nonnegative.
15767 (xd_append_arg, Fdbus_method_return_internal):
15768 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15769 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15770 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15771 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15772 (Bug#8722)
2d1fc3c7 15773
c8a9ca5a
PE
15774 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15775
519e1d69
PE
15776 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15777
6df6ae42 15778 ccl: Add integer overflow checks.
30569699
PE
15779 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15780 (IN_INT_RANGE): New macros.
15781 (ccl_driver): Use them to check for integer overflow when
15782 decoding a CCL program. Many of the new checks are whether XINT (x)
15783 fits in int; it doesn't always, on 64-bit hosts. The new version
15784 doesn't catch all possible integer overflows, but it's an
847044ea 15785 improvement. (Bug#8719)
30569699 15786
c11285dc
PE
15787 * alloc.c (make_event_array): Use XINT, not XUINT.
15788 There's no need for unsigned here.
15789
fdccd48e
PE
15790 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15791 This follows up to the 2011-05-06 change that substituted uintptr_t
15792 for EMACS_INT. This case wasn't caught back then.
15793
37910ab2
PE
15794 Rework Fformat to avoid integer overflow issues.
15795 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15796 now (part of C89). Include <verify.h>.
15797 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15798 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15799 (Fformat): Avoid the prepass trying to compute sizes; it was only
15800 approximate and thus did not catch overflow reliably. Instead, walk
15801 through the format just once, formatting and computing sizes as we go,
15802 checking for integer overflow at every step, and allocating a larger
15803 buffer as needed. Keep track separately whether the format is
15804 multibyte. Keep only the most-recently calculated precision, rather
15805 than them all. Record whether each argument has been converted to
15806 string. Use EMACS_INT, not int, for byte and char and arg counts.
15807 Support field widths and precisions larger than INT_MAX. Avoid
15808 sprintf's undefined behavior with conversion specifications such as %#d
15809 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15810 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15811 formatting out-of-range floating point numbers with int
9173deec 15812 formats. (Bug#8668)
37910ab2 15813
2e6578fb
PE
15814 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15815
0ae6bdee
PE
15816 * data.c: Avoid integer truncation in expressions involving floats.
15817 * data.c: Include <intprops.h>.
15818 (arith_driver): When there's an integer overflow in an expression
15819 involving floating point, convert the integers to floating point
15820 so that the resulting value does not suffer from catastrophic
15821 integer truncation. For example, on a 64-bit host (* 4
15822 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15823 Do not rely on undefined behavior after integer overflow.
15824
de883a70
PE
15825 merge count_size_as_multibyte, parse_str_to_multibyte
15826 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15827 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15828 Check for integer overflow.
15829 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15830 since it's now a duplicate of the other. This is more of
15831 a character than a buffer op, so better that it's in character.c.
15832 * fns.c, print.c: Adjust to above changes.
15833
2ff916cb
PE
158342011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15835
15836 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15837
f1b54466
PE
158382011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15839
fb1ac845
PE
15840 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15841 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15842 (x_clipboard_manager_save): Now static.
15843 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15844
f1b54466
PE
15845 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15846 (crypto_hash_function): Now static.
15847 Fix pointer signedness problems. Avoid unnecessary initializations.
15848
a9f737ee
CY
158492011-05-27 Chong Yidong <cyd@stupidchicken.com>
15850
15851 * termhooks.h (Vselection_alist): Make it terminal-local.
15852
15853 * terminal.c (create_terminal): Initialize it.
15854
15855 * xselect.c: Support for clipboard managers.
15856 (Vselection_alist): Move to termhooks.h as terminal-local var.
15857 (LOCAL_SELECTION): New macro.
15858 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15859 (symbol_to_x_atom): Remove gratuitous arg.
15860 (x_handle_selection_request, lisp_data_to_selection_data)
15861 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15862 (x_own_selection, x_get_local_selection, x_convert_selection):
15863 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15864 (some_frame_on_display): Delete unused function.
15865 (Fx_own_selection_internal, Fx_get_selection_internal)
15866 (Fx_disown_selection_internal, Fx_selection_owner_p)
15867 (Fx_selection_exists_p): New optional frame arg.
15868 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15869 (x_handle_selection_clear): Don't treat other terminals with the
15870 same keyboard specially. Use the terminal-local Vselection_alist.
15871 (x_clear_frame_selections): Use Frun_hook_with_args.
15872
15873 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15874
15875 * xterm.h: Add support for those atoms.
15876
e067f0c1
CY
158772011-05-26 Chong Yidong <cyd@stupidchicken.com>
15878
15879 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15880 (converted_selections, conversion_fail_tag): New global variables.
15881 (x_selection_request_lisp_error): Free the above.
15882 (x_get_local_selection): Remove unnecessary code.
15883 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15884 of converted selections stored in converted_selections.
15885 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15886 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15887 (x_convert_selection): New function.
15888 (x_handle_selection_event): Simplify.
15889 (x_get_foreign_selection): Don't ignore incoming requests while
15890 waiting for an answer; this will fail when we implement
15891 SAVE_TARGETS, and seems unnecessary anyway.
15892 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15893 (Vx_sent_selection_functions): Doc fix.
15894
0f4aebc0
LL
158952011-05-26 Leo Liu <sdl.web@gmail.com>
15896
15897 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15898
e61124cd
YM
158992011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15900
15901 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15902
15903 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15904 for fringe update if it has periodic bitmap.
ac389d0c 15905 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15906 and fringe_bitmap_periodic_p.
15907
15908 * fringe.c (get_fringe_bitmap_data): New function.
15909 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15910 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15911 row. Mark glyph row for fringe update if periodicity changed.
15912
15913 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15914 for fringe update unless it has periodic bitmap.
15915
f16d9837
KH
159162011-05-25 Kenichi Handa <handa@m17n.org>
15917
15918 * xdisp.c (get_next_display_element): Set correct it->face_id for
15919 a static composition.
15920
e1b90ef6
LL
159212011-05-24 Leo Liu <sdl.web@gmail.com>
15922
15923 * deps.mk (fns.o):
15924 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15925
15926 * fns.c (crypto_hash_function, Fsha1): New function.
15927 (Fmd5): Use crypto_hash_function.
15928 (syms_of_fns): Add Ssha1.
15929
7400048f
PE
159302011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15931
15932 * gnutls.c: Remove unused macros.
15933 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15934 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15935 Remove macros that are defined and never used.
15936 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15937
abb71cf4
CY
159382011-05-22 Chong Yidong <cyd@stupidchicken.com>
15939
15940 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15941 (Fx_get_selection_internal): Minor cleanup.
15942 (Fx_own_selection_internal): Rename arguments for consistency with
15943 select.el.
15944
6307db39
PE
159452011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15946
15947 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15948
f3d4e0a4
CY
159492011-05-22 Chong Yidong <cyd@stupidchicken.com>
15950
15951 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15952
4d8ade89
YM
159532011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15954
15955 * dispnew.c (scrolling_window): Don't exclude the case that the
15956 last enabled row in the desired matrix touches the bottom boundary.
15957
32078c8d
GM
159582011-05-21 Glenn Morris <rgm@gnu.org>
15959
15960 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15961 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15962 and add some more files.
32078c8d 15963
7285dc67
EZ
159642011-05-20 Eli Zaretskii <eliz@gnu.org>
15965
15966 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15967 report_file_error introduced by the change from 2011-05-07.
15968
89d1bd22
PE
159692011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15970
15971 * systime.h (Time): Define only if emacs is defined.
15972 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15973 where the include path doesn't have X11/X.h by default. See
15974 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15975
cd394be1 159762011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15977
15978 * composite.c (find_automatic_composition): Fix previous change.
15979
b9704ad9
GM
159802011-05-20 Glenn Morris <rgm@gnu.org>
15981
15982 * lisp.mk: New file, split from Makefile.in.
15983 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15984 (shortlisp): Remove.
15985 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15986
4a720484
GM
159872011-05-19 Glenn Morris <rgm@gnu.org>
15988
15989 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15990 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15991 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15992 (lisp): Set the order to that of loadup.el.
15993 (shortlisp): Make it a copy of $lisp.
15994 (SOME_MACHINE_LISP): Remove.
15995 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15996 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15997
a28d4396
KH
159982011-05-18 Kenichi Handa <handa@m17n.org>
15999
16000 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16001 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16002 (find_automatic_composition): Mostly rewrite for efficiency.
16003
a2b1fa8e
JB
160042011-05-18 Juanma Barranquero <lekktu@gmail.com>
16005
16006 * makefile.w32-in: Update dependencies.
16007
8e1f5610
CS
160082011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16009
16010 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 16011 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 16012
7025ee00 160132011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 16014
cdfa6eab
PE
16015 Fix some integer overflow issues, such as string length overflow.
16016
06d6db33
PE
16017 * insdel.c (count_size_as_multibyte): Check for string overflow.
16018
2b4560a8
PE
16019 * character.c (lisp_string_width): Check for string overflow.
16020 Use EMACS_INT, not int, for string indexes and lengths; in
16021 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16022 the resulting string length overflows an EMACS_INT; instead,
16023 report a string overflow if no precision given. When checking for
16024 precision exhaustion, use a check that cannot possibly have
16025 integer overflow. (Bug#8675)
16026 * character.h (lisp_string_width): Adjust to new signature.
16027
cb93f9be
PE
16028 * alloc.c (string_overflow): New function.
16029 (Fmake_string): Use it. This doesn't change behavior, but saves
16030 a few bytes and will simplify future changes.
16031 * character.c (string_escape_byte8): Likewise.
16032 * lisp.h (string_overflow): New decl.
16033
1a1f3366
PE
16034 Fixups, following up to the user-interface timestamp change.
16035 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16036 for UI timestamps, instead of unsigned long.
9fbd6841
PE
16037 * msdos.c (mouse_get_pos): Likewise.
16038 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
16039 * w32gui.h (Time): Define by including "systime.h" rather than by
16040 declaring it ourselves. (Bug#8664)
16041
d4e3e4d3
PE
16042 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16043 * image.c (clear_image_cache): Likewise.
16044
f6a24d19
PE
16045 * term.c (term_mouse_position): Don't assume time_t wraparound.
16046
08dc5ae6
PE
16047 Be more systematic about user-interface timestamps.
16048 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
16049 and sometimes 'EMACS_UINT', to represent these timestamps.
16050 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
16051 This makes the code easier to follow, and makes it easier to catch
16052 integer overflow bugs such as Bug#8664.
16053 * frame.c (Fmouse_position, Fmouse_pixel_position):
16054 Use Time, not unsigned long, for user-interface timestamps.
16055 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16056 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16057 * keyboard.h (last_event_timestamp): Likewise.
16058 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16059 * menu.h (xmenu_show): Likewise.
16060 * term.c (term_mouse_position): Likewise.
16061 * termhooks.h (struct input_event.timestamp): Likewise.
16062 (struct terminal.mouse_position_hook): Likewise.
16063 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16064 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16065 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16066 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16067 what it was before.
16068 * menu.h, termhooks.h: Include "systime.h", for Time.
16069
8e55734a
PE
16070 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16071 Don't assume that the difference between two unsigned long values
16072 can fit into an integer. At this point, we know button_down_time
16073 <= event->timestamp, so the difference must be nonnegative, so
16074 there's no need to cast the result if double-click-time is
16075 nonnegative, as it should be; check that it's nonnegative, just in
16076 case. This bug is triggered when events are more than 2**31 ms
86db42d2 16077 apart (about 25 days). (Bug#8664)
8e55734a 16078
841f1b75 16079 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 16080 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 16081
3e26f69c
PE
16082 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16083 that always fit in int. Use a sentinel instead of a counter, to
16084 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
16085 * frame.h (struct frame): Use int for menu_bar_items_used
16086 instead of EMACS_INT, since it always fits in int.
3e26f69c 16087
5cc152c0
PE
16088 * menu.c (grow_menu_items): Check for int overflow.
16089
d89eb65e
PE
16090 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16091
5235bd3e
PE
16092 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16093 Before, the code was not consistent. These values cannot exceed
16094 2**31 - 1 so there's no need to make them unsigned.
16095 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16096 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16097 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16098 as modifiers.
16099 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16100
bc827e23
PE
16101 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16102 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16103 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16104 presumably because the widths might not match.
16105
78eb494e
PE
16106 * window.c (size_window): Avoid needless test at loop start.
16107
04f2d78b
CB
161082011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16109
16110 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16111
d2fc7e3d 161122011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
16113
16114 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16115
d2fc7e3d 161162011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
16117
16118 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16119 `width' to `bar_area_x' and `bar_area_width', respectively.
16120 (x_scroll_run): Take account of fringe background extension.
16121
04f2d78b
CB
16122 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16123 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
16124 `bar_area_width', respectively.
16125 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16126 background extension.
16127
79b70037
GM
161282011-05-10 Jim Meyering <meyering@redhat.com>
16129
16130 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16131
2f142cc5
JB
161322011-05-10 Juanma Barranquero <lekktu@gmail.com>
16133
16134 * image.c (Finit_image_library): Return t for built-in image types,
16135 like pbm and xbm. (Bug#8640)
16136
57679c86
AS
161372011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16138
16139 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16140
888c9e86
EZ
161412011-05-07 Eli Zaretskii <eliz@gnu.org>
16142
b0512a1d
EZ
16143 * w32console.c (Fset_screen_color): Doc fix.
16144 (Fget_screen_color): New function.
16145 (syms_of_ntterm): Defsubr it.
16146
7285dc67
EZ
16147 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16148 unlink the temporary file if Fcall_process didn't create it in the
16149 first place.
16150 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16151 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
16152 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16153 cue to call_process_cleanup not to close that handle.
16154
4d3fcc8e
BK
161552011-05-07 Ben Key <bkey76@gmail.com>
16156
16157 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16158 one of two shell specific rules, either bootstrap-temacs-CMD or
16159 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16160 to the previous implementation of the bootstrap-temacs rule.
16161 The bootstrap-temacs-CMD rule is similar to the previous
16162 implementation of the bootstrap-temacs rule except that it
16163 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16164 variable.
16165
16166 These changes, along with some changes to nt/configure.bat,
16167 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16168 earlier fix to add support for --cflags and --ldflags options
16169 that include quotes so that it works whether make uses cmd or
16170 sh as the shell.
16171
b4289b64
MA
161722011-05-06 Michael Albinus <michael.albinus@gmx.de>
16173
16174 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16175 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16176 is a constant.
16177 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16178 a string. Handle both cases.
16179 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16180 (Fdbus_register_method): Use Qinvalid_function.
16181
af4c0e28
JB
161822011-05-06 Juanma Barranquero <lekktu@gmail.com>
16183
16184 * makefile.w32-in: Update dependencies.
16185 (LISP_H): Add inttypes.h and stdin.h.
16186 (PROCESS_H): Add unistd.h.
16187
c51453d9
EZ
161882011-05-06 Eli Zaretskii <eliz@gnu.org>
16189
16190 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16191 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16192
8ff0ac3c 161932011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 16194
4c4b566b
PE
16195 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16196
aab2b9b5
PE
16197 * term.c (vfatal): Remove stray call to va_end.
16198 It's not needed and the C Standard doesn't allow it here anyway.
16199
c378da0b
PE
16200 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16201 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16202
288b08c7
PE
16203 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16204 bytes.
16205
e3601888
PE
16206 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16207
db6c0e74
PE
16208 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16209
dd5963ea
PE
16210 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16211
88c9450f
PE
16212 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16213
2f9442b8
PE
16214 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16215
c032b5f8
PE
16216 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16217 * charset.c (Fdefine_charset_internal): Don't initialize
16218 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 16219 32-bit int (Bug#8600).
a108c10b
PE
16220
16221 * lread.c (read_integer): Be more consistent with string-to-number.
16222 Use string_to_number to do the actual conversion; this avoids
16223 rounding errors and fixes some other screwups. Without this fix,
16224 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16225 (digit_to_number): Move earlier, for benefit of read_integer.
16226 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 16227 not a digit in any supported base. (Bug#8602)
a108c10b 16228
ad5f9eea
PE
16229 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16230
aec1708a
PE
16231 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16232 to match comment at start of function. This also removes a
16233 GCC warning about overflow in a 32+64-bit port.
16234
47be4ab5
PE
16235 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16236
371cac43
PE
16237 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16238 Reported by Stefan Monnier in
16239 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
16240 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16241 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 16242
d01a7826
PE
16243 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16244 (EMACS_UINTPTR): Likewise, with uintptr_t.
16245
7fd47d5c
PE
16246 * lisp.h: Prefer 64-bit EMACS_INT if available.
16247 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16248 on 32-bit hosts that have 64-bit int, so that they can access
16249 large files.
122b0c86
PE
16250 However, temporarily disable this change unless the temporary
16251 symbol WIDE_EMACS_INT is defined.
7fd47d5c 16252
8727937b
PE
16253 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16254
8ac068ac
PE
16255 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16256 This removes an assumption that EMACS_INT and long are the same
16257 width as pointers. The assumption is true for Emacs porting targets
16258 now, but we want to make other targets possible.
16259 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16260 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16261 In the rest of the code, change types of integers that hold casted
16262 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16263 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16264 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16265 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16266 No need to cast type when ORing.
16267 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16268 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16269 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16270 assume EMACS_INT is the same width as char *.
16271 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16272 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16273 Remove no-longer-needed casts.
16274 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16275 (xg_tool_bar_help_callback, xg_make_tool_item):
16276 Use EMACS_INTPTR to hold an integer
16277 that will be cast to void *; this can avoid a GCC warning
16278 if EMACS_INT is not the same width as void *.
16279 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16280 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16281 (current_message_1, set_message_1):
16282 Use a local to convert to proper width without a cast.
16283 * xmenu.c (dialog_selection_callback): Likewise.
16284
ede49d71
PE
16285 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16286 Also, don't assume VALBITS / RAND_BITS is less than 5,
16287 and don't rely on undefined behavior when shifting a 1 left into
16288 the sign bit.
16289 * lisp.h (get_random): Change signature to match.
16290
2f30ecd0
PE
16291 * lread.c (hash_string): Use size_t, not int, for hash computation.
16292 Normally we prefer signed values; but hashing is special, because
16293 it's better to use unsigned division on hash table sizes so that
16294 the remainder is nonnegative. Also, size_t is the natural width
16295 for hashing into memory. The previous code used 'int', which doesn't
16296 retain enough info to hash well into very large tables.
16297 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16298
2a866e7b
PE
16299 * dbusbind.c: Don't possibly lose pointer info when converting.
16300 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16301 Use XPNTR rather than XHASH, so that the high-order bits of
16302 the pointer aren't lost when converting through void *.
16303
51639eac
PE
16304 * eval.c (Fautoload): Don't double-shift a pointer.
16305
92394119
PE
16306 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16307
dbdb9a7c
JB
163082011-05-06 Juanma Barranquero <lekktu@gmail.com>
16309
16310 * gnutls.c (DEF_GNUTLS_FN):
16311 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16312
db7a0b4f
AS
163132011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16314
16315 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16316 marker. (Bug#8610)
16317
cd394be1 163182011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16319
16320 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16321 New version that can reserve upto 2GB of heap space.
16322
f7ff1b0f 163232011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16324
16325 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16326
639c109b
TZ
163272011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16328
16329 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16330 `gnutls_certificate_set_x509_key_file'.
16331
d2127135
JB
163322011-05-05 Juanma Barranquero <lekktu@gmail.com>
16333
16334 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16335 Update dependencies.
16336
e968f4f3
JB
163372011-05-04 Juanma Barranquero <lekktu@gmail.com>
16338
16339 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16340 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16341 Remove unused parameter `fildes'.
16342 * process.c (read_process_output, send_process): Don't pass it.
16343
84d358f0
JB
163442011-05-04 Juanma Barranquero <lekktu@gmail.com>
16345
16346 Fix previous change: the library cache is defined in w32.c.
16347 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16348 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16349
0898ca10
JB
163502011-05-04 Juanma Barranquero <lekktu@gmail.com>
16351
16352 Implement dynamic loading of GnuTLS on Windows.
16353
16354 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16355 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16356 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16357 Declare.
16358
16359 * gnutls.c (Qgnutls_dll): Define.
16360 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16361 (gnutls_*): Declare function pointers.
16362 (init_gnutls_functions): New function to initialize function pointers.
16363 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16364 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16365 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16366 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16367 (emacs_gnutls_write, emacs_gnutls_read)
16368 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16369 (Fgnutls_available_p): New function.
16370 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16371 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16372 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16373
16374 * image.c: Include w32.h.
16375 (Vimage_type_cache): Delete.
16376 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16377 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16378 (w32_delayed_load): Move to w32.c.
16379
16380 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16381
16382 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16383 (w32_delayed_load): Move from image.c. When loading a library, record
16384 its filename in the :loaded-from property of the library id.
16385 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16386 Initialize and staticpro them.
16387 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16388
16389 * process.c: Include lisp.h before w32.h, not after.
16390 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16391 instead of gnutls_record_check_pending.
16392
16393 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16394
ff4de4aa
TZ
163952011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16396
16397 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16398 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16399 as passed in.
16400
abe95abb
JD
164012011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16402
16403 * xterm.c (x_set_frame_alpha): Do not set property on anything
16404 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16405
e16e55d4
JB
164062011-05-02 Juanma Barranquero <lekktu@gmail.com>
16407
16408 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16409
bafcf6a5
JB
164102011-05-02 Juanma Barranquero <lekktu@gmail.com>
16411
16412 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16413 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16414 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16415 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16416 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16417 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16418 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16419 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16420 (Qgnutls_bootprop_callbacks_verify): Make static.
16421
e7a6747f
AS
164222011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16423
19ed11ba
AS
16424 * callproc.c: Indentation fixup.
16425
e7a6747f 16426 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16427 (wait_for_termination, interruptible_wait_for_termination):
16428 Move after wait_for_termination_1.
e7a6747f 16429
1ef14cb4
LMI
164302011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16431
16432 * sysdep.c (interruptible_wait_for_termination): New function
16433 which is like wait_for_termination, but allows keyboard
16434 interruptions.
16435
16436 * callproc.c (Fcall_process): Add (:file "file") as an option for
16437 the STDOUT buffer.
16438 (Fcall_process_region): Ditto.
16439
330d880c
EZ
164402011-04-30 Eli Zaretskii <eliz@gnu.org>
16441
8db90b73
EZ
16442 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16443 rather than `XVECTOR (FOO)->size'.
16444
330d880c
EZ
16445 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16446 inttypes.h, as a gnulib replacement is used if it not available in
16447 system headers.
16448
15cbd324
EZ
164492011-04-21 Eli Zaretskii <eliz@gnu.org>
16450
16451 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16452 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16453 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16454
16455 * coding.c (coding_alloc_by_realloc): Error out if destination
16456 will grow beyond MOST_POSITIVE_FIXNUM.
16457 (decode_coding_emacs_mule): Abort if there isn't enough place in
16458 charbuf for the composition carryover bytes. Reserve an extra
16459 space for up to 2 characters produced in a loop.
16460 (decode_coding_iso_2022): Abort if there isn't enough place in
16461 charbuf for the composition carryover bytes.
16462
164632011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16464
ae940cca
EZ
16465 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16466 aborting when %lld or %lll format is passed.
16467 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16468 %llo or %llx format is passed. (Bug#8545)
16469
03ab8921
EZ
16470 * window.c (window_scroll_line_based): Use a marker instead of
16471 simple variables to record original value of point. (Bug#7952)
16472
afda1437
EZ
16473 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16474 produced by %s or %c overflows available buffer space. (Bug#8545)
16475
f76dee0c
PE
164762011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16477
16478 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16479 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16480
fdc5744d
JB
164812011-04-28 Juanma Barranquero <lekktu@gmail.com>
16482
16483 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16484
638f053a
JB
164852011-04-28 Juanma Barranquero <lekktu@gmail.com>
16486
16487 * keyboard.c (Qdelayed_warnings_hook): Define.
16488 (command_loop_1): Run `delayed-warnings-hook'
16489 if Vdelayed_warnings_list is non-nil.
16490 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16491 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16492
d178f871
EZ
164932011-04-28 Eli Zaretskii <eliz@gnu.org>
16494
16495 * doprnt.c (doprnt): Don't return value smaller than the buffer
16496 size if the message was truncated. (Bug#8545).
16497
b124fd93
JB
164982011-04-28 Juanma Barranquero <lekktu@gmail.com>
16499
16500 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16501 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16502
e810457d
PE
165032011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16504
16505 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16506
ea51cceb
JB
165072011-04-27 Juanma Barranquero <lekktu@gmail.com>
16508
16509 * makefile.w32-in: Update dependencies.
16510
94dcfacf
EZ
165112011-04-27 Eli Zaretskii <eliz@gnu.org>
16512
16513 Improve `doprnt' and its usage. (Bug#8545)
16514 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16515 `format_end'. Remove support for %l as a conversion specifier.
16516 Don't use xrealloc. Improve diagnostics when the %l size modifier
16517 is used. Update the commentary.
16518
16519 * eval.c (verror): Simplify calculation of size_t.
16520
16521 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16522 messages.
16523
f61f41d7
PE
165242011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16525
16526 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16527 change.
16528
96fb4434
PE
165292011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16530
16531 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16532 This makes this file independent of the recent pseudovector change.
16533
671875da 165342011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16535
69e9b5a3
PE
16536 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16537
b5f869a7 16538 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16539 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16540 Remove unused local.
c8926152 16541 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16542
841a1577 16543 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16544 GCC 4.6.0 optimizes based on type-based alias analysis.
16545 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16546 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16547 != &v->size, and therefore "v->size = 1; b->size = 2; return
16548 v->size;" must therefore return 1. This assumption is incorrect
16549 for Emacs, since it type-puns struct Lisp_Vector * with many other
16550 types. To fix this problem, this patch adds a new type struct
f904488f 16551 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16552 and pseudovectors, and helps optimizing compilers not get fooled
16553 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16554 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16555 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16556 the size member.
eab3844f
PE
16557 (XSETPVECTYPE): Rewrite in terms of new macro.
16558 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16559 This is a bit clearer, and further avoids the possibility of
16560 undesirable aliasing.
16561 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16562 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16563 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16564 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16565 (ASIZE): Now uses header.size rather than size.
16566 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16567 to avoid the hassle of writing XVECTOR (foo)->header.size.
16568 (struct vectorlike_header): New type.
eab3844f
PE
16569 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16570 object, to help avoid aliasing.
16571 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16572 (SUBRP): Likewise, since Lisp_Subr is a special case.
16573 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16574 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16575 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16576 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16577 changed to be "header.size" and "header.next".
16578 * buffer.h (struct buffer): Likewise.
16579 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16580 * frame.h (struct frame): Likewise.
16581 * process.h (struct Lisp_Process): Likewise.
16582 * termhooks.h (struct terminal): Likewise.
16583 * window.c (struct save_window_data, struct saved_window): Likewise.
16584 * window.h (struct window): Likewise.
16585 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16586 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16587 * buffer.c (init_buffer_once): Likewise.
16588 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16589 special case.
16590 * process.c (Fformat_network_address): Use local var for size,
16591 for brevity.
16592
0df1eac5
PE
16593 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16594
847ab9d1 16595 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16596 * data.c (atof): Remove decl; no longer used or needed.
16597 (digit_to_number): Move to lread.c.
16598 (Fstring_to_number): Use new string_to_number function, to be
16599 consistent with how the Lisp reader treats infinities and NaNs.
16600 Do not assume that floating-point numbers represent EMACS_INT
16601 without losing information; this is not true on most 64-bit hosts.
16602 Avoid double-rounding errors, by insisting on integers when
16603 parsing non-base-10 numbers, as the documentation specifies.
16604 * lisp.h (string_to_number): New decl, replacing ...
16605 (isfloat_string): Remove.
bc0a5c13 16606 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16607 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16608 appears to have been a coding error. Similarly, do not accept
16609 strings like +-1e0 as floating point numbers. Do not report
16610 overflow for integer overflows unless the base is not 10 which
16611 means we have no simple and reliable way to continue.
16612 Break out the floating-point parsing into a new
16613 function string_to_number, so that Fstring_to_number parses
16614 floating point numbers consistently with the Lisp reader.
04f2d78b 16615 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16616 (E_CHAR, EXP_INT): Remove, replacing with ...
16617 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16618 (string_to_number): New function, replacing isfloat_string.
16619 This function checks for valid syntax and produces the resulting
16620 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16621 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16622 so that overflow for non-base-10 numbers is reported only when
16623 there's no portable and simple way to convert to floating point.
452f4150 16624
67769ffc
PE
16625 * textprop.c (set_text_properties_1): Rewrite for clarity,
16626 and to avoid GCC warning about integer overflow.
16627
c20db43f
PE
16628 * intervals.h (struct interval): Use EMACS_INT for members
16629 where EMACS_UINT might cause problems. See
16630 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16631 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16632 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16633 All uses changed.
37aa2f85
PE
16634 (offset_intervals): Tell GCC not to worry about length overflow
16635 when negating a negative length.
c20db43f 16636
2538aa2f
PE
16637 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16638 (overrun_check_free): Likewise.
16639
f2d3008d
PE
16640 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16641 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16642 word size.
16643
ec8df744
PE
16644 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16645 (gnutls_make_error): Rename local to avoid shadowing.
16646 (gnutls_emacs_global_deinit): ifdef out; not used.
16647 (Fgnutls_boot): Use const for pointer to readonly storage.
16648 Comment out unused local. Fix pointer signedness problems.
16649
640ee02d
PE
16650 * lread.c (openp): Don't stuff size_t into an 'int'.
16651 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16652 about possible signed overflow.
16653
6048fb2a
PE
16654 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16655 (GDK_KEY_g): Don't define if already defined.
16656 (xg_prepare_tooltip): Avoid pointer signedness problem.
16657 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16658
fa3c87e1
PE
16659 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16660 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16661
2172544b
PE
16662 * xfns.c (Fx_window_property): Simplify a bit,
16663 to make a bit faster and to avoid GCC 4.6.0 warning.
16664 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16665
9b821a21
PE
16666 * fns.c (internal_equal): Don't assume size_t fits in int.
16667
3c616cfa
PE
16668 * alloc.c (compact_small_strings): Tighten assertion a little.
16669
c2982e87
PE
16670 Replace pEd with more-general pI, and fix some printf arg casts.
16671 * lisp.h (pI): New macro, generalizing old pEd macro to other
16672 conversion specifiers. For example, use "...%"pI"d..." rather
16673 than "...%"pEd"...".
16674 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16675 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16676 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16677 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16678 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16679 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16680 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16681 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16682 64-bit hosts.
16683 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16684 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16685 * print.c (safe_debug_print, print_object): Likewise.
16686 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16687 to int.
6f04d126
PE
16688 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16689 avoiding the 0 flag, which is not portable.
c2982e87
PE
16690 * process.c (Fmake_network_process): Use pI to avoid cast.
16691 * region-cache.c (pp_cache): Likewise.
16692 * xdisp.c (decode_mode_spec): Likewise.
16693 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16694 behavior on 64-bit hosts with printf arg.
6f04d126 16695 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16696 (x_stop_queuing_selection_requests): Likewise.
16697 (x_get_window_property): Don't truncate byte count to an 'int'
16698 when tracing.
0b432f21 16699
5e073ec7
PE
16700 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16701 here, since it parses constructs like leading '-' and spaces,
16702 which are not wanted; and it overflows with large numbers.
16703 Instead, simply match F[0-9]+, which is what is wanted anyway.
16704
36372bf9
PE
16705 * alloc.c: Remove unportable assumptions about struct layout.
16706 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16707 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16708 (allocate_vectorlike, make_pure_vector): Use the new macros,
16709 plus offsetof, to remove unportable assumptions about struct layout.
16710 These assumptions hold on all porting targets that I know of, but
16711 they are not guaranteed, they're easy to remove, and removing them
16712 makes further changes easier.
16713
0b432f21
PE
16714 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16715 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16716 (string_overrun_cookie): Now const. Use initializers that
16717 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16718 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16719 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16720 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16721 multiple of sizeof (EMACS_INT); it need not be, if
16722 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16723 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16724
895009e1
JB
167252011-04-26 Juanma Barranquero <lekktu@gmail.com>
16726
16727 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16728
6a7a1b0b
TZ
167292011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16730
16731 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16732 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16733 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16734
841a1577 167352011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16736
16737 * lisp.h (Qdebug): List symbol.
895009e1 16738 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16739 * keyboard.c (debug-on-event): New variable.
16740 (handle_user_signal): Break into debugger when debug-on-event
16741 matches the current signal symbol.
16742
f2d3ba6f
DN
167432011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16744
16745 * alloc.c (check_sblock, check_string_bytes)
16746 (check_string_free_list): Convert to standard C.
16747
42ce4c63
TZ
167482011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16749
16750 * w32.c (emacs_gnutls_push): Fix typo.
16751
825cd63c
EZ
167522011-04-25 Eli Zaretskii <eliz@gnu.org>
16753
fb11d64d
EZ
16754 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16755 "cast to pointer from integer of different size".
16756
825cd63c
EZ
16757 Improve doprnt and its use in verror. (Bug#8545)
16758 * doprnt.c (doprnt): Document the set of format control sequences
16759 supported by the function. Use SAFE_ALLOCA instead of always
16760 using `alloca'.
16761
16762 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16763 is one byte too soon. Don't use xrealloc; instead xfree and
16764 xmalloc anew.
16765
e061a11b
TZ
167662011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16767
16768 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16769 callbacks stage.
16770
16771 * gnutls.c: Renamed global_initialized to
16772 gnutls_global_initialized. Added internals for the
16773 :verify-hostname-error, :verify-error, and :verify-flags
16774 parameters of `gnutls-boot' and documented those parameters in the
16775 docstring. Start callback support.
9173deec
JB
16776 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16777 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16778 on error. Return error code.
e061a11b
TZ
16779 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16780 (emacs_gnutls_read): Likewise.
16781 (Fgnutls_boot): Return handshake error code.
16782 (emacs_gnutls_handle_error): New function.
16783 (wsaerror_to_errno): Likewise.
16784
16785 * w32.h (emacs_gnutls_pull): Add prototype.
16786 (emacs_gnutls_push): Likewise.
16787
16788 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16789 (emacs_gnutls_push): Likewise.
16790
167912011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16792
16793 * process.c (wait_reading_process_output): Check if GnuTLS
16794 buffered some data internally if no FDs are set for TLS
16795 connections.
16796
16797 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16798 (LIBS): Link to USER_LIBS.
16799 ($(BLD)/gnutls.$(0)): New target.
16800
fa6996bc
EZ
168012011-04-24 Eli Zaretskii <eliz@gnu.org>
16802
eb35682e
EZ
16803 * xdisp.c (handle_single_display_spec): Rename the
16804 display_replaced_before_p argument into display_replaced_p, to
16805 make it consistent with the commentary. Fix typos in the
16806 commentary.
16807
e2ad650c
EZ
16808 * textprop.c (syms_of_textprop): Remove dead code.
16809 (copy_text_properties): Delete obsolete commentary about an
16810 interface that was deleted long ago. Fix typos in the description
16811 of arguments.
16812
1b2de274
EZ
16813 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16814 to changes in oldXMenu/XMenu.h from 2011-04-16.
16815 <menu_help_message, prev_menu_help_message>: Constify.
16816 (IT_menu_make_room): menu->help_text is now `const char **';
16817 adjust.
16818
16819 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16820 to changes in oldXMenu/XMenu.h from 2011-04-16.
16821 (struct XMenu): Declare `help_text' `const char **'.
16822
16823 * xfaces.c <Qunspecified>: Make extern again.
16824
16825 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16826 required by POSIX.
1b2de274 16827
762b15be
EZ
16828 * doc.c (get_doc_string): Improve the format passed to `error'.
16829
16830 * doprnt.c (doprnt): Improve commentary.
16831
16832 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16833
16834 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16835 them with etags.
16836
f1052e5d
EZ
16837 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16838 changes in globals.h immediately force recompilation.
762b15be
EZ
16839 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16840 $(CURDIR)/s/ms-w32.h.
16841 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16842
fa6996bc
EZ
16843 * character.c (Fchar_direction): Function deleted.
16844 (syms_of_character): Don't defsubr it.
16845 <char-direction-table>: Deleted.
16846
e6c3da20
EZ
168472011-04-23 Eli Zaretskii <eliz@gnu.org>
16848
16849 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16850 * doprnt.c: Include limits.h.
16851 (SIZE_MAX): New macro.
04f2d78b
CB
16852 (doprnt): Return a size_t value. 2nd arg is now size_t.
16853 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16854 Improve overflow protection. Support `l' modifier for integer
16855 conversions. Support %l conversion. Don't assume an EMACS_INT
16856 argument for integer conversions and for %c.
16857
16858 * lisp.h (doprnt): Restore prototype.
16859
16860 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16861 $(SRC)/character.h.
16862
16863 * Makefile.in (base_obj): Add back doprnt.o.
16864
16865 * deps.mk (doprnt.o): Add back prerequisites.
16866 (callint.o): Depend on character.h.
16867
16868 * eval.c (internal_lisp_condition_case): Include the handler
16869 representation in the error message.
16870 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16871 when breaking from the loop.
16872
16873 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16874
16875 * callint.c (Fcall_interactively): When displaying error message
16876 about invalid control letter, pass the character's codepoint, not
16877 a pointer to its multibyte form. Improve display of the character
16878 in octal and display also its hex code.
16879
16880 * character.c (char_string): Use %x to display the (unsigned)
16881 codepoint of an invalid character, to avoid displaying a bogus
16882 negative value.
16883
16884 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16885 `error', not SYMBOL_NAME itself.
16886
16887 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16888 character arguments to `error'.
16889
16890 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16891 to `error' in error message about FINAL_CHAR argument. Make sure
16892 FINAL_CHAR is a character, and use %c when it is passed as
16893 argument to `error'.
16894
4ffd0d6b 168952011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16896
16897 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16898
16899 * w32.c: Include <time.h>.
16900 (sys_localtime): New function.
16901
4ffd0d6b 169022011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16903
16904 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16905
4ffd0d6b 16906 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16907
4ffd0d6b 169082011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16909
4ffd0d6b
GM
16910 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16911 zombies (Bug#8467).
aac0c6e3 16912
04c56954
EZ
169132011-04-19 Eli Zaretskii <eliz@gnu.org>
16914
16915 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16916 gl_state.e_property when gl_state.object is Qt.
16917
16918 * insdel.c (make_gap_larger): Remove limitation of buffer size
16919 to <= INT_MAX.
16920
16a43933
CY
169212011-04-18 Chong Yidong <cyd@stupidchicken.com>
16922
16923 * xdisp.c (lookup_glyphless_char_display)
16924 (produce_glyphless_glyph): Handle cons cell entry in
16925 glyphless-char-display.
16926 (Vglyphless_char_display): Document it.
16927
16928 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16929 glyphless-char-display.
16930
4581706e
CY
169312011-04-17 Chong Yidong <cyd@stupidchicken.com>
16932
16933 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16934
16935 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16936
16937 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16938 definition for no-X builds.
16939
4887c6e2 169402011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16941
fd35b6f9
PE
16942 Static checks with GCC 4.6.0 and non-default toolkits.
16943
5c1ccb01
PE
16944 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16945
006c5daa
PE
16946 * process.c (keyboard_bit_set): Define only if SIGIO.
16947 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16948 (send_process): Repair possible setjmp clobbering.
16949
efc736d3
PE
16950 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16951
4e2fe2e6
PE
16952 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16953
f97334a2
PE
16954 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16955
4e75f29d
PE
16956 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16957 Define only if needed.
16958
90efadd1
PE
16959 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16960 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16961 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16962
3c647824
PE
16963 * dispextern.h (struct redisplay_interface): Rename param
16964 to avoid shadowing.
e264f262 16965 * termhooks.h (struct terminal): Likewise.
761383f4 16966 * xterm.c (xembed_send_message): Likewise.
3c647824 16967
b58c5c4a
PE
16968 * insdel.c (make_gap_smaller): Define only if
16969 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16970
cad59032
PE
16971 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16972 it.
16973
c339dc2e
PE
16974 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16975 so that we aren't warned about unused symbols.
16976
91a3e27b
PE
16977 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16978
399c71d3 16979 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16980
8ffc96f5
PE
16981 * xfns.c (x_real_positions): Mark locals as initialized.
16982
eef9bc79
PE
16983 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16984
098db9dd
PE
16985 * xterm.c: Fix problems found by static analysis with other toolkits.
16986 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16987 (x_dispatch_event): Declare static if USE_GTK, and
16988 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16989 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16990 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16991 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16992 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16993
eb18f6cc
PE
16994 * xmenu.c (menu_help_callback): Pointer type fixes.
16995 Use const pointers when pointing at readonly data. Avoid pointer
16996 signedness clashes.
16997 (FALSE): Remove unused macro.
16998 (update_frame_menubar): Remove unused decl.
16999
1fe72bf8
PE
17000 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17001
60d9e1db
PE
17002 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17003 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17004 (single_menu_item): Rename local to avoid shadowing.
17005
39261c26
PE
17006 * keyboard.c (make_lispy_event): Remove unused local var.
17007
018c5e19
PE
17008 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17009 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17010
63d2b86e
PE
17011 * bitmaps: Change bitmaps from unsigned char back to the X11
17012 compatible char. Avoid the old compiler warnings about
17013 out-of-range initializers by using, for example, '\xab' rather
17014 than 0xab.
17015
aefd87e1
PE
17016 * xgselect.c (xgselect_initialize): Check vs interface
17017 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17018
bf501fb9
PE
17019 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17020
e9829fdf
PE
17021 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17022 to read-only memory.
17023
1086c095
PE
17024 * fns.c (vector): Remove; this old hack is no longer needed.
17025
2baccd04 17026 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 17027 Remove unused var.
dde42981 17028 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 17029
72391843 17030 * xrdb.c (x_load_resources): Omit unused local.
3565b346 17031
436c16df 17032 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 17033 (x_window): Rename locals to avoid shadowing.
dc5ddd85 17034 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 17035
92bb796d 17036 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 17037 (x_term_init): Remove local to avoid shadowing.
92bb796d 17038
764430a3 17039 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
17040
17041 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17042 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17043
d1dfb56c
EZ
170442011-04-16 Eli Zaretskii <eliz@gnu.org>
17045
c4354cb4
EZ
17046 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17047
d1dfb56c
EZ
17048 Fix regex.c, syntax.c and friends for buffers > 2GB.
17049 * syntax.h (struct gl_state_s): Declare character position members
17050 EMACS_INT.
17051
17052 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17053
04f2d78b
CB
17054 * textprop.c (verify_interval_modification, interval_of):
17055 Declare arguments EMACS_INT.
d1dfb56c
EZ
17056
17057 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17058 EMACS_INT.
17059
17060 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17061
17062 * indent.c (Fvertical_motion): Local variable it_start is now
17063 EMACS_INT.
17064
17065 * regex.c (re_match, re_match_2, re_match_2_internal)
17066 (bcmp_translate, regcomp, regexec, print_double_string)
17067 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17068 (re_compile_pattern, re_exec): Declare arguments and local
17069 variables `size_t' and `ssize_t' and return values `regoff_t', as
17070 appropriate.
17071 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17072 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17073 <compile_stack_type>: `size' and `avail' are now `size_t'.
17074
17075 * regex.h <regoff_t>: Use ssize_t, not int.
17076 (re_search, re_search_2, re_match, re_match_2): Arguments that
17077 specify buffer/string position and length are now ssize_t and
17078 size_t. Return type is regoff_t.
17079
613052cd
BK
170802011-04-16 Ben Key <bkey76@gmail.com>
17081
17082 * nsfont.m: Fixed bugs in ns_get_family and
17083 ns_descriptor_to_entity that were caused by using free to
17084 deallocate memory blocks that were allocated by xmalloc (via
17085 xstrdup). This caused Emacs to crash when compiled with
17086 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17087 --enable-checking=xmallocoverrun). xfree is now used to
17088 deallocate these memory blocks.
17089
4170f62f 170902011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 17091
71b41406
PE
17092 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17093
9587a89d
PE
17094 emacs_write: Accept and return EMACS_INT for sizes.
17095 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17096 et seq.
17097 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17098 Accept and return EMACS_INT.
17099 (emacs_gnutls_write): Return the number of bytes written on
17100 partial writes.
17101 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
17102 (emacs_read, emacs_write): Remove check for negative size, as the
17103 Emacs source code has been audited now.
9587a89d
PE
17104 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17105 (emacs_read, emacs_write): Use it.
273a5f82
PE
17106 * process.c (send_process): Adjust to the new signatures of
17107 emacs_write and emacs_gnutls_write. Do not attempt to store
17108 a byte offset into an 'int'; it might overflow.
9587a89d 17109 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 17110
3e047f51
PE
17111 * sound.c: Don't assume sizes fit in 'int'.
17112 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 17113 Return EMACS_INT, not int.
3e047f51 17114 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
17115 Accept EMACS_INT, not int.
17116 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
17117 record read return values.
17118
cc39a9db
BK
171192011-04-15 Ben Key <bkey76@gmail.com>
17120
c9d0ec6d
JB
17121 * keyboard.c (Qundefined): Don't declare static since it is used
17122 in nsfns.m.
17123 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17124 static since they are used in nsfont.m.
cc39a9db 17125
6c60eb9f
SM
171262011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17127
17128 * process.c (Qprocessp): Don't declare static.
17129 * lisp.h (Qprocessp): Declare again.
17130
7990b61a
JB
171312011-04-15 Juanma Barranquero <lekktu@gmail.com>
17132
17133 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17134
5d4cb038
PE
171352011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17136
8bd7b830 17137 Improve C-level modularity by making more things 'static'.
cd64ea1d 17138
e3b27b31
PE
17139 Don't publish debugger-only interfaces to other modules.
17140 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17141 (verify_bytepos, count_markers): Move decls to the only modules
17142 that need them.
17143 * region-cache.h (pp_cache): Likewise.
17144 * window.h (check_all_windows): Likewise.
17145 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17146
5d4cb038
PE
17147 * sysdep.c (croak): Now static, if
17148 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17149 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
17150
17151 * alloc.c (refill_memory_reserve): Now static if
17152 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17153 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 17154
e87b6180
PE
17155 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17156 Define only if USE_LUCID.
17157
ac64929e
PE
17158 * xrdb.c (x_customization_string, x_rm_string): Now static.
17159
6f37259d
PE
17160 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17161 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17162
1683e3ab
PE
17163 * xdisp.c (draw_row_with_mouse_face): Now static.
17164 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17165
de9c2632
PE
17166 * window.h (check_all_windows): Mark externally visible.
17167
2b96acb7
PE
17168 * window.c (window_deletion_count): Now static.
17169
17170 * undo.c: Make symbols static if they're not exported.
17171 (last_undo_buffer, last_boundary_position, pending_boundary):
17172 Now static.
17173
50436f33
PE
17174 * textprop.c (interval_insert_behind_hooks): Now static.
17175 (interval_insert_in_front_hooks): Likewise.
17176
64520e5c
PE
17177 * term.c: Make symbols static if they're not exported.
17178 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17179 (max_frame_lines, tty_set_terminal_modes):
17180 (tty_reset_terminal_modes, tty_turn_off_highlight):
17181 (get_tty_terminal): Now static.
17182 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17183 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 17184 HAVE_WINDOW_SYSTEM.
64520e5c
PE
17185 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17186 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17187
1fa53021
PE
17188 * sysdep.c: Make symbols static if they're not exported.
17189 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17190 Now static.
17191 (sigprocmask_set, full_mask): Remove; unused.
17192 (wait_debugging): Mark as visible.
17193 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17194 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17195
d4b43b22
PE
17196 * syntax.c (syntax_temp): Define only if !__GNUC__.
17197
b7c513d0
PE
17198 * sound.c (current_sound_device, current_sound): Now static.
17199
989b29ad
PE
17200 * search.c (searchbufs, searchbuf_head): Now static.
17201
13a55a78
PE
17202 * scroll.c (scroll_cost): Remove; unused.
17203 * dispextern.h (scroll_cost): Remove decl.
17204
de68a1fc
PE
17205 * region-cache.h (pp_cache): Mark as externally visible.
17206
40ccffa6
PE
17207 * process.c: Make symbols static if they're not exported.
17208 (process_tick, update_tick, create_process, chan_process):
17209 (Vprocess_alist, proc_buffered_char, datagram_access):
17210 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17211 (deactivate_process): Mark defn as static, as well as decl.
17212 * lisp.h (create_process): Remove decl.
17213 * process.h (chan_process, Vprocess_alist): Remove decls.
17214
ad64fc97
PE
17215 * print.c: Make symbols static if they're not exported.
17216 (print_depth, new_backquote_output, being_printed, print_buffer):
17217 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17218 (print_interval, print_number_index, initial_stderr_stream):
17219 Now static.
17220 * lisp.h (Fprinc): Remove decl.
17221 (debug_output_compilation_hack): Mark as externally visible.
17222
adddb265
PE
17223 * sysdep.c (croak): Move decl from here to syssignal.h.
17224 * syssignal.h (croak): Put it here, so the API can be checked when
17225 'croak' is called from dissociate_if_controlling_tty.
17226
1717ede2
PE
17227 * minibuf.c: Make symbols static if they're not exported.
17228 (minibuf_save_list, choose_minibuf_frame): Now static.
17229 * lisp.h (choose_minibuf_frame): Remove decl.
17230
fa5fb2bc
PE
17231 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17232
1e3890d1
PE
17233 * lread.c: Make symbols static if they're not exported.
17234 (read_objects, initial_obarray, oblookup_last_bucket_number):
17235 Now static.
17236 (make_symbol): Remove; unused.
17237 * lisp.h (initial_obarray, make_symbol): Remove decls.
17238
8a1414fa
PE
17239 * keyboard.c: Make symbols static if they're not exported.
17240 (single_kboard, recent_keys_index, total_keys, recent_keys):
17241 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17242 (this_single_command_key_start, echoing, last_auto_save):
17243 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17244 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17245 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17246 (Vlispy_mouse_stem, double_click_count):
17247 Now static.
17248 (force_auto_save_soon): Define only if SIGDANGER.
17249 (ignore_mouse_drag_p): Now static if
17250 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17251 (print_help): Remove; unused.
17252 (stop_character, last_timer_event): Mark as externally visible.
17253 * keyboard.h (ignore_mouse_drag_p): Declare only if
17254 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17255 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17256 * lisp.h (echoing): Remove decl.
17257 (force_auto_save_soon): Declare only if SIGDANGER.
17258 * xdisp.c (redisplay_window): Simplify code, to make it more
17259 obvious that ignore_mouse_drag_p is not accessed if !defined
17260 USE_GTK && !defined HAVE_NS.
17261
93ea6e8f
PE
17262 * intervals.c: Make symbols static if they're not exported.
17263 (merge_properties_sticky, merge_interval_right, delete_interval):
17264 Now static.
17265 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17266
77382fcc
PE
17267 * insdel.c: Make symbols static if they're not exported.
17268 However, leave prepare_to_modify_buffer alone. It's never
17269 called from outside this function, but that appears to be a bug.
17270 (combine_after_change_list, combine_after_change_buffer):
4889fc82 17271 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
17272 (adjust_after_replace_noundo): Remove; unused.
17273 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17274 (signal_before_change): Remove decls.
77382fcc 17275
9306c32e
PE
17276 * indent.c (val_compute_motion, val_vmotion): Now static.
17277
cd44d2eb
PE
17278 * image.c: Make symbols static if they're not exported.
17279 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17280 if USE_GTK.
17281 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17282 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17283
ad9a7a06
PE
17284 * fringe.c (standard_bitmaps): Now static.
17285 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17286
81626931
PE
17287 * frame.c: Make symbols static if they're not exported.
17288 (x_report_frame_params, make_terminal_frame): Now static.
17289 (get_frame_param): Now static, unless HAVE_NS.
17290 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17291 (x_get_resource_string): Remove; not used.
17292 * frame.h (make_terminal_frame, x_report_frame_params):
17293 (x_get_resource_string); Remove decls.
17294 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17295 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17296
239f9db9
PE
17297 * font.c, fontset.c: Make symbols static if they're not exported.
17298 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17299 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17300 * font.c (font_close_object): Now static.
17301 * font.h (font_close_object): Remove.
17302 * fontset.c (FONTSET_OBJLIST): Remove.
17303 (free_realized_fontset) #if-0 the body, which does nothing.
17304 (face_suitable_for_char_p): #if-0, as it's never called.
17305 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17306 * xfaces.c (face_at_string_position):
17307 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17308 since 0 is always ASCII.
17309
dfcf3579
PE
17310 * fns.c (weak_hash_tables): Now static.
17311
5045092b
PE
17312 * fileio.c: Make symbols static if they're not exported.
17313 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17314 (Vwrite_region_annotation_buffers): Now static.
17315
57a96f5c
PE
17316 * eval.c: Make symbols static if they're not exported.
17317 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17318 * lisp.h (backtrace_list): Remove decl.
17319
35f08c38
PE
17320 * emacs.c: Make symbols static if they're not exported.
17321 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17322 (fatal_error_code, fatal_error_signal_hook, standard_args):
17323 Now static.
17324 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17325 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17326 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17327 * lisp.h (fatal_error_signal_hook): Remove decl.
17328 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17329
f44bd759
PE
17330 * editfns.c: Move a (normally-unused) function to its only use.
17331 * editfns.c, lisp.h (get_operating_system_release): Remove.
17332 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17333 worth the hassle of breaking this out.
17334
b532497d
PE
17335 * xterm.c: Make symbols static if they're not exported.
17336 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17337 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17338 (x_destroy_window, x_delete_display):
17339 Now static.
17340 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17341 (x_mouse_leave): Remove; unused.
17342 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17343 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17344 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17345 Remove decls.
17346 (x_mouse_leave): Declare only if WINDOWSNT.
17347 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17348 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17349 USE_X_TOOLKIT.
17350
1675728f
PE
17351 * ftxfont.c: Make symbols static if they're not exported.
17352 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17353 HAVE_FREETYPE.
17354 * font.h (ftxfont_driver): Likewise.
17355
e4cebfca
PE
17356 * xfns.c: Make symbols static if they're not exported.
17357 (x_last_font_name, x_display_info_for_name):
17358 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17359 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17360 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17361 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17362 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17363 (last_show_tip_args): Now static.
17364 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17365 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17366 (x_screen_planes): Remove; unused.
17367 * dispextern.h (x_screen_planes): Remove decl.
17368
5bf46f05
PE
17369 * dispnew.c: Make symbols static if they're not exported.
17370 * dispextern.h (redraw_garbaged_frames, scrolling):
17371 (increment_row_positions): Remove.
17372 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17373 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17374 Now static.
17375 (redraw_garbaged_frames): Remove; unused.
17376
435f4c28
PE
17377 * xfaces.c: Make symbols static if they're not exported.
17378 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17379 Remove decls.
17380 * xterm.h (defined_color): Remove decls.
17381 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17382 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17383 (menu_face_changed_default, defined_color, free_realized_face):
17384 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17385 (ascii_face_of_lisp_face): Remove; unused.
17386
8524aef3
PE
17387 * xdisp.c: Make symbols static if they're not exported.
17388 * dispextern.h (scratch_glyph_row, window_box_edges):
17389 (glyph_to_pixel_coords, set_cursor_from_row):
17390 (get_next_display_element, set_iterator_to_next):
17391 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17392 (show_mouse_face): Remove decls
17393 * frame.h (message_buf_print): Likewise.
17394 * lisp.h (pop_message, set_message, check_point_in_composition):
17395 Likewise.
17396 * xterm.h (set_vertical_scroll_bar): Likewise.
17397 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17398 (message_buf_print, scratch_glyph_row, displayed_buffer):
17399 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17400 (get_next_display_element, show_mouse_face, window_box_edges):
17401 (frame_to_window_pixel_xy, check_point_in_composition):
17402 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17403 (glyph_to_pixel_coords): Remove; unused.
17404
16390cd2
PE
17405 * dired.c (file_name_completion): Now static.
17406
17407 * dbusbind.c (xd_in_read_queued_messages): Now static.
17408
a25f4dfa
PE
17409 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17410 * data.c (circular_list_error): Remove.
17411
14a9c8df
PE
17412 * commands.h (last_point_position, last_point_position_buffer):
17413 (last_point_position_window): Remove decls.
17414 * keyboard.c: Make these variables static.
17415
04f2d78b
CB
17416 * coding.h (coding, code_convert_region, encode_coding_gap):
17417 Remove decls.
74ab6df5
PE
17418 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17419 (iso_code_class, detect_coding, code_convert_region): Now static.
17420 (encode_coding_gap): Remove; unused.
17421
38dfbee1
PE
17422 * chartab.c (chartab_chars, chartab_bits): Now static.
17423
a2cb4e63
PE
17424 * charset.h (charset_iso_8859_1): Remove decl.
17425 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17426 Now static.
17427
127198fd
PE
17428 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17429 * ccl.c (Vccl_program_table): Now static.
17430 (check_ccl_update): Remove; unused.
17431
d85b608f
PE
17432 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17433 * category.h: ... from here.
17434 * category.c (check_category_table, set_category_set): Now static.
17435
31cd66f3
PE
17436 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17437 * lisp.h: Remove these decls.
17438
c358e587
PE
17439 * buffer.c (buffer_count): Remove unused var.
17440
e78aecca
PE
17441 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17442 so that it's not optimized away.
17443 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17444 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17445 exported only to the debugger.
17446
e192d7d3 17447 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17448 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17449
92470028
PE
17450 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17451 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17452 was inaccessible from Lisp.
17453 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17454 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17455
244ed907
PE
17456 alloc.c: Import and export fewer symbols, and remove unused items.
17457 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17458 is defined.
17459 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17460 it's not optimized away by whole-program optimization.
17461 (message_enable_multibyte, free_misc): Remove.
17462 (catchlist, handlerlist, mark_backtrace):
17463 Declare only if BYTE_MARK_STACK.
17464 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17465 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17466 (message_enable_multibyte): Remove decl.
17467 (free_misc, interval_free_list, float_block, float_block_index):
17468 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17469 (cons_free_list, last_marked_index):
17470 Now static.
17471 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17472 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17473 (mark_backtrace): Define only if BYTE_MARK_STACK.
17474 * xdisp.c (message_enable_multibyte): Now static.
17475
61c2b50e 17476 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17477 This makes it easier for human readers (and static analyzers)
17478 to see whether these variables are used from other modules.
17479 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17480 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17481 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17482 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17483 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17484 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17485 * xmenu.c, xselect.c:
17486 Declare Q* vars static if they are not used in other modules.
17487 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17488 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17489 Remove decls of unexported vars.
17490 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17491
95c82688
PE
17492 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17493
16a97296
PE
17494 Make Emacs functions such as Fatom 'static' by default.
17495 This makes it easier for human readers (and static analyzers)
17496 to see whether these functions can be called from other modules.
17497 DEFUN now defines a static function. To make the function external
17498 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17499 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17500 (Finit_image_library):
16a97296
PE
17501 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17502 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17503 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17504 Remove decls, since these functions are now static.
17505 (Funintern, Fget_internal_run_time): New decls, since these functions
17506 were already external.
95c82688 17507
16a97296
PE
17508 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17509 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17510 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17511 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17512 * keyboard.c, keymap.c, lread.c:
17513 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17514 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17515 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17516 Mark functions with DEFUE instead of DEFUN,
17517 if they are used in other modules.
17518 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17519 decls for now-static functions.
17520 * buffer.h (Fdelete_overlay): Remove decl.
17521 * callproc.c (Fgetenv_internal): Mark as internal.
17522 * composite.c (Fremove_list_of_text_properties): Remove decl.
17523 (Fcomposition_get_gstring): New forward static decl.
17524 * composite.h (Fcomposite_get_gstring): Remove decl.
17525 * dired.c (Ffile_attributes): New forward static decl.
17526 * doc.c (Fdocumntation_property): New forward static decl.
17527 * eval.c (Ffetch_bytecode): New forward static decl.
17528 (Funintern): Remove extern decl; now in .h file where it belongs.
17529 * fileio.c (Fmake_symbolic_link): New forward static decl.
17530 * image.c (Finit_image_library): New forward static decl.
17531 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17532 * intervals.h (Fprevious_property_change):
17533 (Fremove_list_of_text_properties): Remove decls.
17534 * keyboard.c (Fthis_command_keys): Remove decl.
17535 (Fcommand_execute): New forward static decl.
17536 * keymap.c (Flookup_key): New forward static decl.
17537 (Fcopy_keymap): Now static.
17538 * keymap.h (Flookup_key): Remove decl.
17539 * process.c (Fget_process): New forward static decl.
17540 (Fprocess_datagram_address): Mark as internal.
17541 * syntax.c (Fsyntax_table_p): New forward static decl.
17542 (skip_chars): Remove duplicate decl.
17543 * textprop.c (Fprevious_property_change): New forward static decl.
17544 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17545 Now internal.
17546 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17547 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17548
785bbd42
PE
17549 * editfns.c (Fformat): Remove unreachable code.
17550
8b913b57
AS
175512011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17552
17553 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17554 change. (Bug#8496)
17555
a6744a35
EZ
175562011-04-13 Eli Zaretskii <eliz@gnu.org>
17557
17558 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17559 when at ZV. (Bug#8487)
17560
e7974947
AS
175612011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17562
baad03f0
AS
17563 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17564 (Bug#8437)
17565 * keyboard.c (parse_tool_bar_item): Likewise.
17566 * sound.c (sound_cleanup, alsa_close): Likewise.
17567 * termcap.c (tgetent): Likewise.
17568 * xfns.c (x_default_font_parameter): Likewise.
17569 * xsettings.c (read_and_apply_settings): Likewise.
17570
e7974947
AS
17571 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17572 (overrun_check_free): Protoize.
17573
28272684
PE
175742011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17575
17576 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17577 since callers should never pass a negative size.
17578 Change the signature to match that of plain 'read' and 'write'; see
17579 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17580 * lisp.h: Update prototypes of emacs_write and emacs_read.
17581
11997c76
EZ
175822011-04-11 Eli Zaretskii <eliz@gnu.org>
17583
17584 * xdisp.c (redisplay_window): Don't try to determine the character
17585 position of the scroll margin if the window start point w->startp
e896f03c 17586 is outside the buffer's accessible region. (Bug#8468)
11997c76 17587
8a2cbd72
EZ
175882011-04-10 Eli Zaretskii <eliz@gnu.org>
17589
17590 Fix write-region and its subroutines for buffers > 2GB.
17591 * fileio.c (a_write, e_write): Modify declaration of arguments and
17592 local variables to support buffers larger than 2GB.
17593 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17594
17595 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17596 argument, local variables, and return value.
17597
17598 * lisp.h: Update prototypes of emacs_write and emacs_read.
17599
17600 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17601
4073e537 176022011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17603
1ebfdcb6
PE
17604 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17605
b2ded58d
PE
17606 Fix more problems found by GCC 4.6.0's static checks.
17607
7d66342c
PE
17608 * xdisp.c (vmessage): Use a better test for character truncation.
17609
bbf47d44
PE
17610 * charset.c (load_charset_map): <, not <=, for optimization,
17611 and to avoid potential problems with integer overflow.
9248994d 17612 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17613 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17614 * editfns.c (Fformat): Likewise.
1e69125e 17615 * syntax.c (skip_chars): Likewise.
3befa583 17616
e3019616
PE
17617 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17618 This also lets GCC 4.6.0 generate slightly better loop code.
17619
becfa255
PE
17620 * callint.c (Fcall_interactively): <, not <=, for optimization.
17621 (Fcall_interactively): Count the number of arguments produced,
17622 not the number of arguments given. This is simpler and lets GCC
17623 4.6.0 generate slightly better code.
17624
dae0cd48
PE
17625 * ftfont.c: Distingish more carefully between FcChar8 and char.
17626 The previous code passed unsigned char * to a functions like
17627 strlen and xstrcasecmp that expect char *, which does not
17628 conform to the C standard.
17629 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17630 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17631 char * when the C standard requires it.
17632
76032d70
PE
17633 * keyboard.c (read_char): Remove unused var.
17634
eb3f1cc8
PE
17635 * eval.c: Port to Windows vsnprintf (Bug#8435).
17636 Include <limits.h>.
17637 (SIZE_MAX): Define if the headers do not.
17638 (verror): Do not give up if vsnprintf returns a negative count.
17639 Instead, grow the buffer. This ports to Windows vsnprintf, which
17640 does not conform to C99. Problem reported by Eli Zaretskii.
17641 Also, simplify the allocation scheme, by avoiding the need for
17642 calling realloc, and removing the ALLOCATED variable.
17643
70476b54
PE
17644 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17645
12020a9e
PE
17646 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17647 But keep the doprint source code for now, as we might revamp it
17648 and use it again (Bug#8435).
ea6c7ae6
PE
17649 * lisp.h (doprnt): Remove.
17650 * Makefile.in (base_obj): Remove doprnt.o.
17651 * deps.mk (doprnt.o): Remove.
17652
5fdb398c
PE
17653 error: Print 32- and 64-bit integers portably (Bug#8435).
17654 Without this change, on typical 64-bit hosts error ("...%d...", N)
17655 was used to print both 32- and 64-bit integers N, which relied on
17656 undefined behavior.
61bdb816 17657 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17658 * lisp.h (error, verror): Mark as printf-like functions.
17659 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17660 Report overflow in size calculations when allocating printf buffer.
17661 Do not truncate output string at its first null byte.
17662 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17663 Truncate the output at a character boundary, since vsnprintf does not
17664 do that.
17665 * charset.c (check_iso_charset_parameter): Convert internal
17666 character to string before calling 'error', since %c now has the
17667 printf meaning.
17668 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17669 overflow when computing char to be passed to 'error'. Do not
17670 pass Lisp_Object to 'error'; pass the integer instead.
17671 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17672 formatted with plain %d.
17673
b189fa66
PE
17674 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17675
bff87ef0
PE
17676 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17677
7e2cac20
PE
17678 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17679
ce4d90b5
PE
17680 * xterm.c (x_catch_errors): Remove duplicate declaration.
17681
266c9547
PE
17682 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17683
79c49ad2
PE
17684 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17685
368f4090
JM
176862011-04-10 Jim Meyering <meyering@redhat.com>
17687
17688 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17689 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17690 return ssize_t not "int", and use size_t as the buffer length.
17691 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17692 * gnutls.h: Update declarations.
17693 * process.c (read_process_output): Use ssize_t, to match.
17694 (send_process): Likewise.
17695
a32d4040
CY
176962011-04-09 Chong Yidong <cyd@stupidchicken.com>
17697
17698 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17699
8546720e 177002011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17701
04f2d78b
CB
17702 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17703 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17704
8546720e
GM
17705 * xterm.c (handle_one_xevent):
17706 * xmenu.c (create_and_show_popup_menu):
17707 * xselect.c (x_decline_selection_request)
17708 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17709
0a2f5c1a 177102011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17711
17712 Fix some uses of `int' instead of EMACS_INT.
17713 * search.c (string_match_1, fast_string_match)
17714 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17715 (scan_buffer, find_next_newline_no_quit)
17716 (find_before_next_newline, search_command, Freplace_match)
17717 (Fmatch_data): Make some `int' variables be EMACS_INT.
17718
17719 * xdisp.c (display_count_lines): 3rd argument and return value now
17720 EMACS_INT. All callers changed.
17721 (pint2hrstr): Last argument is now EMACS_INT.
17722
17723 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17724 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17725 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17726 (decode_coding_utf_16, decode_coding_emacs_mule)
17727 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17728 (decode_coding_ccl, decode_coding_charset)
17729 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17730 (decode_coding_iso_2022, decode_coding_emacs_mule)
17731 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17732 <char_offset, last_offset>: Declare EMACS_INT.
17733 (encode_coding_utf_8, encode_coding_utf_16)
17734 (encode_coding_emacs_mule, encode_invocation_designation)
17735 (encode_designation_at_bol, encode_coding_iso_2022)
17736 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17737 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17738 Declare EMACS_INT.
17739 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17740 (encode_invocation_designation): Last argument P_NCHARS is now
17741 EMACS_INT.
17742 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17743 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17744
17745 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17746 All users changed.
17747
17748 * ccl.c (Fccl_execute_on_string): Declare some variables
17749 EMACS_INT.
17750
8546720e 177512011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17752
17753 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17754
4e19a977
CS
177552011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17756
17757 * process.c (Fformat_network_address): Doc fix.
17758
87302331
R
177592011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17760
ee7683eb 17761 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17762
cbb59342
CY
177632011-04-08 Chong Yidong <cyd@stupidchicken.com>
17764
17765 * keyboard.c (read_char): Call Lisp function help-form-show,
17766 instead of using internal_with_output_to_temp_buffer.
17767 (Qhelp_form_show): New var.
e0d38eeb 17768 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17769
17770 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17771
17772 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17773
e67a13ab
CY
177742011-04-06 Chong Yidong <cyd@stupidchicken.com>
17775
04f2d78b
CB
17776 * process.c (Flist_processes): Remove to Lisp.
17777 (list_processes_1): Delete.
e67a13ab 17778
973f782d
EZ
177792011-04-06 Eli Zaretskii <eliz@gnu.org>
17780
7c106b1e
EZ
17781 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17782
973f782d
EZ
17783 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17784
41cf7d1a 177852011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17786
ca23cc88
PE
17787 Fix more problems found by GCC 4.6.0's static checks.
17788
f390e2d5
PE
17789 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17790
42eea0d0
PE
17791 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17792
b69769da 17793 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17794
f9541e84
PE
17795 * xdisp.c (vmessage): Mark as a printf-like function.
17796
13841b55
PE
17797 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17798
c136c10f
PE
17799 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17800
5e2d4a30
PE
17801 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17802 printf-like functions.
17803 (tiff_load): Add casts to remove these marks before passing them
17804 to system-supplied API.
17805
583f48b9
PE
17806 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17807
b25d760e
PE
17808 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17809 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17810 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17811 directly, rather than having caller test rule sign. This avoids
17812 some unnecessary tests.
17813 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17814 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17815 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17816
bc7b6697 17817 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17818 (xfont_open): Avoid unnecessary tests.
bc7b6697 17819
27ccc379
PE
17820 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17821
dcd5c89a
PE
17822 * composite.h, composite.c (composition_gstring_put_cache):
17823 Use EMACS_INT, not int, for length.
17824
b13a45c6
PE
17825 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17826 breaking out part of COMPOSITION_DECODE_RULE.
17827 (COMPOSITION_DECODE_RULE): Use it.
17828 * composite.c (get_composition_id): Remove unused local vars,
17829 by using the new macro.
17830
1e792e4d
PE
17831 * textprop.c (set_text_properties_1): Change while to do-while,
17832 since the condition is always true at first.
17833
dc6c6455 17834 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17835 (interval_deletion_adjustment): Return unsigned value.
17836 All uses changed.
dc6c6455 17837
aba7731a
PE
17838 * process.c (list_processes_1, create_pty, read_process_output):
17839 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17840 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17841 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17842 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17843 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17844
fdfc4bf3
PE
17845 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17846
fca8fe46 17847 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17848 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17849
06a0259a 17850 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17851 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17852 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17853
e7b9e80f
PE
17854 * print.c (print_error_message): Avoid int overflow.
17855
56201685
PE
17856 * font.c (font_list_entities): Redo for clarity,
17857 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17858
78834453 17859 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17860 (font_score): Avoid potential overflow in diff calculation.
78834453 17861
0bc0b309 17862 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17863 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17864
e610eaca
PE
17865 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17866
b895abce
PE
17867 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17868 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17869 can always succeed if overflow has undefined behavior.
17870
1f1d9321 17871 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17872 (wordify): Omit three unnecessary tests.
1f1d9321 17873
c59478bc
PE
17874 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17875 All callers changed. This avoids the need for an unused var.
17876
79b73827
PE
17877 * casefiddle.c (casify_region): Remove var that is set but not used.
17878
a4db5dfe
PE
17879 * dired.c (file_name_completion): Remove var that is set but not used.
17880
43aae36e
PE
17881 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17882
2a47c44d 17883 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17884 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17885
a37c69bf
PE
17886 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17887 Check for integer overflow on size calculations.
17888
328ab8e7
PE
17889 * buffer.c (Fprevious_overlay_change): Remove var that is set
17890 but not used.
17891
e5a2a5cb
PE
17892 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17893 Remove vars that are set but not used.
8d84a6eb 17894 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17895 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17896
a60e5f68
PE
17897 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17898
f661cb61 17899 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17900 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17901
f0397f5a
PE
17902 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17903 that are set but not used.
17904
8664db06 17905 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17906 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17907
6abdaa4a
PE
17908 * xselect.c (x_get_local_selection, x_handle_property_notify):
17909 Remove vars that are set but not used.
17910
0ce7538d 17911 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17912 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17913
9ae848fc
PE
17914 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17915 Remove var that is set but not used.
0b918413
PE
17916 (scroll_bar_windows_size): Now size_t, not int.
17917 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17918 Check for overflow.
9ae848fc 17919
a5a62657
PE
17920 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17921 (map_tty_color) [!defined MSDOS]: Likewise.
17922
5c5cdd39
PE
17923 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17924
66ebf983
PE
17925 * coding.c: Remove vars that are set but not used.
17926 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17927 All callers changed.
17928 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17929 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17930 (decode_coding_charset): Remove vars that are set but not used.
17931
1be4d761
PE
17932 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17933 that is set but not used.
17934
47553fa8
PE
17935 * print.c (print_object): Remove var that is set but not used.
17936
1f7196bf 17937 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17938 The gnulib version avoids calling malloc in the usual case,
17939 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17940 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17941 * filelock.c (current_lock_owner): Likewise.
17942 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17943 * sysdep.c: Include allocator.h, careadlinkat.h.
17944 (emacs_no_realloc_allocator): New static constant.
17945 (emacs_readlink): New function.
fdb61804
PE
17946 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17947 ../lib/careadlinkat.h.
d1fdcab7 17948
f84c17c7
SM
179492011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17950
17951 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17952 first non-nil return value).
17953
ef3862ad
JD
179542011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17955
17956 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17957 if not defined (Bug#8403).
17958
376a7006
JB
179592011-04-02 Juanma Barranquero <lekktu@gmail.com>
17960
17961 * xdisp.c (display_count_lines): Remove parameter `start',
17962 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17963 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17964 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17965 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17966 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17967 and thereabouts. All callers changed.
17968 (get_per_char_metric): Remove parameter `f', unused since
17969 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17970
6ca3801d
JM
179712011-04-02 Jim Meyering <meyering@redhat.com>
17972
17973 do not dereference NULL upon failed strdup
17974 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17975 (ns_get_family): Likewise.
17976
d8e2b5ba
JB
179772011-04-02 Juanma Barranquero <lekktu@gmail.com>
17978
17979 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17980
8c74fcbd
JD
179812011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17982
17983 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17984 later (Bug#8403).
17985
7200d79c
SM
179862011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17987
03408648 17988 Add lexical binding.
7200d79c 17989
03408648
SM
17990 * window.c (Ftemp_output_buffer_show): New fun.
17991 (Fsave_window_excursion):
17992 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17993
17994 * lread.c (lisp_file_lexically_bound_p): New function.
17995 (Fload): Bind Qlexical_binding.
17996 (readevalloop): Remove `evalfun' arg.
17997 Bind Qinternal_interpreter_environment.
17998 (Feval_buffer): Bind Qlexical_binding.
17999 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18000 Mark as dynamic.
18001 (syms_of_lread): Declare `lexical-binding'.
18002
18003 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18004
18005 * keyboard.c (eval_dyn): New fun.
18006 (menu_item_eval_property): Use it.
ca105506
SM
18007
18008 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 18009
03408648
SM
18010 * fns.c (concat, mapcar1): Accept byte-code-functions.
18011
18012 * eval.c (Fsetq): Handle lexical vars.
18013 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18014 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18015 (FletX, Flet): Obey lexical binding.
18016 (Fcommandp): Handle closures.
18017 (Feval): New `lexical' arg.
18018 (eval_sub): New function extracted from Feval. Use it almost
18019 everywhere where Feval was used. Look up vars in lexical env.
18020 Handle closures.
18021 (Ffunctionp): Move from subr.el.
18022 (Ffuncall): Handle closures.
18023 (apply_lambda): Remove `eval_flags'.
18024 (funcall_lambda): Handle closures and new byte-code-functions.
18025 (Fspecial_variable_p): New function.
18026 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18027 but without exporting it to Lisp.
23aba0ea 18028
23aba0ea 18029 * doc.c (Fdocumentation, store_function_docstring):
03408648 18030 * data.c (Finteractive_form): Handle closures.
23aba0ea 18031
03408648
SM
18032 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18033 interactive spec.
ba83908c 18034
04f2d78b
CB
18035 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18036 New byte-codes.
03408648
SM
18037 (exec_byte_code): New function extracted from Fbyte_code to handle new
18038 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 18039
03408648 18040 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 18041
03408648 18042 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 18043
e2abce01
JB
180442011-03-31 Juanma Barranquero <lekktu@gmail.com>
18045
18046 * xdisp.c (redisplay_internal): Fix prototype.
18047
63696a73 180482011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 18049
63696a73 18050 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
18051 (try_scrolling): Use it when setting scroll_limit.
18052 Limit scrolling to 100 screen lines.
63696a73
EZ
18053 (redisplay_window): Even when falling back on "recentering",
18054 position point in the window according to scroll-conservatively,
18055 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18056
18057 (try_scrolling): When point is above the window, allow searching
18058 as far as scroll_max, or one screenful, to compute vertical
18059 distance from PT to the scroll margin position. This prevents
18060 try_scrolling from unnecessarily failing when
18061 scroll-conservatively is set to a value slightly larger than the
18062 window height. Clean up the case of PT below the margin at bottom
18063 of window: scroll_max can no longer be INT_MAX. When aggressive
18064 scrolling is in use, don't let point enter the opposite scroll
18065 margin as result of the scroll.
18066 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
18067 threshold of 100 lines for never-recentering scrolling.
18068
e4cc2dfc
JB
180692011-03-31 Juanma Barranquero <lekktu@gmail.com>
18070
18071 * dispextern.h (move_it_by_lines):
18072 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18073 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18074 (message_log_check_duplicate): Remove parameters `prev_bol' and
18075 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18076 (redisplay_internal): Remove parameter `preserve_echo_area',
18077 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18078
18079 * indent.c (Fvertical_motion):
18080 * window.c (window_scroll_pixel_based, Frecenter):
18081 Don't pass `need_y_p' to `move_it_by_lines'.
18082
1c470562
SM
180832011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18084
44f230aa
SM
18085 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18086 steal a few bits to be more compact.
18087 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18088 Remove unneeded casts.
18089
1c470562
SM
18090 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18091
888adce9
ZK
180922011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18093
18094 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18095 binding" message (bug#7967).
18096
f838ed7b
PE
180972011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18098
77861b95
PE
18099 Fix more problems found by GCC 4.6.0's static checks.
18100
de6dbc14
PE
18101 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18102 Remove unused local var.
18103
f838ed7b
PE
18104 * editfns.c (Fmessage_box): Remove unused local var.
18105
792c7b2b
PE
18106 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18107 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18108 Omit unused local vars.
c499e557 18109 * window.c (shrink_windows): Omit unused local var.
b01a1c29 18110 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
18111 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18112 Omit unused local var.
18113
ba0165e1
PE
18114 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18115 Don't assume string length fits in int.
32ad8845 18116 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 18117 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 18118
3c59b4c9
PE
18119 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18120 instead of alloca (Bug#8344).
18121
a3eed478 18122 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 18123 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 18124
eb4d412d
PE
18125 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18126
1658b401
PE
18127 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18128 concerns.
18129
18130 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18131
18132 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 18133
9a2c6e05
PE
18134 * keyboard.c (syms_of_keyboard): Use the same style as later
18135 in this function when indexing through an array. This also
18136 works around GCC bug 48267.
18137
03d0a109
PE
18138 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18139
44f730c8
PE
18140 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18141
fe75f926
PE
18142 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18143 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18144
ffa8c828
PE
18145 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18146 This avoids undefined behavior on integer overflow, and is a bit
18147 more convenient anyway since it is compared to a size_t variable.
18148
c5101a77
PE
18149 Variadic C functions now count arguments with size_t, not int.
18150 This avoids an unnecessary limitation on 64-bit machines, which
18151 caused (substring ...) to crash on large vectors (Bug#8344).
18152 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18153 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 18154 All variadic functions and their callers changed accordingly.
c5101a77
PE
18155 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18156 * data.c (arith_driver, float_arith_driver): Likewise.
18157 * editfns.c (general_insert_function): Likewise.
18158 * eval.c (struct backtrace.nargs, interactive_p)
18159 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18160 (funcall_lambda, mark_backtrace): Likewise.
18161 * fns.c (concat): Likewise.
18162 * frame.c (x_set_frame_parameters): Likewise.
18163 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18164 0 if not found, not -1. All callers changed.
18165
dd3f25f7
PE
18166 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18167 (stack_copy_size): Now size_t, not int.
18168 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18169
461c2ab9
JB
181702011-03-28 Juanma Barranquero <lekktu@gmail.com>
18171
18172 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18173 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18174 All callers changed.
18175
18176 * lisp.h (multibyte_char_to_unibyte):
18177 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18178 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18179 * character.h (CHAR_TO_BYTE8):
18180 * cmds.c (internal_self_insert):
18181 * editfns.c (general_insert_function):
18182 * keymap.c (push_key_description):
18183 * search.c (Freplace_match):
18184 * xdisp.c (message_dolog, set_message_1): All callers changed.
18185
f6d62986
SM
181862011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18187
18188 * keyboard.c (safe_run_hook_funcall): New function.
18189 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18190 don't set the hook to nil, but remove the offending function instead.
18191 (Qcommand_hook_internal): Remove, unused.
18192 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18193 Vcommand_hook_internal.
18194
18195 * eval.c (enum run_hooks_condition): Remove.
18196 (funcall_nil, funcall_not): New functions.
18197 (run_hook_with_args): Call each function through a `funcall' argument.
18198 Remove `cond' argument, now redundant.
18199 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18200 (Frun_hook_with_args_until_failure): Adjust accordingly.
18201 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18202
1db5b1ad
JB
182032011-03-28 Juanma Barranquero <lekktu@gmail.com>
18204
18205 * dispextern.h (string_buffer_position): Remove declaration.
18206
18207 * print.c (strout): Remove parameter `multibyte', unused since
18208 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18209
18210 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18211 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18212 All callers changed.
18213
18214 * w32.c (_wsa_errlist): Use braces for struct initializers.
18215
18216 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18217 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18218 All callers changed.
18219 (string_buffer_position): Likewise. Also, make static (it's never
18220 used outside xdisp.c).
18221 (cursor_row_p): Remove parameter `w', unused since
18222 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18223 (decode_mode_spec): Remove parameter `precision', introduced during
18224 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18225 All callers changed.
18226
5ffb62aa
JD
182272011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18228
18229 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18230
461c2ab9 182312011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
18232
18233 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18234 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18235 (ns_update_auto_hide_menu_bar): New functions.
18236 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18237 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18238 ns_constrain_all_frames.
18239 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18240 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18241
5c380ffb
JD
182422011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18243
18244 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18245
9af30bdf
GM
182462011-03-27 Glenn Morris <rgm@gnu.org>
18247
18248 * syssignal.h: Replace RETSIGTYPE with void.
18249 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18250 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18251 Replace SIGTYPE with void everywhere.
18252 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18253 * s/template.h (SIGTYPE): Remove commented out definition.
18254
e2abce01
JB
182552011-03-26 Eli Zaretskii <eliz@gnu.org>
18256
18257 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18258 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18259
f868cd8a
JB
182602011-03-26 Juanma Barranquero <lekktu@gmail.com>
18261
59eb0929
JB
18262 * w32.c (read_unc_volume): Use parameter `henum', instead of
18263 global variable `wget_enum_handle'.
18264
18265 * keymap.c (describe_vector): Remove parameters `indices' and
18266 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18267 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18268
f868cd8a
JB
18269 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18270
18271 * keyboard.c (timer_check): Remove parameter `do_it_now',
18272 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18273 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18274 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18275
18276 * keyboard.c (read_char):
18277 * w32menu.c (w32_menu_display_help):
18278 * xmenu.c (show_help_event, menu_help_callback):
18279 Adjust calls to `show_help_echo'.
18280
18281 * gtkutil.c (xg_maybe_add_timer):
18282 * keyboard.c (readable_events):
18283 * process.c (wait_reading_process_output):
18284 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18285
18286 * insdel.c (adjust_markers_gap_motion):
18287 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18288 (gap_left, gap_right): Don't call it.
18289
2ecf6fdb
CY
182902011-03-25 Chong Yidong <cyd@stupidchicken.com>
18291
18292 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18293 incurred during fontification.
18294
6b1f9ba4
JB
182952011-03-25 Juanma Barranquero <lekktu@gmail.com>
18296
18297 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18298 (DEFVAR_PER_BUFFER): Don't pass it.
18299
18300 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18301 (scrolling_window): Don't pass it.
18302
0f4a96b5
JB
183032011-03-25 Juanma Barranquero <lekktu@gmail.com>
18304
18305 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18306
18307 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18308 and `suffix'.
18309 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18310 of variables specific to SELinux and computation of `encoded_absname'.
18311
18312 * image.c (XPutPixel): Remove unused variable `height'.
18313
18314 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18315
18316 * unexw32.c (get_section_info): Remove unused variable `section'.
18317
18318 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18319 (system_process_attributes): Remove unused variable `sess'.
18320 (sys_read): Remove unused variable `err'.
18321
18322 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18323 (w32_wnd_proc): Remove unused variable `isdead'.
18324 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18325 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18326 (x_create_tip_frame): Remove unused variable `tem'.
18327
18328 * w32inevt.c (w32_console_read_socket):
18329 Remove unused variable `no_events'.
18330
18331 * w32term.c (x_draw_composite_glyph_string_foreground):
18332 Remove unused variable `width'.
18333
1149507c
JB
183342011-03-24 Juanma Barranquero <lekktu@gmail.com>
18335
18336 * w32term.c (x_set_glyph_string_clipping):
18337 Don't pass uninitialized region to CombineRgn.
18338
9c88f339
JB
183392011-03-23 Juanma Barranquero <lekktu@gmail.com>
18340
18341 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18342 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18343 (Fx_close_connection): Remove unused variable `i'.
18344
18345 * w32font.c (w32font_draw): Return number of glyphs.
18346 (w32font_open_internal): Remove unused variable `i'.
18347 (w32font_driver): Add missing initializer.
18348
18349 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18350 (fill_in_menu): Remove unused variable `items_added'.
18351
18352 * w32term.c (last_mouse_press_frame): Remove static global variable.
18353 (w32_clip_to_row): Remove unused variable `f'.
18354 (x_delete_terminal): Remove unused variable `i'.
18355
18356 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18357 (NOTHING): Remove unused static global variable.
18358 (uniscribe_check_otf): Remove unused variable `table'.
18359 (uniscribe_font_driver): Add missing initializers.
18360
dee091a3
JD
183612011-03-23 Julien Danjou <julien@danjou.info>
18362
18363 * term.c (Fsuspend_tty, Fresume_tty):
18364 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18365 * window.c (temp_output_buffer_show):
18366 * insdel.c (signal_before_change):
18367 * frame.c (Fhandle_switch_frame):
18368 * fileio.c (Fdo_auto_save):
18369 * emacs.c (Fkill_emacs):
18370 * editfns.c (save_excursion_restore):
18371 * cmds.c (internal_self_insert):
18372 * callint.c (Fcall_interactively):
18373 * buffer.c (Fkill_all_local_variables):
18374 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18375 Use Frun_hooks.
0f4a96b5 18376 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18377 unconditionally since it does the check itself.
dee091a3 18378
2c520ab5 183792011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18380
c9c49752
PE
18381 Fix more problems found by GCC 4.5.2's static checks.
18382
8abc3f12
PE
18383 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18384 the first time through the loop, since we know p0 < p1 then.
18385 This also avoids a gcc -Wstrict-overflow warning.
18386
a2d26660
PE
18387 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18388 leading to a memory leak, possible in functions like
18389 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18390 of objects (Bug#8318).
a2d26660 18391
916c72e9
PE
18392 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18393 that could (at least in theory) be that large.
18394
19ab8a18
PE
18395 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18396 This is less likely to overflow, and avoids undefined behavior if
18397 overflow does occur. All callers changed. Use strtoul to scan
18398 for the unsigned long integer.
b7cbbd6f
PE
18399 (pint2hrstr): Simplify and tune code slightly.
18400 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18401
f0641eff
PE
18402 * scroll.c (do_scrolling): Work around GCC bug 48228.
18403 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18404
7f650bb9
PE
18405 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18406 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18407 (validate_x_resource_name): Simplify count usage.
18408 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18409
37dd57d1
PE
18410 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18411 fail (Bug#8306).
81e56e61 18412
699979fc 18413 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18414
401bf9b4
PE
18415 * process.c (Fmake_network_process): Use socklen_t, not int,
18416 where POSIX says socklen_t is required in portable programs.
18417 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18418 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18419 (Fmake_network_process, server_accept_connection):
18420 (wait_reading_process_output, read_process_output):
18421 Likewise.
18422
b93aacde
PE
18423 * process.c: Rename or move locals to avoid shadowing.
18424 (list_processes_1, Fmake_network_process):
18425 (read_process_output_error_handler, exec_sentinel_error_handler):
18426 Rename or move locals.
4dc343ee 18427 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18428 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18429 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18430 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18431 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18432
af8a867c 18433 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18434 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18435 Include tparam.h instead, since it declares them.
af8a867c
PE
18436 * cm.h (PC): Remove extern decl; tparam.h now does this.
18437 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18438 * terminfo.c: Include tparam.h, to check interfaces.
18439 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18440 (tparam): Adjust signature to match interface in tparam.h;
18441 this removes some undefined behavior. Check that outstring and len
18442 are zero, which they always are with Emacs.
18443 * tparam.h (PC, BC, UP): New extern decls.
18444
0248044d 18445 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18446 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18447
8ff096c1 18448 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18449 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18450 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18451 (ftfont_list): Remove unused local.
49eaafba
PE
18452 (get_adstyle_property, ftfont_pattern_entity):
18453 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18454 Rename locals to avoid shadowing.
8ff096c1 18455
e2be39f6
PE
18456 * xfont.c (xfont_list_family): Mark var as initialized.
18457
c9735e30
PE
18458 * xml.c (make_dom): Now static.
18459
8f5201ae
PE
18460 * composite.c (composition_compute_stop_pos): Rename local to
18461 avoid shadowing.
b246f932
PE
18462 (composition_reseat_it): Remove unused locals.
18463 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18464 (composition_update_it): Mark var as initialized.
11b61122
PE
18465 (find_automatic_composition): Mark vars as initialized,
18466 with a FIXME (Bug#8290).
8f5201ae 18467
760fbc2c
PE
18468 character.h: Rename locals to avoid shadowing.
18469 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18470 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18471 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18472 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18473 to avoid shadowing.
18474
ff08eb85
PE
18475 * textprop.c (property_change_between_p): Remove; unused.
18476
fc7bf025
PE
18477 * intervals.c (interval_start_pos): Now static.
18478
235d7abc
PE
18479 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18480
44f230aa
SM
18481 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18482 Rename locals to avoid shadowing.
3e7d6594 18483
50060332
PE
18484 * sound.c (wav_play, au_play, Fplay_sound_internal):
18485 Fix pointer signedness.
d01f234b 18486 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18487 (wav_play): Initialize a variable to 0, to prevent undefined
18488 behavior (Bug#8278).
50060332 18489
c4fc4e30
PE
18490 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18491
918436ed
PE
18492 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18493
c939f91b
PE
18494 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18495 clobbering (Bug#8298).
b9c7f648
PE
18496 * sysdep.c (sys_subshell): Likewise.
18497 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18498
6bd8c144
PE
18499 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18500 This should get cleaned up, so that child_setup has the
18501 same signature on all platforms.
18502
7710357c 18503 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18504 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18505
c59da222
CY
185062011-03-22 Chong Yidong <cyd@stupidchicken.com>
18507
18508 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18509 not to be necessary, and produces flickering.
18510
66b87493
GM
185112011-03-20 Glenn Morris <rgm@gnu.org>
18512
18513 * config.in: Remove file.
18514
45b6f6d5
JB
185152011-03-20 Juanma Barranquero <lekktu@gmail.com>
18516
18517 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18518 are now in src/globals.h.
18519 (syms_of_minibuf): Remove spurious & from previous change.
18520
cd394be1 185212011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18522
18523 * minibuf.c (completing-read-function): New variable.
18524 (completing-read-default): Rename from completing-read.
18525 (completing-read): Call completing-read-function.
18526
b14e3e21
CY
185272011-03-19 Juanma Barranquero <lekktu@gmail.com>
18528
18529 * xfaces.c (Fx_load_color_file):
18530 Read color file from absolute filename (bug#8250).
18531
f2b726e6
JB
185322011-03-19 Juanma Barranquero <lekktu@gmail.com>
18533
18534 * makefile.w32-in: Update dependencies.
18535
09f6ff02
EZ
185362011-03-17 Eli Zaretskii <eliz@gnu.org>
18537
18538 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18539
29a6015a
PE
185402011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18541
a3a6c54e
PE
18542 Fix more problems found by GCC 4.5.2's static checks.
18543
b766f867
PE
18544 * process.c (make_serial_process_unwind, send_process_trap):
18545 (sigchld_handler): Now static.
18546
be02381c
PE
18547 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18548 That way, the code declares only the vars that it needs.
18549 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18550 * s/cygwin.h (PTY_ITERATION): Likewise.
18551 * s/darwin.h (PTY_ITERATION): Likewise.
18552 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18553
57048744
PE
18554 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18555 * process.c (allocate_pty): Don't declare stb unless it's needed.
18556
7914961c 18557 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18558 (CONSTANTLIM): Remove; unused.
18559 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18560 Define only if needed.
7914961c 18561
b3967b18
PE
18562 * unexelf.c (unexec): Name an expression,
18563 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18564 Use a different way to cause a compilation error if anyone uses
18565 n rather than nn, a way that does not involve shadowing.
73366a00 18566 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18567
29a6015a
PE
18568 * deps.mk (unexalpha.o): Remove; unused.
18569
43cfc33e 18570 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18571 * unexec.h: New file.
ce701a33
PE
18572 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18573 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18574 Depend on unexec.h.
18575 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18576 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18577 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18578 Change as necessary to match prototype in unexec.h.
ce701a33 18579
01f44d5a
PE
18580 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18581 shadowing.
4f63c6bb 18582 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18583
a6670b0b
PE
18584 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18585 Rename locals to avoid shadowing.
18586
cef2010d 18587 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18588 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18589
d4d7173a
PE
18590 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18591
f08b802a
PE
18592 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18593 warning when compiling print.c.
18594
3ddb0639
PE
18595 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18596 instead of using an uninitialized var.
5ad03b97 18597 (font_sort_entities): Mark var as initialized.
3ddb0639 18598
170a2692
PE
18599 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18600
e663c700
PE
18601 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18602 pointers to constants.
89bc529a 18603 (font_parse_fcname): Remove unused vars.
7b81e2d0 18604 (font_delete_unmatched): Now static.
ea838e10 18605 (font_get_spec): Remove; unused.
13a547c6
PE
18606 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18607 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18608 Rename or move locals to avoid shadowing.
e663c700 18609
2a80c887 18610 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18611 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18612
1384fa33 18613 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18614 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18615
8b2c52e9
PE
18616 * alloc.c (mark_backtrace): Move decl from here ...
18617 * lisp.h: ... to here, so that it can be checked.
18618
475545b5 18619 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18620 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18621 (lisp_indirect_variable): Name an expression,
18622 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18623 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18624
b1349114 18625 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18626 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18627 Use const pointer when appropriate.
b1349114 18628
a2928364
PE
18629 * lisp.h (get_system_name, get_operating_system_release):
18630 Move decls here, to check interfaces.
18631 * process.c (get_operating_system_release): Move decl to lisp.h.
18632 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18633 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18634 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18635 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18636 (Fformat_time_string, Fencode_time, Finsert_char):
18637 (Ftranslate_region_internal, Fformat):
18638 Rename or remove local vars to avoid shadowing.
9710023e 18639 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18640
a415e694
PE
18641 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18642 avoid shadowing.
18643
8ef4622d
PE
18644 * lisp.h (eassert): Check that the argument compiles, even if
18645 ENABLE_CHECKING is not defined.
18646
946f9a5b
PE
18647 * data.c (Findirect_variable): Name an expression, to avoid
18648 gcc -Wbad-function-cast warning.
112396d6 18649 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18650 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18651 (Fmake_variable_buffer_local, Fmake_local_variable):
18652 Mark variables as initialized.
52746918 18653 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18654
e5aab7e7 18655 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18656 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18657 Rename locals to avoid shadowing.
dff45157
PE
18658 (mark_stack): Move local variables into the #ifdef region where
18659 they're used.
7bc26fdb
PE
18660 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18661 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18662 needed otherwise.
18663 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18664 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18665 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18666
e5aab7e7
PE
18667 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18668 avoids undefined behavior in theory.
18669
4da60324
PE
18670 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18671
88043301
PE
18672 Use functions, not macros, for up- and down-casing (Bug#8254).
18673 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18674 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18675 to use the following functions instead of these macros.
18676 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18677 EMACS_INT, since callers assume the returned value fits in int.
18678 (upcase1): Likewise, for UPCASE_TABLE.
18679 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18680 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18681 the race-condition problem in the old DOWNCASE.
88043301 18682
19ed5445
PE
18683 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18684 Rename locals to avoid shadowing.
18685 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18686 (regex_compile, re_search_2, re_match_2_internal):
18687 Remove unused local vars.
952db0d7
PE
18688 (FREE_VAR): Rewrite so as not to use empty "else",
18689 which gcc can warn about.
da053e48 18690 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18691 (RETALLOC_IF): Define only if needed.
18692 (WORDCHAR_P): Likewise. This one is never needed, but is used
18693 only in a comment talking about a compiler bug, so put inside
18694 the #if 0 of that comment.
18695 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18696 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18697 Remove; unused.
19ed5445 18698
1f3561e4 18699 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18700 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18701 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18702
ded6f8f7
PE
18703 * search.c (simple_search): Remove unused var.
18704
dbd37a95
PE
18705 * dired.c (compile_pattern): Move decl from here ...
18706 * lisp.h: ... to here, so that it can be checked.
18707 (struct re_registers): New forward decl.
18708
7e47afad
PE
18709 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18710
85f24f61
PE
18711 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18712 All uses changed.
18713 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18714 Rename locals to avoid shadowing.
5671df8f 18715 (Fvertical_motion): Mark locals as initialized.
85f24f61 18716
181aa2be 18717 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18718 (casify_region): Mark local as initialized.
181aa2be 18719
930d429c
PE
18720 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18721
7082eac6
PE
18722 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18723 New macros, so that the caller can use some names other than
18724 gcpro1, gcpro2, etc.
18725 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18726 of the new macros.
18727 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18728 argument, for consistency with GCPRO2_VAR, etc: it is now the
18729 prefix of the variable, not the variable itself. All uses
18730 changed.
38b2c076
PE
18731 * dired.c (directory_files_internal, file_name_completion):
18732 Rename locals to avoid shadowing.
18733
15206ed9
PE
18734 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18735 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18736 dired.c's scmp function, had undefined behavior.
18737 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18738 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18739 * buffer.h: ... to here, because these macros use current_buffer,
18740 and the new implementation with inline functions needs to have
18741 current_buffer in scope now, rather than later when the macros
18742 are used.
18743 (downcase, upcase1): New static inline functions.
18744 (DOWNCASE, UPCASE1): Reimplement using these functions.
18745 This avoids undefined behavior in expressions like
18746 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18747 from race conditions in accessing the global variables
18748 case_temp1 and case_temp2.
18749 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18750 * lisp.h (case_temp1, case_temp2): Remove their decls.
18751 * character.h (ASCII_CHAR_P): Move from here ...
18752 * lisp.h: ... to here, so that the inline functions mentioned
18753 above can use them.
18754
4a6bea26
PE
18755 * dired.c (directory_files_internal_unwind): Now static.
18756
f14b7e14
PE
18757 * fileio.c (file_name_as_directory, directory_file_name):
18758 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18759 Now static.
2893f146
PE
18760 (file_name_as_directory): Use const pointers when appropriate.
18761 (Fexpand_file_name): Likewise. In particular, newdir might
18762 point at constant storage, so make it a const pointer.
fd4ead52 18763 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18764 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18765 signedness issues.
f839df0c
PE
18766 (Fset_file_times, Finsert_file_contents, auto_save_error):
18767 Rename locals to avoid shadowing.
f14b7e14 18768
5716756e 18769 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18770 (Ftry_completion, Fall_completions): Rename or remove locals
18771 to avoid shadowing.
5716756e 18772
b4c3046a
PE
18773 * marker.c (bytepos_to_charpos): Remove; unused.
18774
b45db522
PE
18775 * lisp.h (verify_bytepos, count_markers): New decls,
18776 so that gcc does not warn that these functions aren't declared.
18777
85876d07
PE
18778 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18779 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18780 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18781 (copy_text): Remove unused local var.
85876d07 18782
03d78a21 18783 * filelock.c (within_one_second): Now static.
b3dd38ab 18784 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18785
5df8f01b
PE
18786 * buffer.c (fix_overlays_before): Mark locals as initialized.
18787 (fix_start_end_in_overlays): Likewise. This function should be
18788 simplified by using pointers-to-pointers, but that's a different
18789 matter.
b1d876f1 18790 (switch_to_buffer_1): Now static.
8f54f30a
PE
18791 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18792 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18793
a70072c9 18794 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18795 Fix pointer signedness issue.
edced198
PE
18796 (sys_subshell): Mark local as volatile if checking for lint,
18797 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18798 (MAXPATHLEN): Define only if needed.
a70072c9 18799
a0977c44
PE
18800 * process.c (serial_open, serial_configure): Move decls from here ...
18801 * systty.h: ... to here, so that they can be checked.
18802
a884fdcc
PE
18803 * fns.c (get_random, seed_random): Move extern decls from here ...
18804 * lisp.h: ... to here, so that they can be checked.
18805
604efe86 18806 * sysdep.c (reset_io): Now static.
b8950c94 18807 (wait_for_termination_signal): Remove; unused.
604efe86 18808
38fc62d9
PE
18809 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18810 (copy_keymap_item, append_key, push_text_char_description):
18811 Now static.
1004a21a 18812 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18813 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18814 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18815 (describe_map_tree):
18816 Rename locals to avoid shadowing.
38fc62d9 18817
2f2650da
PE
18818 * keyboard.c: Declare functions static if they are not used elsewhere.
18819 (echo_char, echo_dash, cmd_error, top_level_2):
18820 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18821 (read_char, kbd_buffer_get_event, make_lispy_position):
18822 (make_lispy_event, make_lispy_movement, apply_modifiers):
18823 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18824 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18825 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18826 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18827 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18828
a053e86c 18829 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18830 (mark_kboards): Move decl here ...
18831 * alloc.c (mark_kboards): ... from here.
a053e86c 18832
4752793e
PE
18833 * lisp.h (force_auto_save_soon): New decl.
18834
74f10ca7 18835 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18836 (DEFINE_DUMMY_FUNCTION): New macro.
18837 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18838 Use it.
c03cd23f
PE
18839 (main): Add casts to avoid warnings
18840 if GCC considers string literals to be constants.
74f10ca7 18841
022e70d4
PE
18842 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18843
59d6fe83
PE
18844 * dbusbind.c: Pointer signedness fixes.
18845 (xd_signature, xd_append_arg, xd_initialize):
18846 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18847 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18848 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18849 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18850
78320123
PE
18851 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18852 if GCC considers string literals to be constants.
49cebcca 18853 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18854
35ac2a97
SM
188552011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18856
fb103ca9
SM
18857 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18858 (print_preprocess, print_object): New macro to fix last change.
18859
35ac2a97
SM
18860 * print.c (print_preprocess): Don't forget font objects.
18861
62973b41
JB
188622011-03-16 Juanma Barranquero <lekktu@gmail.com>
18863
18864 * emacs.c (USAGE3): Doc fixes.
18865
0e48bb22
AS
188662011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18867
18868 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18869 structure.
18870
7684e57b
JB
188712011-03-14 Juanma Barranquero <lekktu@gmail.com>
18872
18873 * lisp.h (VWindow_system, Qfile_name_history):
18874 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18875 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18876 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18877
18878 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18879 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18880
18881 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18882 * w32console.c (detect_input_pending, read_input_pending)
18883 (encode_terminal_code):
18884 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18885 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18886 (w32_system_caret_y, Qfile_name_history):
18887 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18888 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18889 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18890 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18891 * w32proc.c (Qlocal, report_file_error):
18892 * w32term.c (Vwindow_system, updating_frame):
18893 * w32uniscribe.c (initialized, uniscribe_font_driver):
18894 Remove unneeded extern declarations.
18895
2aa46d6c
CY
188962011-03-14 Chong Yidong <cyd@stupidchicken.com>
18897
c96bbc66 18898 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18899
cffc6f3b
CY
189002011-03-13 Chong Yidong <cyd@stupidchicken.com>
18901
18902 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18903 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18904 These macros can no longer be used for assignment.
18905
44f230aa
SM
18906 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18907 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18908 (record_buffer_markers, fetch_buffer_markers): New functions for
18909 recording and fetching special buffer markers.
18910 (set_buffer_internal_1, set_buffer_temp): Use them.
18911
18912 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18913
18914 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18915
18916 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18917 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18918
18919 * xdisp.c (hscroll_window_tree):
18920 (reconsider_clip_changes): Use PT instead of BUF_PT.
18921
d251f04b
EZ
189222011-03-13 Eli Zaretskii <eliz@gnu.org>
18923
18924 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18925 $(EMACS_ROOT)/lib/intprops.h.
18926
f0c77cd1
PE
189272011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18928
3eca4629
PE
18929 Fix more problems found by GCC 4.5.2's static checks.
18930
7c86ee98
PE
18931 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18932 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18933 (xg_free_frame_widgets): Make it clear that a local variable is
18934 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18935 (gdk_window_get_screen): Make it clear that this macro is needed
18936 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18937 (int_gtk_range_get_value): New function, which avoids a diagnostic
18938 from gcc -Wbad-function-cast.
18939 (xg_set_toolkit_scroll_bar_thumb): Use it.
18940 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18941 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18942 (get_utf8_string, xg_get_file_with_chooser):
18943 Rename locals to avoid shadowing.
18944 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18945
41729b81
PE
18946 * xgselect.c (xg_select): Remove unused var.
18947
f0c77cd1
PE
18948 * image.c (four_corners_best): Mark locals as initialized.
18949 (gif_load): Initialize transparent_p to zero (Bug#8238).
18950 Mark another local as initialized.
ec6cf4c6 18951 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18952
ce0ad53d 18953 * image.c (clear_image_cache): Now static.
d5d5a617 18954 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18955 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18956 (x_edge_detection): Remove unnecessary cast that
18957 gcc -Wbad-function-cast diagnoses.
2037898d 18958 (gif_load): Fix pointer signedness.
6ae141d6
PE
18959 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18960 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18961
33383987 189622011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18963
d32df629
PE
18964 Improve quality of tests for time stamp overflow.
18965 For example, without this patch (encode-time 0 0 0 1 1
18966 1152921504606846976) returns the obviously-bogus value (-948597
18967 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18968 reports time overflow. See
18969 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18970 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18971 * editfns.c: Include limits.h and intprops.h.
18972 (TIME_T_MIN, TIME_T_MAX): New macros.
18973 (time_overflow): Move earlier, to before first use.
18974 (hi_time, lo_time): New functions, for an accurate test for
18975 out-of-range times.
18976 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18977 (Fget_internal_run_time): Don't assume time_t fits in int.
18978 (make_time): Use list2 instead of Fcons twice.
18979 (Fdecode_time): More accurate test for out-of-range times.
18980 (check_tm_member): New function.
18981 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18982 (lisp_time_argument): Don't rely on undefined left-shift and
18983 right-shift behavior when checking for time stamp overflow.
8be6f318 18984
fe31d94c
PE
18985 * editfns.c (time_overflow): New function, refactoring common code.
18986 (Fformat_time_string, Fdecode_time, Fencode_time):
18987 (Fcurrent_time_string): Use it.
18988
8be6f318
PE
18989 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18990 * dired.c (make_time): Move to ...
18991 * editfns.c (make_time): ... here.
18992 * systime.h: Note the move.
18993
09d9db2c 189942011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18995
126bc0dc
YM
18996 * fringe.c (update_window_fringes): Remove unused variables.
18997
c47cbdfd
YM
18998 * unexmacosx.c (copy_data_segment): Also copy __got section.
18999 (Bug#8223)
19000
7ac80be9
EZ
190012011-03-12 Eli Zaretskii <eliz@gnu.org>
19002
c96bbc66 19003 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
19004 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19005 Constify `char *' arguments and their references according to
19006 prototypes in tparam.h.
19007
ecb0f94d 19008 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 19009
7ac80be9
EZ
19010 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19011 Adapt all references accordingly.
19012
19013 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19014
ef1fd07e
TT
190152011-03-11 Tom Tromey <tromey@redhat.com>
19016
19017 * buffer.c (syms_of_buffer): Remove obsolete comment.
19018
7ef4b50c
EZ
190192011-03-11 Eli Zaretskii <eliz@gnu.org>
19020
19021 * termhooks.h (encode_terminal_code): Declare prototype.
19022
19023 * msdos.c (encode_terminal_code): Don't declare prototype.
19024
19025 * term.c (encode_terminal_code): Now external again, used by
19026 w32console.c and msdos.c.
19027
44f230aa
SM
19028 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19029 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 19030
4b1ec863 190312011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 19032
1714f52b 19033 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 19034
4b1ec863
PE
19035 * fringe.c (update_window_fringes): Mark locals as initialized
19036 (Bug#8227).
19037 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 19038
524c7aa6
PE
19039 * alloc.c (mark_fringe_data): Move decl from here ...
19040 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19041 to check its interface.
19042 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19043
a5c0af81 19044 * fontset.c (free_realized_fontset): Now static.
7519b8cd 19045 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 19046 (fontset_font): Mark local as initialized.
a9a06e0b 19047 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 19048
b4716021
PE
19049 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19050
811e9bac 19051 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 19052 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
19053 (x_own_selection, Fx_disown_selection_internal): Rename locals
19054 to avoid shadowing.
19055 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 19056
7e3ab302
PE
19057 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19058 so that the caller can use some name other than gcpro1.
19059 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
19060 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19061 (Fx_backspace_delete_keys_p):
19062 Use them to avoid shadowing, and rename vars to avoid shadowing.
19063 (x_decode_color, x_set_name, x_window): Now static.
6b437900 19064 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 19065 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
19066 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19067 Remove unused locals.
7e3ab302
PE
19068 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19069 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19070 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19071 macros.
f78faa98 19072
e2b13473
PE
19073 * xterm.h (x_mouse_leave): New decl.
19074
77f23912
PE
19075 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19076 Remove unused functions.
cdf4ba58
PE
19077 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19078 (x_calc_absolute_position): Now static.
7411c686 19079 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 19080 Don't declare local "event" unless it's used.
ed7bf3a5
PE
19081 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19082 unless they are used.
38d0b34a
PE
19083 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19084 (x_fatal_error_signal): Remove; not used.
a6067996
PE
19085 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19086 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19087 (x_error_catcher, x_connection_closed, x_error_handler):
19088 (x_error_quitter, xembed_send_message, x_iconify_frame):
19089 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 19090 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 19091 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 19092
44f230aa
SM
19093 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19094 Rename or move locals to avoid shadowing.
6b463e58 19095 (tty_defined_color, merge_face_heights): Now static.
5967d051 19096 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
19097 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19098 does not deduce is never used uninitialized.
73719eba
PE
19099 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19100 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 19101
426994c3 19102 * terminal.c (store_terminal_param): Now static.
5489860b 19103
032f1620 19104 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 19105 (set_frame_menubar): Remove unused local.
d4323972 19106 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
19107 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19108 since they might point to immutable storage.
281585b0
PE
19109 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19110 since it's unused otherwise.
032f1620 19111
367c19e5 19112 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 19113 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
19114 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19115 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 19116 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
19117 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19118 does not deduce are never used uninitialized.
70739cbe 19119
07b48fa9
PE
19120 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19121
8868a238 19122 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
19123 * window.c (window_loop, size_window):
19124 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 19125
7e5cf297 19126 * window.c (display_buffer): Now static.
d6550a9f
PE
19127 (size_window): Mark variables that gcc -Wuninitialized
19128 does not deduce are never used uninitialized.
a586633d
PE
19129 * window.h (check_all_windows): New decl, to forestall
19130 gcc -Wmissing-prototypes diagnostic.
5b555da1 19131 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 19132
f6095868
PE
19133 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19134 shadowing.
19135 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
19136 Include <limits.h>.
19137 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19138 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
19139 (load_charset_map): Mark variables that gcc -Wuninitialized
19140 does not deduce are never used uninitialized.
53df7c11 19141 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 19142
f38b440c
PE
19143 * coding.c (coding_set_source, coding_set_destination):
19144 Use "else { /* comment */ }" rather than "else /* comment */;"
19145 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
19146 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19147 a block, when the outer 'i' will do.
19148 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19149 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19150 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19151 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19152 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19153 Rename locals to avoid shadowing.
19154 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
19155 * coding.c (emacs_mule_char, encode_invocation_designation):
19156 Now static, since they're not used elsewhere.
413bb2db 19157 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 19158 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
19159 (decode_coding_emacs_mule): Mark variables that gcc
19160 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
19161 (detect_coding_iso_2022): Initialize a local variable that might
19162 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 19163 this initialization is needed. (Bug#8211)
5f58e762
PE
19164 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19165 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19166 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19167 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19168 Remove unused macros.
f38b440c 19169
232b38b9 19170 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 19171 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 19172 * character.c (string_count_byte8): Likewise.
232b38b9 19173
fb90da1b
PE
19174 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19175 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19176
fb93dbc2
PE
19177 * chartab.c (copy_sub_char_table): Now static, since it's not used
19178 elsewhere.
5c156ace
PE
19179 (sub_char_table_ref_and_range, char_table_ref_and_range):
19180 Rename locals to avoid shadowing.
bbcd0949 19181 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 19182
7d3b3862 19183 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 19184 (BIDI_BOB): Remove unused macro.
7d3b3862 19185
6be7d3da
PE
19186 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19187 deduce are never used uninitialized.
c2ed9c8b 19188 * term.c (encode_terminal_code): Likewise.
6be7d3da 19189
75f8807f 19190 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 19191
50938595
PE
19192 * tparam.h: New file.
19193 * term.c, tparam.h: Include it.
19194 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19195 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19196 Move these decls to tparam.h, and make them agree with what
19197 is actually in tparam.c. The previous trick of using incompatible
19198 decls in different modules does not conform to the C standard.
19199 All callers of tparam changed to use tparam's actual API.
19200 * tparam.c (tparam1, tparam, tgoto):
19201 Use const pointers where appropriate.
19202
fbceeba2
PE
19203 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19204 * cm.h (struct cm): Likewise.
19205 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19206 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19207 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19208 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19209 (turn_on_face, init_tty): Likewise.
19210 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 19211
7f3f1250
PE
19212 * term.c (term_mouse_position): Rename local to avoid shadowing.
19213
e6ca6543
PE
19214 * alloc.c (mark_ttys): Move decl from here ...
19215 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19216
c40f8d15
AS
192172011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19218
19219 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19220
cfe0661d
JB
192212011-03-09 Juanma Barranquero <lekktu@gmail.com>
19222
19223 * search.c (compile_pattern_1): Remove argument regp, unused since
19224 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19225 (compile_pattern): Don't pass it.
19226
0afb4571
J
192272011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19228
19229 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19230 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19231 for ! HAVE_GTK3.
19232 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19233
19234 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19235
19236 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19237 gdk_window_get_screen, gdk_window_get_geometry,
19238 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19239 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19240 (xg_get_pixbuf_from_pixmap): New function.
19241 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19242 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19243 Call xg_get_pixbuf_from_pixmap instead of
19244 gdk_pixbuf_get_from_drawable.
19245 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19246 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19247 (xg_check_special_colors): Use GtkStyleContext and its functions
19248 for HAVE_GTK3.
19249 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19250 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19251 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
19252 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19253 Call gtk_widget_get_preferred_size.
0afb4571
J
19254 (xg_frame_resized): gdk_window_get_geometry only takes 5
19255 parameters.
44f230aa
SM
19256 (xg_win_to_widget, xg_event_is_for_menubar):
19257 Call gdk_x11_window_lookup_for_display.
0afb4571
J
19258 (xg_set_widget_bg): New function.
19259 (delete_cb): New function.
895009e1 19260 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 19261 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
19262 (xg_set_background_color): Call xg_set_widget_bg.
19263 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19264 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19265 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19266 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19267 if ! HAVE_GTK3.
19268 (update_frame_tool_bar): Call gtk_widget_hide.
19269 (xg_initialize): Use GDK_KEY_g.
19270
19271 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19272 if ! HAVE_GTK3
19273 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19274
19275 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19276 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19277 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19278
1c2cc4ef
JB
192792011-03-08 Juanma Barranquero <lekktu@gmail.com>
19280
19281 * w32xfns.c (select_palette): Check success of RealizePalette against
19282 GDI_ERROR, not zero.
19283
33383987 19284See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19285
19286;; Local Variables:
19287;; coding: utf-8
aac0c6e3
MR
19288;; End:
19289
2f097256 19290 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
19291
19292 This file is part of GNU Emacs.
19293
19294 GNU Emacs is free software: you can redistribute it and/or modify
19295 it under the terms of the GNU General Public License as published by
19296 the Free Software Foundation, either version 3 of the License, or
19297 (at your option) any later version.
19298
19299 GNU Emacs is distributed in the hope that it will be useful,
19300 but WITHOUT ANY WARRANTY; without even the implied warranty of
19301 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19302 GNU General Public License for more details.
19303
19304 You should have received a copy of the GNU General Public License
19305 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.