Changelog for previous commit.
[bpt/emacs.git] / src / ChangeLog
1 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xterm.c: Include X11/XKBlib.h
4 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
5
6 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
7
8 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
9 written backwards.
10 * blockinput.h (input_blocked_p): Likewise.
11 * bytecode.c (exec_byte_code): Likewise.
12 * callproc.c (call_process_kill, call_process_cleanup)
13 (Fcall_process): Likewise.
14 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
15 (Fccl_execute_on_string): Likewise.
16 * character.c (string_escape_byte8): Likewise.
17 * charset.c (read_hex): Likewise.
18 * cm.c (calccost): Likewise.
19 * data.c (cons_to_unsigned): Likewise.
20 * dired.c (directory_files_internal, file_name_completion):
21 Likewise.
22 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
23 (sit_for): Likewise.
24 * doc.c (Fsubstitute_command_keys): Likewise.
25 * doprnt.c (doprnt): Likewise.
26 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
27 * emacsgtkfixed.c: Likewise.
28 * fileio.c (file_offset, Fwrite_region): Likewise.
29 * floatfns.c (Fexpt, fmod_float): Likewise.
30 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
31 Likewise.
32 * font.c (font_intern_prop): Likewise.
33 * frame.c (x_set_alpha): Likewise.
34 * gtkutil.c (get_utf8_string): Likewise.
35 * indent.c (check_display_width): Likewise.
36 * intervals.c (create_root_interval, rotate_right, rotate_left)
37 (split_interval_right, split_interval_left)
38 (adjust_intervals_for_insertion, delete_node)
39 (interval_deletion_adjustment, adjust_intervals_for_deletion)
40 (merge_interval_right, merge_interval_left, copy_intervals)
41 (set_intervals_multibyte_1): Likewise.
42 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
43 * keymap.c (Fkey_description): Likewise.
44 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
45 * lread.c (openp, read_integer, read1, string_to_number):
46 Likewise.
47 * menu.c (ensure_menu_items): Likewise.
48 * minibuf.c (read_minibuf_noninteractive): Likewise.
49 * print.c (printchar, strout): Likewise.
50 * process.c (create_process, Faccept_process_output)
51 (wait_reading_process_output, read_process_output, send_process)
52 (wait_reading_process_output): Likewise.
53 * profiler.c (make_log, handle_profiler_signal): Likewise.
54 * regex.c (re_exec): Likewise.
55 * regex.h: Likewise.
56 * search.c (looking_at_1, Freplace_match): Likewise.
57 * sysdep.c (get_child_status, procfs_ttyname)
58 (procfs_get_total_memory): Likewise.
59 * systime.h (EMACS_TIME_VALID_P): Likewise.
60 * term.c (dissociate_if_controlling_tty): Likewise.
61 * window.c (get_phys_cursor_glyph): Likewise.
62 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
63 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
64 Likewise.
65 * xfns.c (Fx_window_property): Likewise.
66 * xmenu.c (set_frame_menubar): Likewise.
67 * xselect.c (x_get_window_property, x_handle_dnd_message):
68 Likewise.
69 * xsmfns.c (smc_save_yourself_CB): Likewise.
70 * xterm.c (x_scroll_bar_set_handle): Likewise.
71
72 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
73
74 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
75 to be optional or nil. Adjust comment and convert it to docstring.
76 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
77 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
78
79 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
80
81 Static checking by GCC 4.8-20130319.
82 * image.c (gif_load): Assume pass < 3 to pacify GCC.
83 * process.c (Fset_process_datagram_address)
84 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
85 * xdisp.c (get_char_face_and_encoding):
86 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
87 (get_glyph_face_and_encoding): Prepare face before possibly using it.
88 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
89
90 2013-03-24 Ken Brown <kbrown@cornell.edu>
91
92 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
93 fix compilation on 64-bit Cygwin, where underscores are not
94 automatically prepended.
95
96 * w32term.c (w32_initialize): Silence compiler warning.
97
98 2013-03-23 Eli Zaretskii <eliz@gnu.org>
99
100 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
101 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
102 variables, to save and restore frame dimensions. Use
103 FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
104 after returning from a 'fullscreen' configuration. use
105 SendMessage instead of PostMessage to send the SC_RESTORE message,
106 to avoid races between the main thread and the input thread.
107
108 * w32term.h (struct w32_output): New members normal_width,
109 normal_height, normal_top, normal_left, and prev_fsmode.
110 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
111 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
112 members of a frame.
113
114 * w32term.c (w32fullscreen_hook): Record last value of the frame's
115 'fullscreen' parameter. Always record previous width and height
116 of the frame, except when switching out of maximized modes, so
117 that they could be restored correctly, instead of resetting to the
118 default frame dimensions. Send SC_RESTORE command to the frame,
119 unless we are going to send SC_MAXIMIZE, to restore the frame
120 resize hints in the mouse pointer shown by the window manager.
121 (Bug#14032)
122
123 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
124
125 * lisp.h (get_frame_param): Adjust conditions for prototype
126 declaration.
127
128 2013-03-22 Ken Brown <kbrown@cornell.edu>
129
130 * unexcw.c: Drop unneeded inclusion of w32common.h.
131 (report_sheap_usage): Declare.
132 (read_exe_header): Add magic numbers for x86_64.
133 (fixup_executable): Fix printf format specifier for unsigned long
134 argument.
135
136 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
137
138 * frame.h (struct frame): Put menu_bar_window under #ifdef
139 because this member is not needed when X toolkit is in use.
140 (fset_menu_bar_window):
141 * dispnew.c (clear_current_matrices, clear_desired_matrices)
142 (free_glyphs, update_frame):
143 * xdisp.c (expose_frame): Likewise.
144 (display_menu_bar): Likewise. Remove redundant eassert.
145 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
146 toolkit is in use.
147
148 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
149
150 Use functions and constants to manipulate Lisp_Save_Value objects.
151 This replaces code that used macros and strings and token-pasting.
152 The change makes the C source a bit easier to follow,
153 and shrinks the Emacs executable a bit.
154 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
155 (make_save_value): Change 1st arg from string to enum. All callers
156 changed.
157 (INTX): Remove.
158 (mark_object): Use if, not #if, for GC_MARK_STACK.
159 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
160 (XSAVE_OBJECT): Now functions, not macros.
161 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
162 the constant was never used.
163 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
164 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
165 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
166 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
167 New constants.
168 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
169 type3 with a single member save_type. All uses changed.
170 (save_type, set_save_pointer, set_save_integer): New functions.
171 * print.c (PRINTX): Remove.
172
173 * alloc.c: Remove redundant static declarations.
174
175 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
176
177 * window.h (struct window): Convert left_col, top_line, total_lines
178 and total_cols from Lisp_Objects to integers. Adjust comments.
179 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
180 Remove.
181 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
182 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
183 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
184 Adjust users where appropriate.
185
186 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
187
188 * frame.h (struct frame): Drop resx and resy because the same data is
189 available from window system-specific output context. Adjust users.
190 (default_pixels_per_inch_x, default_pixels_per_inch_y): New
191 functions to provide defaults when no window system available.
192 (FRAME_RES_X, FRAME_RES_Y): New macros.
193 (NUMVAL): Moved from xdisp.c.
194 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
195 (Ffont_face_attributes, Fopen_font):
196 * image.c (gs_load):
197 * w32font.c (fill_in_logfont):
198 * xdisp.c (calc_pixel_width_or_height):
199 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
200 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
201
202 2013-03-20 Kenichi Handa <handa@gnu.org>
203
204 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
205 to 1 (temporary workaround until a bug related to ASCII
206 optimization is fixed).
207
208 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
209
210 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
211 Signal error if window is not internal. Adjust docstring.
212 (delete_all_child_windows): Use combination_limit to save the buffer.
213 (Fset_window_configuration): Adjust accordingly.
214 * print.c (syms_of_print): Initialize debugging output not here...
215 (init_print_once): ...but in a new function here.
216 * lisp.h (init_print_once): Add prototype.
217 * emacs.c (main): Add call to init_print_once. Adjust comments.
218
219 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
220
221 * window.c (window_resize_check, window_resize_apply)
222 (window_from_coordinates, recombine_windows, set_window_buffer)
223 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
224 (Fsplit_window_internal, Fdelete_window_internal)
225 (freeze_window_starts): Use bool for booleans.
226 * window.h (window_frame_coordinates, resize_frame_windows)
227 (freeze_window_starts, set_window_buffer): Adjust prototypes.
228
229 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
230
231 * dispnew.c (bitch_at_user): Use `user-error'.
232
233 2013-03-17 Ken Brown <kbrown@cornell.edu>
234
235 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
236 as return type of image_background. (Bug#13981)
237 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
238
239 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
240
241 * nsterm.m (updateFrameSize:): Change resize increments if needed.
242 (ns_select): Don't return with result uninitialized.
243
244 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
245 and getDirectory.
246
247 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
248 New functions.
249 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
250 directories. If filename is nil, get directory name (Bug#13932).
251 Use getFilename and getDirectory.
252 (getFilename, getDirectory): New methods for EmacsSavePanel and
253 EmacsOpenPanel.
254 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
255
256 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
257
258 * coding.c (decode_coding_gap): Fix typo caught by static checking.
259
260 2013-03-15 handa <handa@gnu.org>
261
262 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
263 (adjust_after_replace): Make it back to static. Delete the third
264 arg text_at_gap_tail. Cancel the code for handling it.
265
266 * coding.h (struct coding_system): New member eol_seen.
267
268 * coding.c (detect_ascii): New function.
269 (detect_coding): Set coding->head_ascii and coding->eol_seen only
270 when the source bytes are actually scanned. On detecting for
271 coding_category_utf_8_auto, call detect_ascii instead of scanning
272 source bytes directly.
273 (produce_chars): Call insert_from_gap with the new arg 0.
274 (encode_coding): Likewise.
275 (decode_coding_gap): Control ASCII optimization by the variable
276 disable_ascii_optimization instead of #ifndef .. #endif.
277 Deccode EOL format according to coding->eol_seen.
278 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
279 variable.
280
281 * lisp.h (adjust_after_replace): Cancel externing it.
282 (insert_from_gap): Adjust prototype.
283
284 2013-03-15 Eli Zaretskii <eliz@gnu.org>
285
286 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
287 FULLSCREEN_MAXIMIZED. (Bug#13935)
288
289 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
290
291 * region-cache.c (find_cache_boundary, move_cache_gap)
292 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
293 Simplify debugging check and convert to eassert. Adjust comment.
294 (pp_cache): Put under ENABLE_CHECKING.
295
296 2013-03-14 Eli Zaretskii <eliz@gnu.org>
297
298 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
299 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
300 and WM_ACTIVATEAPP.
301 (w32fullscreen_hook): If the frame is visible, reset
302 f->want_fullscreen flag after changing the frame size. If the
303 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
304 (Bug#13953)
305
306 2013-03-13 Daniel Colascione <dancol@dancol.org>
307
308 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
309 too so that these builds can use Cygwin's file conversion
310 functions. (We've been building and linking cygw32.o all along
311 and just not using it.)
312
313 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
314
315 File synchronization fixes (Bug#13944).
316 * Makefile.in (LIB_FDATASYNC): New macro.
317 (LIBES): Use it.
318 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
319 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
320 Don't worry about HAVE_FSYNC, since a substitute fsync is
321 available if the system lacks one.
322 (Fwrite_regin): Retry fsync if interrupted.
323
324 2013-03-13 Eli Zaretskii <eliz@gnu.org>
325
326 * w32term.c (w32_read_socket): If the Emacs frame is being
327 activated, call w32fullscreen_hook, to make sure the new frame
328 dimensions are in effect. (Bug#13937)
329
330 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
331
332 * xdisp.c (init_iterator): Simplify because both character and byte
333 positions are either specified or -1. Add eassert. Adjust comment.
334 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
335 character and byte positions can be obtained from marker.
336
337 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
338
339 Static checking by Sun C 5.12.
340 * alloc.c (buffer_memory_full) [REL_ALLOC]:
341 * bytecode.c (exec_byte_code):
342 * dispnew.c (init_display):
343 * eval.c (error):
344 * fileio.c (Fsubstitute_in_file_name):
345 * keyboard.c (Fevent_convert_list):
346 * keymap.c (Fsingle_key_description):
347 * term.c (maybe_fatal, fatal):
348 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
349 * xsmfns.c (Fhandle_save_session):
350 Omit unreachable code.
351 * keymap.c (map_keymap_char_table_item): Cast void * to
352 a function pointer type; the C Standard requires this.
353
354 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
355 Include <sys/param.h> unconditionally, as that works elsewhere and
356 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
357 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
358 and FreeBSD now.
359
360 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
361
362 * insdel.c (adjust_after_replace): Use bool for boolean.
363
364 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
365
366 * keyboard.c: Move keyboard decoding to read_key_sequence.
367 (decode_keyboard_code): Remove.
368 (tty_read_avail_input): Don't try to decode input.
369 (read_decoded_char): New function.
370 (read_key_sequence): Use it.
371
372 2013-03-10 Daniel Colascione <dancol@dancol.org>
373
374 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
375 (GUI_SDATA, guichar_t): Macros to abstract out differences between
376 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
377 w32fns.c.
378
379 * w32term.c (construct_drag_n_drop): Use the above macros to make
380 drag-and-drop work for non-ASCII filenames in cygw32 builds.
381
382 * w32fns.c (x_set_name, x_set_title): Use the above macros to
383 properly display non-ASCII frame titles in cygw32 builds.
384
385 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
386 call ShellExecute in cygw32 builds.
387
388 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
389 common file dialog code.
390
391 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
392 can just use du like other systems.
393
394 * coding.c (from_unicode_buffer): Declare.
395 * coding.c (from_unicode_buffer): Implement.
396
397 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
398
399 * lread.c: Minor cleanup.
400 (FROM_FILE_P): New macro.
401 (skip_dyn_bytes, unreadchar, read1): Use it.
402 (read_list): Consolidate duplicated code.
403
404 * bytecode.c (struct byte_stack): Remove `constants' when unused.
405
406 2013-03-10 Eli Zaretskii <eliz@gnu.org>
407
408 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
409 (redisplay_internal, set_cursor_from_row, try_window)
410 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
411 (display_line, notice_overwritten_cursor)
412 (mouse_face_from_buffer_pos, note_mouse_highlight):
413 Use MATRIX_ROW_DISPLAYS_TEXT_P.
414 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
415 (mouse_face_from_string_pos, fast_find_string_pos):
416 Use MATRIX_ROW_VPOS.
417
418 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
419
420 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
421
422 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
423 MATRIX_MODE_LINE_ROW.
424
425 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
426
427 2013-03-10 handa <handa@gnu.org>
428
429 * lisp.h (adjust_after_replace): Extern it.
430
431 * coding.c (detect_coding): Cound the heading ASCII bytes in the
432 case of detection for coding_category_utf_8_auto.
433 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
434 Skip decoding if all bytes are ASCII.
435
436 * insdel.c (adjust_after_replace): Make it public. New arg
437 text_at_gap_tail.
438 (adjust_after_insert): Call adjust_after_replace with the new arg
439 value 0.
440
441 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
442
443 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
444 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
445 from Elisp via unread-command-events.
446
447 * keyboard.c (access_keymap_keyremap): Accept nil return value from
448 functions to mean "no change".
449
450 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
451
452 region-cache.c, scroll.c, search.c: Use bool for booleans.
453 * lisp.h (compile_pattern):
454 * scroll.c (do_scrolling, do_direct_scrolling):
455 * search.c (struct regexp_cache, compile_pattern_1)
456 (compile_pattern, string_match_1, search_command)
457 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
458 (search_regs_saved, Fregexp_quote):
459 Use bool for boolean.
460 * region-cache.c (region_cache_forward, region_cache_backward):
461 Fix comments to match code: these functions return int, not boolean.
462
463 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
464
465 * search.c (find_newline): Accept start and end byte positions
466 as arguments and allow -1 if not known.
467 (find_newline_no_quit): Likewise for start position.
468 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
469 * bidi.c (bidi_find_paragraph_start): Pass byte position to
470 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
471 * editfns.c (Fconstrain_to_field): Break long line.
472 Adjust call to find_newline.
473 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
474 Use DEC_BOTH to start next search from the previous buffer
475 position, where appropriate.
476 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
477 (get_visually_first_element, move_it_vertically_backward): Likewise.
478 Obtain byte position from the display iterator, where appropriate.
479
480 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
481
482 print.c, process.c: Use bool for booleans.
483 * lisp.h (wait_reading_process_output):
484 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
485 (strout, debug_output_compilation_hack, float_to_string, print)
486 (print_object):
487 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
488 (decode_status, status_message, create_process, create_pty)
489 (Fmake_network_process, Fnetwork_interface_info)
490 (wait_reading_process_output, read_process_output)
491 (write_queue_push, write_queue_pop, process_send_signal)
492 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
493 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
494 Use bool for booleans.
495 * process.c (Fnetwork_interface_list): Remove unused local.
496 (connect_counter): Now EMACS_INT, not int.
497
498 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
499
500 * bidi.c (bidi_fetch_char): Swap first and second arguments
501 to match other functions accepting character and byte positions.
502 Adjust comment.
503 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
504 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
505 when you need just to move to the previous buffer position.
506 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
507
508 2013-03-07 Eli Zaretskii <eliz@gnu.org>
509
510 * .gdbinit (prowlims): Display the enabled_p flag of the row.
511
512 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
513
514 Avoid character to byte conversions in motion subroutines.
515 * indent.h (compute_motion, vmotion): Add byte position argument.
516 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
517 Add eassert.
518 (Fcompute_motion): Break long line. Adjust call to compute_motion.
519 Use list5 for return value.
520 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
521 Adjust comments, style and calls to compute_motion.
522 (Fvertical_motion): Adjust call to vmotion.
523 * window.c (Fdelete_other_windows_internal): Record window start
524 byte position and adjust call to vmotion.
525 (window_scroll_line_based): Likewise with call to compute_motion.
526 Use SET_PT_BOTH.
527 (Frecenter): Adjust calls to vmotion.
528
529 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
530
531 * lisp.h (list2i, list3i): New functions.
532 (list4i): Move from window.c and make LISP_INLINE.
533 * editfns.c (make_lisp_time):
534 * fns.c (Flocale_info):
535 * keyboard.c (parse_modifiers):
536 * xterm.c (x_ewmh_activate_frame): Use list2i.
537 * instel.c (signal_after_change):
538 * nsfns.m (Fx_server_version, Fxw_color_values):
539 * w32fns.c (Fxw_color_values, Fx_server_version):
540 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
541 * fileio.c (Fvisited_file_modtime):
542 * nsfns.m (Fns_display_usable_bounds):
543 * w32.c (ltime): Use list4i.
544
545 2013-03-06 Eli Zaretskii <eliz@gnu.org>
546
547 * search.c (find_newline_no_quit): Rename from find_next_newline.
548 Add commentary.
549
550 * lisp.h (find_newline_no_quit): Rename prototype.
551
552 * xdisp.c (back_to_previous_line_start)
553 (forward_to_next_line_start, get_visually_first_element)
554 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
555 * indent.c (vmotion): Callers of find_newline_no_quit changed.
556 * bidi.c (bidi_find_paragraph_start): Callers of
557 find_newline_no_quit changed.
558
559 * msdos.c: Change encoding to cp850. (Bug#13879)
560 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
561
562 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
563
564 Coding system support cleanup and minor refactoring.
565 * coding.h (enum coding_result_code): Remove
566 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
567 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
568 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
569 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
570 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
571 (decode_coding_region, encode_coding_region, decode_coding_string):
572 Remove unused compatibility macros.
573 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
574 (record_conversion_result): Adjust user.
575 (syms_of_coding): Likewise.
576 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
577 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
578 (decode_coding_object): Simplify since xrealloc never returns NULL.
579 Add eassert.
580
581 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
582
583 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
584 * sysdep.c (list_system_processes)
585 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
586 Make it a stub in this case; otherwise the build might fail,
587 and this code hasn't been tested on such hosts anyway.
588 Problem reported by Nelson H. F. Beebe in
589 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
590 and analyzed by Jérémie Courrèges-Anglas in
591 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
592
593 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
594
595 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
596 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
597 (get_visually_first_element, move_it_vertically_backward): Ajust users.
598 * bidi.c (bidi_find_paragraph_start): Likewise.
599 * indent.c (vmotion): Likewise.
600
601 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
602
603 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
604 * filelock.c: Include <c-ctype.h>.
605 (MAX_LFINFO): New top-level constant.
606 (lock_info_type): Remove members pid, boot_time. Add members at,
607 dot, colon. Change user member to be the entire buffer, not a
608 pointer. This allows us to handle the case where a foreign
609 pid or boot time exceeds the local range. All uses changed.
610 (LINKS_MIGHT_NOT_WORK): New constant.
611 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
612 (defined_WINDOWSNT): Remove.
613 (MAKE_LOCK_NAME, file_in_lock_file_name):
614 Always use .#FILE (not .#-FILE) for the file lock,
615 even if it is a regular file.
616 (rename_lock_file): New function.
617 (create_lock_file): Use it.
618 (create_lock_file, read_lock_data):
619 Prefer a symbolic link for the lock file, falling back on a
620 regular file if symlinks don't work. Do not try to create
621 symlinks on MS-Windows, due to security hassles. Stick with
622 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
623 link, rename, unlink, mkstemp) when creating locks, as a GNUish
624 host may be using a Windowsish file system, and cannot use
625 MS-Windows-only system calls. Fall back on mktemp if mkstemp
626 doesn't work. Don't fail merely because of a symlink-contents
627 length limit in the current file system; fall back on regular
628 files. Increase the symlink contents length limit to 8 KiB, this
629 should be big enough for any real use and doesn't crunch the
630 stack.
631 (create_lock_file, lock_file_1, read_lock_data):
632 Simplify allocation of lock file buffers now that they fit in 8 KiB.
633 (lock_file_1): Return error number, not bool. All callers changed.
634 (ELOOP): New macro, if not already defined.
635 (read_lock_data): Return size of lock file contents, not Lisp object.
636 All callers changed. Handle a race condition if some other process
637 replaces a regular-file lock with a symlink lock or vice versa,
638 while we're trying to read the lock.
639 (current_lock_owner): Parse contents more carefully, to help avoid
640 confusing a regular-file lock with some other application's use
641 of the file. Check for lock file contents being too long, or
642 not parsing correctly.
643 (current_lock_owner, lock_file):
644 Allow foreign pid and boot times that exceed the local range.
645 (current_lock_owner, lock_if_free, lock_file):
646 Simplify allocation of lock file contents.
647 * w32.c (sys_rename_replace): New function, containing most of
648 the contents of the old sys_rename.
649 (sys_rename): Use it.
650 (fchmod): New dummy function.
651 * w32.h (sys_rename_replace, fchmod): New decls.
652
653 2013-03-05 Eli Zaretskii <eliz@gnu.org>
654
655 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
656 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
657 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
658 <dmantipov@yandex.ru>.
659
660 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
661
662 * composite.c (get_composition_id, fill_gstring_header):
663 Use make_uninit_vector where appropriate.
664 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
665 * xselect.c (clean_local_selection_data): Likewise.
666
667 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
668
669 Fix misuse of ImageMagick that caused core dump (Bug#13846).
670 * image.c (imagemagick_load_image): Calculate height and width
671 after flattening the image, not before.
672
673 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
674
675 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
676 * ftfont.c (ftfont_shape_by_flt): Likewise.
677 * w32uniscribe.c (uniscribe_shape): Likewise.
678
679 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
680
681 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
682 The old approach, which fell back on DIR/.#FILE.0 through
683 DIR/.#FILE.9, had race conditions that could not be easily fixed.
684 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
685 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
686 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
687 because the locking mechanism was never reliable in that case).
688 This patch fixes this and other bugs discovered by a code
689 inspection that was prompted by
690 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
691 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
692 to avoid interoperability problems between the MS-Windows and
693 non-MS-Windows implementations. MS-Windows and non-MS-Windows
694 instances of Emacs now ignore each others' locks.
695 * filelock.c (defined_WINDOWSNT): New constant.
696 (MAKE_LOCK_NAME, fill_in_lock_file_name):
697 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
698 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
699 regular files on MS-Windows hosts.
700 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
701 Use SAFE_ALLOCA to avoid problems with long file names.
702 (MAX_LFINFO): Now a local constant, not a global macro.
703 (IS_LOCK_FILE): Remove.
704 (lock_file_1): Don't inspect errno if symlink call succeeds;
705 that's not portable.
706 (lock_file): Document that this function can return if lock
707 creation fails.
708 (lock_file): Don't access freed storage.
709
710 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
711
712 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
713
714 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
715
716 * textprop.c: Use bool for booleans.
717 (validate_interval_range, Fadd_text_properties)
718 (Fremove_text_properties): Prefer bool to int when either works.
719
720 2013-03-02 Eli Zaretskii <eliz@gnu.org>
721
722 * textprop.c (Fadd_text_properties, Fremove_text_properties):
723 If the interval tree changes as a side effect of calling
724 modify_region, re-do processing starting from the call to
725 validate_interval_range. (Bug#13743)
726
727 2013-02-28 Eli Zaretskii <eliz@gnu.org>
728
729 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
730 (Bug#13546).
731
732 2013-02-27 Eli Zaretskii <eliz@gnu.org>
733
734 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
735 _SH_DENYRW flag, instead of emacs_open, to deny any other process
736 access to the lock file until it is written and closed.
737 (Bug#13807)
738
739 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
740
741 * callint.c (Qcall_interactively):
742 * macros.c (Qexecute_kbd_macro):
743 Now static.
744
745 2013-02-26 Bastien Guerry <bzg@gnu.org>
746
747 * window.c (Frecenter): Tiny docstring enhancement.
748
749 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
750
751 Minor textprop integer cleanup.
752 * intervals.h, textprop.c (add_text_properties_from_list):
753 Return void, not int, since nobody uses the return value.
754 * textprop.c (validate_plist, add_properties, remove_properties)
755 (Fadd_text_properties):
756 Don't assume list length fits in int.
757 (interval_has_all_properties, interval_has_some_properties)
758 (interval_has_some_properties_list, add_properties, remove_properties)
759 (Fadd_text_properties, Fremove_text_properties)
760 (Fremove_list_of_text_properties, text_property_stickiness):
761 Use bool for booleans.
762 (Fadd_text_properties, Fremove_text_properties):
763 (Fremove_list_of_text_properties):
764 Reindent do-while as per GNU style.
765
766 2013-02-25 Eli Zaretskii <eliz@gnu.org>
767
768 Implement CLASH_DETECTION for MS-Windows.
769
770 * filelock.c [WINDOWSNT]: Include w32.h.
771 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
772 function of that name. Up-case the macro arguments.
773 (IS_LOCK_FILE): New macro.
774 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
775 (create_lock_file): New function, with body extracted from
776 lock_file_1.
777 [WINDOWSNT]: Implement lock files by writing a regular file with
778 the lock information as its contents.
779 (read_lock_data): New function, on Posix platforms just calls
780 emacs_readlinkat.
781 [WINDOWSNT]: Read the lock info from the file.
782 (current_lock_owner): Call read_lock_data instead of calling
783 emacs_readlinkat directly.
784 (lock_file) [WINDOWSNT]: Run the file name through
785 dostounix_filename.
786
787 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
788 just check if the process by that PID exists.
789
790 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
791 also present, as doing so will fail to error out if the file
792 already exists.
793
794 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
795
796 * textprop.c (Fadd_text_properties, Fremove_text_properties)
797 (Fremove_list_of_text_properties): Skip all of the intervals in
798 the region between START and END that already have resp. don't
799 have the requested properties, not just the first one.
800 Add assertions that the loop afterwards always modifies the
801 properties. (Bug#13743)
802
803 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
804
805 * callint.c (Fcall_interactively): Use the right lexical environment
806 for `interactive' specs (bug#13811).
807 * eval.c (Feval): Accept a lexical environment.
808
809 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
810
811 Simplify data_start configuration (Bug#13783).
812 This is a followon simplification to the fix for Bug#13650.
813 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
814 (START_FILES): Remove. All uses removed.
815 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
816 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
817 (buildobj.h): Use it.
818 ($(ALLOBJS)): Depend on globals.h.
819 (temacs$(EXEEXT)): Use $(ALLOBJS).
820 * autodeps.mk (ALLOBJS): Move to Makefile.in.
821 * deps.mk (vm-limit.o):
822 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
823 Do not depend on mem-limits.h.
824 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
825 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
826 [__GNUC__ && !ORDINARY_LINK]: Remove.
827 * mem-limits.h, pre-crt0.c: Remove.
828 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
829 * unexcoff.c (etext): New decl.
830 (make_hdr): Use DATA_START instead of start_of_data.
831 * vm-limit.c: Move most of mem-limits.h's contents here.
832 (data_start): New decl. It's OK if this is approximate,
833 so simplify-away some unnecessary exactness.
834 (POINTER): Remove; all uses removed.
835 (data_space_start): Now char *, to avoid casts.
836 (exceeds_lisp_ptr): New function, replacing the old
837 EXCEEDS_LISP_PTR macro. All uses changed.
838 (check_memory_limits): Simplify and remove casts.
839 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
840 (memory_warnings): Use data_start instead of start_of_data.
841
842 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
843
844 * xdisp.c (set_message): Only check for debug-on-message if STRING
845 is a string. (Bug#13797)
846
847 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
848
849 Fix regression introduced by July 10 filelock.c patch.
850 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
851 2012-07-10 patch to this file. Reported by Eli Zaretskii in
852 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
853 and diagnosed by Andreas Schwab in
854 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
855
856 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
857
858 Assume C89 or better.
859 * ralloc.c (SIZE, POINTER, NIL):
860 * vm-limit.c (POINTER):
861 Remove, replacing all uses with C89 equivalents. These old
862 symbols were present only for porting to pre-C89 platforms.
863
864 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
865
866 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
867 This avoids warning messages reported as part of Bug#13546.
868
869 2013-02-21 Ken Brown <kbrown@cornell.edu>
870
871 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
872
873 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
874
875 * sheap.c (report_sheap_usage): Prefer message1_nolog.
876
877 * keyboard.c (Qcommand_execute): New var.
878 (command_loop_1, read_char): Use it.
879 (Fcommand_execute): Remove, replace by an Elisp implementation.
880 (syms_of_keyboard): Adjust accordingly.
881
882 2013-02-19 Daniel Colascione <dancol@dancol.org>
883
884 * sheap.c (report_sheap_usage): Use message, not message1, so
885 that we don't try to create a buffer while we're in the middle
886 of dumping Emacs. Explain why.
887
888 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
889
890 * search.c (find_newline): Return byte position in bytepos.
891 Adjust comment.
892 (find_next_newline_no_quit, find_before_next_newline):
893 Add bytepos argument.
894 * lisp.h (find_newline, find_next_newline_no_quit)
895 (find_before_next_newline): Adjust prototypes.
896 * bidi.c (bidi_find_paragraph_start):
897 * editfns.c (Fconstrain_to_field, Fline_end_position):
898 * indent.c (compute_motion, vmotion):
899 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
900 (get_visually_first_element, move_it_vertically_backward):
901 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
902
903 2013-02-19 Eli Zaretskii <eliz@gnu.org>
904
905 * w32proc.c (new_child): Avoid leaking handles if the subprocess
906 resources were not orderly released.
907
908 2013-02-17 Eli Zaretskii <eliz@gnu.org>
909
910 * xdisp.c (x_draw_vertical_border): For a window that is neither
911 the leftmost nor the rightmost, redraw both the left and the right
912 vertical borders. (Bug#13723)
913
914 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
915
916 * xml.c (init_libxml2_functions):
917 * sound.c (sound_warning):
918 * sheap.c (report_sheap_usage):
919 * process.c (wait_reading_process_output):
920 * msdos.c (XMenuActivate):
921 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
922 * keyboard.c (top_level_1):
923 * editfns.c (Fmessage, Fmessage_box):
924 * callint.c (Fcall_interactively):
925 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
926
927 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
928
929 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
930 * frame.c (syms_of_frame): ... to here.
931
932 2013-02-16 Eli Zaretskii <eliz@gnu.org>
933
934 * w32.c (sys_chown): Remove unused function.
935
936 * w32term.c <input_signal_count>: Declare 'volatile'
937 unconditionally. (Bug#9066)
938
939 * w32.c (set_errno): Reset h_errno and don't set it to any other
940 value. Set errno instead.
941 (check_errno): Reset h_errno.
942 (sys_socket, socket_to_fd, sys_bind, sys_connect)
943 (sys_gethostname, sys_getservbyname, sys_getpeername)
944 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
945 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
946 h_errno.
947 (sys_gethostbyname): Set h_errno only errors detected.
948
949 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
950
951 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
952
953 2013-02-15 Eli Zaretskii <eliz@gnu.org>
954
955 * keyboard.c (read_char): Fix calculation of auto-save time out
956 when auto-save-timeout is less than 4. (Bug#13720)
957
958 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
959 time. Improve diagnostics in DebPrint. (Bug#13546)
960
961 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
962 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
963 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
964 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
965 make sure errno is set to an appropriate value. (Bug#13546)
966 (socket_to_fd): Add assertion against indexing fd_info[] with a
967 value that is out of bounds.
968 (sys_accept): If fd is negative, do not set up the child_process
969 structure for reading.
970
971 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
972
973 * composite.c (fill_gstring_header): Remove useless prototype.
974 Break long line.
975 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
976 * print.c (PRINTDECLARE, print_object):
977 * search.c (compile_pattern, fast_looking_at, search_buffer):
978 (simple_search, boyer_moore, Freplace_match):
979 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
980 (get_overlay_arrow_glyph_row, display_mode_element):
981 (decode_mode_spec_coding, message3):
982 * xfaces.c (face_at_string_position): Use bool for booleans.
983 Adjust comments.
984
985 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
986
987 Fix AIX port (Bug#13650).
988 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
989 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
990 was #undeffed earlier, so it cannot be used as a macro here.
991 Use the constant and not the macro.
992
993 2013-02-15 Eli Zaretskii <eliz@gnu.org>
994
995 * w32proc.c (new_child): If no vacant slots are found in
996 child_procs[], make another pass looking for slots whose process
997 has exited or died. (Bug#13546)
998
999 * w32.c (sys_pipe): When failing due to file descriptors above
1000 MAXDESC, set errno to EMFILE.
1001 (_sys_read_ahead): Update cp->status when failing to read serial
1002 communications input, so that the status doesn't stay at
1003 STATUS_READ_IN_PROGRESS. (Bug#13546)
1004
1005 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1006
1007 * gtkutil.c (tb_size_cb): New function.
1008 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1009
1010 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1011
1012 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1013 an event.
1014
1015 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1016
1017 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1018
1019 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1020
1021 * font.c (font_range): Add pos_byte argument. Adjust comment
1022 and break long line.
1023 * font.h (font_range): Adjust prototype.
1024 * composite.c (autocmp_chars): Pass byte position to font_range.
1025 Break long line. Remove useless prototype and format comment.
1026
1027 2013-02-13 Glenn Morris <rgm@gnu.org>
1028
1029 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1030
1031 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1032
1033 Improve AIX port some more (Bug#13650).
1034 With this, it should be as good as it was in 23.3, though it's
1035 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1036 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1037 * unexaix.c (start_of_text): Remove.
1038 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1039 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1040 (orig_load_scnptr, orig_data_scnptr):
1041 Now off_t, not long, since they are file offsets.
1042 (make_hdr): Use _data, not start_of_data ().
1043 This is the key part of the fix.
1044 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1045 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1046
1047 * pre-crt0.c (data_start): Initialize to 1.
1048 This ports to compilers that optimize the external declaration
1049 'int x = 0;' as if it were 'int x;' to shrink the executable.
1050
1051 Improve AIX port (Bug#13650).
1052 This doesn't fix the bug, but it makes progress: Emacs builds now.
1053 * unexaix.c: Include inttypes.h, stdarg.h.
1054 (report_error, report_error_1): Mark as _Noreturn.
1055 (report_error): Don't report the wrong errno.
1056 (report_error_1): Now varargs. All callers changed.
1057 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1058 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1059 (write_ptr): Use %p to print address rather than %lx and a cast
1060 to unsigned long. Grow buffer a bit, to be safer.
1061
1062 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1063
1064 * bidi.c (bidi_resolve_neutral): After finding the next
1065 non-neutral character, accept NEUTRAL_ON type as well, because
1066 directional control characters, such as LRE and RLE, have their
1067 type converted to that by bidi_resolve_weak. This avoids aborts
1068 when LRE/RLE follows a run of neutrals.
1069 (bidi_move_to_visually_next): Assert that return value of
1070 bidi_peek_at_next_level is non-negative. Negative values will
1071 cause an infloop.
1072
1073 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1074
1075 Minor getenv-related fixes.
1076 * callproc.c (Fcall_process_region) [!DOS_NT]:
1077 Avoid unnecessary duplicate call to getenv.
1078 * callproc.c (init_callproc):
1079 * dispnew.c (init_display):
1080 * sysdep.c (sys_subshell):
1081 Omit unnecessary cast of getenv or egetenv.
1082
1083 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1084
1085 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1086 Update dependencies.
1087
1088 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1089
1090 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1091 marker's position.
1092 (display_line): Set w->region_showing to the value of
1093 it->region_beg_charpos, not to -1. This fixes redisplay
1094 optimization when cursor is moved up after M->. (Bug#13623)
1095 (Bug#13626)
1096 (try_scrolling): Scroll text up more if point is too close to ZV
1097 and inside the scroll margin. This makes sure point is moved
1098 outside the scroll margin in these cases.
1099
1100 * window.h (struct window): region_showing can no longer be
1101 negative.
1102
1103 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1104
1105 Tune by using memchr and memrchr.
1106 * doc.c (Fsnarf_documentation):
1107 * fileio.c (Fsubstitute_in_file_name):
1108 * search.c (find_newline, scan_newline):
1109 * xdisp.c (pos_visible_p, display_count_lines):
1110 Use memchr and memrchr rather than scanning byte-by-byte.
1111 * search.c (find_newline): Rename from scan_buffer.
1112 Omit first arg TARGET, as it's always '\n'. All callers changed.
1113
1114 Clean up read_key_sequence a tiny bit more.
1115 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1116 (read_key_sequence): Remove unused locals.
1117
1118 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1119
1120 Clean up read_key_sequence a bit; reread active keymaps after first event.
1121 * keyboard.c (read_char, read_char_x_menu_prompt)
1122 (read_char_minibuf_menu_prompt):
1123 Replace nmaps+maps with a single `map' arg.
1124 (follow_key): Operate on a single map.
1125 (active_maps): New function.
1126 (test_undefined): Also return true for nil bindings.
1127 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1128 a single (composed) keymap. Remember `first_event' to choose the right
1129 set of active keymaps. Recompute the set of keymaps after receiving
1130 the first event. Remove GOBBLE_FIRST_EVENT.
1131 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1132 * keyboard.h (read_char): Update declaration.
1133 * lread.c (read_filtered_event): Adjust call to read_char.
1134
1135 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1136
1137 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1138 Don't use the limitation on backwards movement when lines are truncated
1139 in the window. (Bug#13675)
1140
1141 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1142
1143 * marker.c (set_marker_internal): If desired position is passed
1144 as a marker, avoid call to buf_charpos_to_bytepos.
1145 * window.c (Fset_window_point): Omit redundant type checking.
1146 (Fset_window_start): Likewise. Format comment.
1147 (window_scroll_pixel_based): Use set_marker_restricted_both
1148 with character and byte positions obtained from an iterator.
1149 (Fset_window_configuration): Use set_marker_restricted_both.
1150 * xdisp.c (message_dolog): Likewise.
1151
1152 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1153
1154 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1155 When text lines are longer than window's screen lines, don't move back
1156 too far. This speeds up some redisplay operations. (Bug#13675)
1157
1158 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1159
1160 * syntax.c (scan_sexps_forward): Fix byte position calculation
1161 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1162
1163 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1164
1165 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1166 that was not needed.
1167
1168 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1169
1170 Minor hashing refactoring.
1171 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1172 (sxhash_float): Return EMACS_UINT, for consistency with the other
1173 hash functions.
1174 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1175 non-static inline function and therefore can't use static vars.
1176 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1177 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1178 with the other hash functions.
1179
1180 2013-02-09 Eli Zaretskii <eliz@gnu.org>
1181
1182 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1183 XXXXXX part of the temporary file pattern is not downcased even
1184 when w32-downcase-file-names is non-nil. (Bug#13661)
1185
1186 * xdisp.c (decode_mode_spec): Remove handling of %t.
1187
1188 * msdos.c (careadlinkatcwd): Remove.
1189
1190 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1191
1192 * lread.c (skip_dyn_bytes): New function (bug#12598).
1193 (read1): Use it. Use getc instead of READCHAR to read bytes.
1194 (load_each_byte): Remove. Update users.
1195
1196 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1197
1198 * search.c (scan_buffer): Calculate end byte position just once.
1199 (scan_newline): Do not recalculate start_byte.
1200 (search_command): Use eassert.
1201 * syntax.c (struct lisp_parse_state): New member location_byte.
1202 (scan_sexps_forward): Record from_byte and avoid redundant
1203 character to byte position calculation ...
1204 (Fparse_partial_sexp): ... here. Break too long line.
1205
1206 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1207
1208 * lisp.h (make_uninit_vector): New function.
1209 * alloc.c (Fvector, Fmake_byte_code):
1210 * ccl.c (Fregister_ccl_program):
1211 * charset.c (Fdefine_charset_internal, define_charset_internal):
1212 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1213 * composite.c (syms_of_composite):
1214 * font.c (Fquery_font, Ffont_info, syms_of_font):
1215 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1216 * ftfont.c (ftfont_shape_by_flt):
1217 * indent.c (recompute_width_table):
1218 * nsselect.m (clean_local_selection_data):
1219 * syntax.c (init_syntax_once):
1220 * w32unsubscribe.c (uniscribe_shape):
1221 * window.c (Fcurrent_window_configuration):
1222 * xfaces.c (Fx_family_fonts):
1223 * xselect.c (selection_data_to_lisp_data): Use it.
1224
1225 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1226
1227 * coding.c (Fdefine_coding_system_internal): Use AREF where
1228 argument is known to be a vector.
1229 * fns.c (Flocale_info): Likewise for ASET.
1230 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1231 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1232
1233 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1234
1235 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1236 height.
1237
1238 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1239 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1240 updateCollectionBehaviour.
1241
1242 * nsterm.m (NEW_STYLE_FS): Remove.
1243 (ns_last_use_native_fullscreen): New variable.
1244 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1245 (x_set_window_size): Do not take title bar and tool bar into account
1246 if isFullscreen returns YES.
1247 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1248 (check_native_fs): New function.
1249 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1250 (ns_term_init): Remove NEW_STYLE_FS.
1251 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1252 and tool bar if isFullscreen returns NO.
1253 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1254 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1255 with HAVE_NATIVE_FS.
1256 (window:willUseFullScreenPresentationOptions:): New method.
1257 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1258 Hide toolbar if not enabled (Bug#13444).
1259 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1260 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1261 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1262 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1263 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1264 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1265 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1266 (syms_of_nsterm): Add ns-use-native-fullscreen.
1267
1268 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1269
1270 * fileio.c (Qchoose_write_coding_system): Now static.
1271
1272 2013-02-04 Eli Zaretskii <eliz@gnu.org>
1273
1274 * xdisp.c (window_buffer_changed): region_showing can be negative,
1275 which still means region is being displayed.
1276 (redisplay_internal): Resurrect code that forced redisplay of the
1277 whole window when showing region and the mark has changed.
1278 Record the new mark position to allow redisplay optimizations.
1279 (display_line): If it->region_beg_charpos is non-zero, set the
1280 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1281
1282 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1283 not bitfield of 1 bit.
1284
1285 2013-02-03 Daniel Colascione <dancol@dancol.org>
1286
1287 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1288 daemon mode works on cygw32 when Emacs is installed and not just
1289 during development.
1290
1291 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1292
1293 Avoid file time stamp bug on MS-Windows (Bug#13149).
1294 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1295 as FAT32 doesn't update time stamps when truncating them.
1296 Also, check that a file time stamp is not a multiple of 100 ns;
1297 this should catch all instances of the problem on MS-Windows,
1298 as its native file system resolution is 100 ns or worse, and
1299 checking for a non-multiple of 100 ns should impose only a small
1300 overhead on systems with ns resolution.
1301
1302 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1303
1304 Avoid encoding file names on MS-Windows when they need to be run
1305 through dostounix_filename.
1306 * w32.c (normalize_filename): Accept an additional argument
1307 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1308 downcase it even if w32-downcase-file-names is non-nil.
1309 (dostounix_filename): Accept an additional argument MULTIBYTE and
1310 pass it to normalize_filename.
1311 (emacs_root_dir): Adjust.
1312
1313 * msdos.h (dostounix_filename): Adjust prototype.
1314
1315 * w32.h (dostounix_filename): Adjust prototype.
1316
1317 * msdos.c (dostounix_filename): Accept an additional argument and
1318 ignore it.
1319 (init_environment): Adjust callers of dostounix_filename.
1320
1321 * fileio.c (Ffile_name_directory, file_name_as_directory)
1322 (directory_file_name, Fexpand_file_name)
1323 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1324 dostounix_filename.
1325 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1326 non-nil.
1327 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1328 variables, as egetenv is case-insensitive for DOS_NT.
1329
1330 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1331 with an encoded file name.
1332
1333 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1334 Adjust calls to dostounix_filename.
1335
1336 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1337
1338 * unexw32.c (unexec): Adjust call to dostounix_filename.
1339
1340 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1341
1342 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1343 dostounix_filename.
1344
1345 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1346 dostounix_filename.
1347
1348 * callproc.c (Fcall_process): Make sure program name in PATH and
1349 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1350 is passed to exec/spawnve, which fails unless the file-name
1351 encoding is UTF-8.
1352
1353 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1354 even if w32-quote-process-args is nil.
1355
1356 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1357
1358 Fix timestamp bug when write-region appends nothing (Bug#13149).
1359 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1360 the file's time stamp doesn't change if Emacs happens to write nothing
1361 to the file, and on a buggy file system this could cause Emacs to
1362 incorrectly infer that the file system doesn't have the bug.
1363 Avoid this problem by inhibiting the inference in this case.
1364
1365 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 * window.h (struct window): Convert base_line_number, base_line_pos
1368 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1369 Convert region_showing member from Lisp_Object to bitfield.
1370 Remove sequence_number member. Adjust comments.
1371 * window.c (sequence_number): Remove.
1372 (make_window): Initialize column_number_displayed.
1373 * print.c (print_object): Follow the printed representation of
1374 frames and print window pointer to distinguish between windows.
1375 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1376 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1377 (wset_column_number_displayed, wset_region_showing): Remove.
1378 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1379 (try_scrolling, try_cursor_movement, redisplay_window)
1380 (try_window_reusing_current_matrix, try_window_id, display_line)
1381 (display_mode_lines, decode_mode_spec): Adjust users.
1382 * .gdbinit (pwinx): Do not print sequence_number.
1383
1384 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1385
1386 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1387 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1388 * dired.c: Include <fcntl.h>.
1389 (open_directory): New function, which uses open and fdopendir
1390 rather than opendir. DOS_NT platforms still use opendir, though.
1391 (directory_files_internal, file_name_completion): Use it.
1392 (file_attributes): New function, with most of the old Ffile_attributes.
1393 (directory_files_internal, Ffile_attributes): Use it.
1394 (file_attributes, file_name_completion_stat): First arg is now fd,
1395 not dir name. All uses changed. Use fstatat rather than lstat +
1396 stat.
1397 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1398 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1399 (emacs_readlinkat): New function, with much of the old
1400 Ffile_symlink_p, but with an fd argument for speed.
1401 It uses readlinkat rather than careadlinkatcwd, so that it
1402 need not assume the working directory.
1403 (Ffile_symlink_p): Use it.
1404 * filelock.c (current_lock_owner): Use emacs_readlinkat
1405 rather than emacs_readlink.
1406 * lisp.h (emacs_readlinkat): New decl.
1407 (READLINK_BUFSIZE, emacs_readlink): Remove.
1408 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1409 (emacs_norealloc_allocator, emacs_readlink): Remove.
1410 This stuff is moved to fileio.c.
1411 * w32.c (fstatat, readlinkat): New functions.
1412 (careadlinkat): Don't check that fd == AT_FDCWD.
1413 (careadlinkatcwd): Remove; no longer needed.
1414
1415 2013-01-31 Glenn Morris <rgm@gnu.org>
1416
1417 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1418 (Fwrite_region): Update for new choose_write_coding_system args.
1419 Move the last piece of choose_write_coding_system here. (Bug#13522)
1420 (syms_of_fileio): Add choose-write-coding-system.
1421
1422 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1423
1424 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1425 (sys_close): Zero out the flags for the file descriptor before
1426 closing it. (Bug#13546)
1427
1428 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1429 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1430 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1431 DBCS. (Bug#13553)
1432
1433 * w32.c (w32_get_long_filename, init_environment, readlink):
1434 Support file names encoded in DBCS codepages.
1435 (readlink): Use the current file-name-coding-system, not the ANSI
1436 codepage, to decode and handle targets of symlinks.
1437
1438 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1439
1440 * w32.c (opendir): Now accepts a 'const char *'.
1441
1442 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1443
1444 Remove obsolete redisplay code. See the discussion at
1445 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1446 * dispnew.c (preemption_period, preemption_next_check): Remove.
1447 (Vredisplay_preemption_period): Likewise.
1448 (update_frame, update_single_window, update_window, update_frame_1):
1449 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1450 used, following the 2012-06-22 change.
1451
1452 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1453
1454 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1455
1456 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1457
1458 * font.c (num_fonts): Remove the leftover from old
1459 debugging code. Adjust comment style here and there.
1460 * insdel.c (insert_1): Remove.
1461 * lisp.h (insert_1): Remove prototype.
1462 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1463
1464 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1465
1466 * w32.c (max_filename_mbslen): New function.
1467 (normalize_filename, readdir): Use it to detect locales where ANSI
1468 encoding of file names uses a double-byte character set (DBCS).
1469 If a DBCS encoding is used, advance by characters using
1470 CharNextExA, instead of incrementing a 'char *' pointer.
1471 Use _mbslwr instead of _strlwr. (Bug#13515)
1472
1473 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1474 request of memory reservation to 1.7GB. (Bug#13065)
1475
1476 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
1477
1478 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1479 at check_extra_latin label. (Bug#13505)
1480
1481 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1482
1483 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1484 Avoid redundant calls to strlen.
1485
1486 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1487
1488 Drop async_visible and async_iconified fields of struct frame.
1489 This is possible because async input is gone; for details, see
1490 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1491 * frame.h (struct frame): Remove async_visible and async_iconified
1492 members, convert garbaged to unsigned bitfield. Adjust comments.
1493 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1494 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1495 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1496 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1497 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1498 * w32term.c: Ditto.
1499 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1500 properly. Likewise for obscured.
1501 * xterm.c: Ditto.
1502 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1503 properly.
1504 * nsterm.m: Ditto.
1505 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1506
1507 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1508
1509 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1510 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1511
1512 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1513
1514 * xdisp.c (message2, message2_nolog): Remove functions.
1515 (message3, message3_nolog): Extract nbytes and multibyteness directly
1516 from the string. Change all callers.
1517 (message3_nolog): Don't set message_enable_multibyte since set_message
1518 will reset it anyway.
1519 (message1, message1_nolog): Use message3.
1520 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1521 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1522 (set_message): Drop all but the second arg, which has to be a string.
1523 (set_message_1): Simplify now that we know that a1 is NULL and the
1524 second arg is a string.
1525 * frame.h (struct frame): Remove `message_buf' field.
1526 Use glyphs_initialized_p instead.
1527 (FRAME_MESSAGE_BUF): Remove macro.
1528 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1529 * lisp.h (message2, message2_nolog): Remove declarations.
1530 (message3, message3_nolog): Update declarations.
1531 * keyboard.c (read_char_minibuf_menu_text)
1532 (read_char_minibuf_menu_width): Remove vars.
1533 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1534 to correctly handle multibyte strings.
1535 * frame.c (delete_frame): Don't free message_buf any more.
1536 * editfns.c (message_text, message_length): Remove vars.
1537 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1538 * fileio.c (auto_save_error): Use message3 instead of message2.
1539 * dispnew.c (adjust_frame_message_buffer): Remove function.
1540
1541 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1542
1543 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1544 real estate used for the tool bar and the menu bar.
1545
1546 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1547
1548 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1549 hidden buffer is prepared to modification (Bug#13164).
1550
1551 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1552
1553 * window.h (struct window): Change window_end_valid member from
1554 Lisp_Object to a bitfield. Adjust comments.
1555 (wset_window_end_valid): Remove.
1556 * window.c (adjust_window_count): Clear window_end_valid.
1557 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1558 (Fwindow_line_height, set_window_buffer, Frecenter)
1559 (Fsplit_window_internal, Fdelete_other_windows_internal)
1560 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1561 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1562 * xdisp.c (check_window_end, reconsider_clip_changes)
1563 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1564 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1565 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1566
1567 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1568
1569 * xdisp.c (mark_window_display_accurate): Simplify the loop
1570 assuming that the only one of vchild, hchild or buffer window
1571 slots is non-nil. Call mark_window_display_accurate_1 for
1572 the leaf windows only.
1573 (mark_window_display_accurate_1): Always assume leaf window.
1574 Adjust comment.
1575
1576 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1577
1578 * emacs.c (Qkill_emacs_hook): Now static.
1579
1580 * fileio.c (Finsert_file_contents): Simplify.
1581 Remove unnecessary assignments and tests.
1582
1583 2013-01-21 Eli Zaretskii <eliz@gnu.org>
1584
1585 * w32.c (acl_set_file): Don't test for errors unless
1586 set_file_security returns FALSE. Avoids spurious errors when
1587 saving files.
1588
1589 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1590
1591 * fileio.c (Finsert_file_contents): Revert code introduced at
1592 2013-01-18 in favor of the simpler and generally better fix.
1593 Save stack space by removing 'buffer' and reusing 'read_buf'
1594 where appropriate.
1595
1596 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1597
1598 * lisp.h (eabs): Define unconditionally (Bug#13419).
1599 The old "#if !defined (eabs)" was an unnecessary revenant of back
1600 when this macro was called "abs". Document 'eabs' better.
1601
1602 2013-01-19 Glenn Morris <rgm@gnu.org>
1603
1604 * fns.c (Frandom): Doc fix.
1605
1606 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1607
1608 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1609 segfault when there are lots of overlays.
1610
1611 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1612 when there are lots of overlays.
1613 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1614 for the details and a way to reproduce.
1615
1616 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1617
1618 * fileio.c: Use O_APPEND to append.
1619 This corresponds better to the natural interpretation of "append",
1620 and avoids the need to open the output file twice, or to invoke
1621 lseek when APPEND is neither nil nor a number.
1622 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1623 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1624 file possibly twice, and lseeking to its end; this avoids the
1625 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1626 at the same time: the combination is never needed and apparently
1627 it doesn't work with DOS_NT.
1628
1629 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1630 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1631
1632 Allow floating-point file offsets.
1633 Problem reported by Vitalie Spinu in
1634 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1635 * fileio.c (emacs_lseek): Remove.
1636 (file_offset): New function.
1637 (Finsert_file_contents, Fwrite_region): Use it.
1638
1639 2013-01-19 Chong Yidong <cyd@gnu.org>
1640
1641 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1642 aborting on Fsignal (Bug#13289).
1643
1644 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1645
1646 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1647 set_file_security as failure due to insufficient privileges.
1648 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1649 (fstat): Return owner and group like 'stat' and 'lstat' do.
1650
1651 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1652
1653 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1654 The bug was observed on Ubuntu operating inside a virtual machine,
1655 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1656 The workaround introduces a race condition on non-buggy hosts,
1657 but it's an unlikely race and anyway there's a nearly identical
1658 nearby race that can't be fixed.
1659 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1660 New static vars.
1661 (Fwrite_region): Test for file system time stamp bug.
1662 (init_fileio): New function.
1663 * lisp.h (init_fileio): Declare it.
1664 * emacs.c (main): Call it.
1665
1666 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1667 and make it more consistent with other stat-failure diagnostics.
1668
1669 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1670
1671 Fix crash when inserting data from non-regular files.
1672 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1673 for the error description produced by valgrind.
1674 * fileio.c (read_non_regular): Rename to read_contents.
1675 Free Lisp_Save_Value object used to pass parameters.
1676 (read_non_regular_quit): Rename to read_contents_quit.
1677 (Finsert_file_contents): Redesign internal file reading loop to adjust
1678 gap and end positions after each read and so help make_gap to work
1679 properly. Do not signal an I/O error too early and so do not leave
1680 not yet decoded characters in a buffer, which was the reason of
1681 redisplay crash. Use list2 to build return value. Adjust comments.
1682
1683 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1684
1685 Close a race when statting and reading files (Bug#13149).
1686 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1687 This avoids a race if the file is renamed between stat and open.
1688 This race is not the problem originally noted in Bug#13149;
1689 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1690
1691 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1692
1693 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1694 objects, related functions and macros.
1695 (make_save_value): Adjust prototype.
1696 (make_save_pointer): New prototype.
1697 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1698 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1699 * alloc.c (format_save_value): Rename to make_save_value.
1700 (make_save_pointer): New function.
1701 (record_xmalloc): Use make_save_pointer.
1702 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1703 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1704 Change users of make_save_value to make_save_pointer.
1705 Likewise for format_save_value and make_save_value.
1706
1707 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1710 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1711 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1712 debugging stubs.
1713
1714 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1715
1716 * alloc.c (free_save_value): Now static.
1717
1718 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1719
1720 * keymap.c (map_keymap_internal): Use format_save_value.
1721 (map_keymap_char_table_item): Adjust accordingly.
1722 * fileio.c (non_regular_fd, non_regular_inserted)
1723 (non_regular_nbytes): Remove.
1724 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1725 Use format_save_value to pass parameters to read_non_regular.
1726 (read_non_regular): Use XSAVE_ macros to extract parameters.
1727 Adjust comment.
1728 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1729 format_save_value.
1730 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1731
1732 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1733
1734 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1735 extraction from any Lisp_Save_Value slot. Add type checking.
1736 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1737 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1738 * xselect.c: All users changed.
1739
1740 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1741
1742 Some convenient bits to deal with Lisp_Save_Values.
1743 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1744 (allocate_misc): Remove prototype.
1745 (format_save_value): New prototype.
1746 * alloc.c (allocate_misc): Revert back to static.
1747 (format_save_value): New function to build Lisp_Save_Value
1748 object with the specified internal structure.
1749 (make_save_value): Reimplement using format_save_value.
1750 * editfns.c (save_excursion_save): Use format_save_value.
1751 (save_excursion_restore): Use XSAVE_OBJECT.
1752
1753 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1754
1755 Avoid needless casts with XSAVE_POINTER.
1756 * alloc.c (mark_object) [GC_MARK_STACK]:
1757 * dired.c (directory_files_internal_unwind):
1758 * fileio.c (do_auto_save_unwind):
1759 * gtkutil.c (pop_down_dialog):
1760 * keymap.c (map_keymap_char_table_item):
1761 * lread.c (load_unwind):
1762 * nsmenu.m (pop_down_menu):
1763 * print.c (print_object) [GC_MARK_STACK]:
1764 * xfns.c (clean_up_file_dialog):
1765 * xmenu.c (cleanup_widget_value_tree):
1766 Omit casts between XSAVE_POINTER and a pointer type.
1767
1768 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1769
1770 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1771 * eval.c (eval_sub): Protect `form' from being GCed before its
1772 car and cdr becomes protected with the backtrace entry.
1773
1774 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1775
1776 Make Lisp_Save_Value more versatile storage for up to four objects.
1777 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1778 (struct Lisp_Save_Value): New layout. Adjust comments.
1779 (XSAVE_POINTER): New macro.
1780 (XSAVE_INTEGER): Likewise.
1781 (allocate_misc): Add prototype.
1782 (free_misc): Likewise.
1783 * alloc.c (allocate_misc): Now global.
1784 (free_misc): Likewise. Adjust comment.
1785 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1786 (free_save_value): Likewise.
1787 (mark_object): Likewise.
1788 * editfns.c (save_excursion_save): Pack everything within
1789 Lisp_Save_Value and so avoid xmalloc.
1790 (save_excursion_restore): Adjust to match new layout. Use free_misc
1791 because we do not allocate extra memory any more. Add eassert.
1792 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1793 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1794 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1795 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1796 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1797
1798 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1799
1800 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1801 (nsfont_draw): Remove disabling of LCD smoothing.
1802 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1803 Bug#11484 with LCD smoothing on.
1804
1805 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
1806
1807 Fix SIGDANGER handlers, for AIX (Bug#13408).
1808 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1809 Move handlers here from emacs.c; they were out of place.
1810
1811 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1812
1813 * xterm.c (syms_of_xterm): Adjust documentation for
1814 scroll-bar-adjust-thumb-portion.
1815
1816 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
1817
1818 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1819 determine whether scroll bar thumb size should be adjusted or
1820 not. Use variable for MOTIF.
1821
1822 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1823 GTK.
1824
1825 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1826
1827 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1828 event is generated.
1829 (doCommandBySelector:): Set processingCompose to NO.
1830
1831 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1832 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1833 (nsfont_list_family): Add block/unblock_input calls.
1834 (nsfont_open): Move block_input earlier. Add unblock_input before early
1835 return.
1836 (nsfont_draw): Add block/unblock_input calls.
1837
1838 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1839
1840 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1841 for old_charpos and old_bytepos.
1842
1843 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1844
1845 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1846 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1847 Clear tzvalbuf_in_environ if this workaround is in effect.
1848 Problem and fix reported by Kazuhiro Ito.
1849
1850 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1851
1852 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1853 Fix ambiguous doc string cross-reference(s).
1854
1855 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1856 doc string cross-reference(s).
1857
1858 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1859 string cross-reference(s).
1860
1861 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1862
1863 Avoid unnecessary byte position calculation for the gap movement.
1864 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1865 anyway, all of them should use move_gap_both instead.
1866 * lisp.h (move_gap): Remove prototype.
1867 * insdel.c (move_gap): Remove.
1868 (move_gap_both): Add eassert.
1869 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1870 * xml.c (parse_region): Likewise.
1871
1872 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1873
1874 emacsclient -t should not suspend Emacs server (Bug#13387)
1875 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1876 New functions.
1877 * term.c (init_tty): Use them instead of rolling our own code.
1878 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1879 switches from 'signal' to 'pthread_sigmask', which is safer in
1880 multithreaded applications.
1881 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1882 which has already arranged for that.
1883 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1884 This is the main part of the bug fix.
1885
1886 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
1887
1888 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1889 x_last_font_name (Bug#13403).
1890
1891 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1892
1893 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1894 the type of per-buffer values where appropriate.
1895 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1896 predicate, which is how it's really used now. Adjust comment.
1897 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1898 * buffer.c (buffer_slot_type_mismatch): Remove.
1899 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1900 predicate. Adjust comment.
1901 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1902 fill-column, left-margin, tab-width, buffer-saved-size,
1903 left-margin-width, right-margin-width, left-fringe-width,
1904 right-fringe-width, scroll-bar-width and buffer-display-count.
1905 Use Qstringp for default-directory, buffer-file-name,
1906 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1907 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1908 line-spacing.
1909 * data.c (store_symval_forwarding): Adjust to call the predicate.
1910
1911 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
1912
1913 * w32.c (get_name_and_id, acl_set_file):
1914 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1915
1916 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1917
1918 * lisp.h (make_gap_1): New prototype.
1919 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1920 gap size values.
1921 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1922 naming convention.
1923 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
1924 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
1925 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1926 (make_gap_1): New function to adjust the gap of any buffer.
1927 * coding.c (coding_alloc_by_making_gap): Use it.
1928 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1929 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1930
1931 2013-01-08 Juri Linkov <juri@jurta.org>
1932
1933 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1934 of (supports :underline (:style wave)). (Bug#13000)
1935
1936 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1937
1938 * undo.c (Fprimitive_undo): Move to simple.el.
1939 (syms_of_undo): Remove declarations for Sprimitive_undo.
1940
1941 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1942
1943 * keyboard.c (echo_add_key): Rename from echo_add_char.
1944
1945 2013-01-06 Chong Yidong <cyd@gnu.org>
1946
1947 * keyboard.c (echo_add_char): New function, factored out from
1948 echo_char. Don't add a space if the previous echo string was
1949 empty (Bug#13255).
1950 (echo_char): Use it.
1951 (read_key_sequence): When echoing mock input, ensure that the
1952 trailing dash is properly added.
1953
1954 2013-01-05 Eli Zaretskii <eliz@gnu.org>
1955
1956 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1957 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
1958 digits for buffer positions, before misalignment starts.
1959 Display "0" for integer "object" field.
1960 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1961 Display the newline glyph more unambiguously.
1962
1963 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1964
1965 * nsterm.m (ns_draw_underwave):
1966 * w32term.c (w32_draw_underwave):
1967 * xterm.c (x_draw_underwave): Make underwave look more triangular
1968 and also degrade gracefully for small fonts. (Bug#13000)
1969
1970 * nsterm.m (ns_draw_text_decoration):
1971 * w32term.c (x_draw_glyph_string):
1972 * xterm.c (x_draw_glyph_string): Don't use previous underline
1973 thickness and position if previous underline type is underwave.
1974
1975 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1976
1977 * fileio.c (Ffile_acl): Undocument return format.
1978
1979 2013-01-02 Glenn Morris <rgm@gnu.org>
1980
1981 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1982
1983 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1984
1985 Simplify via eabs.
1986 * dired.c (file_name_completion):
1987 * doc.c (get_doc_string):
1988 * floatfns.c (round2):
1989 * font.c (font_score, font_delete_unmatched):
1990 * fringe.c (compute_fringe_widths):
1991 * lread.c (read_list):
1992 * minibuf.c (Ftry_completion):
1993 * term.c (tty_ins_del_lines):
1994 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1995 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1996
1997 2012-12-31 Eli Zaretskii <eliz@gnu.org>
1998
1999 * w32.c (unsetenv): Set up the string passed to _putenv
2000 correctly.
2001 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2002 for the bug this caused.
2003
2004 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 * coding.c (Qmac): Now static.
2007
2008 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2009
2010 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2011 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2012 handlebox_widget. Set toolbar_in_hbox to false/true, set
2013 toolbar_is_packed to true.
2014 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2015 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2016 Show all on TOOLBAR_TOP_WIDGET.
2017 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2018 by TOOLBAR_TOP_WIDGET.
2019 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2020 Check toolbar_is_packed.
2021 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2022 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2023 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2024 false.
2025 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2026 (xg_update_menubar): Update title only if
2027 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2028 (xg_update_submenu): Skip tearoff only if
2029 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2030 (xg_initialize): Initialize xg_detached_menus only if
2031 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2032
2033 * xterm.h (struct x_output): Surround handlebox_widget with
2034 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2035 toolbar_in_hbox is bool.
2036
2037 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2038
2039 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2040 (LIBS_GNUSTEP): Define.
2041 (LIBES): Add $(LIBS_GNUSTEP).
2042 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2043
2044 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2045
2046 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2047 continuation glyph on a TTY with an indication of an empty line.
2048 (Bug#13277)
2049
2050 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2051
2052 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2053 file's SELinux context or ACLs successfully set, nil otherwise.
2054 (Bug#13298)
2055 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2056
2057 * w32proc.c (reader_thread): Avoid passing NULL handles to
2058 SetEvent and WaitForSingleObject.
2059
2060 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2061
2062 Port EXTERNALLY_VISIBLE to Clang 3.2.
2063 * conf_post.h (__has_attribute): New macro.
2064 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2065
2066 2012-12-27 Glenn Morris <rgm@gnu.org>
2067
2068 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2069 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2070
2071 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2072
2073 * fileio.c (file_name_as_directory, directory_file_name):
2074 Accept an additional argument MULTIBYTE to indicate whether the input C
2075 came from a multibyte or a unibyte Lisp string; all callers
2076 adjusted. Don't assume the input string is always multibyte.
2077 (Bug#13262)
2078 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2079 don't ENCODE_FILE them, and return a unibyte string if the input
2080 was unibyte.
2081 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2082 don't assume the input strings will always be multibyte. If the
2083 input strings are multibyte, decode strings obtained from C
2084 library functions.
2085
2086 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2087
2088 * lisp.h (toplevel): Add two notices to the comment about
2089 defining a new Lisp data type.
2090 * print.c (print_object): If Lisp_Save_Value object's pointer
2091 is the address of a memory area containing Lisp_Objects, try
2092 to print them.
2093 * alloc.c (valid_lisp_object_p): Adjust comment.
2094
2095 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2096
2097 * keyboard.c (record_asynch_buffer_change): Initialize an event
2098 only if it's really needed.
2099 * frame.h (enum output_method): Remove output_mac member since
2100 it's a leftover from the deleted code.
2101 * frame.c (Fframep): Adjust user here ...
2102 * terminal.c (Fterminal_live_p): ... and here.
2103 * coding.c (Qmac): Now here because it's only used to denote
2104 end-of-line encoding type.
2105 (syms_of_coding): DEFSYM it.
2106 * frame.h (Qmac): Remove duplicated declaration.
2107
2108 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2109
2110 * window.c (select_window_1): Now static, since it's used only here.
2111
2112 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2113
2114 * window.c (window_body_cols): Subtract display margins from the
2115 window body width on TTYs as well. See
2116 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2117 for the original report.
2118
2119 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 * xdisp.c (redisplay_window): Remove inner local variable
2122 because the outer shadowed one has the same meaning.
2123 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2124 set but never used.
2125 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2126 (xg_create_tool_bar): Adjust users.
2127
2128 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2129
2130 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2131 * buffer.c (Fget_buffer_create): Use it to set compact field of
2132 struct buffer_text to avoid accessing an uninitialized value
2133 when compact_buffer is called for the first time.
2134 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2135 (Fset_buffer_modified_p): Use buffer_window_count to check
2136 whether the buffer is displayed in some window.
2137 * xdisp.c (message_dolog): Likewise.
2138
2139 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2140
2141 * w32.c (acl_set_file): If setting the file security descriptor
2142 fails, and the new DACL is identical to the existing one, silently
2143 return success. This fixes problems for users backing up their
2144 own files without having the necessary privileges for setting
2145 security descriptors.
2146
2147 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2148 values.
2149 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2150 after WaitForSingleObject returns normally. This expedites reader
2151 thread shutdown when delete_child triggers it.
2152 (reap_subprocess): More accurate commentary for why we call
2153 delete_child only when cp->fd is negative.
2154
2155 * w32.c (sys_close): Do not call delete_child on a subprocess
2156 whose handle is not yet closed. Instead, set its file descriptor
2157 to a negative value, so that reap_subprocess will call
2158 delete_child on that subprocess when its SIGCHLD arrives.
2159 This avoids closing handles used for communications between sys_select
2160 and reader_thread, which doesn't give sys_select a chance to
2161 notice that the process exited and invoke the SIGCHLD handler for
2162 it.
2163
2164 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2165
2166 * nsfns.m (Fns_do_applescript): Run event loop until script has
2167 been executed (Bug#12969).
2168 (ns_run_ascript): Chech as_script for nil, set to nil after
2169 executing script.
2170
2171 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2172
2173 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2174
2175 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2176
2177 * w32term.c (w32fullscreen_hook): New function.
2178 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2179
2180 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2181
2182 * fileio.c (Finsert_file_contents): Doc fix.
2183
2184 * w32proc.c (new_child, delete_child, find_child_pid): For a
2185 subprocess, consider its slot being in use as long as its process
2186 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2187 slot when a new process is started immediately after killing
2188 another one, without waiting enough time for the first process to
2189 be reaped and resources allocated for it be orderly freed.
2190 (Bug#13086)
2191 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2192
2193 2012-12-21 Chong Yidong <cyd@gnu.org>
2194
2195 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2196
2197 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2198
2199 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2200
2201 * w32.c (get_name_and_id): Always pass NULL as the first argument
2202 of lookup_account_sid. Avoids crashes with UNC file names that
2203 refer to DFS domains, not to specific machine names. (Bug#12621)
2204 Remove now unused argument FNAME; all callers changed.
2205 (get_file_owner_and_group): Remove now unused argument FNAME; all
2206 callers changed.
2207
2208 2012-12-21 Chong Yidong <cyd@gnu.org>
2209
2210 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2211 error for invalid chars, don't check for a nil return value.
2212
2213 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2214
2215 Avoid calls to CHAR_TO_BYTE if byte position is known.
2216 * editfns.c (make_buffer_string_both): Use move_gap_both.
2217 (Fbuffer_string): Use make_buffer_string_both.
2218 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2219 Adjust comment.
2220 (buf_bytepos_to_charpos): Likewise.
2221 (charpos_to_bytepos): Remove.
2222 * fileio.c (Finsert_file_contents): Use move_gap_both.
2223 * search.c (Freplace_match): Likewise.
2224 * process.c (process_send_region): Likewise. Use convenient
2225 names for byte positions.
2226 * lisp.h (charpos_to_bytepos): Remove prototype.
2227 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2228 * insdel.c (move_gap): Likewise.
2229
2230 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2231
2232 * xdisp.c (redisplay_internal): Remove now-unused local.
2233
2234 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2235
2236 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2237 (redisplay_internal): Don't bother selecting the frame to get the
2238 proper value of frame-local variables (bug#13225).
2239
2240 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2241
2242 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2243 Rename 4th argument since it may be buffer or string. Adjust comment.
2244 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2245
2246 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2247
2248 * coding.c (Fdetect_coding_region): Do not check start and end with
2249 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2250 (code_convert_region): Likewise.
2251
2252 2012-12-18 Eli Zaretskii <eliz@gnu.org>
2253
2254 * w32.c (acl_get_file, acl_set_file): Run the file name through
2255 map_w32_filename, and resolve any symlinks in the file name, like
2256 Posix platforms do.
2257 (acl_set_file): Call revert_to_self, if any privileges were
2258 enabled.
2259
2260 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
2261
2262 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2263 ($(BLD)/w32.$(O)): Update dependencies.
2264
2265 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2266
2267 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2268 propagate redisplay's scrolling (if any) to the right window.
2269 (redisplay_internal): Use ensure_selected_frame.
2270 (display_mode_lines): Complete last fix.
2271 * window.c (select_window_1): New func, extracted from select_window.
2272 (select_window): Use it.
2273 * window.h (select_window_1): Declare.
2274
2275 2012-12-17 Eli Zaretskii <eliz@gnu.org>
2276
2277 Emulate Posix ACL APIs on MS-Windows.
2278 * w32.c: Include sddl.h and sys/acl.h.
2279 (SDDL_REVISION_1): Define if not already defined.
2280 (g_b_init_get_security_descriptor_dacl)
2281 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2282 (g_b_init_is_valid_security_descriptor)
2283 (g_b_init_set_file_security): New static flags.
2284 (globals_of_w32): Initialize them to zero.
2285 (SetFileSecurity_Name): New string constant.
2286 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2287 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2288 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2289 (IsValidSecurityDescriptor_Proc): New typedefs.
2290 (get_file_security, get_security_descriptor_owner)
2291 (get_security_descriptor_group): Set errno to ENOTSUP.
2292 (set_file_security, get_security_descriptor_dacl)
2293 (is_valid_security_descriptor, convert_sd_to_sddl)
2294 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2295 (acl_free, acl_get_file, acl_set_file): New functions.
2296
2297 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2298
2299 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2300
2301 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2302 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2303 for some of that bug's symptoms can now cause Emacs to abort.
2304 Remove the workaround.
2305 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2306 The bug that caused SIGCHLD to get lost has been fixed, and the
2307 workaround for it can now cause Emacs to abort.
2308
2309 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2310
2311 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2312 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2313 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2314
2315 2012-12-16 Romain Francoise <romain@orebokech.com>
2316
2317 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2318 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2319 and copy ACL entries of file in addition to SELinux context if set.
2320 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2321
2322 * Makefile.in (LIBACL_LIBS): New macro.
2323 (LIBES): Use it.
2324
2325 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2326
2327 * fileio.c (internal_delete_file): Use bool for boolean.
2328
2329 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2330
2331 Fix bug #13079 on MS-Windows with temp files not being deleted.
2332 * w32.h (_child_process): New members input_file and
2333 pending_deletion.
2334 (register_child): First argument is now pid_t.
2335 (record_infile, record_pending_deletion): New prototypes.
2336
2337 * w32proc.c (new_child): Initialize input_file and
2338 pending_deletion members of the child.
2339 (delete_child): Delete the child's temporary input file, if any,
2340 that is pending deletion.
2341 (register_child): First argument is now pid_t.
2342 (record_infile, record_pending_deletion): New functions.
2343 (reap_subprocess): Fix a typo in DebPrint string.
2344 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2345
2346 * fileio.c (internal_delete_file): Return an int again: non-zero
2347 if delete-file succeeds, zero otherwise.
2348
2349 * lisp.h (internal_delete_file): Adjust prototype.
2350
2351 * callproc.c (Fcall_process): Don't overwrite infile with result
2352 of DECODE_FILE.
2353 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2354 asynchronous subprocess, record the name of the input file name,
2355 if any.
2356 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2357 delete the file, record it as pending deletion when the subprocess
2358 exits.
2359
2360 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2361
2362 * editfns.c [HAVE_PWD_H]: Include grp.h.
2363
2364 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2365
2366 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 Fix permissions bugs with setgid directories etc. (Bug#13125)
2369 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2370 to mark it as a placeholder. The old value was often wrong.
2371 The only user of this attribute has been changed to use
2372 file-ownership-preserved-p instead, with its new group arg.
2373 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2374
2375 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2376
2377 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2378 Keep selected_window and selected_frame in sync.
2379
2380 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2381
2382 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2383 try to get accurate owner and group information from NT file
2384 security APIs. This is to make most callers of 'stat' and
2385 'lstat', which don't need that information, much faster.
2386
2387 * dired.c (Ffile_attributes) [WINDOWSNT]:
2388 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2389 owner and group information from 'lstat'.
2390
2391 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2392
2393 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2394 as that confuses set-auto-coding, so insist on the head-read
2395 returning the full 1024 bytes. Let lseek compute the tail offset;
2396 less work for us. Do not ignore I/O errors when reading the tail.
2397
2398 * xdisp.c: Minor style fixes.
2399 (init_iterator): Hoist assignment out of if-expression.
2400 (markpos_of_region): Callers now test for sign, not for -1.
2401
2402 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2403
2404 Minor redisplay optimization when the region length is zero.
2405 * xdisp.c (markpos_of_region): New function.
2406 (init_iterator): Do not highlight the region of zero length.
2407 (redisplay_window): Check whether the region is of non-zero length.
2408 (try_cursor_movement): Allow if the region length is zero.
2409 (try_window_reusing_current_matrix, try_window_id): Likewise.
2410
2411 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2412
2413 * search.c (search_buffer): Check the inverse translations of each
2414 character in pattern when the buffer being searched is unibyte.
2415 (Bug#13084)
2416
2417 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2418
2419 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2420 files, fixing a regression from 24.2.
2421 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2422
2423 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2424
2425 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2426 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2427 Remove unnecessary S_ISLNK test, as (contra the comments) this
2428 function can't copy symlinks. Improve quality of error message
2429 when attempting to copy files that are neither regular files nor
2430 directories.
2431
2432 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2433
2434 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2435 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2436 * window.c (Frecenter):
2437 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2438 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2439
2440 2012-12-12 Daniel Colascione <dancol@dancol.org>
2441
2442 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2443 the dumped Emacs is not a sparse file, greatly improving Cygwin
2444 "make bootstrap" performance.
2445
2446 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2447
2448 * inotify.c (inotify_callback): Generate an Emacs event for every
2449 incoming inotify event.
2450
2451 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2452
2453 * xdisp.c (handle_face_prop): Fix logic of computing
2454 it->start_of_box_run_p.
2455 (append_space_for_newline): If the glyph row is R2L, reset the
2456 iterator's end_of_box_run_p flag before prepending the space glyph.
2457 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2458 iterator's start_of_box_run_p flag before prepending the stretch.
2459 (append_glyph, produce_image_glyph, append_composite_glyph)
2460 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2461 left_box_line_p and right_box_line_p flags of the glyph for R2L
2462 glyph rows. (Bug#13011)
2463
2464 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2465
2466 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2467 if changed buffer is not shown in a window.
2468 * insdel.c (prepare_to_modify_buffer): Likewise.
2469 * window.c (replace_buffer_in_windows_safely): Do nothing
2470 if buffer is not shown in a window.
2471 (Fforce_window_update): Likewise if string or buffer argument
2472 is passed.
2473
2474 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2475
2476 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2477 encoded_file_name, which is what it is.
2478
2479 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2480
2481 Consistently use marker_position and marker_byte_position.
2482 * fringe.c (Ffringe_bitmaps_at_pos):
2483 * indent.c (Fvertical_motion):
2484 * insdel.c (prepare_to_modify_buffer):
2485 * keyboard.c (make_lispy_position):
2486 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2487 (window_scroll_pixel_based, displayed_window_lines)
2488 (Fset_window_configuration):
2489 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2490 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2491 Replace direct access to marker fields with calls
2492 to marker_position and/or marker_byte_position.
2493
2494 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2495
2496 * makefile.w32-in (SIG2STR_H): New macro.
2497 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2498 ($(BLD)/w32notify.$(O)): Update dependencies.
2499
2500 2012-12-10 Daniel Colascione <dancol@dancol.org>
2501
2502 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2503 Windows file notification functionality unless WINDOWSNT.
2504
2505 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2506 declarations.
2507
2508 * w32fns.c (cache_system_info): Initialize the global hinst
2509 variable here so various initialization calls DTRT.
2510
2511 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2512 (hinst): Remove unneeded extern declaration.
2513 (_start): Remove initialization of above variables; remove
2514 initialization of hinst, as cache_system_info now does that.
2515
2516 * emacs.c (main): Call cache_system_info early in startup; we
2517 previously weren't calling it in Cygwin builds.
2518
2519 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2520 Teach the autoconf build system how to compile a Windows resource file
2521 and link it to Emacs.
2522
2523 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2524
2525 Per-buffer window counters.
2526 * buffer.h (struct buffer): New member window_count.
2527 (buffer_window_count): New function.
2528 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2529 Initialize window_count.
2530 (Fkill_buffer): Verify window_count for the buffer being killed.
2531 (modify_overlay): Do not force redisplay if buffer is not shown
2532 in any window.
2533 (init_buffer_once): Initialize window_count for buffer_defaults
2534 and buffer_local_symbols.
2535 * window.h (buffer_shared): Remove declaration.
2536 (wset_buffer): Convert from inline ...
2537 * window.c (wset_buffer): ... to an ordinary function.
2538 (adjust_window_count): New function.
2539 (make_parent_window): Use it.
2540 * xdisp.c (buffer_shared): Remove.
2541 (redisplay_internal, redisplay_window): Adjust users.
2542 (buffer_shared_and_changed): Use per-buffer window counter.
2543
2544 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2545
2546 Support for filesystem notifications on MS-Windows.
2547 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2548 and this is a TTY frame, signal the caller that keyboard input is
2549 available.
2550
2551 * w32xfns.c (drain_message_queue): Now returns an int: an
2552 indication whether any WM_EMACS_FILENOTIFY messages were found in
2553 the queue.
2554
2555 * w32inevt.c (handle_file_notifications): New function.
2556 (w32_console_read_socket): Call it to process file notifications.
2557
2558 * w32console.c (initialize_w32_display): Record the main thread ID
2559 in dwMainThreadId.
2560
2561 * deps.mk (inotify.o): New dependency list.
2562
2563 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2564
2565 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2566 (WM_EMACS_END): Bump value by 1.
2567 (notification_buffer_in_use, file_notifications)
2568 (notifications_size, notifications_desc): Declare.
2569 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2570 Add prototypes.
2571
2572 * w32term.c (lispy_file_action, queue_notifications): New functions.
2573 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2574 <Qrenamed_to>: New symbols.
2575 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2576
2577 * w32notify.c: New file, implements file event notifications for
2578 MS-Windows.
2579
2580 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2581 by posting it to the w32_read_socket queue.
2582
2583 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2584
2585 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2586 (GLOBAL_SOURCES): Add w32notify.c
2587 ($(BLD)/w32notify.$(O)): New set of dependencies.
2588
2589 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2590
2591 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2592 Handle FILE_NOTIFY_EVENT.
2593 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2594 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2595 w32notify-handle-event by default.
2596
2597 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2598 syms_of_w32notify.
2599
2600 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2601
2602 Support for filesystem notifications on GNU/Linux via inotify.
2603 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2604
2605 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2606
2607 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2608 (syms_of_keyboard): DEFSYM it.
2609 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2610 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2611 Qfile_inotify events.
2612 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2613 special-event-map to inotify-handle-event.
2614
2615 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2616
2617 * Makefile.in (base_obj): Add inotify.o.
2618
2619 * inotify.c: New file.
2620
2621 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
2622
2623 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2624
2625 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
2626
2627 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2628 DWORD_PTR, for compatibility with 64-bit builds.
2629
2630 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2631 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2632 (system_process_attributes): Use SIZE_T rather than DWORD, for
2633 compatibility with 64-bit builds.
2634
2635 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
2636
2637 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2638
2639 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2640
2641 * indent.c (Fvertical_motion): If a display string will be
2642 displayed on the left or the right margin, don't consider it as a
2643 factor in cursor positioning. (Bug#13108)
2644
2645 2012-12-10 Martin Rudalics <rudalics@gmx.at>
2646
2647 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2648
2649 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2650
2651 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2652 for string length.
2653
2654 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2655
2656 * w32.c (unsetenv): Return 0 if the input string is too long.
2657
2658 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2659
2660 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2661 * alloc.c (xputenv): New function.
2662 * dbusbind.c (Fdbus_init_bus):
2663 * emacs.c (main):
2664 * xterm.c (x_term_init):
2665 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2666 * editfns.c (initial_tz): Move static var decl up.
2667 (tzvalbuf_in_environ): New static var.
2668 (init_editfns): Initialize these two static vars.
2669 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2670 Save old TZ value on stack, if it's small.
2671 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2672 instead, use xputenv+unsetenv to set and restore TZ.
2673 (environbuf): Remove static var. All uses removed.
2674 (Fset_time_zone_rule): Do not save TZ and environ;
2675 no longer needed here.
2676 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2677 Move to inside set_time_zone_rule; they don't need file scope any more.
2678 (set_time_zone_rule): Maintain the TZ=value string separately.
2679 (syms_of_editfns): Don't initialize initial_tz;
2680 init_editfns now does it.
2681 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2682 * lisp.h (xputenv): New decl.
2683
2684 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2685
2686 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2687
2688 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2689
2690 * w32.c (unsetenv, sys_putenv): New functions.
2691
2692 2012-12-08 Chong Yidong <cyd@gnu.org>
2693
2694 * editfns.c (Finsert_char): Make the error message more
2695 informative (Bug#12992).
2696
2697 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2698
2699 Simplify get_lim_data.
2700 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2701 Remove USG and vlimit methods; no longer used these days.
2702 Add #error catchall just in case.
2703
2704 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2705 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2706 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2707 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2708 (deleted_pid_list, Fdelete_process, create_process)
2709 (record_child_status_change, handle_child_signal, deliver_child_signal)
2710 (init_process_emacs, syms_of_process):
2711 Assume SIGCHLD is defined.
2712 (parse_signal): Remove. All uses removed.
2713 (abbr_to_signal): New static function.
2714 (Fsignal_process): Use it to convert signal names to ints.
2715 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2716 kill (getpgrp (), ...).
2717 (emacs_sigaction_init): Assume SIGCHLD is defined.
2718 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2719 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2720 * syssignal.h (EMACS_KILLPG): Remove.
2721 All uses replaced by 'kill' with a negative pid.
2722 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2723 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2724
2725 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2726
2727 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2728 This will cause a production Emacs to dump core instead of
2729 infinite-looping.
2730
2731 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2732
2733 * frame.c (make_frame): Do not set window's buffer to t.
2734 * window.c (Fsplit_window_internal): Likewise. Previously it was
2735 used to indicate that the window is being set up. Now we use
2736 set_window_buffer for all new windows, so the condition in ...
2737 (Fset_window_buffer): ... is always true and can be removed.
2738
2739 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2740
2741 Convenient macro to check whether the buffer is hidden.
2742 * buffer.h (BUFFER_HIDDEN_P): New macro.
2743 * frame.c (make_frame): Use it. Adjust comment.
2744 * buffer.c (candidate_buffer): New function.
2745 (Fother_buffer, other_buffer_safely): Use it.
2746
2747 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2748
2749 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2750 if the child process is still running. Instead, exit the wait
2751 loop and return zero. (Bug#13086)
2752
2753 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2754
2755 * frame.h (x_char_width, x_char_height): Remove prototypes.
2756 * w32term.h (x_char_width, x_char_height): Likewise.
2757 * xfns.c (x_char_width, x_char_height): Remove.
2758 * w32fns.c (x_char_width, x_char_height): Likewise.
2759 * nsfns.c (x_char_width, x_char_height): Likewise.
2760 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2761 all window frames.
2762 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2763 * keyboard.c (command_loop_1): Remove prototype.
2764 (command_loop_2, top_level_1): Add static to match prototype.
2765
2766 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2767
2768 Fix a recently-introduced delete-process race condition.
2769 * callproc.c, process.h (record_kill_process):
2770 New function, containing part of the old call_process_kill.
2771 (call_process_kill): Use it.
2772 This does not change call_process_kill's behavior.
2773 * process.c (Fdelete_process): Use record_kill_process to fix a
2774 race condition that could cause Emacs to lose track of a child.
2775
2776 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2777
2778 Avoid code duplication between prev_frame and next_frame.
2779 * frame.c (candidate_frame): New function. Add comment.
2780 (prev_frame, next_frame): Use it. Adjust comment.
2781
2782 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2783
2784 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2785 fails, signal an error instead of continuing with an empty
2786 string. (Bug#13079)
2787 Encode expanded temp file pattern before passing it to mkstemp or
2788 mktemp.
2789
2790 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2791 Encode the file name before passing it to dostounix_filename, in
2792 case it will downcase it (under w32-downcase-file-names).
2793 (Bug#12933)
2794
2795 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2796
2797 Minor call-process cleanups.
2798 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2799 at the same time as other platforms, to simplify analysis.
2800 No need for fd0_volatile since we have synch_process_fd.
2801 Avoid needless emacs_close; arg is always negative.
2802
2803 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2804
2805 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2806 processes.
2807
2808 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2809
2810 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2811 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2812 and mouse_face_hidden members to a bitfields.
2813 * frame.h (struct frame): Remove set-but-not-used space_width member.
2814 (FRAME_SPACE_WIDTH): Remove.
2815 * nsterm.m, w32term.c, xterm.c: Adjust users.
2816 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2817 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2818 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2819 members to a bitfields.
2820
2821 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2822
2823 Don't let call-process be a zombie factory (Bug#12980).
2824 Fixing this bug required some cleanup of the signal-handling code.
2825 As a side effect, this change also fixes a longstanding rare race
2826 condition whereby Emacs could mistakenly kill unrelated processes,
2827 and it fixes a bug where a second C-g does not kill a recalcitrant
2828 synchronous process in GNU/Linux and similar platforms.
2829 The patch should also fix the last vestiges of Bug#9488,
2830 a bug which has mostly been fixed on the trunk by other changes.
2831 * callproc.c, process.h (synch_process_alive, synch_process_death)
2832 (synch_process_termsig, sync_process_retcode):
2833 Remove. All uses removed, to simplify analysis and so that
2834 less consing is done inside critical sections.
2835 * callproc.c (call_process_exited): Remove. All uses replaced
2836 with !synch_process_pid.
2837 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2838 These take the role of what used to be in unwind-protect arg.
2839 All uses changed.
2840 (block_child_signal, unblock_child_signal):
2841 New functions, to avoid races that could kill innocent-victim processes.
2842 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2843 (call_process_kill): Record killed processes as deleted, so that
2844 zombies do not clutter up the system. Do this inside a critical
2845 section, to avoid a race that would allow the clutter.
2846 (call_process_cleanup): Fix code so that the second C-g works again
2847 on common platforms such as GNU/Linux.
2848 (Fcall_process): Create the child process in a critical section,
2849 to fix a race condition. If creating an asynchronous process,
2850 record it as deleted so that zombies do not clutter up the system.
2851 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2852 light of these changes. Omit unnecessary call to emacs_close
2853 before failure, as the unwind-protect code does that.
2854 * callproc.c (call_process_cleanup):
2855 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2856 * process.c (record_deleted_pid): New function, containing
2857 code refactored out of Fdelete_process.
2858 (Fdelete_process): Use it.
2859 (process_status_retrieved): Remove. All callers changed to use
2860 child_status_change.
2861 (record_child_status_change): Remove, folding its contents into ...
2862 (handle_child_signal): ... this signal handler. Now, this
2863 function is purely a handler for SIGCHLD, and is not called after
2864 a synchronous waitpid returns; the synchronous code is moved to
2865 wait_for_termination. There is no need to worry about reaping
2866 more than one child now.
2867 * sysdep.c (get_child_status, child_status_changed): New functions.
2868 (wait_for_termination): Now takes int * status and bool
2869 interruptible arguments, too. Do not record child status change;
2870 that's now the caller's responsibility. All callers changed.
2871 Reimplement in terms of get_child_status.
2872 (wait_for_termination_1, interruptible_wait_for_termination):
2873 Remove. All callers changed to use wait_for_termination.
2874 * syswait.h: Include <stdbool.h>, for bool.
2875 (record_child_status_change, interruptible_wait_for_termination):
2876 Remove decls.
2877 (record_deleted_pid, child_status_changed): New decls.
2878 (wait_for_termination): Adjust to API changes noted above.
2879
2880 * bytecode.c, lisp.h (Qbytecode): Remove.
2881 No longer needed after 2012-11-20 interactive-p changes.
2882
2883 2012-12-03 Eli Zaretskii <eliz@gnu.org>
2884
2885 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2886 the scroll margin, move point outside the margin. (Bug#13055)
2887
2888 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2889
2890 * gtkutil.c (my_log_handler): New function.
2891 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2892
2893 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2894
2895 * lisp.h (modify_region): Rename to...
2896 (modify_region_1): ...new prototype.
2897 * textprop.c (modify_region): Now static. Adjust users.
2898 * insdel.c (modify_region): Rename to...
2899 (modify_region_1): ...new function to work with current buffer.
2900 Adjust comment and users. Use true and false for booleans.
2901
2902 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2903
2904 * alloc.c (free_save_value): New function.
2905 (safe_alloca_unwind): Use it.
2906 * lisp.h (free_save_value): New prototype.
2907 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2908 Add comment.
2909 (save_excursion_restore): Adjust to match saved data structure.
2910 Use free_save_value to offload some work from GC. Drop obsolete
2911 #if 0 code.
2912
2913 2012-12-03 Chong Yidong <cyd@gnu.org>
2914
2915 * fileio.c (Vauto_save_list_file_name): Doc fix.
2916
2917 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
2918
2919 * w32fns.c: Remove prototype of atof.
2920 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2921 builds.
2922 (file_dialog_callback): Make it UINT_PTR.
2923
2924 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2925 with 64-bit builds.
2926
2927 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2928 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2929 defined.
2930
2931 2012-12-03 Glenn Morris <rgm@gnu.org>
2932
2933 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2934
2935 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2936
2937 Fix xpalloc confusion after memory is exhausted.
2938 * alloc.c (xpalloc): Comment fix.
2939 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2940 and signals an error, do not clear charset_table_size, as
2941 charset_table is still valid.
2942 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2943
2944 Use execve to avoid need to munge environ (Bug#13054).
2945 * callproc.c (Fcall_process):
2946 * process.c (create_process):
2947 Don't save and restore environ; no longer needed.
2948 * callproc.c (child_setup):
2949 Use execve, not execvp, to preserve environ.
2950
2951 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2952
2953 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2954
2955 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2956
2957 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2958 display for sliced images (Bug#10500).
2959
2960 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2961
2962 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2963
2964 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2965 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2966
2967 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2968
2969 * xdisp.c (window_outdated): Remove eassert since it hits
2970 some suspicious corner cases (see Bug#13007 and Bug#13012).
2971 (mode_line_update_needed): New function.
2972 (redisplay_internal, redisplay_window): Use it.
2973 (ensure_selected_frame): New function.
2974 (redisplay_internal, unwind_redisplay): Use it.
2975 (redisplay_internal): Move comment about buffer_shared...
2976 (buffer_shared_and_changed): ...near to its real use.
2977
2978 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2979
2980 * callproc.c (Fcall_process): Don't misreport vfork failure.
2981
2982 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2983
2984 * callproc.c (Fcall_process): Fix vfork portability problems.
2985 Do not assume that fd[0], count, filefd, and save_environ survive
2986 vfork. Fix bug whereby wrong errno value could be reported for
2987 pipe failure. Some minor cleanups, too, as follows. Move buf and
2988 bufsize to the context where they're needed. Change new_argv to
2989 be of type char **, as this is more convenient and avoids casts.
2990 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2991 Now local constants, not macros.
2992
2993 2012-11-18 Kenichi Handa <handa@gnu.org>
2994
2995 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2996 for the variable "f".
2997
2998 2012-11-13 Kenichi Handa <handa@gnu.org>
2999
3000 * font.c (font_unparse_xlfd): Exclude special characters from the
3001 generating XLFD name.
3002
3003 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3004
3005 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3006 * dired.c (stat_uname, stat_gname):
3007 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3008
3009 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3010 * dired.c (directory_files_internal, file_name_completion):
3011 Assume EAGAIN and EINTR are defined.
3012
3013 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3014 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3015 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3016 * lread.c (readbyte_from_file): Assume EINTR is defined.
3017 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3018 Assume EIO and EAGAIN are defined.
3019 * unexcoff.c (write_segment): Assume EFAULT is defined.
3020
3021 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3022
3023 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3024 (Bug#11964)
3025
3026 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3027 highlighting on the frame was cleared. Prevents assertion
3028 violations when repeatedly clicking on the "Top" link of the
3029 "bread-crumbs" in Info buffers.
3030
3031 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3032
3033 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3034
3035 2012-11-24 Ken Brown <kbrown@cornell.edu>
3036
3037 * keyboard.c (HAVE_MOUSE):
3038 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3039 were always defined.
3040
3041 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3042
3043 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3044 between bpos_covered and bpos_max. This fixes cursor display when
3045 several display strings follow each other.
3046
3047 * .gdbinit (pgx): If the glyph's object is a string, display the
3048 pointer to string data, rather than the value of the string object
3049 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3050
3051 * indent.c (Fvertical_motion): If the starting position is covered
3052 by a display string, return to one position before that, to avoid
3053 overshooting it inside move_it_to. (Bug#12930)
3054
3055 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3056
3057 * frame.h (struct frame): Remove display_preempted member
3058 since all users are dead long ago.
3059 * nsterm.h (struct x_output): Use the only dummy member.
3060 * w32menu.c (pending_menu_activation): Remove since not
3061 really used.
3062 (set_frame_menubar): Adjust user.
3063 * w32term.h (struct x_output): Drop outdated #if 0 code.
3064 (struct w32_output): Use bitfields for explicit_parent,
3065 asked_for_visible and menubar_active members.
3066 Drop unused pending_menu_activation member.
3067 * xterm.h (struct x_output): Drop outdated #if 0 code.
3068 Use bitfields for explicit_parent, asked_for_visible,
3069 has_been_visible and net_wm_state_hidden_seen members.
3070
3071 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3072
3073 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3074 of a literal "/". (Bug#12955)
3075 (gl-stamp): Invoke fc.exe directly, not through cmd.
3076
3077 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3078
3079 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3080 * dired.c: Assume HAVE_DIRENT_H.
3081 (NAMLEN): Remove, replacing with ...
3082 (dirent_namelen): New function. All uses changed. Use the GNU macro
3083 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3084 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3085 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3086 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3087 $(NT_INC)/dirent.h.
3088 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3089 * ndir.h: Rename to ../nt/inc/dirent.h.
3090 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3091 Do not include <dirent.h>; no longer needed.
3092 * w32.c: Include <dirent.h> rather than "ndir.h".
3093
3094 2012-11-23 Chong Yidong <cyd@gnu.org>
3095
3096 * xftfont.c (xftfont_open): Remove duplicate assignment.
3097
3098 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3099
3100 * alloc.c (Fgarbage_collect): Unblock input after clearing
3101 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3102 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3103 * msdos.c (IT_frame_up_to_date): Use it here...
3104 * w32term.c (w32_frame_up_to_date): ...here...
3105 * xterm.c (XTframe_up_to_date): ...and here...
3106 * nsterm.m (ns_frame_up_to_date): ...but not here.
3107 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3108 Adjust users.
3109 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3110 Do not check whether GC is in progress.
3111
3112 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3113
3114 * xdisp.c (window_buffer_changed): New function.
3115 (update_menu_bar, update_tool_bar): Use it to
3116 simplify large 'if' statements.
3117 (redisplay_internal): Generalize commonly used
3118 'tail' and 'frame' local variables.
3119
3120 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3121
3122 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3123 with Windows system header.
3124
3125 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3126
3127 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3128 * alloc.c: Assume unistd.h exists.
3129 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3130 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3131 (getwd) [USG]: Remove; no longer needed.
3132 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3133 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3134 * w32.h (getcwd): Remove decl.
3135
3136 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3137
3138 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3139 Make it set selected_window as well.
3140 (update_tool_bar): Use it.
3141
3142 2012-11-21 Ken Brown <kbrown@cornell.edu>
3143
3144 * emacs.c (main): Set the G_SLICE environment variable for all
3145 Cygwin builds, not just GTK builds. See
3146 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3147
3148 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3149
3150 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3151 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3152 Define for the MSVC compiler.
3153
3154 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3155
3156 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3157 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3158 dostounix_filename. Prevents crashes down the road, because
3159 dostounix_filename assumes it gets a unibyte string.
3160 Reported by Michel de Ruiter <michel@sentient.nl>, see
3161 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3162
3163 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3164
3165 Conflate Qnil and Qunbound for `symbol-function'.
3166 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3167 * lread.c (init_obarray): Set `function' fields to Qnil.
3168 * eval.c (Fcommandp): Ignore Qunbound.
3169 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3170 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3171 Test NILP rather than Qunbound.
3172 (Ffmakunbound): Set to Qnil.
3173 (Fsymbol_function): Never signal an error.
3174 (Finteractive_form): Ignore Qunbound.
3175
3176 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3177
3178 * eval.c (interactive_p): Remove no-longer-used decl.
3179
3180 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3181
3182 * xdisp.c (buffer_shared): Adjust comment.
3183 (buffer_shared_and_changed): New function.
3184 (prepare_menu_bars, redisplay_internal): Use it to
3185 decide whether all windows or frames should be updated.
3186 (window_outdated): New function.
3187 (text_outside_line_unchanged_p, redisplay_window): Use it.
3188 (redisplay_internal): Likewise. Fix indentation.
3189
3190 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3191
3192 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3193 (syms_of_eval): Remove corresponding defsubr.
3194 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3195
3196 2012-11-19 Daniel Colascione <dancol@dancol.org>
3197
3198 * w32fns.c (Fx_file_dialog):
3199 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3200 cygwin_convert_file_name*.
3201
3202 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3203 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3204
3205 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3206
3207 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3208
3209 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3210
3211 * w32select.c: Include w32common.h before w32term.h, so that
3212 windows.h gets included before w32term.h uses some of its
3213 features, see below.
3214
3215 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3216 New typedefs.
3217 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3218 New prototypes.
3219 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3220
3221 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3222
3223 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3224 (ns_select): Return at once if events are held (Bug#12834).
3225
3226 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3227
3228 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3229 Needed following 2012-10-20 change. (Bug#12902)
3230
3231 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3232
3233 * w32proc.c (waitpid): Remove unused label get_result.
3234
3235 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3236
3237 * makefile.w32-in (SYSWAIT_H): New macro.
3238 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3239 ($(BLD)/sysdep.$(O)): Update dependencies.
3240
3241 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3242
3243 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3244 * callproc.c (relocate_fd): Assume F_DUPFD.
3245 * emacs.c, term.c (O_RDWR): Remove.
3246 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3247 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3248 * nsterm.m: Assume <fcntl.h> exists.
3249 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3250 (create_pty, Fmake_network_process, server_accept_connection)
3251 (wait_reading_process_output, init_process_emacs):
3252 Assume O_NONBLOCK.
3253 (wait_reading_process_output): Put in a special case for WINDOWSNT
3254 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3255 It's not clear this is needed, but it's a more-conservative change.
3256 (create_process): Assume FD_CLOEXEC.
3257 (create_process, create_pty): Assume O_NOCTTY.
3258 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3259 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3260 Omit if not DOS_NT, since F_GETFL is not defined there.
3261 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3262 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3263 (O_NOCTTY): Remove.
3264 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3265 lack it, since gnulib guarantees this.
3266 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3267
3268 2012-11-17 Eli Zaretskii <eliz@gnu.org>
3269
3270 * w32.c (faccessat): Pretend that directories have the execute bit
3271 set. Emacs expects that, e.g., in files.el:cd-absolute.
3272
3273 * w32proc.c (create_child): Don't clip the PID of the child
3274 process to fit into an Emacs integer, as this is no longer a
3275 restriction.
3276 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3277 reaping only the process specified by PID argument, if that is
3278 positive. Use PID instead of dead_child to know which process to
3279 reap. Wait for the child to die only if WNOHANG is not in
3280 OPTIONS.
3281 (sys_select): Don't set dead_child.
3282
3283 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3284 as it is no longer needed.
3285
3286 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3287 no longer needed.
3288 (record_child_status_change): Remove the setting of
3289 record_at_most_one_child for the !WNOHANG case.
3290
3291 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3292
3293 Fix problems in ns port found by static checking.
3294 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3295 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3296 not to process group.
3297 (ns_select): Use emacs_write, not write, as that's more robust
3298 in the presence of signals.
3299 (fd_handler:): Check for read errors.
3300
3301 2012-11-16 Glenn Morris <rgm@gnu.org>
3302
3303 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3304
3305 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3306
3307 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3308
3309 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3310
3311 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3312 use the same value of thread handle.
3313 (start_timer_thread): If the timer thread exited (due to error),
3314 clean up by closing the two handles it used. Duplicate the caller
3315 thread's handle here, so it gets duplicated only once, when
3316 launching the timer thread. Set priority of the timer thread, not
3317 the caller thread.
3318 (getitimer): Don't duplicate the caller thread's handle here.
3319 (Bug#12832)
3320
3321 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3322
3323 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3324 called (Bug#12834).
3325
3326 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3327
3328 Remove no-longer-used pty_max_bytes variable.
3329 * process.c (pty_max_bytes): Remove; unused.
3330 (send_process): Do not set it.
3331
3332 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3333
3334 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3335 Update dependencies.
3336
3337 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3338
3339 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3340 This follows up on the 2012-09-29 patch that removed indirection
3341 for the 'function' field. Reported by Sergey Vinokurov in
3342 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3343
3344 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3345
3346 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3347 different name, as the MS runtime does not have such a function,
3348 and probably never will.) All callers changed. Ignore DIRFD
3349 value if PATH is an absolute file name, to match Posix spec
3350 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3351 symlinks.
3352
3353 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3354
3355 * xdisp.c (echo_area_display, redisplay_internal):
3356 Omit redundant check whether frame_garbaged is set.
3357
3358 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3359
3360 Use faccessat, not access, when checking file permissions (Bug#12632).
3361 This fixes a bug that has been present in Emacs since its creation.
3362 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3363 which must set some sort of record. (Torek's bug report was against
3364 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3365 same common flaw.) See Torek's Usenet posting
3366 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3367 Posted: Fri Apr 8 14:18:56 1983.
3368 * Makefile.in (LIB_EACCESS): New macro.
3369 (LIBES): Use it.
3370 * callproc.c (init_callproc):
3371 * charset.c (init_charset):
3372 * fileio.c (check_existing, check_executable, check_writable)
3373 (Ffile_readable_p):
3374 * lread.c (openp, load_path_check):
3375 * process.c (allocate_pty):
3376 * xrdb.c (file_p):
3377 Use effective UID when checking permissions, not real UID.
3378 * callproc.c (init_callproc):
3379 * charset.c (init_charset):
3380 * lread.c (load_path_check, init_lread):
3381 Test whether directories are accessible, not merely whether they exist.
3382 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3383 * fileio.c (check_existing, check_executable, check_writable)
3384 (Ffile_readable_p):
3385 Use symbolic names instead of integers for the flags, as they're
3386 portable now.
3387 (check_writable): New arg AMODE. All uses changed.
3388 Set errno on failure.
3389 (Ffile_readable_p): Use faccessat, not stat + open + close.
3390 (Ffile_writable_p): No need to call check_existing + check_writable.
3391 Just call check_writable and then look at errno. This saves a syscall.
3392 dir should never be nil; replace an unnecessary runtime check
3393 with an eassert. When checking the parent directory of a nonexistent
3394 file, check that the directory is searchable as well as writable, as
3395 we can't create files in unsearchable directories.
3396 (file_directory_p): New function, which uses 'stat' on most platforms
3397 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3398 (Ffile_directory_p, Fset_file_times): Use it.
3399 (file_accessible_directory_p): New function, which uses a single
3400 syscall for efficiency.
3401 (Ffile_accessible_directory_p): Use it.
3402 * xrdb.c (file_p): Use file_directory_p.
3403 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3404 * lread.c (openp): When opening a file, use fstat rather than
3405 stat, as that avoids a permissions race. When not opening a file,
3406 use file_directory_p rather than stat.
3407 (dir_warning): First arg is now a usage string, not a format.
3408 Use errno. All uses changed.
3409 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3410 that merely introduced a race.
3411 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3412 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3413 and similarly for the other O_* flags.
3414 * w32.c (sys_faccessat): Rename from sys_access and switch to
3415 faccessat's API. All uses changed.
3416 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3417 (magic_db): Rename from magic_file_p.
3418 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3419 char *, so that we don't have to test for file existence
3420 separately from opening the file for reading. This removes a race
3421 fixes a permission-checking problem, and simplifies the code.
3422 All uses changed.
3423 (file_p): Remove; no longer needed.
3424
3425 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3426
3427 Omit glyphs initialization at startup.
3428 * dispnew.c (glyphs_initialized_initially_p): Remove.
3429 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3430 (Fredraw_frame): Move actual code from here...
3431 (redraw_frame): ...to here. Add eassert. Adjust comment.
3432 (Fredraw_display): Use redraw_frame.
3433 * xdisp.c (clear_garbaged_frames): Likewise.
3434
3435 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3436
3437 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3438 passed to pint2str and pint2hrstr to be at most the size of the
3439 frame's decode_mode_spec_buffer. This avoids crashes with very
3440 large values of FIELD_WIDTH argument to decode_mode_spec.
3441 (Bug#12867)
3442
3443 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3444
3445 Fix a race with verify-visited-file-modtime (Bug#12863).
3446 Since at least 1991 Emacs has ignored an mtime difference of no
3447 more than one second, but my guess is that this was to work around
3448 file system bugs that were fixed long ago. Since the race is
3449 causing problems now, let's remove that code.
3450 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3451 whose time stamp is off by no more than a second. Insist that the
3452 file time stamps match exactly.
3453
3454 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3455
3456 * frame.h (struct frame): Convert external_tool_bar member to
3457 1-bit unsigned bitfield.
3458 * termhooks.h (struct terminal): Remove mouse_moved member since
3459 all users are long dead. Adjust comment on mouse_position_hook.
3460
3461 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3462
3463 Simplify by using FOR_EACH_FRAME here and there.
3464 * frame.c (next_frame, prev_frame, other_visible_frames)
3465 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3466 * w32term.c (x_window_to_scroll_bar): Likewise.
3467 * window.c (window_list): Likewise.
3468 * xdisp.c (x_consider_frame_title): Likewise.
3469 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3470 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3471 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3472 * xmenu.c (menubar_id_to_frame): Likewise.
3473 * xselect.c (frame_for_x_selection): Likewise.
3474 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3475 (x_window_to_menu_bar): Likewise.
3476 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3477
3478 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 * data.c (Qdefalias_fset_function): Now static.
3481
3482 Another tweak to vectorlike_header change.
3483 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3484 Remove, and replace all uses with ...
3485 (next_in_free_list, set_next_in_free_list):
3486 New functions, which respect C's aliasing rules better.
3487
3488 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3489
3490 * window.c (list4i): Rename from 'quad'. All uses changed.
3491 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3492
3493 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3494
3495 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3496 warning about mixing declarations and code in ISO C90.
3497
3498 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3499
3500 * window.c (Fsplit_window_internal): Set combination limit of
3501 new parent window to t iff Vwindow_combination_limit is t;
3502 fixing a regression introduced with the change from 2012-09-22.
3503 (Fset_window_combination_limit): Fix doc-string.
3504
3505 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3506
3507 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3508 amount when the scroll margins are too large. When scrolling
3509 backwards in the buffer, give up if cannot reach point or the
3510 scroll margin within a reasonable number of screen lines.
3511 Fixes point position in window under scroll-up/down-aggressively when
3512 point is positioned many lines beyond the window top/bottom.
3513 (Bug#12811)
3514
3515 * ralloc.c (relinquish): If real_morecore fails to return memory
3516 to the system, don't crash; instead, leave the last heap
3517 unchanged and return. (Bug#12774)
3518
3519 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3520
3521 * lisp.h (AUTOLOADP): New macro.
3522 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3523 * data.c (Ffset): Remove special ad-advice-info handling.
3524 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3525 (Fsubr_arity): CSE.
3526 (Finteractive_form): Simplify.
3527 (Fquo): Don't insist on having at least 2 arguments.
3528 (Qdefalias_fset_function): New var.
3529
3530 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3531
3532 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3533
3534 * nsfont.m (Qcondensed, Qexpanded): New variables.
3535 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3536 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3537
3538 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3539
3540 Fix recently introduced crash on MS-Windows (Bug#12839).
3541 * w32term.h (struct scroll_bar): Use convenient header.
3542 (SCROLL_BAR_VEC_SIZE): Remove.
3543 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3544
3545 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3546
3547 Tweak last vectorlike_header change.
3548 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3549 vectorlike object on the free list. This is introduced to avoid
3550 some (but not all) pointer casting and aliasing problems, see
3551 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3552 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3553 objects.
3554 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3555
3556 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3557
3558 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3559 been removed, so remove them here also.
3560
3561 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3562
3563 * doc.c (Fdocumentation): Handle new property
3564 dynamic-docstring-function to replace the old ad-advice-info.
3565
3566 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * fns.c (Qeql, hashtest_eq): Now static.
3569
3570 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3571
3572 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3573 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3574 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3575 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3576
3577 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3578
3579 Use same hash function for hashfn_profiler as for hash_string etc.
3580 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3581 * lisp.h (sxhash_combine): New inline function, with the contents
3582 of the old SXHASH_COMBINE.
3583 * profiler.c (hashfn_profiler): Use it, instead of having a
3584 special hash function containing a comparison that always yields 1.
3585
3586 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3587
3588 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3589 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3590 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3591 Remove unused vars.
3592
3593 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3594
3595 * image.c (xpm_make_color_table_h): Fix compiler error because
3596 make_hash_table changed.
3597
3598 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
3599
3600 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3601
3602 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3603
3604 Use ad-hoc comparison function for the profiler's hash-tables.
3605 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3606 (make_log): Use them.
3607 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3608 call Fequal any more.
3609 (Ffunction_equal): New function.
3610 (cmpfn_profiler, hashfn_profiler): New functions.
3611 (syms_of_profiler): Initialize them.
3612 * lisp.h (struct hash_table_test): New struct.
3613 (struct Lisp_Hash_Table): Use it.
3614 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3615 * fns.c (make_hash_table): Take a struct to describe the test.
3616 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3617 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3618 (hash_lookup, hash_remove_from_table): Move assertion checking of
3619 hashfn result here. Check hash-equality before calling cmpfn.
3620 (Fmake_hash_table): Adjust call to make_hash_table.
3621 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3622 (syms_of_fns): Initialize them.
3623 * emacs.c (main): Move syms_of_fns earlier.
3624 * xterm.c (syms_of_xterm):
3625 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3626 * print.c (print_object): Adjust to new hash-table struct.
3627 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3628
3629 2012-11-08 Eli Zaretskii <eliz@gnu.org>
3630
3631 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3632 value of w32-scroll-lock-modifier is neither nil nor one of the
3633 known key modifiers. (Bug#12806)
3634
3635 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3636
3637 Shrink struct vectorlike_header to the only size field.
3638 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3639 Adjust comment.
3640 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3641 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3642 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3643 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3644 information from the vector header. Adjust comment.
3645 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3646 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3647 layout.
3648 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3649 (struct vectorlike_header): Remove next member. Adjust comment.
3650 (struct Lisp_Subr): Add convenient header. Adjust comment.
3651 (allocate_pseudovector): Adjust prototype.
3652 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3653 (sweep_string, lisp_malloc): Remove useless prototypes.
3654 (enum mem_type): Adjust comment.
3655 (NEXT_IN_FREE_LIST): New macro.
3656 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3657 (Fmake_bool_vector): Likewise.
3658 (struct large_vector): New type to represent allocation unit for
3659 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3660 (large_vectors): Change type to struct large_vector.
3661 (allocate_vector_from_block): Simplify.
3662 (PSEUDOVECTOR_NBYTES): Replace with...
3663 (vector_nbytes): ...new function. Adjust users.
3664 (sweep_vectors): Adjust processing of large vectors.
3665 (allocate_vectorlike): Likewise.
3666 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3667 Add easserts. Adjust XSETPVECTYPESIZE usage.
3668 (allocate_buffer): Use BUFFER_PVEC_INIT.
3669 (live_vector_p): Adjust to match large vector.
3670 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3671 * buffer.h (struct buffer): Add next member.
3672 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3673 New macros.
3674 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3675 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3676 (copy_hash_table): Adjust to match vector header change.
3677 * lread.c (defsubr): Use XSETPVECTYPE.
3678 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3679 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3680 (xvecsize): New command.
3681
3682 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3683
3684 * keyboard.c (event_to_kboard): Do not dereference
3685 frame_or_window field of SELECTION_REQUEST_EVENT
3686 and SELECTION_CLEAR_EVENT events (Bug#12814).
3687 * xterm.h (struct selection_input_event): Adjust comment.
3688
3689 2012-11-07 Eli Zaretskii <eliz@gnu.org>
3690
3691 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3692 such as Scroll Lock, if the respective keys are treated as
3693 function keys, not as modifiers. This avoids destroying non-ASCII
3694 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
3695
3696 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3697
3698 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3699
3700 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3701
3702 Restore some duplicate definitions (Bug#12814).
3703 This undoes part of the 2012-11-03 changes. Some people build
3704 with plain -g rather than with -g3, and they need the duplicate
3705 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3706 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3707 Define as macros, as well as as enums or as constants.
3708
3709 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3710
3711 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3712 to keypad keys (Bug#12816).
3713
3714 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3715
3716 Minor adjustments of recently-changed frame functions.
3717 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3718 known to be a frame (we're in the FRAMEP branch).
3719 * lisp.h (Qframep): Remove decl. frame.h declares this.
3720 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3721 since they're meant for Lisp fixnum values.
3722
3723 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3724
3725 * window.c (Fwindow_combination_limit): Revert to the only
3726 required argument and adjust docstring as suggested in
3727 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3728 by Martin Rudalics <rudalics@gmx.at>.
3729
3730 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3731
3732 Widely used frame validity and checking functions.
3733 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3734 * frame.c (decode_live_frame, decode_any_frame): New functions.
3735 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3736 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3737 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3738 (Fframe_pointer_visible_p): Use decode_any_frame.
3739 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3740 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3741 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3742 (Fframe_focus): Likewise. Allow zero number of arguments.
3743 Adjust docstring.
3744 (frame_buffer_list, frame_buffer_predicate): Remove.
3745 * lisp.h (frame_buffer_predicate): Remove prototype.
3746 * buffer.c (Fother_buffer): Use decode_any_frame.
3747 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3748 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3749 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3750 (Fclose_font, Ffont_info): Use decode_live_frame.
3751 * fontset.c (check_fontset_name): Likewise.
3752 * terminal.c (Fframe_terminal): Likewise.
3753 * w32fns.c (check_x_frame): Likewise.
3754 * window.c (Fminibuffer_window, Fwindow_at)
3755 (Fcurrent_window_configuration): Likewise.
3756 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3757 Likewise. Allow zero number of arguments. Adjust docstring.
3758 * dispnew.c (Fredraw_frame): Likewise.
3759 * xfaces.c (frame_or_selected_frame): Remove.
3760 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3761 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3762 (Fframe_face_alist): Use decode_live_frame.
3763 * xfns.c (check_x_frame): Likewise.
3764
3765 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3766
3767 * window.c (quad): New function.
3768 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3769 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3770 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3771 (Fwindow_line_height): Use it.
3772 (Fwindow_fringes): Use list3.
3773 (Fwindow_scroll_bars): Use list4.
3774 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3775 (Fwindow_combination_limit): Allow zero number of arguments.
3776
3777 2012-11-05 Eli Zaretskii <eliz@gnu.org>
3778
3779 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3780
3781 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3782 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3783 file descriptor 2 for standard error. (Bug#12805)
3784
3785 2012-11-05 Chong Yidong <cyd@gnu.org>
3786
3787 * process.c (wait_reading_process_output): Revert previous change.
3788
3789 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3790
3791 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3792 This removes code that has been obsolete since around 1990.
3793 * callproc.c (Fcall_process):
3794 * emacs.c (main):
3795 * process.c (create_process):
3796 * term.c (dissociate_if_controlling_tty):
3797 Assume setsid exists.
3798 * callproc.c (child_setup): Assume setpgid exists and behaves as
3799 per POSIX.1-1988 or later.
3800 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3801 * emacs.c (shut_down_emacs):
3802 * sysdep.c (sys_suspend, init_foreground_group):
3803 Assume getpgrp behaves as per POSIX.1-1998 or later.
3804 * msdos.c (setpgrp): Remove.
3805 (tcgetpgrp, setpgid, setsid): New functions.
3806 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3807 * term.c (no_controlling_tty): Remove; unused.
3808 * w32proc.c (setpgrp): Remove.
3809 (setsid, tcgetpgrp): New functions.
3810
3811 Simplify by assuming __fpending.
3812 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3813 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3814 Do not assume that __fpending's result fits in int.
3815
3816 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3817
3818 Remove EMACS_OUTQSIZE+sleep hack.
3819 * dispnew.c (update_frame_1): Remove hack for terminals slower
3820 than 2400 bps, which throttled Emacs by having it sleep.
3821 This code hasn't worked since at least 2007, when the multi-tty stuff
3822 was added, and anyway those old terminals are long dead.
3823 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3824 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3825
3826 Fix data-loss with --version (Bug#9574).
3827 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3828 as we can't assume that emacs_strerror is initialized, and strerror
3829 is good enough here.
3830 (main): Invoke atexit earlier, to catch earlier instances of
3831 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3832
3833 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3834
3835 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3836 (keyDown): Remap keypad keys to X11 virtual key codes.
3837
3838 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 Fix data-loss with --batch (Bug#9574).
3841 * emacs.c: Include <close-stream.h>.
3842 (close_output_streams): New function.
3843 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3844 and handles errors appropriately.
3845 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3846 does that now.
3847
3848 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3849 The symptom is a diagnostic "GLib-WARNING **: In call to
3850 g_spawn_sync(), exit status of a child process was requested but
3851 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3852 waitpid(), so exit status can't be returned." The diagnostic
3853 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3854 The real bug is a race condition between Emacs and glib: Emacs
3855 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3856 so that glib can't find it. Work around the bug by invoking
3857 waitpid only on subprocesses that Emacs itself creates.
3858 * process.c (create_process, record_child_status_change):
3859 Don't use special value -1 in pid field, as the caller now must
3860 know the pid rather than having the callee infer it.
3861 The inference was sometimes incorrect anyway, due to another race.
3862 (create_process): Set new 'alive' member if child is created.
3863 (process_status_retrieved): New function.
3864 (record_child_status_change): Use it.
3865 Accept negative 1st argument, which means to wait for the
3866 processes that Emacs already knows about. Move special-case code
3867 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3868 processes that have already been waited for, by testing and
3869 clearing new 'alive' member.
3870 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3871 now does this internally.
3872 (handle_child_signal): Let record_child_status_change do all
3873 the work, since we do not want to reap all exited child processes,
3874 only the child processes that Emacs itself created.
3875 * process.h (Lisp_Process): New boolean member 'alive'.
3876
3877 Omit duplicate definitions no longer needed with gcc -g3.
3878 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3879 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3880 Define only as macros. There's no longer any need to also define
3881 these symbols as enums or as constants, since we now assume
3882 gcc -g3 when debugging.
3883
3884 2012-11-03 Eli Zaretskii <eliz@gnu.org>
3885
3886 * lisp.mk: Adjust comments to the fact that term/internal is now
3887 loaded from loadup.el.
3888
3889 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3890 (msdos_fatal_signal): New function.
3891 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3892 its argument list.
3893
3894 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3895 for GCC versions before 4.
3896 (emacs_raise): Define to call msdos_fatal_signal.
3897
3898 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3899 iterator when starting in the middle of a display or overlay
3900 string. (Bug#12745)
3901
3902 2012-11-03 Chong Yidong <cyd@gnu.org>
3903
3904 * process.c (wait_reading_process_output): Clean up the last
3905 change.
3906
3907 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3908
3909 * process.c (wait_reading_process_output): Avoid a race condition
3910 with SIGIO delivery (Bug#11536).
3911
3912 2012-11-03 Chong Yidong <cyd@gnu.org>
3913
3914 * buffer.c (cursor_type): Untabify docstring.
3915
3916 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3917
3918 * frame.h (struct frame): Drop can_have_scroll_bars member
3919 which is meaningless for a long time. Adjust comments.
3920 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3921 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3922
3923 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3924
3925 * window.c (decode_next_window_args): Update window arg after
3926 calling decode_live_window and so fix crash reported at
3927 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3928 by Juanma Barranquero <lekktu@gmail.com>.
3929 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3930 * font.c (Ffont_at): Likewise.
3931
3932 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3933
3934 * widget.c (resize_cb): New function.
3935 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3936 (EmacsFrameResize): Check if all is up to date before changing frame
3937 size.
3938
3939 2012-11-02 Eli Zaretskii <eliz@gnu.org>
3940
3941 Implement backtrace output for fatal errors on MS-Windows.
3942 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3943 (BACKTRACE_LIMIT_MAX): New macro.
3944 (w32_backtrace): New function.
3945 (emacs_abort): Use w32_backtrace when the user chooses not to
3946 attach a debugger. Update the text of the abort dialog.
3947
3948 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3949
3950 Window-related stuff cleanup here and there.
3951 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3952 Use decode_any_window.
3953 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3954 * xdisp.c (Fformat_mode_line): Likewise.
3955 * font.c (Ffont_at): Use decode_live_window.
3956 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3957 * window.c (decode_next_window_args): Likewise.
3958 (decode_any_window): Remove static.
3959 * window.h (decode_any_window): Add prototype.
3960 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3961 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3962 respectively.
3963
3964 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3965
3966 Remove pad from struct input_event.
3967 * termhooks.h (struct input_event): Remove padding field.
3968 Adjust comment.
3969 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3970 member is never cons for a long time. Adjust comment.
3971 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3972 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3973 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3974 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3975
3976 2012-11-01 Eli Zaretskii <eliz@gnu.org>
3977
3978 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3979
3980 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3981
3982 Fix crash when using Emacs as commit editor for git (Bug#12697).
3983 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3984 and it is configured in conf_post.h.
3985 (Fcall_process): Don't invoke both setsid and setpgid; the former
3986 is enough, if it exists.
3987 * callproc.c (Fcall_process, child_setup):
3988 * process.c (create_process): Use setpgid.
3989 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3990 for the real thing.
3991 * dispnew.c (init_display): Initialize the foreground group
3992 if we are running a tty display.
3993 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3994 * lisp.h (init_foreground_group): New decl.
3995 * sysdep.c (inherited_pgroup): New static var.
3996 (init_foreground_group, tcsetpgrp_without_stopping)
3997 (narrow_foreground_group, widen_foreground_group): New functions.
3998 (init_sys_modes): Narrow foreground group.
3999 (reset_sys_modes): Widen foreground group.
4000
4001 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4002
4003 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4004
4005 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4006
4007 * minibuf.c (read_minibuf): Restore current buffer since
4008 choose_minibuf_frame calling Fset_frame_selected_window may
4009 change it (Bug#12766).
4010
4011 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4012
4013 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4014
4015 2012-10-30 Kenichi Handa <handa@gnu.org>
4016
4017 * font.c (Ffont_at): If WINDOW is specified and it is not
4018 displaying the current buffer, signal an error.
4019
4020 2012-10-29 Daniel Colascione <dancol@dancol.org>
4021
4022 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4023 In preparation for fixing bug#12739, move these functions from
4024 here...
4025
4026 * coding.h, coding.c: ... to here, and compile them only when
4027 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4028 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4029
4030 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4031
4032 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4033 (timer_loop, getitimer, setitimer): Use it instead of
4034 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4035 'clock'.
4036 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4037 literal 10000.
4038
4039 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4040
4041 * nsterm.m (NO_APPDEFINED_DATA): New define.
4042 (last_appdefined_event_data): New variable
4043 (last_appdefined_event): Remove.
4044 (ns_select): Initialize t from last_appdefined_event_data instead
4045 of [last_appdefined_event data1].
4046 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4047 remove last_appdefined_event (Bug#12698).
4048
4049 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4050
4051 * frame.c (x_set_font): Catch internal error.
4052
4053 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4054
4055 Avoid overflow in w32 implementation of interval timers.
4056 When possible, for ITIMER_PROF count only times the main thread
4057 actually executes.
4058 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4059 'volatile ULONGLONG' types. All the other data which was
4060 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4061 (GetThreadTimes_Proc): New typedef.
4062 (w32_get_timer_time): New function, returns a suitable time value
4063 for the timer.
4064 (timer_loop): Enter critical section when accessing ULONGLONG
4065 values of the itimer_data struct, as these accesses are no longer
4066 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4067 Remove unused variable.
4068 (init_timers): Initialize s_pfn_Get_Thread_Times.
4069 (start_timer_thread): Don't assign itimer->caller_thread here.
4070 (getitimer): Assign itimer->caller_thread here.
4071 (setitimer): Always call getitimer to get the value of ticks_now.
4072 (sys_spawnve): Avoid compiler warning about format mismatch.
4073
4074 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4075
4076 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4077 mouse movement events if the menu bar is active. This avoids
4078 producing a busy "hour-glass" cursor by Windows if the mouse
4079 pointer is positioned over a tooltip shown for some menu item.
4080
4081 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 Don't assume process IDs fit in int.
4084 * emacs.c (shut_down_emacs) [!DOS_NT]:
4085 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4086 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4087 Use pid_t, not int, to store process IDs, as 'int'
4088 is not wide enough on a few platforms (e.g., AIX and IRIX).
4089
4090 2012-10-23 Kenichi Handa <handa@gnu.org>
4091
4092 The following change is to make face-font-rescale-alist work
4093 correctly for non-ASCII fonts.
4094
4095 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4096 (font_open_for_lface): Handle Vface_font_rescale_alist.
4097
4098 2012-10-23 Chong Yidong <cyd@gnu.org>
4099
4100 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4101
4102 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4103
4104 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4105 for screen font.
4106 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4107
4108 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4109 event (Bug#12681).
4110
4111 2012-10-21 Glenn Morris <rgm@gnu.org>
4112
4113 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4114
4115 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 Port to OpenBSD 5.1.
4118 * frame.c (Fmouse_position, Fmouse_pixel_position):
4119 * xdisp.c (produce_stretch_glyph):
4120 Declare local vars only when they're needed.
4121 This is clearer and avoids a warning on OpenBSD about unused vars.
4122 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4123 This is safer, and avoids OpenBSD warnings about unused vars.
4124 * keyboard.c (record_menu_key): Remove unnecessary decl.
4125 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4126 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4127 as our definition clashes with OpenBSD's.
4128 * xfaces.c (load_face_colors, check_lface_attrs)
4129 (get_lface_attributes_no_remap, get_lface_attributes)
4130 (lface_fully_specified_p, x_supports_face_attributes_p)
4131 (tty_supports_face_attributes_p, face_fontset, realize_face)
4132 (realize_x_face, realize_tty_face):
4133 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4134 merely Lisp_Object *. This is more informative and avoids
4135 a warning on OpenBSD about accessing beyond an object's size.
4136
4137 2012-10-20 Chong Yidong <cyd@gnu.org>
4138
4139 * lread.c (Fload): Doc fix (Bug#12592).
4140
4141 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4142
4143 * font.c (Ffont_at): Fix previous change.
4144
4145 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4146
4147 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4148 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4149 for the reasons.
4150
4151 * alloc.c (NSTATICS): Decrease to 0x800.
4152
4153 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4154
4155 * fns.c (Fnreverse): Include the problem element when signaling an
4156 error (bug#12677).
4157
4158 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4159
4160 * nsterm.m (ns_select): Check writefds before call to
4161 FD_ISSET (Bug#12668).
4162
4163 2012-10-18 Daniel Colascione <dancol@dancol.org>
4164
4165 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4166 (staticpro): If we run out of staticpro slots, die with an
4167 informative error instead of just calling emacs_abort.
4168
4169 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4170
4171 Fix two flaws reported by Dmitry Antipov.
4172 * window.c (Ftemp_output_buffer_show): Remove.
4173 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4174 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4175
4176 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4177
4178 * makefile.w32-in ($(BLD)/w32.$(O)):
4179 ($(BLD)/vm-limit.$(O)):
4180 ($(BLD)/term.$(O)):
4181 ($(BLD)/unexw32.$(O)):
4182 ($(BLD)/fileio.$(O)):
4183 ($(BLD)/dispnew.$(O)): Update dependencies.
4184
4185 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4186 Add prototypes.
4187
4188 * w32proc.c: Include ctype.h.
4189
4190 * w32.h (init_environment, check_windows_init_file)
4191 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4192 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4193 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4194 (sys_link): Add prototypes.
4195
4196 * w32.c: Include w32select.h.
4197 (sys_access, e_malloc, sys_select): Add prototypes.
4198 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4199
4200 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4201
4202 * unexw32.c: Include lisp.h and w32.h.
4203
4204 * term.c [WINDOWSNT]: Include w32term.h.
4205
4206 * process.c [WINDOWSNT]: Add prototype of sys_select.
4207
4208 * fileio.c [WINDOWSNT]: Include w32.h.
4209
4210 * dispnew.c [WINDOWSNT]: Include w32.h.
4211
4212 * cygw32.c (Fcygwin_convert_path_to_windows)
4213 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4214 Lisp_Object values. (Bug#12661)
4215
4216 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4217 to Lisp_Object. (Bug#12661)
4218
4219 2012-10-17 Kenichi Handa <handa@gnu.org>
4220
4221 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4222 invalidate.
4223
4224 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4225
4226 * buffer.c (Fkill_buffer): When unchaining the marker,
4227 reset its buffer pointer to NULL (Bug#12652).
4228
4229 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Do not verify indirection counters of killed buffers (Bug#12579).
4232 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4233 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4234
4235 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 * alloc.c (Fmake_byte_code): Fix typo in comment.
4238 * print.c (print_interval): Define as static to match prototype.
4239 * indent.c (disptab_matches_widthtab, recompute_width_table):
4240 Convert to eassert.
4241
4242 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4243
4244 * editfns.c (get_system_name): Remove.
4245 * lisp.h (get_system_name): Remove prototype.
4246 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4247 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4248
4249 2012-10-15 Daniel Colascione <dancol@dancol.org>
4250
4251 * dbusbind.c: Add comment explaining reason for previous change.
4252
4253 2012-10-15 Martin Rudalics <rudalics@gmx.at>
4254
4255 * window.c (Fwindow_end): Rewrite check whether cached position
4256 can be used (Bug#12600).
4257 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4258 Set windows_or_buffers_changed.
4259
4260 2012-10-15 Daniel Colascione <dancol@dancol.org>
4261
4262 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4263 enabled by undefining the symbol "interface", which the platform
4264 headers define to something incompatible.
4265
4266 2012-10-14 Daniel Colascione <dancol@dancol.org>
4267
4268 * image.c (init_tiff_functions, init_imagemagick_functions)
4269 (init_svg_functions): Fix cygw32 build break by using these
4270 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4271
4272 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4273
4274 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4275
4276 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4277
4278 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4279
4280 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4281
4282 * coding.c (detect_coding): Set coding->id before calling
4283 this->detector.
4284
4285 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4286
4287 * fileio.c: Formatting fixes.
4288
4289 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4290
4291 Fix some stat-related races.
4292 * fileio.c (Fwrite_region): Avoid race condition if a file is
4293 removed or renamed by some other process immediately after Emacs
4294 writes it but before Emacs stats it. Do not assume that stat (or
4295 fstat) succeeds.
4296 * image.c (slurp_file): Resolve the file name with fopen + fstat
4297 rather than stat + fopen.
4298 (pbm_read_file) [0]: Remove unused code with stat race.
4299 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4300 Remove ineffective code with stat race.
4301
4302 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4303
4304 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4305
4306 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4307
4308 * nsterm.m (hold_event_q): New static variable.
4309 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4310 ! q_event_ptr.
4311 (hold_event): New function.
4312 (ns_read_socket): If hold_event_q have events, store them and
4313 return (Bug#12384).
4314 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4315 is zero (Bug#12384).
4316
4317 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4318
4319 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4320
4321 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4322
4323 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4324
4325 * fileio.c (check_existing): New function.
4326 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4327 instead of calling 'stat', when what's needed is to check whether
4328 a file exists. This avoids expensive system calls on MS-Windows.
4329 (Bug#12587)
4330
4331 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4332
4333 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4334 determine whether a file exists and is not a directory.
4335
4336 * lisp.h (check_existing): Add prototype.
4337
4338 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4339
4340 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4341
4342 2012-10-12 Glenn Morris <rgm@gnu.org>
4343
4344 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4345
4346 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4347
4348 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4349
4350 * eval.c (Fautoload): Remember previous autoload status in load-history.
4351
4352 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4353
4354 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4355 * lread.c (load_each_byte, new_backquote_flag, readchar)
4356 (read_filtered_event, lisp_file_lexically_bound_p)
4357 (safe_to_load_version, Fload, complete_filename_p, openp)
4358 (build_load_history, readevalloop, read_escape, read1)
4359 (string_to_number, read_vector, read_list):
4360 * macros.c (Fstart_kbd_macro):
4361 * marker.c (CONSIDER):
4362 * menu.c (parse_single_submenu, digest_single_submenu)
4363 (find_and_return_menu_selection, Fx_popup_menu):
4364 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4365 (Ftry_completion):
4366 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4367 (ns_menu_show):
4368 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4369 (xmenu_show, xdialog_show):
4370 Use bool for booleans.
4371 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4372 as it's not a predicate. All uses changed. Omit unnecessary
4373 buffer termination.
4374
4375 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4376
4377 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4378 (save_excursion_restore): Do not restore mark if it was not saved.
4379
4380 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4381
4382 * marker.c (cached_modiff): EMACS_INT, not int.
4383
4384 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4385 instead of having a wrong decl.
4386 * nsmenu.m (waiting_for_input): Remove wrong decl.
4387
4388 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4389
4390 keyboard.c, keymap.c: Use bool for booleans.
4391 * dispnew.c (sit_for): Distinguish between 3-way display_option
4392 and boolean do_display.
4393 * keyboard.c (single_kboard, this_command_key_count_reset)
4394 (waiting_for_input, echoing, immediate_quit, input_pending)
4395 (interrupt_input, interrupts_deferred, pop_kboard)
4396 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4397 (command_loop_1, adjust_point_for_property)
4398 (safe_run_hooks_error, input_polling_used, read_char):
4399 (help_char_p, readable_events, kbd_buffer_events_waiting)
4400 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4401 (lucid_event_type_list_p, get_input_pending):
4402 (gobble_input, menu_separator_name_p, menu_bar_item)
4403 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4404 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4405 (keyremap_step, test_undefined, read_key_sequence)
4406 (detect_input_pending, detect_input_pending_ignore_squeezables)
4407 (detect_input_pending_run_timers, requeued_events_pending_p)
4408 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4409 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4410 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4411 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4412 (accessible_keymaps_1, Fkey_description, push_key_description):
4413 (shadow_lookup, struct where_is_internal_data)
4414 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4415 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4416 (describe_map, describe_vector):
4417 * menu.c (single_menu_item):
4418 * nsmenu.m (ns_update_menubar):
4419 * process.c (wait_reading_process_output):
4420 * search.c (scan_buffer, scan_newline):
4421 Use bool for boolean.
4422 * keyboard.c (timers_run, swallow_events)
4423 (detect_input_pending_run_timers):
4424 * process.c (wait_reading_process_output):
4425 Use unsigned for counter where wraparound-on-overflow is desired,
4426 since unsigned is guaranteed to have that behavior and signed is not.
4427 (read_char): Use ptrdiff_t for string length.
4428 (get_input_pending): Remove first argument, since it was always
4429 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4430 and behave as if it had that value. Return new value of
4431 input_pending. All callers changed.
4432 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4433 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4434 a string length.
4435 * keymap.c (push_key_description): Omit last arg, which was always 1.
4436 All callers changed.
4437
4438 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4439
4440 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4441
4442 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4443 ($(BLD)/term.$(O)): Update dependencies.
4444
4445 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4446
4447 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4448 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4449 initializer for PVEC_NORMAL_VECTOR.
4450
4451 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4452
4453 Clean out old termopts cruft.
4454 * termopts.h (flow_control, meta_key): Remove unused decls.
4455 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4456 Don't include termopts.h.
4457
4458 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4461
4462 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4463
4464 * commands.h (immediate_quit): Remove duplicate decl.
4465
4466 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4467
4468 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4469 caching.
4470 (nsfont_open): Remove setting of Vfonts_in_cache.
4471 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4472
4473 2012-10-09 Eli Zaretskii <eliz@gnu.org>
4474
4475 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4476 match what GetLastError returns. Explain why the function is
4477 needed.
4478
4479 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4480 'is_tooltip_frame', to avoid confusion with its global namesake.
4481
4482 2012-10-08 Daniel Colascione <dancol@dancol.org>
4483
4484 * xdisp.c (start_hourglass): Call w32_note_current_window when
4485 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4486 build that caused Emacs to display the hourglass cursor forever.
4487
4488 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4489 which is broken under remote desktop, calculate the number of
4490 colors available for a display based on the display's number of
4491 planes and number of bits per pixel per plane. (bug#10397).
4492
4493 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4494
4495 * nsfont.m (Vfonts_in_cache): New variable.
4496 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4497 are used. Add cached fonts to Vfonts_in_cache.
4498 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4499
4500 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4501
4502 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4503 in nt/config.nt.
4504 (FONT_H): Define after FRAME_H.
4505 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4506 Update dependencies.
4507
4508 * w32term.c: Remove leftover declaration of keyboard_codepage.
4509
4510 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4511
4512 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4513 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4514 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4515 (GLOBAL_SOURCES): Add cygw32.c.
4516 ($(BLD)/unexw32.$(O)):
4517 ($(BLD)/w32.$(O)):
4518 ($(BLD)/w32console.$(O)):
4519 ($(BLD)/w32fns.$(O)):
4520 ($(BLD)/w32heap.$(O)):
4521 ($(BLD)/w32menu.$(O)):
4522 ($(BLD)/w32proc.$(O)): Add w32common.h.
4523
4524 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4525 'const char *'.
4526 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4527
4528 2012-10-08 Daniel Colascione <dancol@dancol.org>
4529
4530 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4531 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4532 accidental message numbering hole. Change other messages to
4533 match.
4534
4535 * w32select.h (HAVE_W32SELECT): Remove.
4536
4537 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4538 w32common.h instead of w32heap.h.
4539
4540 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4541 (get_allocation_unit, get_processor_type, get_w32_major_version)
4542 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4543 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4544 (OS_NT, os_subtype, cache_system_info): Move declarations to
4545 w32common.
4546
4547 * w32heap.c: Include w32common.h.
4548 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4549 (w32_minor_version, w32_build_number, w32_subtype):
4550 Remove duplicate definitions.
4551
4552 * w32fns.c: Include w32common.h; include w32heap.h only in
4553 WINDOWSNT.
4554
4555 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4556 Use `report_file_error' instead of `error' in order to better
4557 inform users of what went wrong. Increase NTGUI_UNICODE file
4558 dialog box file name length to 32k, the maximum allowed by the NT
4559 kernel.
4560
4561 * w32common.h: New file.
4562 (ROUND_UP, ROUND_DOWN, get_page_size)
4563 (get_allocation_unit, get_processor_type, get_w32_major_version)
4564 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4565 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4566 (OS_NT, os_subtype, cache_system_info): Move here.
4567
4568 * unexw32.c, unexcw.c: Include w32common.h.
4569
4570 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4571 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4572 to call syms_of_w32select.
4573
4574 * cygw32.h: Remove obsolete EXFUN declarations.
4575
4576 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4577
4578 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4579 of w32inevt.o from SOME_MACHINE_OBJECTS.
4580
4581 2012-10-08 Daniel Colascione <dancol@dancol.org>
4582
4583 * image.c: Permanent fix for JPEG compilation issue --- limit
4584 jpeglib `boolean' redefinition to Cygwin builds.
4585
4586 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4587
4588 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4589
4590 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4591 Cygwin.
4592
4593 2012-10-08 Daniel Colascione <dancol@dancol.org>
4594
4595 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4596 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4597 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4598 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4599 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4600 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4601 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4602 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4603 now a supported configuration.
4604
4605 * Makefile.in: consolidate image variables into LIBIMAGE; add
4606 W32_OBJ and W32_LIBS. Compile new files.
4607
4608 * conf_post.h:
4609 (_DebPrint) declare tracing facility for W32 debugging. We need
4610 to unify tracing later.
4611
4612 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4613 unconditional use of W32 Unicode functions. Cygwin runs only on
4614 100% Unicode operating systems.
4615
4616 * cygw32.c: New file. Define Cygwin-specific facilities.
4617 (Fcygwin_convert_path_to_windows)
4618 (Fcygwin_convert_path_from_windows): New user functions for
4619 accessing Cygwin path-munging routines.
4620
4621 * cygw32.h: New file.
4622 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4623 UTF-16LE strings temporarily inside non-Lisp-visible string
4624 objects.
4625
4626 (w32_strerror): Just what it says on the tin.
4627
4628 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4629 also run for Cygwin; both systems have the same problem with using
4630 GUI facilities in a forked child. Also call syms_of_cygw32,
4631 syms_of_w32select in correct places.
4632
4633 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4634 needs fork-then-exec for daemon launching.
4635
4636 * font.h: Include frame.h.
4637
4638 * image.c: Use the image library cache machinery only when we're
4639 compiling for native WINDOWSNT; Cygwin can use shared libraries
4640 like any other Unixlike system.
4641
4642 * keyboard.c: Clarify a comment regarding the input loop.
4643
4644 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4645 functions directly instead of trying to detect at runtime that our
4646 host operating system supports them. We make this change for two
4647 reasons: Cygwin lacks support for the multibyte character
4648 conversion functions used by the legacy menu code, and Cygwin
4649 never needs to rely on non-Unicode APIs.
4650
4651 * unexw32.c (hinst): Declare extern.
4652
4653 * w32.c: Change header order;
4654 (w32_strerror): Move to w32fns.c because we need it for
4655 non-WINDOWSNT builds.
4656
4657 * w32.h: Add #error macro to make sure we don't include w32.h for
4658 Cygwin builds. Remove w32select declarations.
4659
4660 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4661 w32fns.c. w32console.c is WINDOWSNT-only.
4662
4663 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4664 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4665 POSIXy alternative.
4666 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4667 (w32_major_version, w32_minor_version, w32_build_number)
4668 (os_subtype, sound_type): Define here
4669 (w32_defined_color): Make color parameter const for consistency
4670 with other _defined_color functions.
4671 (w32_createwindow): Unconditionally call w32_init_class instead of
4672 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4673 through the code is complex and unnecessary because class
4674 registration is practically free.
4675 (w32_name_of_message): New EMACSDEBUG-only function.
4676 (Fset_message_beep): Move here
4677 (Fx_open_connection): Require that the display name for Windows be
4678 "w32" for consistency, emacsclient disambiguation, and maybe, one
4679 day, multi-window-system support.
4680 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4681 Cygwin files for W32 GUI facilities, since these clearly don't
4682 expect Cygwin names.
4683 (_DebPrint): Define.
4684 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4685 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4686 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4687 (w32_last_error): Remove.
4688
4689 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4690
4691 * w32heap.c (syspage_mask): Declare here.
4692 (cache_system_info): Remove.
4693
4694 * w32inevt.c (faked_key): Define globally, not statically.
4695 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4696 (w32_console_toggle_lock_key): Move to w32fns.c.
4697
4698 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4699
4700 * w32proc.c (_DebPrint): Move to w32fns.c.
4701 * w32select.c: Include string.h, stdio.h for Cygwin.
4702 * w32select.h: New File.
4703
4704 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4705 get_osfhandle.
4706 (w32_message_fd): New variable. Under Cygwin, holds the file
4707 descriptor the system used to tell us about pending thread
4708 messages.
4709
4710 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4711 that prevented compilation under non-WINDOWSNT systems.
4712
4713 (w32_initialize): Open /dev/windows and assign it to
4714 w32_message_fd. Provide w32 feature.
4715
4716 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4717 (WM_EMACS_INPUT_READY): add.
4718 (prepend_msg, w32_message_fd): Declare globally.
4719
4720 * w32xfns.c:
4721 (keyboard_handle): Use only when WINDOWSNT.
4722 (notify_msg_ready): New function. Posts a message to the main
4723 thread's message queue under CYGWIN, which wakes up the main
4724 thread from select(2) by making the /dev/windows file descriptor
4725 ready. Under WINDOWSNT, it sets an event the same way the old
4726 code did.
4727
4728 (post, prepend_msg): Actually call notify_msg_ready instead of
4729 setting the input event directly.
4730
4731 2012-10-07 Eli Zaretskii <eliz@gnu.org>
4732
4733 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4734 but it still has blocs in it, don't return it to the system,
4735 instead of aborting. (Bug#12402)
4736
4737 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4738
4739 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4740
4741 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4742 MAC_OS_X_VERSION_10_6.
4743 (syms_of_nsterm): Remove comment about Panther and above for
4744 ns-antialias-text.
4745 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4746 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4747 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4748
4749 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4750 MAC_OS_X_VERSION_10_4.
4751
4752 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4753 MAC_OS_X_VERSION_10_2.
4754
4755 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4756
4757 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4758 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4759
4760 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4761 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4762 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4763 Remove ns_in_resize check.
4764 (ns_clear_frame_area): Remove resize handle code.
4765
4766 * nsfns.m (ns_in_resize): Remove.
4767 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4768 Remove ns_in_resize check.
4769
4770 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 Improve sys_siglist detection.
4773 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4774 defined as a macro, as is done in Solaris.
4775 (sys_siglist_entries): New macro.
4776 (save_strsignal): Use it.
4777 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4778 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4779
4780 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4781
4782 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4783 fullscreen/Fullscreen.
4784
4785 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4786 tobar_height is new.
4787
4788 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4789 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4790 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4791 (windowDidResize:): Check for correct window if old style fullscreen.
4792 Capitalize word in comment. Remove incorrect comment.
4793 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4794 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4795 error in drawing background.
4796 (toggleFullScreen:): Remove comment. Rearrange calls.
4797 Set toolbar values to zero, save old height in tobar_height.
4798 Restore tool bar height when leaving fullscreen.
4799 (canBecomeMainWindow): New function.
4800
4801 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4804
4805 2012-10-05 Eli Zaretskii <eliz@gnu.org>
4806
4807 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4808
4809 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4810 that time stamps of directories could also be changed.
4811 Don't request the too broad GENERIC_WRITE, only the more restrictive
4812 FILE_WRITE_ATTRIBUTES access rights.
4813
4814 * fileio.c (Fset_file_times): Special-case ignoring errors for
4815 directories only on MSDOS, not on MS-Windows.
4816
4817 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
4818
4819 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4820
4821 2012-10-04 Eli Zaretskii <eliz@gnu.org>
4822
4823 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4824 see whether CreateFile failed.
4825
4826 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4827
4828 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4829 to avoid similar races.
4830 * keyboard.c (pending_signals): Now bool, not int.
4831
4832 Port timers to OpenBSD, plus check for timer failures.
4833 OpenBSD problem reported by Han Boetes.
4834 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4835 and/or setitimer.
4836 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4837 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4838 like OpenBSD, which has timer_settime but does not declare it.
4839 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4840 whether to use itimerspec-related primitives. All uses of
4841 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4842
4843 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 * profiler.c (handle_profiler_signal): Fix a malloc race
4846 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4847
4848 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4849
4850 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4851
4852 2012-10-02 Eli Zaretskii <eliz@gnu.org>
4853
4854 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4855 consistent with the change in return value of 'safe_strsignal'.
4856
4857 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 Prefer plain 'static' to 'static inline' (Bug#12541).
4860 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4861 (bidi_set_sor_type, bidi_push_embedding_level)
4862 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4863 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4864 (bidi_cache_search, bidi_cache_ensure_space)
4865 (bidi_cache_iterator_state, bidi_cache_find)
4866 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4867 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4868 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4869 Now 'static', not 'static inline'.
4870
4871 Count overruns when profiling; change units to ns.
4872 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4873 Give extra weight to samples after overruns, to attempt to count
4874 the time more accurately.
4875 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4876 the underlying primitives nominally do ns.
4877 (Fprofiler_cpu_start): Document the change. Mention that
4878 the sampling intervals are only approximate.
4879
4880 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4881
4882 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4883
4884 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4885 case for the special 0 coding-system.
4886
4887 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4888 (Fmake_overlay): Remove redundant tests.
4889 (fix_start_end_in_overlays): Remove redundant recentering.
4890
4891 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
4892
4893 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4894 Update dependencies.
4895
4896 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4897
4898 Fix a malloc race condition involving strsignal.
4899 A signal can arrive in the middle of a malloc, and Emacs's signal
4900 handler can invoke strsignal, which can invoke malloc, which is
4901 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4902 Fix it by altering the signal handler so that it does not invoke
4903 strsignal.
4904 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4905 * process.c (status_message): Use const pointer, in case strsignal
4906 is #defined to safe_strsignal.
4907 * sysdep.c (sys_siglist, init_signals): Always define and
4908 initialize a substitute sys_siglist if the system does not define
4909 one, even if HAVE_STRSIGNAL.
4910 (safe_strsignal): Rename from strsignal. Always define,
4911 using sys_siglist. Return a const pointer.
4912 * syssignal.h (safe_strsignal): New decl.
4913 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4914
4915 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4916
4917 * w32proc.c (timer_loop): Fix code that waits for timer
4918 expiration, to avoid high CPU usage.
4919
4920 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4921
4922 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4923 (sweep_weak_table): Remove redundant prototypes.
4924
4925 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4926
4927 * emacs.c: Move the inclusion of TERM_HEADER after including
4928 windows.h on WINDOWSNT. This avoids compilation problems with
4929 MSVC.
4930
4931 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4932
4933 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4934 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4935 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4936 as the previous version used 'void *'.
4937
4938 * ralloc.c (ROUNDUP): Fix last change.
4939 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4940 'size_t'.
4941
4942 * w32proc.c <disable_itimers>: New static flag.
4943 (init_timers): Initialize it to zero, after creating the critical
4944 sections used by the timer threads.
4945 (term_timers): Set to 1 before deleting the critical sections.
4946 (getitimer, setitimer): If disable_itimers is non-zero, return an
4947 error indication without doing anything. Reported by Fabrice
4948 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4949 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4950 return results.
4951 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4952 support timers.
4953
4954 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4955 term_ntproc after all the other bookkeeping, to get timers working
4956 as long as possible.
4957
4958 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4959
4960 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4961 Suggested by Juri Linkov in
4962 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4963
4964 Prefer plain 'static' to 'static inline' (Bug#12541).
4965 With static functions, modern compilers inline pretty well by
4966 themselves; advice from programmers often hurts as much as it helps.
4967 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4968 this change shrinks the text size of the Emacs executable by 1.1%
4969 without affecting CPU significantly in my benchmark.
4970 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4971 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4972 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4973 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4974 (bset_auto_fill_function, bset_auto_save_file_format)
4975 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4976 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4977 (bset_cache_long_line_scans, bset_case_fold_search)
4978 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4979 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4980 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4981 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4982 (bset_header_line_format, bset_indicate_buffer_boundaries)
4983 (bset_indicate_empty_lines, bset_invisibility_spec)
4984 (bset_left_fringe_width, bset_major_mode, bset_mark)
4985 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4986 (bset_name, bset_overwrite_mode, bset_pt_marker)
4987 (bset_right_fringe_width, bset_save_length)
4988 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4989 (bset_scroll_up_aggressively, bset_selective_display)
4990 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4991 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4992 (set_buffer_overlays_after):
4993 * category.c (bset_category_table):
4994 * charset.c (read_hex):
4995 * coding.c (produce_composition, produce_charset)
4996 (handle_composition_annotation, handle_charset_annotation)
4997 (char_encodable_p):
4998 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4999 (assign_row, set_frame_matrix_frame, make_current)
5000 (add_row_entry):
5001 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5002 * fns.c (maybe_resize_hash_table):
5003 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5004 * gmalloc.c (register_heapinfo):
5005 * image.c (lookup_image_type):
5006 * intervals.c (set_interval_object, set_interval_left)
5007 (set_interval_right, copy_interval_parent, rotate_right)
5008 (rotate_left, balance_possible_root_interval):
5009 * keyboard.c (kset_echo_string, kset_kbd_queue)
5010 (kset_keyboard_translate_table, kset_last_prefix_arg)
5011 (kset_last_repeatable_command, kset_local_function_key_map)
5012 (kset_overriding_terminal_local_map, kset_real_last_command)
5013 (kset_system_key_syms, clear_event, set_prop):
5014 * lread.c (digit_to_number):
5015 * marker.c (attach_marker, live_buffer, set_marker_internal):
5016 * nsterm.m (ns_compute_glyph_string_overhangs):
5017 * process.c (pset_buffer, pset_command)
5018 (pset_decode_coding_system, pset_decoding_buf)
5019 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5020 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5021 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5022 * syntax.c (bset_syntax_table, dec_bytepos):
5023 * terminal.c (tset_param_alist):
5024 * textprop.c (interval_has_some_properties)
5025 (interval_has_some_properties_list):
5026 * window.c (wset_combination_limit, wset_dedicated)
5027 (wset_display_table, wset_hchild, wset_left_fringe_width)
5028 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5029 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5030 (wset_right_fringe_width, wset_right_margin_cols)
5031 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5032 (wset_vertical_scroll_bar_type, wset_window_parameters):
5033 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5034 (wset_column_number_displayed, wset_region_showing)
5035 (window_box_edges, run_window_scroll_functions)
5036 (append_glyph_string_lists, prepend_glyph_string_lists)
5037 (append_glyph_string, set_glyph_string_background_width)
5038 (append_glyph, append_composite_glyph)
5039 (take_vertical_position_into_account):
5040 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5041 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5042 (lface_hash, lface_same_font_attributes_p, lookup_face):
5043 * xml.c (libxml2_loaded_p):
5044 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5045 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5046 Now 'static', not 'static inline'.
5047
5048 * bidi.c: Tune.
5049 (bidi_copy_it): Do the whole copy with a single memcpy.
5050 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5051
5052 Revert the FOLLOW-SYMLINKS change for file-attributes.
5053 Doing it right would require several changes to Tramp, and there's
5054 not enough time to get that tested before the freeze today.
5055 * dired.c (directory_files_internal, Ffile_attributes):
5056 Undo last change.
5057
5058 * frame.c (x_report_frame_params): Port better to wider ints.
5059 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5060 or that pointers can be printed in 15 decimal digits.
5061 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5062
5063 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5064
5065 Support x64 build on MS-Windows.
5066 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5067 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5068 compatibility with x64.
5069 (x_get_focus_frame): Add prototype.
5070
5071 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5072 defining an XRectangle structure.
5073
5074 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5075 arithmetics for compatibility with x64.
5076
5077 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5078 compatibility with x64.
5079
5080 * w32heap.h: Adjust prototypes and declarations.
5081
5082 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5083 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5084 DWORD, long, and unsigned long, for compatibility with x64.
5085 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5086 (sbrk): Argument is now of type ptrdiff_t.
5087
5088 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5089 less than 0x0500.
5090 (w32_msg_pump): Use WPARAM type for 'result'.
5091
5092 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5093 architecture.
5094 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5095 compatibility with x64.
5096
5097 * vm-limit.c (lim_data): Now size_t.
5098 (check_memory_limits): Adjust prototypes of real_morecore and
5099 __morecore to receive argument of type ptrdiff_t. Use size_t for
5100 five_percent and data_size.
5101
5102 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5103 variables, for compatibility with x64.
5104 (rva_to_section, offset_to_section, relocate_offset)
5105 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5106 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5107 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5108 for compatibility with x64.
5109
5110 * sysdep.c (STDERR_FILENO): Define if not already defined.
5111
5112 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5113 (__morecore): Argument type is now ptrdiff_t.
5114 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5115 (relinquish): Use ptrdiff_t type for 'excess'.
5116 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5117
5118 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5119 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5120 instead of a literal number.
5121
5122 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5123 (min): Define only if not already defined.
5124
5125 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5126 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5127 hosts.
5128
5129 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5130 'bitmaps' is a pointer.
5131
5132 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5133
5134 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5135
5136 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5137
5138 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5139 * dired.c (directory_files_internal, Ffile_attributes):
5140 New arg follow_symlinks. All uses changed.
5141
5142 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5143
5144 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5145
5146 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5147
5148 Support atimers and CPU profiler via profile.c on MS-Windows.
5149 * w32proc.c (sig_mask, crit_sig): New static variables.
5150 (sys_signal): Support SIGALRM and SIGPROF.
5151 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5152 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5153 sigfillset, and sigprocmask are no longer no-ops.
5154 (sigismember): New function.
5155 (struct itimer_data): New definition.
5156 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5157 (crit_prof): New static variables.
5158 (MAX_SINGLE_SLEEP): New definition.
5159 (timer_loop, stop_timer_thread, term_timers, init_timers)
5160 (start_timer_thread, getitimer, setitimer): New functions.
5161 (alarm): No longer a no-op, calls setitimer.
5162
5163 * w32.c (term_ntproc): Call term_timers.
5164 (init_ntproc): Make sure all signals are unblocked at startup, to
5165 erase any traces of dumping. Call init_timers.
5166
5167 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5168 Windows-specific code to display the hourglass mouse pointer is no
5169 longer used.
5170 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5171 to hourglass timer expiration.
5172 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5173 Remove, no longer used.
5174 (w32_note_current_window, show_hourglass, hide_hourglass):
5175 New functions, in support of hourglass cursor display similar to other
5176 window systems.
5177 (syms_of_w32fns): Don't initialize hourglass_timer.
5178
5179 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5180 WINDOWSNT as well.
5181 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5182
5183 * w32.h (init_timers, term_timers): Add prototypes.
5184
5185 2012-09-30 Kenichi Handa <handa@gnu.org>
5186
5187 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5188 to the buffer relocation which may be caused by ccl_driver.
5189
5190 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5191
5192 * xfns.c (Fx_file_dialog): Update comment.
5193
5194 * w32fns.c (Fx_file_dialog): Update comment.
5195
5196 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5197 Initialize panel name field if OSX >= 10.6.
5198
5199 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5200
5201 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5202
5203 * nsterm.m (NEW_STYLE_FS): New define.
5204 (ns_fullscreen_hook, windowWillEnterFullScreen)
5205 (windowDidEnterFullScreen, windowWillExitFullScreen)
5206 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5207 (setFSValue): New functions.
5208 (EmacsFSWindow): New implementation.
5209 (canBecomeKeyWindow): New function for EmacsFSWindow.
5210 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5211 (dealloc): Release nonfs_window if in fullscreen.
5212 (updateFrameSize:): Call windowDidMove to update top/left.
5213 (windowWillResize:toSize:): Check if frame is still maximized.
5214 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5215 next_maximized, maximized_width, maximized_height and nonfs_window.
5216 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5217 tbar_height.
5218 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5219 fullscreen. Set maximized_width/height. Act on next_maximized.
5220
5221 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5222 (EmacsView): Add variables for fullscreen.
5223 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5224 (EmacsFSWindow): New interface for fullscreen.
5225
5226 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5227
5228 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5229
5230 2012-09-30 Chong Yidong <cyd@gnu.org>
5231
5232 * fns.c (Frandom): Doc fix.
5233
5234 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5235
5236 * window.c (Vwindow_combination_limit): New default value.
5237 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5238
5239 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5240
5241 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5242 Suggested by Eli Zaretskii in
5243 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5244
5245 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5246
5247 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5248 HAVE_TIMER_SETTIME is defined.
5249
5250 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 Profiler improvements: more-accurate timers, overflow checks.
5253 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5254 signal.h, setjmp.h. Include systime.h instead.
5255 (saturated_add): New function.
5256 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5257 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5258 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5259 New static vars.
5260 (enum profiler_cpu_running): New enum.
5261 (profiler_cpu_running): Now of that enum type, not bool.
5262 All uses changed to store the new value.
5263 (handle_profiler_signal): Rename from sigprof_handler_1,
5264 for consistency with other handlers. Do not check whether
5265 cpu_log is a hash-table if garbage collecting, since it
5266 doesn't matter in that case.
5267 (deliver_profiler_signal): Rename from sigprof_handler,
5268 for consistency with other handlers.
5269 (setup_cpu_timer): New function, with much of what used to be in
5270 Fprofiler_cpu_start. Check for out-of-range argument.
5271 Prefer timer_settime if available, and prefer
5272 thread cputime clocks, then process cputime clocks, then
5273 monotonic clocks, to the old realtime clock. Use make_timeval
5274 to round more-correctly when falling back to setitimer.
5275 (Fprofiler_cpu_start): Use it.
5276 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5277 Don't assume that passing NULL as the 2nd argument of setitimer
5278 is the same as passing a pointer to all-zero storage.
5279 Ignore SIGPROF afterwards.
5280 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5281 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5282 non-fatal signal handlers. Ignore SIGPROF on startup.
5283 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5284 in profiler.c, since sysdep.c now uses it.
5285
5286 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5287 Suggested by Eli Zaretskii in
5288 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5289
5290 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5291
5292 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5293
5294 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5295
5296 * lisp.h (struct backtrace): Remove indirection for `function' field.
5297 * xdisp.c (redisplay_internal):
5298 * profiler.c (record_backtrace, sigprof_handler_1):
5299 * alloc.c (Fgarbage_collect):
5300 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5301 (Fbacktrace_frame): Adjust accordingly.
5302
5303 2012-09-28 Glenn Morris <rgm@gnu.org>
5304
5305 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5306 (Frun_hook_with_args_until_failure): Doc fixes.
5307
5308 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5309
5310 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5311 Qautomatic_redisplay and change the symbol name. All users changed.
5312
5313 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5314
5315 * profiler.c (sigprof_handler): Fix race condition.
5316
5317 2012-09-28 Glenn Morris <rgm@gnu.org>
5318
5319 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5320
5321 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5322
5323 Check more robustly for timer_settime.
5324 * Makefile.in (LIB_TIMER_TIME): New macro.
5325 (LIBES): Add it.
5326 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5327 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5328 call timer_settime.
5329
5330 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5331
5332 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5333
5334 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5335
5336 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5337
5338 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5339
5340 * character.h (MAYBE_UNIFY_CHAR): Remove.
5341 * charset.c, charset.h (maybe_unify_char): Now static.
5342 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5343 Since this stuff is now private to charset.c, there's no need for
5344 a public macro and no need to inline by hand.
5345
5346 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5347 Stefan Monnier <monnier@iro.umontreal.ca>
5348 Juanma Barranquero <lekktu@gmail.com>
5349
5350 * profiler.c: New file.
5351 * Makefile.in (base_obj): Add profiler.o.
5352 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5353 ($(BLD)/profiler.$(O)): New target.
5354 * emacs.c (main): Call syms_of_profiler.
5355 * alloc.c (Qautomatic_gc): New constant.
5356 (MALLOC_PROBE): New macro.
5357 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5358 (total_bytes_of_live_objects): New function.
5359 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5360 Call malloc_probe for the memory profiler.
5361 (syms_of_alloc): Define Qautomatic_gc.
5362 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5363 race condition.
5364 (struct backtrace): Move definition...
5365 * lisp.h (struct backtrace): ..here.
5366 (Qautomatic_gc, profiler_memory_running): Declare vars.
5367 (malloc_probe, syms_of_profiler): Declare functions.
5368 * xdisp.c (Qautomatic_redisplay): New constant.
5369 (redisplay_internal): Record itself in backtrace_list.
5370 (syms_of_xdisp): Define Qautomatic_redisplay.
5371
5372 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5373 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5374
5375 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5376
5377 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5378
5379 Prefer POSIX timers if available.
5380 They avoid a race if the timer is too close to the current time.
5381 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5382 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5383 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5384
5385 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5386
5387 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5388 CHAR_STRING_ADVANCE.
5389 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5390 STRING_CHAR_ADVANCE.
5391
5392 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5393
5394 Move Vlibrary_cache to emacs.c and reset before dumping.
5395
5396 * lisp.h (reset_image_types): Declare.
5397 [WINDOWSNT] (Vlibrary_cache): Declare.
5398
5399 * image.c (reset_image_types): New function.
5400
5401 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5402 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5403 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5404
5405 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5406 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5407
5408 * w32.h (Vlibrary_cache): Do not declare.
5409
5410 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5411
5412 * w32proc.c (sys_signal): Handle all signals defined by the
5413 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5414 handlers for signals supported by Windows. Don't override
5415 term_ntproc as the handler for SIGABRT.
5416 (sigaction): Rewrite to call sys_signal instead of duplicating its
5417 code.
5418 (sys_kill): Improve commentary.
5419
5420 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5421 consistency with a signature of a signal handler. All callers
5422 changed.
5423 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5424 install term_ntproc as a signal handler for SIGABRT, as that
5425 should be done by the dumped Emacs.
5426
5427 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5428
5429 * w32select.c (term_w32select): Protect against repeated
5430 invocation by setting clipboard_owner to NULL after calling
5431 DestroyWindow.
5432
5433 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5434 and term_ntproc to their modified signatures.
5435
5436 * character.c (char_string, string_char): Remove calls to
5437 MAYBE_UNIFY_CHAR. See the discussion starting at
5438 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5439 for the details.
5440
5441 2012-09-25 Chong Yidong <cyd@gnu.org>
5442
5443 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5444
5445 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5446
5447 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5448 when encountering an unknown bytecode.
5449
5450 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5451
5452 image.c, indent.c: Use bool for booleans.
5453 * dispextern.h (struct image_type): Members valid_p, load, init
5454 now return bool, not int. All uses changed.
5455 * image.c: Omit unnecessary static decls.
5456 (x_create_bitmap_mask, x_build_heuristic_mask):
5457 Return void, not int, since callers don't care about the return value.
5458 (x_create_bitmap_mask, define_image_type, valid_image_p)
5459 (struct image_keyword, parse_image_spec, image_spec_value)
5460 (check_image_size, image_background)
5461 (image_background_transparent, x_clear_image_1)
5462 (postprocess_image, lookup_image, x_check_image_size)
5463 (x_create_x_image_and_pixmap, xbm_image_p)
5464 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5465 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5466 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5467 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5468 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5469 (png_image_p, init_png_functions, png_load_body, png_load)
5470 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5471 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5472 (init_gif_functions, gif_load, imagemagick_image_p)
5473 (imagemagick_load_image, imagemagick_load, svg_image_p)
5474 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5475 (gs_load):
5476 * nsimage.m (ns_load_image):
5477 * nsterm.m (ns_defined_color):
5478 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5479 * xfns.c (x_defined_color):
5480 * xterm.c (x_alloc_lighter_color_for_widget)
5481 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5482 (x_alloc_lighter_color):
5483 * indent.c (disptab_matches_widthtab, current_column)
5484 (scan_for_column, string_display_width, indented_beyond_p)
5485 (compute_motion, vmotion, Fvertical_motion):
5486 Use bool for booleans.
5487
5488 2012-09-24 Chong Yidong <cyd@gnu.org>
5489
5490 * chartab.c (Fset_char_table_default): Obsolete function removed.
5491
5492 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5493
5494 Move pid_t related decls out of lisp.h.
5495 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5496 (interruptible_wait_for_termination):
5497 Move these decls from lisp.h to syswait.h, since they use pid_t.
5498 Needed on FreeBSD; see Herbert J. Skuhra in
5499 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5500 * callproc.c: Include syswait.h.
5501
5502 gnutls.c, gtkutil.c: Use bool for boolean.
5503 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5504 (emacs_gnutls_handle_error):
5505 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5506 (xg_hide_tooltip, xg_create_frame_widgets)
5507 (create_dialog, xg_uses_old_file_dialog)
5508 (xg_get_file_with_chooser, xg_get_file_with_selection)
5509 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5510 (xg_item_label_same_p, xg_update_menubar)
5511 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5512 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5513 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5514 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5515 (update_frame_tool_bar, free_frame_tool_bar):
5516 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5517 * nsmenu.m (ns_update_menubar):
5518 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5519 * xfns.c (Fx_show_tip) [USE_GTK]:
5520 Use bool for boolean.
5521 * gtkutil.c (xg_update_frame_menubar):
5522 * xmenu.c (update_frame_menubar):
5523 Return void, not int, since caller ignores return value.
5524 * gtkutil.c (xg_change_toolbar_position):
5525 Return void, not 1.
5526
5527 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5528
5529 * makefile.w32-in (BLOCKINPUT_H): Remove.
5530 (SYSSIGNAL_H): New macro.
5531 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5532 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5533 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5534 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5535 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5536 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5537 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5538 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5539 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5540 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5541 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5542 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5543 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5544 ($(BLD)/w32xfns.$(O)): Update dependencies.
5545
5546 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5547
5548 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5549 fatal_error_backtrace.
5550
5551 * w32proc.c (sys_kill): Undo last change: don't do anything when
5552 invoked to deliver SIGABRT to our own process. This is now
5553 handled by emacs_raise.
5554
5555 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5556
5557 * w32term.c (w32_read_socket): Remove leftover reference to
5558 interrupt_input_pending.
5559
5560 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5561
5562 Do not use SA_NODEFER.
5563 Problem reported by Dani Moncayo in
5564 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5565 * alloc.c (die):
5566 * sysdep.c (emacs_abort): Do not reset signal handler.
5567 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5568 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5569 wanted even on POSIXish hosts, and it doesn't work on Windows.
5570
5571 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5572
5573 * xterm.c (x_term_init): Call fixup_locale before and after calling
5574 gtk_init (Bug#12392).
5575
5576 2012-09-23 Chong Yidong <cyd@gnu.org>
5577
5578 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5579 Vdynamic_library_alist.
5580
5581 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5582 (Fgnutls_available_p): Caller changed.
5583
5584 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5585 (Flibxml_parse_xml_region): Likewise.
5586
5587 * dispextern.h (struct image_type): Remove arg from init function.
5588
5589 * image.c (Finit_image_library, lookup_image_type)
5590 (define_image_type): Remove now-unneeded second arg.
5591 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5592 (init_tiff_functions, init_gif_functions, init_svg_functions):
5593 Arglist and w32_delayed_load calling convention changed.
5594 (gs_type): Remove init_gs_functions; there is no such function.
5595 (valid_image_p, make_image): Fix caller to lookup_image_type.
5596
5597 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5598
5599 Simplify and avoid signal-handling races (Bug#12471).
5600 * alloc.c (die):
5601 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5602 Avoid recursive loop if there's a fatal error in the function itself.
5603 * atimer.c (pending_atimers):
5604 * blockinput.h: Don't include "atimer.h"; no longer needed.
5605 (interrupt_input_pending): Remove. All uses removed.
5606 pending_signals now counts both atimers and ordinary interrupts.
5607 This is less racy than having three separate pending-signal flags.
5608 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5609 (input_blocked_p):
5610 Rename from their upper-case counterparts BLOCK_INPUT,
5611 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5612 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5613 This makes it easier to access volatile variables more accurately.
5614 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5615 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5616 that's more reliable if the code is buggy and sets
5617 interrupt_input_blocked to a negative value. All uses changed.
5618 * atimer.c (deliver_alarm_signal):
5619 Remove. No need to deliver this to the parent; any thread can
5620 handle this signal now. All uses replaced by underlying handler.
5621 * atimer.c (turn_on_atimers):
5622 * dispnew.c (handle_window_change_signal):
5623 * emacs.c (handle_danger_signal):
5624 * keyboard.c (kbd_buffer_get_event):
5625 Don't reestablish signal handler; not needed with sigaction.
5626 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5627 (UNBLOCK_INPUT_TO):
5628 Rework to avoid unnecessary accesses to volatile variables.
5629 (UNBLOCK_INPUT_TO): Now a function.
5630 (totally_unblock_input, unblock_input): New decls.
5631 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5632 (init_data): Remove. Necessary stuff now done in init_signal.
5633 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5634 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5635 (fatal_error_code): Remove; no longer needed.
5636 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5637 it doesn't always backtrace. All uses changed. No need to reset
5638 signal to default, since sigaction and/or die does that for us now.
5639 Use emacs_raise (FOO), not kill (getpid (), FOO).
5640 (main): Check more-accurately whether we're dumping.
5641 Move fatal-error setup to sysdep.c
5642 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5643 * gtkutil.c (xg_get_file_name, xg_get_font):
5644 Remove no-longer-needed signal-mask manipulation.
5645 * keyboard.c, process.c (POLL_FOR_INPUT):
5646 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5647 * keyboard.c (read_avail_input): Remove.
5648 All uses replaced by gobble_input.
5649 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5650 (kbd_buffer_store_event_hold, gobble_input):
5651 (record_asynch_buffer_change) [USABLE_SIGIO]:
5652 (store_user_signal_events):
5653 No need to mess with signal mask.
5654 (gobble_input): If blocking input and there are terminals, simply
5655 set pending_signals to 1 and return. All hooks changed to not
5656 worry about whether input is blocked.
5657 (process_pending_signals): Clear pending_signals before processing
5658 them, in case a signal comes in while we're processing.
5659 By convention callers now test pending_signals before calling us.
5660 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5661 New functions, to support changes to blockinput.h.
5662 (handle_input_available_signal): Now extern.
5663 (reinvoke_input_signal): Remove. All uses replaced by
5664 handle_async_input.
5665 (quit_count): Now volatile, since a signal handler uses it.
5666 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5667 All callers changed. Block SIGINT only if not already blocked.
5668 Clear sigmask reliably, even if Fsignal returns, which it can.
5669 Omit unnecessary accesses to volatile var.
5670 (quit_throw_to_read_char): No need to restore sigmask.
5671 * keyboard.c (gobble_input, handle_user_signal):
5672 * process.c (wait_reading_process_output):
5673 Call signal-handling code rather than killing ourselves.
5674 * lisp.h: Include <float.h>, for...
5675 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5676 (pending_signals): Now volatile.
5677 (syms_of_data): Now const if IEEE floating point.
5678 (handle_input_available_signal) [USABLE_SIGIO]:
5679 (terminate_due_to_signal, record_child_status_change): New decls.
5680 * process.c (create_process): Avoid disaster if memory is exhausted
5681 while we're processing a vfork, by tightening the critical section
5682 around the vfork.
5683 (send_process_frame, process_sent_to, handle_pipe_signal)
5684 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5685 ignores SIGPIPE.
5686 (send_process): No need for setjmp/longjmp any more, since the
5687 SIGPIPE stuff is now gone. Instead, report an error if errno
5688 is EPIPE.
5689 (record_child_status_change): Now extern. PID and W are now args.
5690 Return void, not bool. All callers changed.
5691 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5692 Remove. All uses removed. This bug should be fixed now in a
5693 different way.
5694 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5695 and record the child status change directly. This avoids the
5696 need to futz with the signal mask.
5697 (process_fatal_action): Move here from emacs.c.
5698 (emacs_sigaction_flags): New function, containing
5699 much of what used to be in emacs_sigaction_init.
5700 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5701 caught by emacs, to make races less likely.
5702 (deliver_process_signal): Rename from handle_on_main_thread.
5703 All uses changed.
5704 (BACKTRACE_LIMIT_MAX): Now at top level.
5705 (thread_backtrace_buffer, threadback_backtrace_pointers):
5706 New static vars.
5707 (deliver_thread_signal, deliver_fatal_thread_signal):
5708 New functions, for more-accurate delivery of thread-specific signals.
5709 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5710 (deliver_arith_signal): Handle in this thread, not
5711 in the main thread, since it's triggered by this thread.
5712 (maybe_fatal_sig): New function.
5713 (init_signals): New arg DUMPING so that we can be more accurate
5714 about whether we're dumping. Caller changed.
5715 Treat thread-specific signals differently from process-general signals.
5716 Block all signals while handling fatal error; that's safer.
5717 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5718 on IEEE hosts.
5719 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5720 Ignore SIGPIPE unless batch.
5721 (emacs_backtrace): Output backtrace for the appropriate thread,
5722 which is not necessarily the main thread.
5723 * syssignal.h: Include <stdbool.h>.
5724 (emacs_raise): New macro.
5725 * xterm.c (x_connection_signal): Remove; no longer needed
5726 now that we use sigaction.
5727 (x_connection_closed): No need to mess with sigmask now.
5728 (x_initialize): No need to reset SIGPIPE handler here, since
5729 init_signals does this for us now.
5730
5731 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5732
5733 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5734 background rect may be larger (Bug#12245).
5735
5736 2012-09-23 Chong Yidong <cyd@gnu.org>
5737
5738 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5739
5740 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5741
5742 * .gdbinit: Just stop at fatal_error_backtrace.
5743 See Stefan Monnier's request in
5744 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5745 Remove no-longer-used query of system type.
5746
5747 2012-09-22 Chong Yidong <cyd@gnu.org>
5748
5749 * search.c (Freplace_match): Doc fix (Bug#12325).
5750
5751 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5752
5753 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5754 (Fline_end_position): Doc fix.
5755
5756 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5757
5758 2012-09-22 Chong Yidong <cyd@gnu.org>
5759
5760 * dispextern.h (struct image_type): Add new slot, storing a type
5761 initialization function.
5762
5763 * image.c (define_image_type): Call the image initializer function
5764 if it is defined. Arguments and return value changed.
5765 (valid_image_p, make_image): Callers changed.
5766 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5767 (gif_type, imagemagick_type, svg_type, gs_type):
5768 Add initialization functions.
5769 (Finit_image_library): Call lookup_image_type.
5770 (CHECK_LIB_AVAILABLE): Macro deleted.
5771 (lookup_image_type): Call define_image_type here, rather than via
5772 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5773 (syms_of_image): Move define_image_type calls for xbm_type and
5774 pbm_type to lookup_image_type.
5775
5776 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5777
5778 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5779 'idle_timers' from here ...
5780 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5781 lists, to avoid infloops when the timer does something stupid,
5782 like reinvoke itself with the same or smaller time-out.
5783 (Bug#12447)
5784
5785 2012-09-22 Martin Rudalics <rudalics@gmx.at>
5786
5787 * window.c (Fsplit_window_internal): Handle only Qt value of
5788 Vwindow_combination_limit separately.
5789 (Qtemp_buffer_resize): New symbol.
5790 (Vwindow_combination_limit): New default value.
5791 Rewrite doc-string.
5792
5793 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5794
5795 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5796 the new overlay string. (Bug#10159)
5797
5798 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5799
5800 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5801 or that fprintf is async-signal-safe. POSIX doesn't require
5802 either assumption.
5803
5804 2012-09-22 Chong Yidong <cyd@gnu.org>
5805
5806 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5807 (Bug#8207).
5808
5809 2012-09-22 Kenichi Handa <handa@gnu.org>
5810
5811 * composite.c (composition_reseat_it): Handle the case that a
5812 grapheme cluster is not covered by a single font (Bug#12352).
5813
5814 2012-09-21 Chong Yidong <cyd@gnu.org>
5815
5816 * image.c (define_image_type): Avoid adding duplicate types to
5817 image_types (Bug#12463). Suggested by Jörg Walter.
5818
5819 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5820
5821 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5822 (print_load_command_name): Add case LC_DATA_IN_CODE.
5823 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5824
5825 2012-09-21 Glenn Morris <rgm@gnu.org>
5826
5827 * eval.c (Frun_hook_with_args_until_success)
5828 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5829
5830 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
5831
5832 * fileio.c (Ffile_selinux_context): Only call freecon when
5833 lgetfilecon succeeded.
5834 (Fset_file_selinux_context): Likewise. (Bug#12444)
5835
5836 2012-09-21 Eli Zaretskii <eliz@gnu.org>
5837
5838 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5839 reordering, locate the cursor by calling set_cursor_from_row; if
5840 that fails, clear the desired glyph matrix before returning a
5841 failure indication to the caller. Fixes leaving garbled display
5842 when fast scrolling with a down-key. (Bug#12403)
5843 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5844 scrolling through multibyte text.
5845
5846 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5847
5848 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5849 calling mark_vectorlike since that's the one that marks the window.
5850 (mark_discard_killed_buffers): Mark the final cdr.
5851 * window.h (struct window): Move prev/next_buffers to the
5852 non-standard fields.
5853 * window.c (make_window): Initialize prev/next_buffers manually.
5854
5855 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5856
5857 Omit unused arg EXPECTED from socket hooks.
5858 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5859 * nsterm.m (ns_term_init):
5860 * termhooks.h (struct terminal.read_socket_hook):
5861 * w32inevt.c (w32_console_read_socket):
5862 * w32term.c (w32_read_socket):
5863 * xterm.c (XTread_socket):
5864 Omit unused arg EXPECTED. All callers changed.
5865 (store_user_signal_events): Return void, not int, since callers no
5866 longer care about the return value. All uses changed.
5867
5868 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
5869
5870 * w32gui.h (XParseGeometry): Do not declare.
5871
5872 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5873
5874 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5875 Ignore 'expected'. See Eli Zaretskii in
5876 <http://bugs.gnu.org/12471#8> (last line).
5877
5878 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5879 (XParseGeometry): Now static. Substitute extremal values for
5880 values that are out of range.
5881
5882 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5883
5884 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5885
5886 * nsfns.m (XParseGeometry): Remove.
5887 (Fx_create_frame): Call x_set_offset to correctly interpret
5888 top_pos in geometry.
5889
5890 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5891 (Fx_parse_geometry): If there is a space in string, call
5892 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5893
5894 2012-09-17 Eli Zaretskii <eliz@gnu.org>
5895
5896 * search.c (scan_buffer): Use character positions in calls to
5897 region_cache_forward and region_cache_backward, not byte
5898 positions. (Bug#12196)
5899
5900 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5901 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5902
5903 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5904 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5905 emacs_blocked_malloc, now deleted.
5906
5907 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5908
5909 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5910 The workaround was for improving performance on Solaris 2.4, but
5911 is getting in the way now. Emacs will still work if someone is
5912 still running Solaris 2.4 in a museum somewhere; Sun dropped
5913 support for Solaris 2.4 in 2003.
5914 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5915 * process.c (create_process) [HAVE_WORKING_VFORK]:
5916 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5917 since Emacs no longer uses vfork on that platform.
5918
5919 2012-09-17 Glenn Morris <rgm@gnu.org>
5920
5921 * emacs.c: Use COPYRIGHT.
5922
5923 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5924
5925 Remove configure's --without-sync-input option (Bug#12450).
5926 When auditing signal-handling in preparation for cleaning it up,
5927 I found that SYNC_INPUT has race conditions and would be a real
5928 pain to fix. Since it's an undocumented and deprecated
5929 configure-time option, now seems like a good time to remove it.
5930 Also see <http://bugs.gnu.org/11080#16>.
5931 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5932 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5933 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5934 (malloc_hysteresis):
5935 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5936 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5937 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5938 (dont_register_blocks, bytes_used_when_reconsidered)
5939 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5940 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5941 [!SYSTEM_MALLOC && !SYNC_INPUT]:
5942 Remove. All uses removed.
5943 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5944 implementation, one that depends on whether the new macro
5945 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5946 is defined.
5947 * atimer.c (run_timers, handle_alarm_signal):
5948 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5949 (handle_async_input, process_pending_signals)
5950 (handle_input_available_signal, init_keyboard):
5951 * nsterm.m (ns_read_socket):
5952 * process.c (wait_reading_process_output):
5953 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5954 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5955 (emacs_write):
5956 * xterm.c (XTread_socket):
5957 Assume SYNC_INPUT.
5958 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5959 * eval.c (handling_signal): Remove. All uses removed.
5960 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5961 All uses replaced with the SYNC_INPUT version.
5962 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5963 Remove decls.
5964 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5965 Now static.
5966
5967 * font.c (Ffont_shape_gstring): Remove unused local.
5968
5969 2012-09-16 Glenn Morris <rgm@gnu.org>
5970
5971 * Makefile.in (clean): No longer run nextstep's clean.
5972
5973 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5974 (ns_frag): Remove.
5975 (ns-app): Move here from ns.mk, and simplify.
5976 (clean): Simplify nextstep entry.
5977 * ns.mk: Remove file.
5978
5979 2012-09-17 Kenichi Handa <handa@gnu.org>
5980
5981 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5982 not covert the last few charactes.
5983
5984 2012-09-16 Kenichi Handa <handa@gnu.org>
5985
5986 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5987 here, but just check the validity of glyphs in the glyph-string.
5988
5989 2012-09-16 Martin Rudalics <rudalics@gmx.at>
5990
5991 * window.c (Fwindow_parameter, Fset_window_parameter):
5992 Accept any window as argument (Bug#12452).
5993
5994 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5995
5996 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5997 to ns_term_init to avoid memory leak.
5998
5999 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6000 explicit retain/release.
6001 (ns_term_init): Only allow one display. Initialize outerpool and
6002 ns_*_types.
6003
6004 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6007 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6008 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6009 the Microsoft problem in a different way, by altering ../nt/config.nt.
6010
6011 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6012
6013 * w32xfns.c:
6014 * w32uniscribe.c:
6015 * w32term.c:
6016 * w32select.c:
6017 * w32reg.c:
6018 * w32proc.c:
6019 * w32menu.c:
6020 * w32inevt.c:
6021 * w32heap.c:
6022 * w32font.c:
6023 * w32fns.c:
6024 * w32console.c:
6025 * w32.c:
6026 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6027 by lisp.h. This completes removal of setjmp.h inclusion
6028 erroneously announced in the previous commit. (Bug#12446)
6029
6030 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6031 more accurate.
6032
6033 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6034 not defined as a macro. The latter happens on MS-Windows.
6035 (Bug#12446)
6036
6037 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6038
6039 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6040 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6041 Some instances of '#include <setjmp.h>' removed, if the
6042 only reason for the instance was because "lisp.h" was included.
6043 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6044 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6045 and _longjmp with the new symbols. Emacs already uses _setjmp if
6046 available, so this change affects only POSIXish hosts that have
6047 sigsetjmp but not _setjmp, such as some versions of Solaris and
6048 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6049 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6050 (png_load_body) [HAVE_PNG]:
6051 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6052 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6053 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6054 since PNG requires jmp_buf. This is the only exception to the
6055 general rule that we now use sys_setjmp and sys_longjmp.
6056 This exception is OK since this code does not change the signal
6057 mask or longjmp out of a signal handler.
6058
6059 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6060
6061 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6062 Include "syssignal.h", for 'main_thread'.
6063
6064 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 Avoid out-of-range marker position (Bug#12426).
6067 * insdel.c (replace_range, replace_range_2):
6068 Adjust markers before overlays, as suggested by comments.
6069 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6070 Remove redundant check before calling offset_intervals.
6071
6072 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6073
6074 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6075 current buffer (Bug#12387).
6076
6077 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6078
6079 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6080
6081 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6082
6083 Use a more backwards-compatible timer format (Bug#12430).
6084 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6085 vector element, not from the 4th, since PSECS is now at the end.
6086 (Fcurrent_idle_time): Doc fix.
6087
6088 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6089
6090 Function to mark objects and remove killed buffers at once.
6091 * alloc.c (discard_killed_buffers): Rename to ...
6092 (mark_discard_killed buffers) ... new name. Add marking
6093 of remaining objects. Fix comment. Adjust users.
6094 (mark_object): Do not touch frame buffer lists here.
6095 * frame.c (delete_frame): Reset frame buffer lists here.
6096
6097 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6098
6099 Better workaround for GNOME bug when --enable-gcc-warnings.
6100 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6101 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6102 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6103
6104 Simplify SIGIO usage (Bug#12408).
6105 The code that dealt with SIGIO was crufty and confusing, e.g., it
6106 played tricks like "#undef SIGIO" but these tricks were not used
6107 consistently. Simplify mostly by not #undeffing standard symbols,
6108 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6109 or not as we please) rather than "defined SIGIO" (standard symbol
6110 that we probably shouldn't #undef).
6111 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6112 Modules that need it can include it.
6113 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6114 * dispextern.h (ignore_sigio): New decl.
6115 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6116 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6117 * emacs.c (shut_down_emacs):
6118 * keyboard.c (kbd_buffer_store_event_hold):
6119 Use ignore_sigio rather than invoking 'signal' directly.
6120 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6121 for FIONREAD.
6122 (FIONREAD, SIGIO): Do not #undef.
6123 (tty_read_avail_input): Use #error rather than a syntax error.
6124 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6125 for I_PIPE, used by SETUP_SLAVE_PTY.
6126 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6127 * sysdep.c (croak): Remove; no longer needed. This bit of
6128 temporary code, with Fred N. Fish's comment that it's temporary,
6129 has been in Emacs since at least 1992!
6130 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6131 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6132 * syssignal.h (croak): Remove decl.
6133 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6134 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6135 now that we're termios-only.
6136 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6137 * term.c (dissociate_if_controlling_tty): Use #error rather than
6138 a run-time error.
6139
6140 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6141 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6142 to work around GNOME bug 683906.
6143 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6144 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6145 This works around GCC bug 54561.
6146
6147 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6148
6149 More fixes for 'volatile' and setjmp/longjmp.
6150 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6151 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6152 (png_load_body) [HAVE_PNG]:
6153 (jpeg_load_body) [HAVE_JPEG]:
6154 New function, with most of the old parent function's body.
6155 (png_load) [HAVE_PNG]:
6156 (jpeg_load) [HAVE_JPEG]:
6157 Invoke the new function, to avoid longjmp munging our locals.
6158 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6159 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6160 longjmp is passed 2, as the C standard doesn't guarantee this.
6161 Instead, store the failure code into mgr->failure_code.
6162
6163 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6164
6165 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6166 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6167 (syms_of_keyboard): Remove support for unread-command-char.
6168
6169 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6170
6171 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6172 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6173 violation. (Bug#12426)
6174
6175 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6176
6177 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6178
6179 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6180
6181 * eval.c: Add `inhibit-debugger'.
6182 (Qinhibit_debugger): New symbol.
6183 (call_debugger): Bind it instead of Qdebug_on_error.
6184 (maybe_call_debugger): Test Vinhibit_debugger.
6185 (syms_of_eval): Define inhibit-debugger.
6186 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6187 (syms_of_xdisp): Remove inhibit-debug-on-message.
6188
6189 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6190
6191 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6192 If a nonvolatile local variable is written before a _longjmp to
6193 the frame containing the variable, and is read after the _longjmp,
6194 the value read is indeterminate. Some local variables of type
6195 'struct handler' and 'struct catchtag' are used in this way, so
6196 mark each of their slots as volatile if the slot can be set before
6197 _longjmp and read afterwards.
6198 * lisp.h (struct handler): var and chosen_clause are now volatile.
6199 (struct catchtag): val, next, and pdlcount are now volatile.
6200
6201 * bidi.c (bidi_push_it, bidi_pop_it):
6202 * fns.c (copy_hash_table):
6203 * image.c (define_image_type):
6204 * keyboard.c (kbd_buffer_store_event_hold):
6205 * process.c (Fprocess_send_eof):
6206 * xfaces.c (x_create_gc) [HAVE_NS]:
6207 * xgselect.c (xg_select):
6208 Prefer assignment to memcpy when either will do.
6209
6210 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6211 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6212 time an item is removed. No need to mark this function 'inline';
6213 the compiler knows better than we do.
6214
6215 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6216
6217 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6218 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6219 to change_frame_size (Bug#12388).
6220 (windowDidResize:): Pass YES to updateFrameSize.
6221
6222 * nsterm.h: Add delay parameter to updateFrameSize.
6223
6224 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6225
6226 Discard killed buffers from deleted window and frame objects.
6227 This reduces an amount of references to killed buffers and
6228 helps GC to reclaim them faster.
6229 * alloc.c (discard_killed_buffers): New function.
6230 (mark_object): Use it for deleted windows and frames.
6231 (mark_object): If symbol's value is set up for a killed buffer
6232 or deleted frame, restore its global binding.
6233 * data.c (swap_in_global_binding): Add GC notice.
6234 (swap_in_symval_forwarding): Use convenient set_blv_where.
6235 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6236 * window.h: ... to here.
6237
6238 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6239
6240 Convenient macro to check whether the buffer is live.
6241 * buffer.h (BUFFER_LIVE_P): New macro.
6242 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6243 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6244
6245 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6246
6247 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6248 composition cases (Bug#12364).
6249
6250 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6251 overhang of succeeding glyphs overlapping box cursor.
6252
6253 * w32term.c (x_draw_glyph_string): Likewise.
6254
6255 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6256
6257 Simplify, document, and port floating-point (Bug#12381).
6258 The porting part of this patch fixes bugs on non-IEEE platforms
6259 with frexp, ldexp, logb.
6260 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6261 Now static.
6262 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6263 support, by removing commented-out code and briefly listing the
6264 C89 functions excluded. The commented-out stuff was confusing
6265 maintenance, e.g., we thought we needed cbrt but it was commented out.
6266 (logb): Remove decl; no longer needed.
6267 (isfinite): New macro, if not already supplied.
6268 (isnan): Don't replace any existing macro.
6269 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6270 are present on all C89 platforms.
6271 (Ffrexp): Do not special-case zero, as frexp does the right thing
6272 for that case.
6273 (Flogb): Do not use logb, as it doesn't have the desired meaning
6274 on hosts that use non-base-2 floating point. Instead, stick with
6275 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6276 frexp, to avoid getting an unspecified result.
6277
6278 * xdisp.c (Qinhibit_debug_on_message): Now static.
6279
6280 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6281
6282 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6283 NSBezierPath (Bug#12131).
6284
6285 2012-09-10 Chong Yidong <cyd@gnu.org>
6286
6287 * fns.c (Fdelq, Fdelete): Doc fix.
6288
6289 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6290
6291 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6292 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6293
6294 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6295
6296 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6297 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6298 Use it.
6299
6300 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6301
6302 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6303 left fringe if the window has a left margin. This avoids leaving
6304 traces of the cursor because its leftmost pixel is not drawn over.
6305
6306 * dispnew.c (update_window_line): When the left margin area of a
6307 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6308 that screen line. (Bug#12277)
6309
6310 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6311
6312 Assume C89 or later for math functions (Bug#12381).
6313 This simplifies the code, and makes it a bit smaller and faster,
6314 and (most important) makes it easier to clean up signal handling
6315 since we can stop worring about floating-point exceptions in
6316 library code. That was a problem before C89, but the problem
6317 went away many years ago on all practical Emacs targets.
6318 * data.c, image.c, lread.c, print.c:
6319 Don't include <math.h>; no longer needed.
6320 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6321 might be autoconfigured, as that never happens.
6322 * data.c (fmod):
6323 * doprnt.c (DBL_MAX_10_EXP):
6324 * print.c (DBL_DIG):
6325 Remove. C89 or later always defines these.
6326 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6327 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6328 (arith_error, domain_error, domain_error2):
6329 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6330 no longer needed -- we simply return what C returns. All uses removed.
6331 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6332 the wrapped code.
6333 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6334 Remove. All uses expanded, as these macros are no longer used
6335 more than once and are now more trouble than they're worth.
6336 (Ftan): Use tan, not sin / cos.
6337 (Flogb): Assume C89 frexp.
6338 (fmod_float): Assume C89 fmod.
6339 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6340 (init_floatfns): Remove. All uses removed.
6341
6342 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6343
6344 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6345 compositeToPoint for OSX < 10.6 (Bug#12390).
6346
6347 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6348
6349 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6350 This produces more-accurate results.
6351
6352 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6353
6354 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6355 changes (Bug#12088).
6356
6357 2012-09-08 Chong Yidong <cyd@gnu.org>
6358
6359 * syntax.c (Fstring_to_syntax): Doc fix.
6360
6361 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6362
6363 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6364 in the internal border.
6365 (x_set_window_size): Remove static variables and their usage.
6366 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6367 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6368 Remove fringe/internal border adjustment (Bug#11052).
6369 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6370 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6371 (ns_fix_rect_ibw): Remove.
6372 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6373 (ns_dumpglyphs_box_or_relief): Ditto.
6374 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6375 adjustment.
6376 (ns_dumpglyphs_image): Ditto.
6377 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6378 border adjustment.
6379 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6380 their usage. Add fringe_extended_p and its use as in other terms.
6381 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6382 scroll bar was removed.
6383 (updateFrameSize): New function.
6384 (windowDidResize): Move code to updateFrameSize and call it.
6385
6386 * nsterm.h (EmacsView): Add updateFrameSize.
6387
6388 2012-09-07 Chong Yidong <cyd@gnu.org>
6389
6390 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6391
6392 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6393
6394 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6395
6396 More signal-handler cleanup (Bug#12327).
6397 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6398 Problem introduced when merging patches. Noted by Eli Zaretskii in
6399 <http://bugs.gnu.org/12327#67>.
6400 * floatfns.c: Comment fix.
6401 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6402 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6403 and anyway the declaration is harmless even if SIGDANGER is not defined.
6404 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6405 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6406 source files not surprisingly expected syssignal.h to define, or
6407 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6408 Include <sys/ioctl.h>, for FIONREAD.
6409 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6410 This eliminates a problem whereby other files mysteriously had
6411 to include "syssignal.h" before including "systty.h" if they
6412 wanted to use "#ifdef SIGIO".
6413
6414 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6415
6416 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6417
6418 * w32.c (sigemptyset): Empty the set.
6419 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6420
6421 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6422
6423 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6424
6425 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6426 (mark_object): Likewise for frame objects.
6427
6428 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6429
6430 * syssignal.h (handle_on_main_thread): Always declare,
6431 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6432 This ports to platforms without HAVE_PTHREAD.
6433
6434 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6435
6436 Signal-handler cleanup (Bug#12327).
6437 Emacs's signal handlers were written in the old 4.2BSD style with
6438 sigblock and sigmask and so forth, and this led to some
6439 inefficiencies and confusion. Rewrite these to use
6440 pthread_sigmask etc. without copying signal sets around. Also,
6441 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6442 'signal', and instead use functions that do not attempt to take
6443 over the system name space. This patch causes Emacs's text
6444 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6445 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6446 Do not include <signal.h> or "syssignal.h", as these
6447 modules do not use signals.
6448 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6449 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6450 Do not include <signal.h>, as "syssignal.h" does that for us now.
6451 * atimer.c (sigmask_atimers): New function.
6452 (block_atimers, unblock_atimers): New functions,
6453 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6454 All uses replaced.
6455 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6456 no longer needed here.
6457 * emacs.c (main): Inspect existing signal handler with sigaction,
6458 so that there's no need to block and unblock SIGHUP.
6459 * sysdep.c (struct save_signal): New member 'action', replacing
6460 old member 'handler'.
6461 (save_signal_handlers, restore_signal_handlers):
6462 Use sigaction instead of 'signal' to save and restore.
6463 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6464 New function. All users of 'signal' modified to use set_sighandler
6465 if they're writeonly, and to use sys_signal if they're read+write.
6466 (emacs_sigaction_init, forwarded_signal): New functions.
6467 (sys_signal): Remove. All uses replaced by calls to sigaction
6468 and emacs_sigaction_init, or by direct calls to 'signal'.
6469 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6470 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6471 all uses replaced by pthread_sigmask etc. calls.
6472 * syssignal.h: Include <signal.h>.
6473 (emacs_sigaction_init, forwarded_signal): New decls.
6474 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6475 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6476 (sigmask, sys_sigmask): Remove; no longer needed.
6477 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6478 (sigblock, sigunblock, sigfree):
6479 (sigsetmask) [!defined sigsetmask]:
6480 Remove. All uses replaced by pthread_sigmask.
6481 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6482 no longer need to be replaced, and its typical old uses
6483 are now done via emacs_sigaction_init and sigaction.
6484 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6485 (sys_sigdel): Remove; unused.
6486 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6487
6488 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6489
6490 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6491 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6492
6493 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6494
6495 Explicitly mark buffer_defaults and buffer_local_symbols.
6496 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6497 mark_local_symbols here.
6498 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6499 since special buffers aren't marked here any more.
6500 (allocate_buffer): Chain new buffer with all_buffers here...
6501 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6502 not here.
6503 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6504 (syms_of_buffer): Remove staticpro of the above.
6505 (init_buffer_once): Set names for buffer_defaults and
6506 buffer_local_symbols.
6507
6508 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6509
6510 Use bool for booleans in font-related modules.
6511 * font.c (font_intern_prop, font_style_to_value)
6512 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6513 (generate_otf_features, font_check_otf_features, font_check_otf)
6514 (font_match_p, font_list_entities, font_at):
6515 * fontset.c (fontset_id_valid_p, reorder_font_vector
6516 (fontset_find_font, Fset_fontset_font)
6517 (face_suitable_for_char_p) [0]:
6518 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6519 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6520 (m17n_flt_initialized, ftfont_shape_by_flt):
6521 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6522 * nsfont.m (nsfont_draw):
6523 * w32font.c (w32font_draw):
6524 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6525 Use bool for booleans.
6526 * font.h: Adjust to above API changes.
6527 (struct font, struct font_driver, struct font_driver_list):
6528 Use bool for booleans.
6529 (struct font): Remove useless member encoding_type.
6530 All users removed.
6531 * fontset.c, xftfont.c: Omit unnecessary static decls.
6532
6533 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6534
6535 * alloc.c (mark_object): Revert window marking code
6536 since it's unsafe for the Fset_window_configuration.
6537
6538 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6539
6540 Fix race conditions with signal handlers and errno (Bug#12327).
6541 Be more systematic about preserving errno whenever a signal
6542 handler returns, even if it's not in the main thread. Do this by
6543 renaming signal handlers to distinguish between signal delivery
6544 and signal handling. All uses changed.
6545 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6546 * data.c (deliver_arith_signal): Rename from arith_error.
6547 * dispnew.c (deliver_window_change_signal): Rename from
6548 window_change_signal.
6549 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6550 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6551 * keyboard.c (deliver_input_available_signal): Rename from
6552 input_available_signal.
6553 (deliver_user_signal): Rename from handle_user_signal.
6554 (deliver_interrupt_signal): Rename from interrupt_signal.
6555 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6556 (deliver_child_signal): Rename from sigchld_handler.
6557 * atimer.c (handle_alarm_signal):
6558 * data.c (handle_arith_signal):
6559 * dispnew.c (handle_window_change_signal):
6560 * emacs.c (handle_fatal_signal, handle_danger_signal):
6561 * keyboard.c (handle_input_available_signal):
6562 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6563 * process.c (handle_pipe_signal, handle_child_signal):
6564 New functions, with the actual signal-handling code taken from the
6565 original respective signal handlers, sans the sporadic attempts to
6566 preserve errno, since that's now done by handle_on_main_thread.
6567 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6568 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6569 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6570 Move to sysdep.c.
6571 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6572 Move initialization of main_thread to sysdep.c's init_signals.
6573 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6574 our usage, and simplifies the mainline code.
6575 (record_child_status_change): New static function, as a helper
6576 for handle_child_signal, and with most of the old child handler's
6577 contents.
6578 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6579 (handle_child_signal): Use the above.
6580 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6581 Moved here from emacs.c.
6582 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6583 code moved here from emacs.c's main function.
6584 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6585 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6586 This lets callers save and restore errno properly.
6587
6588 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6589
6590 Remove redundant or unused things here and there.
6591 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6592 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6593 * editfns.c (Fcompare_buffer_substrings): Likewise.
6594 * frame.h (struct terminal, struct font_driver_list):
6595 Remove redundant declarations.
6596 * window.h (Qleft, Qright): Likewise.
6597
6598 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6599
6600 Do not mark objects from deleted buffers, windows and frames.
6601 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6602 (mark_object): Likewise for windows and frames.
6603
6604 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6607 buffer_defaults and buffer_local_symbols as valid objects.
6608 Return special value to denote them.
6609
6610 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6611
6612 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6613 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6614 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6615 (file_name_absolute_p, Fsubstitute_in_file_name):
6616 (check_executable, check_writable, Ffile_accessible_directory_p)
6617 (Fset_file_selinux_context, Fdefault_file_modes)
6618 (Finsert_file_contents, choose_write_coding_system)
6619 (Fwrite_region, build_annotations, a_write, e_write)
6620 (Fdo_auto_save):
6621 * filelock.c (boot_time_initialized, get_boot_time)
6622 (get_boot_time_1, lock_file_1, within_one_second):
6623 * floatfns.c (in_float):
6624 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6625 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6626 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6627 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6628 * window.c (compare_window_configurations):
6629 Use bool for booleans.
6630 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6631 (Fdefault_file_modes): Now mode_t, not int, for modes.
6632 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6633 (internal_delete_file): Now returns void, not a (boolean) int,
6634 since nobody was looking at the return value.
6635 * lisp.h, window.h: Adjust to above API changes.
6636
6637 * xdisp.c (set_message): Simplify and reindent last change.
6638
6639 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
6640
6641 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6642
6643 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6644
6645 * eval.c (call_debugger): Make the function non-static so that we
6646 can call it from set_message.
6647
6648 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6649 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6650
6651 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 Give more-useful info on a fatal error (Bug#12328).
6654 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6655 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6656 of doing the work ourselves.
6657 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6658 do most of the work.
6659 (fatal_error_backtrace): New function, taken from the guts
6660 of the old fatal_error_signal, but with a new option to output
6661 a backtrace.
6662 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6663 info about the signal than just its number.
6664 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6665 * sysdep.c: Include <execinfo.h>
6666 (emacs_backtrace): New function, taken partly from the previous
6667 code of the 'die' function.
6668 (emacs_abort): Call fatal_error_backtrace rather than abort.
6669
6670 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6671
6672 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6673 eager (load-time) macro-expansion.
6674 * lisp.mk (lisp): Add macroexp.
6675
6676 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6677
6678 Simplify redefinition of 'abort' (Bug#12316).
6679 Do not try to redefine the 'abort' function. Instead, redo
6680 the code so that it calls 'emacs_abort' rather than 'abort'.
6681 This removes the need for the NO_ABORT configure-time macro
6682 and makes it easier to change the abort code to do a backtrace.
6683 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6684 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6685 Remove; sysdep.c's emacs_abort now takes its place.
6686 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6687 'abort' changed to use 'emacs_abort'.
6688 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6689 (abort) [!defined abort]: Rename to ...
6690 (emacs_abort): ... new name.
6691 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6692 the place of the old 'abort' in emacs.c.
6693 * w32.c, w32fns.c (abort): Do not #undef.
6694 * w32.c (emacs_abort): Rename from w32_abort.
6695
6696 2012-09-04 Eli Zaretskii <eliz@gnu.org>
6697
6698 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6699 offsets[j].dv, since the y axis of the screen coordinates points
6700 down, while the y axis of the font definition coordinates points
6701 up. This fixes display of Arabic diacritics such as KASRA and
6702 KASRATAN. (Bug#11860)
6703
6704 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 Be more systematic about _setjmp vs setjmp.
6707 * alloc.c (test_setjmp, mark_stack):
6708 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6709 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6710 (png_load, my_error_exit, jpeg_load):
6711 * process.c (send_process_trap, send_process):
6712 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6713 The underscored versions are up to 30x faster on some hosts.
6714 Formerly, the code used setjmp+longjmp sometimes and
6715 _setjmp+_longjmp at other times, with no particular reason to
6716 prefer setjmp+longjmp.
6717
6718 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 Fix minor problem found by static checking.
6721 * buffer.c (Fdelete_all_overlays): Return nil.
6722
6723 2012-09-03 Martin Rudalics <rudalics@gmx.at>
6724
6725 * buffer.c (Fdelete_all_overlays): New function.
6726
6727 2012-09-03 Chong Yidong <cyd@gnu.org>
6728
6729 * gtkutil.c: Add extern decl for Qxft.
6730
6731 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6732
6733 * emacs.c, eval.c: Use bool for boolean.
6734 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6735 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6736 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6737 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6738 (main, decode_env_path, Fdaemon_initialized):
6739 * eval.c (call_debugger, Finteractive_p, interactive_p):
6740 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6741 (maybe_call_debugger, Fbacktrace):
6742 * process.c (read_process_output, exec_sentinel):
6743 Use bool for booleans.
6744 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6745 All callers changed.
6746 * eval.c (interactive_p): Omit always-true boolean argument
6747 EXCLUDE_SUBRS_P. All callers changed.
6748 * dispextern.h, lisp.h: Reflect above API changes.
6749 * firstfile.c (dummy): Use the address of 'main', whose signature
6750 won't change, instead of the address of 'initialize', whose
6751 signature just changed from int to bool.
6752 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6753 * msdos.c (fatal_error_in_progress): ... from here.
6754 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6755 of incrementing it.
6756 (redisplay_internal, unwind_redisplay): Simply clear
6757 REDISPLAYING_P when unwinding, instead of saving its previous,
6758 always-false value and then restoring it.
6759
6760 Clean up some extern decls.
6761 Mostly, this hoists extern decls out of .c files and into .h files.
6762 That way, we're more likely to catch errors if the interfaces change.
6763 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6764 declare xg_mark_data.
6765 * dispextern.h (x_frame_parm_handlers):
6766 * font.h (Qxft):
6767 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6768 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6769 (Qultra_bold, Qoblique, Qitalic):
6770 Move extern decl here from .c file.
6771 * alloc.c (xg_mark_data) [USE_GTK]:
6772 * doc.c (Qclosure):
6773 * eval.c (Qlexical_binding):
6774 * fns.c (time) [!HAVE_UNISTD_H]:
6775 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6776 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6777 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6778 * lread.c (Qinternal_interpreter_environment):
6779 * minibuf.c (Qbuffer):
6780 * process.c (QCfamily, QCfilter):
6781 * widget.c (free_frame_faces):
6782 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6783 * xfont.c (x_clear_errors):
6784 * xterm.c (x_frame_parm_handlers):
6785 Remove now-redundant extern decls.
6786 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6787 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6788 Now static.
6789 * xfaces.c: Remove unnecessary static decls.
6790 * xterm.c (updating_frame): Remove decl of nonexistent object.
6791
6792 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6793 when building globals.h, as the objects that are not built on
6794 this host are not needed to compile C files on this host.
6795
6796 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6797
6798 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6799
6800 * frame.h: Add missing prototype for x_wm_set_size_hint.
6801
6802 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6803
6804 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6805 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6806 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6807 (Fsubstitute_command_keys):
6808 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6809 (save_excursion_save, save_excursion_restore)
6810 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6811 (format_time_string, general_insert_function)
6812 (make_buffer_string, make_buffer_string_both)
6813 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6814 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6815 (copy_text, insert_1, insert_1_both, insert_from_string)
6816 (insert_from_string_before_markers, insert_from_string_1)
6817 (insert_from_buffer, insert_from_buffer_1, replace_range)
6818 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6819 (del_range_2, modify_region):
6820 * intervals.c (intervals_equal, balance_possible_root_interval)
6821 (adjust_intervals_for_insertion, merge_properties_sticky)
6822 (graft_intervals_into_buffer, lookup_char_property)
6823 (adjust_for_invis_intang, set_point_both)
6824 (get_property_and_range, compare_string_intervals)
6825 (set_intervals_multibyte_1, set_intervals_multibyte):
6826 * keyboard.c (decode_timer):
6827 Use bool for boolean.
6828 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6829 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6830
6831 2012-09-02 Chong Yidong <cyd@gnu.org>
6832
6833 * keymap.c (push_key_description): Print M-TAB as C-M-i
6834 (Bug#11758).
6835
6836 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
6837
6838 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6839 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6840 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6841 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6842 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6843 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6844 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6845
6846 2012-09-01 Eli Zaretskii <eliz@gnu.org>
6847
6848 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6849 more than one grapheme cluster passed to the shaper: compute the
6850 offset adjustment values separately for each cluster. (Bug#11860)
6851
6852 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6853 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6854 about implicit conversions from integer to pointer.
6855
6856 2012-09-01 Daniel Colascione <dancol@dancol.org>
6857
6858 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6859 system used too early.
6860
6861 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6862
6863 Better seed support for (random).
6864 * emacs.c (main): Call init_random.
6865 * fns.c (Frandom): Set the seed from a string argument, if given.
6866 Remove long-obsolete Gentzel cruft.
6867 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6868 (init_random): New function.
6869
6870 2012-09-01 Daniel Colascione <dancol@dancol.org>
6871
6872 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6873 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6874 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6875 x_wm_set_size_hint, x_query_colors, x_real_positions,
6876 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6877 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6878 all of which have been moved to common code.
6879
6880 * xfaces.c: Include TERM_HEADER instead of listing all possible
6881 window-system headers.
6882
6883 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6884 to match header.
6885
6886 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6887 directly accessing frame internals.
6888
6889 * w32font.h: Include font.h. Define syms_of_w32font and
6890 globals_of_w32font.
6891
6892 * process.c: Include TERM_HEADER instead of listing all possible
6893 window-system headers.
6894
6895 * nsterm.h: Remove declarations now in frame.h.
6896 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6897
6898 * menu.c: Include TERM_HEADER instead of listing all possible
6899 window-system headers.
6900
6901 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6902 window system.
6903
6904 * keyboard.c: Include TERM_HEADER instead of listing all possible
6905 window-system headers.
6906
6907 * image.c: Include TERM_HEADER instead of listing all possible
6908 window-system headers. Declare Vlibrary_cache when compiling for
6909 Windows.
6910
6911 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6912 window system declarations.
6913
6914 * frame.h: Move common functions here: set_frame_menubar,
6915 x_set_window_size, x_sync, x_get_focus_frame,
6916 x_set_mouse_position, x_set_mouse_pixel_position,
6917 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6918 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6919 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6920 x_activate_menubar, x_real_positions, x_bitmap_icon,
6921 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6922 and x_query_colors.
6923
6924 * frame.c: Include TERM_HEADER instead of listing all possible
6925 window-system headers.
6926
6927 * font.c: Include TERM_HEADER instead of listing all possible
6928 window-system headers.
6929
6930 * emacs.c: Include TERM_HEADER.
6931
6932 * dispnew.c: Include TERM_HEADER instead of listing all possible
6933 window-system headers.
6934
6935 * ccl.h: Include character.h.
6936
6937 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6938 the current window system; include in list of objects to link into
6939 Emacs.
6940
6941 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6942
6943 Remove mark_ttys function and fix tty_display_info initialization.
6944 * lisp.h (mark_ttys): Remove prototype.
6945 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6946 to mark_ttys because all possible values of 'top_frame' slot are
6947 the frames which are reachable from Vframe_list.
6948 * term.c (mark_ttys): Remove.
6949 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6950
6951 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6952
6953 Change struct frame bitfields from unsigned char to unsigned.
6954 * frame.h (struct frame): Change type of 'display_preempted',
6955 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6956 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6957 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6958 bitfields from unsigned char to unsigned.
6959
6960 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6961
6962 Remove unused member of struct x_output and struct w32_output.
6963 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6964 * w32term.h (struct w32_output): Likewise.
6965
6966 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6967
6968 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6969 does not become zero (Bug#12234).
6970
6971 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6972
6973 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6974 for GCC 4.7.1 x86-64.
6975
6976 2012-08-30 Glenn Morris <rgm@gnu.org>
6977
6978 * lread.c (init_lread): For out-of-tree builds, only add the
6979 source directory's site-lisp dir to the load-path if it exists,
6980 consistent with in-tree builds. (Bug#12302)
6981
6982 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6983
6984 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6985 button_values to NULL. Call setStykeMask so dialogs get a close button.
6986 (windowShouldClose:): Set window_closed.
6987 (dealloc): New member, free button_values.
6988 (process_dialog:): Make member function. Remove window argument,
6989 replace window with self. Count buttons and allocate and store values
6990 in button_values.
6991 (addButton:value:row:): value is int with the name tag. Call setTag
6992 with tag. Remove return self, declare return value as void.
6993 (addString:row:): Remove return self, declare return value as void.
6994 (addSplit): Remove return self, declare return value as void.
6995 (clicked:): Remove return self, declare return value as void.
6996 Set dialog_return to button_values[seltag]. Code formatting change.
6997 (initFromContents:isQuestion:): Adjust call to process_dialog.
6998 Code formatting change.
6999 (timeout_handler:): Set timer_fired to YES.
7000 (runDialogAt:): Set timer_fired to NO.
7001 Handle click on close button as quit.
7002
7003 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7004 Add window_closed and button_values. Add void as return value for
7005 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7006 Add process_dialog as new member.
7007
7008 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7009
7010 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7011 is not one of the heaps we manage. (Bug#12242)
7012
7013 2012-08-28 Glenn Morris <rgm@gnu.org>
7014
7015 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7016
7017 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7018
7019 * window.c (Fset_window_configuration): Remove handling of
7020 auto-buffer-name window parameter. Install revision of reverted
7021 fix.
7022
7023 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7024
7025 Do not allow to set major mode for a dead buffer.
7026 * buffer.c (Fset_buffer_major_mode): Signal an error
7027 if the buffer is dead.
7028 (Fother_buffer, other_buffer_safely): Remove redundant
7029 nested declaration.
7030
7031 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7032
7033 Always use set_buffer_if_live to restore original buffer at unwind.
7034 * buffer.h (record_unwind_current_buffer): New function.
7035 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7036 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7037 * undo.c, window.c: Adjust users.
7038 * buffer.c (set_buffer_if_live): Fix comment.
7039
7040 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7041
7042 Fix usage of set_buffer_internal.
7043 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7044 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7045 * coding.c (decode_coding): Omit redundant test.
7046 * fileio.c (decide_coding_unwind): Likewise.
7047 * fns.c (secure_hash): Likewise.
7048 * insdel.c (modify_region): Likewise.
7049 * keyboard.c (command_loop_1): Likewise.
7050 * print.c (PRINTFINISH): Likewise.
7051 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7052
7053 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7054
7055 * dispnew.c: Use bool for boolean.
7056 (frame_garbaged, display_completed, delayed_size_change)
7057 (fonts_changed_p, add_window_display_history)
7058 (add_frame_display_history, verify_row_hash)
7059 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7060 (row_equal_p, realloc_glyph_pool)
7061 (allocate_matrices_for_frame_redisplay)
7062 (showing_window_margins_p)
7063 (adjust_frame_glyphs_for_frame_redisplay)
7064 (build_frame_matrix_from_leaf_window, make_current)
7065 (mirrored_line_dance, mirror_line_dance, update_frame)
7066 (update_window_tree, update_single_window)
7067 (check_current_matrix_flags, update_window, update_text_area)
7068 (update_window_line, set_window_update_flags, scrolling_window)
7069 (update_frame_1, scrolling, buffer_posn_from_coords)
7070 (do_pending_window_change, change_frame_size)
7071 (change_frame_size_1, sit_for):
7072 Use bool for boolean.
7073 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7074 and remove last int (actually boolean) argument, which was always 0.
7075 All callers changed.
7076 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7077 * dispextern.h (struct composition_it): Use bool for boolean.
7078 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7079 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7080 * dired.c (file_name_completion):
7081 Use bool for boolean. (This was missed in an earlier change.)
7082
7083 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7084
7085 * window.c (Fset_window_configuration): Revert first part of
7086 last change.
7087
7088 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7089
7090 * nsterm.h (NSPanel): New class variable dialog_return.
7091
7092 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7093 Initialize dialog_return.
7094 (windowShouldClose:): Use stop instead of stopModalWithCode.
7095 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7096 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7097 event.
7098 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7099 modal loop returns.
7100
7101 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7104 * composite.c (find_composition, composition_gstring_p)
7105 (composition_reseat_it, find_automatic_composition):
7106 * data.c (let_shadows_buffer_binding_p)
7107 (let_shadows_global_binding_p, set_internal, make_blv)
7108 (Fmake_variable_buffer_local, Fmake_local_variable)
7109 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7110 (cons_to_signed, arith_driver):
7111 * dbusbind.c (xd_in_read_queued_messages):
7112 * dired.c (directory_files_internal, file_name_completion):
7113 Use bool for booleans.
7114 * dired.c (file_name_completion):
7115 * process.h (fd_callback):
7116 Omit int (actually boolean) argument. It wasn't being used.
7117 All uses changed.
7118 * composite.h, lisp.h: Reflect above API changes.
7119
7120 * cmds.c, coding.c: Use bool for booleans.
7121 * cmds.c (move_point, Fself_insert_command):
7122 * coding.h (struct composition status, struct coding_system):
7123 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7124 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7125 (emacs_mule_char, decode_coding_emacs_mule)
7126 (encode_coding_emacs_mule, detect_coding_iso_2022)
7127 (decode_coding_iso_2022, encode_invocation_designation)
7128 (encode_designation_at_bol, encode_coding_iso_2022)
7129 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7130 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7131 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7132 (encode_coding_raw_text, detect_coding_charset)
7133 (decode_coding_charset, encode_coding_charset, detect_eol)
7134 (detect_coding, get_translation_table, produce_chars)
7135 (consume_chars, reused_workbuf_in_use)
7136 (make_conversion_work_buffer, code_conversion_save)
7137 (decode_coding_object, encode_coding_object)
7138 (detect_coding_system, char_encodable_p)
7139 (Funencodable_char_position, code_convert_region)
7140 (code_convert_string, code_convert_string_norecord)
7141 (Fset_coding_system_priority):
7142 * fileio.c (Finsert_file_contents):
7143 Use bool for booleans.
7144 * coding.h, lisp.h: Reflect above API changes.
7145 * coding.c: Remove unnecessary static function decls.
7146 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7147 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7148 not a boolean 'int', since callers never look at the return value.
7149 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7150 * coding.h (decoding_buffer_size, encoding_buffer_size)
7151 (emacs_mule_string_char): Remove unused extern decls.
7152 (struct iso_2022_spec, struct coding_system):
7153 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7154 (struct emacs_mule_spec): Remove unused field 'full_support'.
7155 All initializations removed.
7156 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7157
7158 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7159
7160 Fix spare memory change (Bug#12286).
7161 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7162 (valid_lisp_object_p): Likewise.
7163
7164 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7165
7166 * window.c (Fset_window_configuration): Record any window's old
7167 buffer if it's replaced (see Bug#8789). If the new current
7168 buffer doesn't appear in the selected window, go to its old
7169 point (Bug#12208).
7170
7171 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7172
7173 Special MEM_TYPE_SPARE to denote reserved memory.
7174 * alloc.c (enum mem_type): New memory type.
7175 (refill_memory_reserve): Use new type for spare memory.
7176 This prevents live_cons_p and live_string_p from incorrect
7177 detection of uninitialized objects from spare memory as live.
7178
7179 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7180
7181 Spelling fixes.
7182 * Makefile.in (.PHONY): versioclean -> versionclean.
7183
7184 Remove unused external symbols.
7185 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7186 * window.c (Qwindow_valid_p, decode_valid_window):
7187 Now static, not extern.
7188 * data.c (Qinterval): Remove; unused.
7189 (syms_of_data): Do not define 'interval'.
7190 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7191 * window.h (decode_valid_window):
7192 Remove decls.
7193
7194 * character.c, charset.c, chartab.c: Use bool for booleans.
7195 * character.c (lisp_string_width, string_count_byte8)
7196 (string_escape_byte8):
7197 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7198 (load_charset_map_from_file, map_charset_chars)
7199 (Fdefine_charset_internal, define_charset_internal)
7200 (Fdeclare_equiv_charset, find_charsets_in_text)
7201 (Ffind_charset_region, char_charset, Fiso_charset):
7202 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7203 (sub_char_table_set, sub_char_table_set_range)
7204 (char_table_set_range, optimize_sub_char_table)
7205 (map_sub_char_table):
7206 Use bool for boolean.
7207 * character.c (str_to_unibyte): Omit last boolean argument; it was
7208 always 0. All callers changed.
7209 * character.h, charset.h: Adjust to match previous changes.
7210 * character.h (char_printable_p): Remove decl of nonexistent function.
7211 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7212 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7213 are all boolean, so make them single-bit bitfields.
7214
7215 * lisp.h (ASET): Remove attempt to detect side effects.
7216 It was meant to be temporary and it often doesn't work,
7217 because when IDX has side effects the behavior of IDX==IDX
7218 is undefined. See Stefan Monnier in
7219 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7220
7221 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7222
7223 * lisp.h (functionp): New function (extracted from Ffunctionp).
7224 (FUNCTIONP): Use it.
7225 * eval.c (Ffunctionp): Use it.
7226
7227 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7228
7229 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7230 as that's faster and simpler than static storage. Don't bother
7231 with the g_main_context_query overhead if g_main_context_pending
7232 says no events are pending.
7233 (gfds, gfds_size): Remove these static vars.
7234 (xgselect_initialize): Remove; no longer needed.
7235 All uses and decls removed.
7236
7237 * emacs.c (fatal_error_signal_hook): Remove.
7238 All uses removed. This leftover from old code was always 0.
7239
7240 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7241 * casefiddle.c (casify_object, casify_region):
7242 * casetab.c (set_case_table):
7243 * category.c, category.h (word_boundary_p):
7244 * category.h (CHAR_HAS_CATEGORY):
7245 Use bool for booleans, instead of int.
7246
7247 2012-08-25 Eli Zaretskii <eliz@gnu.org>
7248
7249 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7250
7251 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 On assertion failure, print backtrace if available.
7254 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7255 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7256 * Makefile.in (LIB_EXECINFO): New macro.
7257 (LIBES): Use it.
7258
7259 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7260 * bytecode.c (exec_byte_code):
7261 * callint.c (check_mark, Fcall_interactively):
7262 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7263 (getenv_internal, sync_process_alive, call_process_exited):
7264 * lisp.h (USE_SAFE_ALLOCA):
7265 Use bool for booleans, instead of int.
7266 * lisp.h, process.h: Adjust prototypes to match above changes.
7267 * callint.c (Fcall_interactively): Don't assume the mark's
7268 offset fits in 'int'.
7269
7270 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7271
7272 * buffer.c, buffer.h: Use bool for boolean.
7273 * buffer.c (reset_buffer_local_variables)
7274 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7275 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7276 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7277 (overlay_touches_p, overlay_strings, Foverlay_put)
7278 (report_overlay_modification, call_overlay_mod_hooks):
7279 (mmap_enlarge, mmap_set_vars):
7280 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7281 Use bool for booleans, instead of int.
7282 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7283 since the 1-or-0 return value is always ignored anyway.
7284 (mmap_initialized_p):
7285 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7286 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7287
7288 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7289
7290 * bidi.c: Use bool for boolean.
7291 This is a bit more readable, and makes the text segment of bidi.o
7292 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7293 Presumably it's faster too.
7294 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7295 Now bool.
7296 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7297 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7298 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7299 (bidi_explicit_dir_char, bidi_level_of_next_char)
7300 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7301 Use bool for booleans, instead of int.
7302 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7303 (bidi_unshelve_cache): Adjust decls to match code.
7304
7305 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7306
7307 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7308 argument.
7309
7310 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7311
7312 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7313 * atimer.h: Include <stdbool.h>.
7314
7315 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7316
7317 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7318 compile time tests instead of run time tests on systems that do
7319 not use them.
7320 (FRAME_MAC_P): Remove leftover from deleted code.
7321 * frame.c (syms_of_frame): Remove leftover from deleted code.
7322
7323 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7324
7325 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7326
7327 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7328
7329 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7330 Otherwise, the compiler complains about (A?B:C) where B is void
7331 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7332 (fontset_add): Return void, for FONTSET_ADD.
7333
7334 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * alloc.c: Use bool for booleans.
7337 (gc_in_progress, abort_on_gc)
7338 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7339 (dont_register_blocks) [GC_MALLOC_CHECK]:
7340 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7341 (check_string_bytes, make_specified_string, memory_full)
7342 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7343 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7344 (mark_stack, valid_pointer_p, make_pure_string)
7345 (Fgarbage_collect, survives_gc_p, gc_sweep):
7346 Use bool for booleans, instead of int.
7347 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7348 Remove unused local.
7349 * alloc.c (PURE_POINTER_P):
7350 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7351 * editfns.c (Fformat):
7352 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7353 (Fdo_auto_save):
7354 * fns.c (sweep_weak_table):
7355 * lisp.h (suppress_checking, push_message, survives_gc_p)
7356 (make_pure_string, gc_in_progress, abort_on_gc):
7357 * lread.c (readchar, read1):
7358 * print.c (Fprin1_to_string):
7359 * xdisp.c (push_message):
7360 Use bool for booleans affected directly or indirectly by
7361 alloc.c's changes.
7362
7363 Make recently-introduced setters macros.
7364 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7365 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7366 (set_fontset_default, set_fontset_fallback): Rename from their
7367 upper-case counterparts, and make them functions rather than macros.
7368 This is more consistent with the other recently-introduced setters.
7369 These don't need to be inline, since they're local.
7370
7371 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7372
7373 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7374 the loop (Bug#12247).
7375
7376 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7377
7378 * lisp.h (vcopy): Use memcpy rather than our own loop.
7379 This fixes a performance regression introduced by the recent
7380 addition of vcopy. This means 'vcopy' will need to be modified
7381 for a copying collector, but that's OK. Also, tighten the
7382 checking in the assertion.
7383
7384 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7385
7386 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7387 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7388 non-base glyph for the width of the base character, according to
7389 what x_draw_composite_glyph_string_foreground expects.
7390 Generate WADJUST value according to composition_gstring_width's
7391 expectations, to produce correct width of the composed character.
7392 Reverse the sign of the DU offset produced by ScriptPlace.
7393
7394 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7397
7398 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7399
7400 Avoid direct writes to contents member of struct Lisp_Vector.
7401 * lisp.h (vcopy): New function to copy data into vector.
7402 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7403 * fns.c (Ffillarray): Use ASET.
7404 * keyboard.c (timer_check_2): Use AREF and ASET.
7405 (append_tool_bar_item, Frecent_keys): Use vcopy.
7406 * lread.c (read_vector): Use ASET.
7407 * msdos.c (Frecent_doskeys): Use vcopy.
7408 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7409 (Finternal_merge_in_global_face): Use ASET and vcopy.
7410 * xfont.c (xfont_list_pattern): Likewise.
7411
7412 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7413
7414 * window.c (Fwindow_point): For the selected window always return
7415 the position of its buffer's point.
7416 (Fset_window_point): For the selected window always go in its
7417 buffer to the specified position.
7418
7419 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7420
7421 Setter macros for fontsets.
7422 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7423 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7424 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7425 Adjust users.
7426
7427 2012-08-20 Glenn Morris <rgm@gnu.org>
7428
7429 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7430 Don't assume that `ln -f' works.
7431
7432 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7433
7434 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7435 and later about non-assignments with no effect. See discussion at
7436 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7437 details.
7438
7439 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7440
7441 Inline setter functions for Lisp_Objects slots of struct specbinding.
7442 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7443 Adjust users.
7444
7445 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7446
7447 * window.c (select_window): Always make selected window's buffer
7448 current.
7449
7450 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7451
7452 Use AREF and ASET for docstrings of category tables.
7453 * category.h (CATEGORY_DOCSTRING): Use AREF.
7454 (SET_CATEGORY_DOCSTRING): Use ASET.
7455 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7456
7457 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7458
7459 Inline setter functions for hash table members.
7460 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7461 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7462 (set_hash_key_and_value, set_hash_index, set_hash_next)
7463 (set_hash_hash): New functions.
7464 * charset.c, fns.c: Adjust users.
7465
7466 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7467
7468 Inline getter and setter functions for per-buffer values.
7469 * buffer.h (per_buffer_default, set_per_buffer_default)
7470 (per_buffer_value, set_per_buffer_value): New functions.
7471 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7472 * buffer.c, data.c: Adjust users.
7473
7474 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
7475
7476 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7477
7478 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 Rely on <config.h> + <unistd.h> to declare 'environ',
7481 as gnulib does this if the system doesn't.
7482 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7483 Remove declaration. MS-Windows declares it on stdlib.h which is
7484 included by conf_post.h.
7485 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7486 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7487 * vm-limit.c: Include <unistd.h>, for 'environ'.
7488
7489 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7490 (start_of_data): Remove decl; mem-limits.h provides it.
7491
7492 * xdisp.c (handle_invisible_prop): Make it a bit faster
7493 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7494
7495 2012-08-19 Chong Yidong <cyd@gnu.org>
7496
7497 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7498 ends (Bug#3874).
7499
7500 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7501
7502 * .gdbinit: Use call instead of set when calling a function in the
7503 inferior.
7504
7505 * data.c (set_internal): Don't use set_blv_found.
7506 (Fkill_local_variable): Likewise.
7507
7508 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7509
7510 * nsfont.m (ns_ascii_average_width): Ensure the string
7511 ascii_printable is initialized with a null-terminated character
7512 array. Otherwise, it can contain undesired extra characters.
7513
7514 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7515
7516 port new setting code to Sun C 5.8 2005/10/13
7517 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7518 Return void, not Lisp_Object. Otherwise, the compiler
7519 complains about (A?B:C) where B is void and C is Lisp_Object
7520 when compiling CHAR_TABLE_SET, due to the recent change to
7521 the API of sub_char_table_set_contents.
7522
7523 2012-08-18 Chong Yidong <cyd@gnu.org>
7524
7525 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7526 for the string case (Bug#3874).
7527
7528 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * buffer.h (BSET): Remove (Bug#12215).
7531 Replace all uses with calls to new setter functions.
7532 (bset_bidi_paragraph_direction, bset_case_canon_table)
7533 (bset_case_eqv_table, bset_directory, bset_display_count)
7534 (bset_display_time, bset_downcase_table)
7535 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7536 (bset_last_selected_window, bset_local_var_alist)
7537 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7538 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7539 (bset_width_table):
7540 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7541 (bset_auto_fill_function, bset_auto_save_file_format)
7542 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7543 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7544 (bset_cache_long_line_scans, bset_case_fold_search)
7545 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7546 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7547 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7548 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7549 (bset_header_line_format, bset_indicate_buffer_boundaries)
7550 (bset_indicate_empty_lines, bset_invisibility_spec)
7551 (bset_left_fringe_width, bset_major_mode, bset_mark)
7552 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7553 (bset_name, bset_overwrite_mode, bset_pt_marker)
7554 (bset_right_fringe_width, bset_save_length)
7555 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7556 (bset_scroll_up_aggressively, bset_selective_display)
7557 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7558 (bset_word_wrap, bset_zv_marker):
7559 * category.c (bset_category_table):
7560 * syntax.c (bset_syntax_table):
7561 New setter functions.
7562
7563 * process.h (PSET): Remove (Bug#12215).
7564 Replace all uses with calls to new setter functions.
7565 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7566 (PROCESS_INLINE): New macro.
7567 (pset_childp): New setter function.
7568 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7569 * process.c (PROCESS_INLINE):
7570 Define to EXTERN_INLINE, so that the corresponding functions
7571 are compiled into code.
7572 (pset_buffer, pset_command, pset_decode_coding_system)
7573 (pset_decoding_buf, pset_encode_coding_system)
7574 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7575 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7576 (pset_type, pset_write_queue): New setter functions.
7577
7578 * window.h (WSET): Remove (Bug#12215).
7579 Replace all uses with calls to new setter functions.
7580 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7581 (WINDOW_INLINE): New macro.
7582 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7583 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7584 (wset_total_lines, wset_vertical_scroll_bar)
7585 (wset_window_end_pos, wset_window_end_valid)
7586 (wset_window_end_vpos): New setter functions.
7587 * window.c (WINDOW_INLINE):
7588 Define to EXTERN_INLINE, so that the corresponding functions
7589 are compiled into code.
7590 (wset_combination_limit, wset_dedicated, wset_display_table)
7591 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7592 (wset_new_normal, wset_new_total, wset_next_buffers)
7593 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7594 (wset_prev_buffers, wset_right_fringe_width)
7595 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7596 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7597 (wset_window_parameters):
7598 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7599 (wset_column_number_displayed, wset_region_showing):
7600 New setter functions.
7601
7602 * termhooks.h (TSET): Remove (Bug#12215).
7603 Replace all uses with calls to new setter functions.
7604 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7605 (TERMHOOKS_INLINE): New macro.
7606 (tset_charset_list, tset_selection_alist): New setter functions.
7607 * terminal.c (TERMHOOKS_INLINE):
7608 Define to EXTERN_INLINE, so that the corresponding functions
7609 are compiled into code.
7610 (tset_param_alist): New setter function.
7611
7612 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7613
7614 * keyboard.h (KSET): Remove (Bug#12215).
7615 Replace all uses with calls to new setter functions.
7616 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7617 (KEYBOARD_INLINE): New macro.
7618 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7619 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7620 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7621 New setter functions.
7622 * keyboard.c (KEYBOARD_INLINE):
7623 Define to EXTERN_INLINE, so that the corresponding functions
7624 are compiled into code.
7625 (kset_echo_string, kset_kbd_queue)
7626 (kset_keyboard_translate_table, kset_last_prefix_arg)
7627 (kset_last_repeatable_command, kset_local_function_key_map)
7628 (kset_overriding_terminal_local_map, kset_real_last_command)
7629 (kset_system_key_syms): New setter functions.
7630
7631 * frame.h (FSET): Remove (Bug#12215).
7632 Replace all uses with calls to new setter functions.
7633 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7634 (FRAME_INLINE): New macro.
7635 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7636 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7637 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7638 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7639 (fset_param_alist, fset_root_window, fset_scroll_bars)
7640 (fset_selected_window, fset_title, fset_tool_bar_items)
7641 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7642 * frame.c (FRAME_INLINE):
7643 Define to EXTERN_INLINE, so that the corresponding functions
7644 are compiled into code.
7645 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7646
7647 A few more naming-convention fixes for getters and setters.
7648 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7649 and rename from buffer_overlays_set_before.
7650 (set_buffer_overlays_after): Move here from buffer.h, and rename
7651 from buffer_overlays_set_after.
7652 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7653 All uses changed.
7654 (set_buffer_intervals): Rename from buffer_set_intervals.
7655 * intervals.c (set_interval_object): Move here from intervals.h,
7656 and rename from interval_set_object.
7657 (set_interval_left): Move here from intervals.h, and rename from
7658 interval_set_left.
7659 (set_interval_right): Move here from intervals.h, and rename from
7660 interval_set_right.
7661 (copy_interval_parent): Move here from intervals.h, and rename from
7662 interval_copy_parent.
7663 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7664 (set_interval_plist): Rename from interval_set_plist.
7665 Return void, not Lisp_Object, since no caller uses the result.
7666 * lisp.h (string_intervals): Rename from string_get_intervals.
7667 (set_string_intervals): Rename from string_set_intervals.
7668
7669 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7670 (set_char_table_contents): Rename from char_table_set_contents.
7671 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7672 All uses changed. See the end of
7673 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7674
7675 * lisp.h (CSET): Remove (Bug#12215).
7676 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7677 (set_char_table_purpose): New functions,
7678 replacing CSET. All uses changed. For example, replace
7679 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7680 "set_char_table_parent (char_table, parent);".
7681 The old version was confusing because it used the same name
7682 'parent' for two different things.
7683
7684 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7685
7686 Functions to get and set Lisp_Object fields of buffer-local variables.
7687 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7688 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7689 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7690 * data.c, eval.c, frame.c: Adjust users.
7691
7692 2012-08-17 Chong Yidong <cyd@gnu.org>
7693
7694 * xfaces.c (merge_face_vectors): If the target font specfies a
7695 font spec, make the font's attributes take precedence over
7696 directly-specified attributes.
7697 (merge_face_ref): Recognize :font.
7698
7699 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7700
7701 Do not use memcpy for copying intervals.
7702 * intervals.c (reproduce_interval): New function.
7703 (reproduce_tree, reproduce_tree_obj): Use it.
7704 (reproduce_tree_obj): Remove prototype.
7705
7706 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7707
7708 * lisp.h (duration_to_sec_usec): Remove unused decl.
7709
7710 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7711
7712 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7713 to an allocated instance of NSString, not to the class itself.
7714
7715 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
7716
7717 * makefile.w32-in (C_CTYPE_H): New macro.
7718 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7719 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7720 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7721
7722 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7723
7724 Use ASCII tests for character types.
7725 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7726 * xfns.c, xterm.c:
7727 Don't include <ctype.h>; was not needed.
7728 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7729 * sysdep.c, xfaces.c:
7730 Include <c-ctype.h> instead of <ctype.h>.
7731 * nsterm.m: Include <c-ctype.h>.
7732 * charset.c (read_hex):
7733 * doc.c (Fsnarf_documentation):
7734 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7735 (DRIVE_LETTER) [DOS_NT]:
7736 (Ffile_name_directory, Fexpand_file_name)
7737 (Fsubstitute_in_file_name):
7738 * font.c (font_parse_xlfd, font_parse_fcname):
7739 * frame.c (x_set_font_backend):
7740 * gtkutil.c (xg_get_font):
7741 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7742 * nsimage.m (hexchar):
7743 * nsterm.m (ns_xlfd_to_fontname):
7744 * sysdep.c (system_process_attributes):
7745 * xfaces.c (hash_string_case_insensitive):
7746 Use C-locale tests instead of locale-specific tests for character
7747 types, since we want the ASCII interpretation here, not the
7748 interpretation suitable for whatever happens to be the current locale.
7749
7750 2012-08-16 Martin Rudalics <rudalics@gmx.at>
7751
7752 Consistently check windows for validity/liveness
7753 (Bug#11984, Bug#12025, Bug#12026).
7754 * lisp.h (CHECK_VALID_WINDOW): New macro.
7755 * window.c (decode_window): Rename to decode_live_window.
7756 (decode_valid_window, Fwindow_valid_p): New functions.
7757 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7758 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7759 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7760 (Fwindow_prev_sibling, Fwindow_combination_limit)
7761 (Fset_window_combination_limit, Fwindow_use_time)
7762 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7763 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7764 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7765 (Fwindow_hscroll, Fset_window_hscroll)
7766 (Fwindow_redisplay_end_trigger)
7767 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7768 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7769 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7770 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7771 (Fwindow_end, Fset_window_point, Fset_window_start)
7772 (Fpos_visible_in_window_p, Fwindow_line_height)
7773 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7774 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7775 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7776 (Fset_window_parameter, Fwindow_display_table)
7777 (Fset_window_display_table, Fdelete_other_windows_internal)
7778 (Fset_window_buffer, Fset_window_new_total)
7779 (Fset_window_new_normal, Fdelete_window_internal)
7780 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7781 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7782 (Fwindow_scroll_bars): Check whether argument window is a valid or
7783 live window. Update doc-strings.
7784 (syms_of_window): New symbol Qwindow_valid_p.
7785 * keyboard.c (Fposn_at_x_y): Check whether argument
7786 frame_or_window denotes a valid window.
7787
7788 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7789
7790 Fix previous char table change.
7791 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7792 * chartab.c (optimize_sub_char_table): Likewise.
7793
7794 2012-08-16 Chong Yidong <cyd@gnu.org>
7795
7796 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7797
7798 * xfont.c (xfont_open):
7799 * xftfont.c (xftfont_open): Set the font's max_width field.
7800
7801 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7802 min_width to space_width and average_width to the average over
7803 printable ASCII characters.
7804 (ns_char_width): Code cleanup.
7805 (ns_ascii_average_width): New utility function.
7806
7807 * font.h (struct font): Update comments.
7808
7809 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7810
7811 Simple interface to set Lisp_Object fields of character tables.
7812 * lisp.h (CSET): New macro.
7813 (char_table_set_extras, char_table_set_contents)
7814 (sub_char_table_set_contents): New function.
7815 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7816 * syntax.c: Adjust users.
7817
7818 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7819
7820 * eval.c (eval_sub): Bind lexical-binding.
7821 * lread.c (Qlexical_binding): Make non-static.
7822
7823 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7824
7825 * nsmenu.m (popupSession): Remove.
7826 (pop_down_menu): Remove endModalSession.
7827 (timeout_handler:): New method.
7828 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7829 Call runModalForWindow. Check timer_fired when it returns.
7830 If not set, cancel timer and break out of loop.
7831 Otherwise loop again, with a new timeout.
7832
7833 * nsterm.m: Include fcntl.h if present.
7834 (fd_entry, t_readfds, inNsSelect): Remove.
7835 (select_writefds, select_valid, select_timeout, selfds)
7836 (select_mutex, apploopnr): Add.
7837 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7838 Otherwise call kbd_buffer_store_event.
7839 (ns_send_appdefined): Remove release of fd_entry.
7840 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7841 Increment and decrement apploopnr.
7842 (ns_select): If no file descriptors, just do a NSTimer.
7843 Otherwise copy read/write masks and start select thread (fd_handler).
7844 Start main loop and wait for application defined event.
7845 Inform select thread to stop selecting after main loop is exited.
7846 (ns_term_init): Create selfds pipe and set non-blocking.
7847 Initialize select_mutex. Start the select thread (fd_handler).
7848 (fd_handler:): Loop forever, wait for info from the main thread
7849 to either start or stop selecting. When select returns, send
7850 and appdefined event.
7851 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7852 If not call kbd_buffer_store_event.
7853
7854 * nsterm.h (EmacsApp): fd_handler takes id argument.
7855 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7856
7857 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7858
7859 2012-08-15 Eli Zaretskii <eliz@gnu.org>
7860
7861 * region-cache.c (move_cache_gap): Update gap_len using the actual
7862 growth of the boundaries array. Do not change cache_len.
7863 (Bug#12196)
7864
7865 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7866
7867 Generalize and cleanup font subsystem checks.
7868 * font.h (FONT_DEBUG, font_assert): Remove.
7869 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7870 Change font_assert to eassert. Use eassert where appropriate.
7871
7872 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7873
7874 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7875
7876 2012-08-15 Chong Yidong <cyd@gnu.org>
7877
7878 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7879 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7880 extract the font descriptor instead of just the font name.
7881 In that case, return a font spec instead of a string.
7882 (x_last_font_name): Move to this file from xfns.c.
7883
7884 * xfns.c (Fx_select_font): The return value can also be a font
7885 spec. Move x_last_font_name management to gtkutil.c.
7886
7887 * xfaces.c: Make font weight and style symbols non-static.
7888
7889 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7890
7891 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7892 (bug#12117).
7893
7894 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7895
7896 * alloc.c (Fgarbage_collect): Use plural form consistently.
7897
7898 2012-08-14 Eli Zaretskii <eliz@gnu.org>
7899
7900 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7901 iteration through the command loop. Fixes a problem whereby mouse
7902 movements are ignored until the first mouse click.
7903
7904 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7905
7906 Use bool, not int, for Lisp booleans.
7907 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7908 makes Emacs a bit smaller and presumably a bit faster.
7909 * lisp.h: Include <stdbool.h>.
7910 (struct Lisp_Boolfwd, defvar_bool):
7911 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7912 * regex.c [!emacs]: Include <stdbool.h>.
7913 (false, true): Remove; <stdbool.h> does this for us now.
7914
7915 2012-08-14 Chong Yidong <cyd@gnu.org>
7916
7917 * character.c (Fcharacterp): Doc fix (Bug#12076).
7918
7919 * data.c (Findirect_variable): Doc fix (Bug#11040).
7920
7921 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7922
7923 * editfns.c (Fformat): Doc fix (Bug#12059).
7924 (Fsave_current_buffer): Doc fix (Bug#11542).
7925
7926 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7927
7928 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7929 (bug#12022).
7930
7931 2012-08-14 Martin Rudalics <rudalics@gmx.at>
7932
7933 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7934 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7935 * minibuf.c (choose_minibuf_frame, read_minibuf):
7936 * w32fns.c (x_create_tip_frame):
7937 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7938 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7939
7940 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7941
7942 * intervals.c (offset_intervals): Remove obsolete comment.
7943
7944 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7945
7946 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7947
7948 2012-08-14 Gergely Risko <gergely@risko.hu>
7949
7950 * coding.c (decode_coding): Record buffer modification before
7951 disabling undo_list (Bug#11773).
7952
7953 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7954
7955 Revert and cleanup some recent overlay changes.
7956 * buffer.h (enum overlay_type): Remove.
7957 (buffer_get_overlays, buffer_set_overlays): Likewise.
7958 (buffer_set_overlays_before, buffer_set_overlays_after):
7959 New function. Adjust users.
7960 (unchain_both): Add eassert.
7961
7962 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7963
7964 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7965
7966 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7967
7968 * gtkutil.c (xg_mark_data): Don't assume C99.
7969
7970 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7971
7972 * gtkutil.c (xg_frame_tb_info): New struct.
7973 (TB_INFO_KEY): New define.
7974 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7975 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7976 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7977 if not present.
7978 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7979 is up to date. Otherwise store new data.
7980 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7981
7982 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7983
7984 Use KSET for write access to Lisp_Object members of struct kboard.
7985 * keyboard.h (KSET): New macro.
7986 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7987 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7988 * xterm.c: Adjust users.
7989
7990 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7991
7992 Use BSET for write access to Lisp_Object members of struct buffer.
7993 * buffer.h (BSET): New macro.
7994 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7995 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7996 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7997 * window.c, xdisp.c, xfns.c: Adjust users.
7998
7999 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8000
8001 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8002
8003 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8004
8005 * nsterm.m (not_in_argv): New function.
8006 (application:openFile, application:openTempFile:):
8007 (application:openFileWithoutUI:, application:openFiles:): Open file
8008 if not_in_argv returns non-zero (bug#12171).
8009
8010 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8011 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8012 Define for Gtk+ versions less than 3.2.
8013 (xg_get_font_name): Use those functions/macros here.
8014 Reported by Frans Oilinki <moilinki@gmail.com>.
8015
8016 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8017
8018 * unexmacosx.c (copy_data_segment): Copy initialized data in
8019 statically linked libraries from input file rather than memory.
8020
8021 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8022 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8023 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8024
8025 2012-08-10 Glenn Morris <rgm@gnu.org>
8026
8027 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8028 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8029
8030 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8031
8032 Fix last change to allow compilation with low optimization levels.
8033 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8034 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8035
8036 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8037
8038 Use common inline syntax in intervals.h.
8039 * intervals.h (INTERVALS_INLINE): New macro.
8040 Change all users from LISP_INLINE.
8041
8042 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8043
8044 Define Qnone once for all platforms.
8045 * frame.c (Qnone): Define here.
8046 (syms_of_frame): DEFSYM it.
8047 * lisp.h (Qnone): New declaration.
8048 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8049 * xfns.c: Remove duplication. Adjust users.
8050
8051 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8052
8053 Remove unused macros from intervals.h.
8054 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8055 * intervals.c: Adjust comment.
8056
8057 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8058
8059 * w32fns.c <w32_unicode_gui>: New static variable.
8060 (globals_of_w32fns): Initialize it according to os_subtype.
8061 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8062 testing os_subtype.
8063
8064 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8065 Eli Zaretskii <eliz@gnu.org>
8066
8067 Fix bug #10299 with Unicode characters sent by customized
8068 keyboards created by MSKLC.
8069 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8070 (w32_init_class): Use it to initialize the Emacs class with either
8071 ANSI or Unicode API calls.
8072 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8073 later.
8074 (w32_wnd_proc): If the character code sent by WM_CHAR or
8075 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8076 original message. Call DefWindowProcW on NT and later.
8077
8078 2012-08-10 Glenn Morris <rgm@gnu.org>
8079
8080 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8081
8082 * lisp.h (DIRECTORY_SEP): Let configure set it.
8083
8084 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8085
8086 Use TSET for write access to Lisp_Object slots of struct terminal.
8087 * termhooks.h (TSET): New macro.
8088 * coding.c, terminal.c, xselect.c: Adjust users.
8089
8090 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8091
8092 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8093 the failing expression, include them in the error message.
8094 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8095 * lisp.h (internal_condition_case_n): Update declaration.
8096
8097 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8098
8099 Inline functions to examine and change buffer overlays.
8100 * buffer.c (unchain_both): New function.
8101 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8102 (buffer_has_overlays): New function.
8103 (enum overlay_type): New enum.
8104 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8105 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8106
8107 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8108
8109 Inline functions to examine and change buffer intervals.
8110 * alloc.c (mark_interval_tree): Remove.
8111 (MARK_INTERVAL_TREE): Simplify.
8112 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8113 * intervals.c (buffer_balance_intervals): New function.
8114 (graft_intervals_into_buffer): Adjust indentation.
8115 (set_intervals_multibyte): Simplify.
8116 * buffer.h (BUF_INTERVALS): Remove.
8117 (buffer_get_intervals, buffer_set_intervals): New function.
8118 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8119 * intervals.c, textprop.c: Adjust users.
8120
8121 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8122
8123 Inline functions to examine and change string intervals.
8124 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8125 (string_get_intervals, string_set_intervals): New function.
8126 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8127 * lread.c, print.c, textprop.c: Adjust users.
8128
8129 2012-08-08 Glenn Morris <rgm@gnu.org>
8130
8131 * lisp.mk (lisp): Remove language/persian.elc.
8132
8133 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8134
8135 Cleanup intervals.
8136 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8137 (NULL_INTERVAL_P): Likewise. Adjust users.
8138 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8139 Adjust comment. Move under #if 0.
8140 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8141 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8142
8143 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8144
8145 Check total length of intervals with eassert.
8146 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8147 * intervals.c: Change all users to eassert.
8148
8149 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8150
8151 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8152 Rename fields to match removal of FGET and WGET and disuse of
8153 INTERNAL_FIELD in Lisp_Cons.
8154
8155 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8156
8157 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8158 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8159 name since all xname users are fixed long time ago. Do not
8160 use INTERNAL_FIELD.
8161 (set_symbol_name, set_symbol_function, set_symbol_plist):
8162 (set_symbol_next, set_overlay_plist): New function.
8163 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8164 (struct Lisp_Overlay): Likewise.
8165 (CVAR, MVAR, SVAR): Remove.
8166 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8167 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8168 * xterm.c: Adjust users.
8169 * .gdbinit: Change to use name field of struct Lisp_Symbol
8170 where appropriate.
8171
8172 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8173
8174 Basic functions to set Lisp_Object and pointer slots of intervals.
8175 * intervals.h (interval_set_parent, interval_set_object):
8176 (interval_set_left, interval_set_right, interval_set_plist):
8177 (interval_copy_parent): New function.
8178 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8179 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8180 Adjust indentation.
8181 (INTERVAL_SIZE): Remove. Adjust users.
8182 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8183
8184 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8185
8186 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8187 * process.h (PGET): Remove.
8188 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8189 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8190
8191 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8192
8193 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8194 * window.h (WGET): Remove.
8195 (struct window): Do not use INTERNAL_FIELD.
8196 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8197 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8198 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8199 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8200 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8201 Adjust users.
8202
8203 2012-08-07 Chong Yidong <cyd@gnu.org>
8204
8205 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8206 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8207 (Fdelete_window_internal): Signal an error if the window is not on
8208 a live frame (Bug#12025).
8209
8210 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8211
8212 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8213 * frame.h (FGET): Remove.
8214 (struct frame): Do not use INTERNAL_FIELD.
8215 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8216 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8217 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8218 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8219
8220 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8221
8222 * w32.c: Silence compiler warnings.
8223 (map_w32_filename): Remove unused variable `is_fat'.
8224 (chase_symlinks): Add parentheses around expression.
8225
8226 2012-08-06 Glenn Morris <rgm@gnu.org>
8227
8228 * sysdep.c: Respect BROKEN_GETWD.
8229
8230 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8231 Let configure handle it.
8232 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8233
8234 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8235
8236 Use GCALIGNMENT where appropriate.
8237 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8238 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8239 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8240
8241 2012-08-06 Eli Zaretskii <eliz@gnu.org>
8242
8243 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8244 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8245
8246 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8247
8248 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8249 that should be sufficient for everyone.
8250
8251 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8252
8253 * keyboard.c (timer_check_2): Add break so timer_check returns next
8254 timeout.
8255
8256 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8257
8258 Fix Windows build errors introduced after converting to WGET and WSET.
8259 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8260 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8261
8262 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8263
8264 * nsterm.m (ns_frame_rehighlight): Use FSET.
8265
8266 * nsmenu.m (ns_update_menubar): Use FSET.
8267
8268 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8269
8270 Separate read and write access to Lisp_Object slots of Lisp_Process.
8271 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8272 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8273
8274 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8275
8276 Separate read and write access to Lisp_Object slots of struct window.
8277 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8278 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8279 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8280 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8281 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8282 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8283 Adjust users.
8284
8285 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8286
8287 Fix Windows build errors introduced after converting to FGET and FSET.
8288 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8289 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8290 (w32_judge_scroll_bars): Change to use FSET.
8291 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8292
8293 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8294
8295 Fix replacement typo.
8296 * window.c (replace_window): Set root_window instead of
8297 selected_window. This fixes a total window subsystem
8298 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8299
8300 2012-08-06 Glenn Morris <rgm@gnu.org>
8301
8302 * lisp.mk (lisp): Add language/persian.elc.
8303
8304 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8305
8306 Separate read and write access to Lisp_Object slots of struct frame.
8307 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8308 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8309 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8310 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8311 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8312
8313 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8314
8315 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8316
8317 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8318
8319 Generalize common compile-time constants.
8320 * lisp.h (header_size, bool_header_size, word_size): Now here.
8321 (struct Lisp_Vector): Add comment.
8322 (struct Lisp_Bool_Vector): Move up to define handy constants.
8323 (VECSIZE, PSEUDOVECSIZE): Simplify.
8324 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8325 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8326 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8327 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8328 * xfont.c, xmenu.c: Use word_size where appropriate.
8329
8330 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8331
8332 * search.c (Freplace_match): Treat \? in the replacement text
8333 literally (Bug#8161).
8334
8335 2012-08-05 Chong Yidong <cyd@gnu.org>
8336
8337 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8338 * frame.c (Vdelete_frame_functions):
8339 * emacs.c (Vkill_emacs_hook): Doc fix.
8340
8341 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8342
8343 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8344 --with-x-toolkit=no builds.
8345 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8346
8347 2012-08-04 Chong Yidong <cyd@gnu.org>
8348
8349 * syntax.c (Fmodify_syntax_entry): Doc fix.
8350
8351 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8352
8353 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8354 * w32.c (init_environment): Change the default values of many
8355 environment variables in dflt_envvars[] to NULL, to avoid pushing
8356 them into environment when they were not already defined.
8357 Remove the code that deletes site-lisp subdirectories from the default
8358 value of EMACSLOADPATH, as it is no longer needed.
8359 (check_windows_init_file): Now external, not static.
8360 Use Vload_path as is, without adding anything, as this function is now
8361 called when Vload_path is already set up.
8362
8363 * w32.h (check_windows_init_file): Add prototype.
8364
8365 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8366 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8367 compatibility with Posix platforms.
8368 (main): Move the call to check_windows_init_file to here from
8369 w32.c.
8370 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8371 any, in the DEFALT argument into the root of the Emacs build or
8372 installation tree, as appropriate.
8373
8374 * callproc.c (init_callproc_1): Call decode_env_path instead of
8375 doing its equivalent by hand.
8376 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8377 the code that sets Vexec_path run on MS-Windows.
8378
8379 * lread.c (init_lread): Add comments to #ifdef's.
8380
8381 * msdos.c (dos_set_window_size, IT_update_begin)
8382 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8383 instead of direct references.
8384
8385 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8386
8387 Export DEFAULT_REHASH_* to GDB.
8388 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8389 Now constants, not macros.
8390
8391 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8392
8393 Remove unnecessary casts involving pointers.
8394 These casts are no longer needed now that we assume C89 or later,
8395 since they involve casting to or from void *.
8396 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8397 (make_pure_float, make_pure_vector):
8398 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8399 * macros.c (Fstart_kbd_macro):
8400 * menu.c (find_and_return_menu_selection):
8401 * minibuf.c (read_minibuf_noninteractive):
8402 * sysdep.c (closedir):
8403 * xdisp.c (x_produce_glyphs):
8404 * xfaces.c (compare_fonts_by_sort_order):
8405 * xfns.c (x_real_positions, select_visual):
8406 * xselect.c (x_stop_queuing_selection_requests)
8407 (x_get_window_property, x_get_window_property_as_lisp_data):
8408 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8409 Remove unnecessary pointer casts.
8410 * alloc.c (record_xmalloc): New function.
8411 * lisp.h (record_xmalloc): New decl.
8412 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8413 more like a function. This is because the pointer cast is not
8414 needed. All uses changed.
8415 * print.c (print_string, print_error_message): Avoid length recalc.
8416
8417 Improve fix for macroexp crash with debugging (Bug#12118).
8418 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8419 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8420 not supposed to be invoked from the garbage collector.
8421 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8422 (gc_aset): New function, which is like ASET but can be
8423 used in the garbage collector.
8424 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8425 (set_hash_index): Use it instead of ASET.
8426
8427 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8428
8429 Support symlinks on latest versions of MS-Windows.
8430 * w32.c: Include winioctl.h and aclapi.h.
8431 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8432 (revert_to_self): Forward declarations of static functions.
8433 <static BOOL g_b_init_get_security_info>:
8434 <g_b_init_create_symbolic_link>: New static flags.
8435 (globals_of_w32): Initialize them to zero.
8436 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8437 (map_w32_filename): Improve commentary. Simplify switch.
8438 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8439 headers (most versions of MinGW w32api don't).
8440 (get_security_info, create_symbolic_link)
8441 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8442 New functions.
8443 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8444 in the argument file name.
8445 (sys_access): Call unc_volume_file_attributes only if
8446 GetFileAttributes fails with network-related error codes.
8447 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8448 have the required privileges.
8449 (get_file_security_desc_by_name): Rename from
8450 get_file_security_desc.
8451 (stat_worker): New function, with most of the guts of 'stat', and
8452 with addition of handling of symlinks and support for 'lstat'.
8453 If possible, get file's attributes and security information by
8454 handle, not by name. Produce S_IFLNK bit for symlinks, when
8455 called from 'lstat'.
8456 (stat, lstat): New functions, call 'stat_worker'.
8457 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8458 symlinks when the underlying filesystem supports them.
8459
8460 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8461
8462 Fix macroexp crash on Windows with debugging (Bug#12118).
8463 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8464 checking subscripts; problem introduced with the recent
8465 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8466 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8467 since it's used in non-static inline functions now.
8468
8469 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8470 Don't assume buffer size fits in 'int'. Remove unused local.
8471
8472 Use C99-style 'extern inline' if available.
8473 * buffer.h (BUFFER_INLINE):
8474 * category.h (CATEGORY_INLINE):
8475 * character.h (CHARACTER_INLINE):
8476 * charset.h (CHARSET_INLINE):
8477 * composite.h (COMPOSITE_INLINE):
8478 * dispextern.h (DISPEXTERN_INLINE):
8479 * lisp.h (LISP_INLINE):
8480 * systime.h (SYSTIME_INLINE):
8481 New macro, replacing 'static inline' in this header.
8482 * buffer.h, category.h, character.h, charset.h, composite.h:
8483 * dispextern.h, lisp.h, systime.h:
8484 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8485 * alloc.c (LISP_INLINE):
8486 * buffer.c (BUFFER_INLINE):
8487 * category.c (CATEGORY_INLINE):
8488 * character.c (CHARACTER_INLINE):
8489 * charset.c (CHARSET_INLINE):
8490 * composite.c (COMPOSITE_INLINE):
8491 * dispnew.c (DISPEXTERN_INLINE):
8492 * sysdep.c (SYSTIME_INLINE):
8493 Define to EXTERN_INLINE, so that the corresponding functions
8494 are compiled into code.
8495 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8496 (INLINE_HEADER_END): New macros.
8497 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8498 since it's used in non-static inline functions now.
8499 (VALMASK) [!USE_LSB_TAG]: Likewise.
8500
8501 2012-08-02 Glenn Morris <rgm@gnu.org>
8502
8503 * s/: Remove empty directory.
8504
8505 * s/ms-w32.h: Move to ../nt/inc.
8506 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8507 Update for new ms-w32.h location.
8508
8509 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8510
8511 Port to Solaris 8.
8512 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8513
8514 2012-08-02 Glenn Morris <rgm@gnu.org>
8515
8516 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8517 hard-coding the path separator.
8518
8519 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8522 This how ASET and AREF are supposed to work, and makes
8523 it easier to think about future improvements. See
8524 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8525 * charset.h (set_charset_attr): New function.
8526 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8527 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8528 (aref_addr): New function. All uses of &AREF(...) changed.
8529 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8530 (set_hash_index): New functions. All lvalue-style uses of
8531 HASH_KEY etc. changed.
8532 * keyboard.c (set_prop): New function. All lvalue-style uses
8533 of PROP changed.
8534
8535 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8536
8537 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8538 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8539 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8540 * nsfns.m (ns_set_name_as_filename): Likewise.
8541 * nsmenu.m (ns_update_menubar): Likewise.
8542 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8543
8544 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8545
8546 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8547 Adapt to latest changes in field names of the corresponding Lisp
8548 objects.
8549
8550 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8551
8552 2012-08-01 Glenn Morris <rgm@gnu.org>
8553
8554 * s/msdos.h: Remove file.
8555 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8556 * Makefile.in (S_FILE): Remove.
8557 (config_h): Remove S_FILE.
8558
8559 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8560
8561 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8562 Remove; moved to nt/config.nt.
8563
8564 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8565
8566 Use INTERNAL_FIELD for conses and overlays.
8567 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8568 Remove obsolete comment.
8569 (MVAR): New macro.
8570 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8571 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8572
8573 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8574
8575 Use INTERNAL_FIELD for symbols.
8576 * lisp.h (SVAR): New macro. Adjust users.
8577 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8578 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8579
8580 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8581
8582 Use INTERNAL_FIELD for processes.
8583 * process.h (PVAR): New macro. Adjust style.
8584 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8585 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8586
8587 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8588
8589 Use INTERNAL_FIELD for windows.
8590 * window.h (WVAR): New macro.
8591 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8592 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8593 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8594 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8595 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8596 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8597
8598 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8599
8600 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8601
8602 2012-08-01 Glenn Morris <rgm@gnu.org>
8603
8604 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8605 Move to configure.ac.
8606
8607 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8608
8609 * makefile.w32-in (CONFIG_H): Update dependencies.
8610 (CONF_POST_H): New macro.
8611
8612 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8613
8614 2012-07-31 Glenn Morris <rgm@gnu.org>
8615
8616 * Makefile.in (S_FILE): No longer set by configure.
8617
8618 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8619 is available.
8620 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8621
8622 * process.h (NULL_DEVICE):
8623 * emacs.c (SEPCHAR):
8624 * editfns.c (USER_FULL_NAME): Let configure set them.
8625
8626 * s/README, s/template.h: Remove files.
8627
8628 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8629
8630 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8631 Move to configure.ac.
8632
8633 2012-07-31 Eli Zaretskii <eliz@gnu.org>
8634
8635 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8636 resulting renaming of 'struct frame' members.
8637
8638 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8639
8640 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8641 after introduction of FVAR.
8642
8643 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8644
8645 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8646
8647 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8648 instead of compositeToPoint.
8649 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8650
8651 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8652
8653 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8654
8655 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8656 * lisp.h (INTERNAL_FIELD): New macro.
8657 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8658 (BVAR): Change to use INTERNAL_FIELD.
8659 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8660 (KVAR): Change to use INTERNAL_FIELD.
8661 * frame.h (FVAR): New macro.
8662 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8663 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8664 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8665 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8666 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8667
8668 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8669
8670 Miscellaneous fixes for non-default X toolkits.
8671 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8672 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8673 Move under #ifdef USE_LUCID.
8674 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8675 definition and usage to avoid warnings.
8676
8677 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8678
8679 * nsterm.m (openFiles): Fix previous checkin.
8680
8681 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8682
8683 * indent.c (compute_motion): Remove unused local.
8684
8685 2012-07-31 Glenn Morris <rgm@gnu.org>
8686
8687 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8688
8689 * conf_post.h [USG5_4]:
8690 Move remaining contents of s/usg5-4-common.h here.
8691 * s/usg5-4-common.h: Remove file.
8692
8693 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8694 * s/irix6-5.h: Remove file.
8695
8696 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8697 * s/darwin.h: Remove file.
8698
8699 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8700 * s/hpux10-20.h: Remove file, which is now empty.
8701
8702 2012-07-30 Glenn Morris <rgm@gnu.org>
8703
8704 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8705 * Makefile.in (config_h): Add conf_post.h.
8706 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8707
8708 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8709
8710 * nsterm.m (ns_do_open_file): New variable.
8711 (ns_term_init): Set ns_do_open_file to YES after run returns.
8712 (openFile, openTempFile, openFileWithoutUI, openFiles):
8713 Open files only if ns_do_open_file.
8714
8715 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8718 This no-op macro hasn't been needed for many years.
8719 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8720
8721 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8722 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8723 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8724 gdb_make_enums_visible.
8725 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8726 (DIRECTORY_SEP): Now a constant, not a macro.
8727
8728 2012-07-30 Eli Zaretskii <eliz@gnu.org>
8729
8730 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8731 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8732
8733 * w32term.c <w32_keyboard_codepage>: Renamed from
8734 keyboard_codepage and now external. All users changed.
8735
8736 * w32term.h: Add declaration of w32_keyboard_codepage.
8737
8738 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8739 the codepage to translate keys to Unicode. If this argument is
8740 -1, use the value returned by GetConsoleCP. All callers changed.
8741
8742 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8743
8744 Update .PHONY listings in makefiles.
8745 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8746 bootstrap-clean, distclean, maintainer-clean, versioclean,
8747 extraclean, frc.
8748
8749 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8750 This is a bit clearer. Fix some commentary typos.
8751
8752 2012-07-30 Glenn Morris <rgm@gnu.org>
8753
8754 * s/netbsd.h: Let configure include signal.h if needed.
8755 Remove file, which is now empty.
8756
8757 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8758 Let configure set them.
8759 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8760 No more need to undefine.
8761
8762 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8763
8764 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8765 non-single-byte char when adding meta modifier. (Bug#12090)
8766
8767 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 Convert safe_call to use variable number of arguments.
8770 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8771 (safe_call2): Fix comment.
8772 * lisp.h (safe_call): Adjust prototype.
8773 * coding.c (encode_coding_object): Change to use safe_call2.
8774 * xfaces.c (merge_face_heights): Change to use safe_call1.
8775
8776 2012-07-30 Glenn Morris <rgm@gnu.org>
8777
8778 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8779 does that unconditionally. Remove file, which is now empty.
8780
8781 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8782 Remove empty files.
8783
8784 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8785
8786 Export to GDB most of lisp.h's remaining object-like macros.
8787 * lisp.h (min, max): Move earlier, because they're used earlier now.
8788 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8789 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8790 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8791 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8792 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8793 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8794 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8795 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8796 Now constants, for GDB. They need not be macros.
8797 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8798 Now constants, for GDB, as well as macros, for static initializers.
8799 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8800 Move to after the definition of struct Lisp_Char_Table,
8801 since the former now needs that type defined.
8802 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8803 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8804 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8805 New enums, for gdb_make_enums_visible.
8806 (GLYPH_MODE_LINE_FACE): Remove; unused.
8807 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8808 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8809 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8810 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8811 enum maxargs, enum MAX_ALLOCA.
8812 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8813 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8814 no longer needed, now that they are done in lisp.h.
8815
8816 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8817
8818 Cleanup string bytes checking.
8819 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8820 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8821 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8822 (check_sblock, compact_small_strings): Simplify.
8823
8824 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8825
8826 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8827 These macros are confusing and no longer need to be defined, as
8828 the enum values now suffice. All uses replaced with definiens.
8829 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8830
8831 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
8832
8833 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8834 ($(BLD)/w32console.$(O)): Update dependencies.
8835
8836 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8837
8838 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8839 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8840 time. Adjust users.
8841 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8842
8843 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8844
8845 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8846 setting sitelisp (Bug#12010).
8847
8848 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8849
8850 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8851
8852 * w32heap.c (cache_system_info):
8853 * w32.c (sys_rename):
8854 * w32proc.c (find_child_console, sys_kill): All users changed.
8855
8856 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8857
8858 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8859
8860 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8861
8862 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8863
8864 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8865
8866 Cleanup statistics calculation in Fgarbage_collect.
8867 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8868 Fix zombies percentage calculation. Simplify elapsed time calculation.
8869
8870 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8871
8872 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8873 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8874 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8875 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8876 (replace_range, replace_range_2, del_range_2): Change to eassert.
8877 * marker.c (byte_char_debug_check): Adjust style.
8878
8879 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8882 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8883 long-ago-commented-out code that talks about "WIN32".
8884 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8885 All uses changed.
8886
8887 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8888
8889 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8890 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8891 Simplify by using alignof.
8892 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8893 * lisp.h: Include <stdalign.h>.
8894 (GCALIGNMENT): New macro and constant.
8895 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8896 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8897 (stdalign): New macro, if not already defined.
8898
8899 2012-07-28 Eli Zaretskii <eliz@gnu.org>
8900
8901 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8902 * w32inevt.c: Include w32inevt.h.
8903 (w32_read_console_input): New inline function, calls either
8904 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8905 w32_console_unicode_input.
8906 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8907 (w32_kbd_patch_key, key_event): Use the codepage returned by
8908 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8909 (key_event): use uChar.UnicodeChar only if
8910 w32_console_unicode_input is non-zero.
8911
8912 * w32console.c: Include w32heap.h.
8913 <w32_console_unicode_input>: New global variable.
8914 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8915 family of Windows, zero otherwise.
8916
8917 * w32inevt.h: Declare w32_console_unicode_input.
8918
8919 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8920 --without-x. (Bug#11742)
8921
8922 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8923
8924 Adjust GDB to reflect pvec_type changes (Bug#12036).
8925 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8926 2012-07-04 changes to pseudovector representation.
8927 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8928
8929 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
8930
8931 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8932 bus address.
8933 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8934
8935 2012-07-27 Eli Zaretskii <eliz@gnu.org>
8936
8937 * alloc.c (listn): Fix the order the arguments are consed onto the
8938 list.
8939
8940 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8941 enumeration constants, as PURE and HEAP are too general, and clash
8942 with other headers and sources, such as gmalloc.c and the
8943 MS-Windows system headers. All users changed.
8944
8945 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8946
8947 Revert last save_excursion_save and save_excursion_restore changes.
8948 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8949 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8950
8951 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8952
8953 Fix recently-introduced typos in Windows port.
8954 Reported by Martin Rudalics <rudalics@gmx.at>.
8955 * w32.c (init_environment): Replace comma with semicolon.
8956 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8957
8958 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8959
8960 Improve GDB symbol export (Bug#12036).
8961 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8962 arms of an 'if', not using conditional expressions; otherwise GDB
8963 complains about the types in the unevaluated arm when the argument
8964 is an integer literal.
8965 (xgetint): Simplify expression.
8966 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8967 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8968 Zaretskii in <http://bugs.gnu.org/12036#13>.
8969 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8970 needed now that we have gdb_make_enums_visible.
8971 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8972 (enum enum_USE_LSB_TAG):
8973 New enum types, packaging up enums that need to be exported to GDB.
8974
8975 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8976
8977 Utility function to make a list from specified amount of objects.
8978 * lisp.h (enum constype): New datatype.
8979 (listn): New prototype.
8980 * alloc.c (listn): New function.
8981 (Fmemory_use_count, syms_of_alloc): Use it.
8982 * buffer.c (syms_of_buffer): Likewise.
8983 * callint.c (syms_of_callint): Likewise.
8984 * charset.c (define_charset_internal): Likewise.
8985 * coding.c (syms_of_coding): Likewise.
8986 * keymap.c (syms_of_keymap): Likewise.
8987 * search.c (syms_of_search): Likewise.
8988 * syntax.c (syms_of_syntax): Likewise.
8989 * w32.c (init_environment): Likewise.
8990 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8991 * xdisp.c (syms_of_xdisp): Likewise.
8992 * xfns.c (syms_of_xfns): Likewise.
8993
8994 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8995
8996 Fast save_excursion_save and save_excursion_restore.
8997 * lisp.h (struct Lisp_Excursion): New data type.
8998 (PVEC_EXCURSION): New pseudovector type.
8999 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9000 to deal with it. Adjust comments.
9001 (init_marker, attach_marker): New prototype.
9002 (unchain_marker): Adjust prototype.
9003 * marker.c (attach_marker): Change to global.
9004 (init_marker): New function.
9005 * alloc.c (Fmake_marker, build_marker): Use it.
9006 (build_marker): More easserts.
9007 (mark_object): Handle struct Lisp_Excursion.
9008 * editfns.c (save_excursion_save, save_excursion_restore):
9009 Reimplement to use struct Lisp_Excursion. Add comments.
9010
9011 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9012
9013 Fix export of symbols to GDB (Bug#12036).
9014 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9015 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9016 emacs.c, as this is a more-suitable home. Had this been done earlier
9017 the fix for 12036 would have avoided some of the problems noted in
9018 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9019 would have been more obvious.
9020 * emacs.c: Do not include <verify.h>; no longer needed.
9021 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9022 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9023 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9024 Remove; now done in lisp.h.
9025 * lisp.h (PUBLISH_TO_GDB): New macro.
9026 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9027 (DATA_SEG_BITS): Use it.
9028 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9029 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9030 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9031 not be usable in #if. This simplifies things.
9032
9033 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9034
9035 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9036
9037 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9038
9039 Simplify export of symbols to GDB (Bug#12036).
9040 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9041 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9042 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9043 Adjust to changes in lisp.h and emacs.c, by using
9044 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9045 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9046 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9047 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9048 instead of gdb_valbits.
9049 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9050 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9051 instead of gdb_array_mark_flag.
9052 (xboolvector): Get size from $->size, not $->header.size.
9053 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9054 (xreload, hook-run, hookpost-run): Remove.
9055 * emacs.c: Include <verify.h>.
9056 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9057 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9058 Remove.
9059 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9060 (gdb_USE_LSB_TAG): New enum constants.
9061 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9062 Also define these as enum constants, so they're visible to GDB.
9063 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9064 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9065 as constants, so they're visible to GDB.
9066 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9067 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9068 Now enum constants, not macros, so they're visible to GDB.
9069 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9070 more convenient now. All uses changed.
9071 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9072 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9073
9074 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9075
9076 Explicitly free restriction data that are not needed anymore.
9077 * editfns.c (save_restriction_restore): Free restriction data.
9078
9079 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9080
9081 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9082 add argument, tune behavior, and adjust all callers.
9083
9084 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9085
9086 Use typedef for EMACS_INT, EMACS_UINT.
9087 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9088 than macros. This simplifies debugging in the usual case, since
9089 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9090 and it allows expressions involving EMACS_INT casts.
9091 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9092
9093 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9094
9095 * nsterm.m (ns_read_socket): Return early if there is a modal
9096 window (Bug#12043).
9097
9098 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9099
9100 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9101 that FOCUS-FRAME can be omitted.
9102
9103 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9104
9105 Adjust buffer text indirection counters at the end of Fkill_buffer.
9106 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9107 buffer is definitely dead. This should really fix an issue reported
9108 by Christoph Scholtes again. (Bug#12007).
9109 (init_buffer_once): Initialize indirection counters of
9110 buffer_defaults and buffer_local_symbols (for sanity and safety).
9111
9112 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9113
9114 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9115 and continuation glyphs on tooltip frames, leave them at zero.
9116 Avoids continued lines in tooltips. (Bug#11832)
9117
9118 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9119
9120 Simplify copy_overlay.
9121 * buffer.c (copy_overlay): Simplify. Use build_marker.
9122 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9123
9124 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9125
9126 * print.c (print_object): Don't crash when a frame's name is nil
9127 or invalid. (Bug#12025)
9128
9129 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9130 it signals an error when a tooltip frame is being created.
9131
9132 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9133
9134 Cleanup miscellaneous objects allocation and initialization.
9135 * alloc.c (allocate_misc): Change to static. Add argument to
9136 specify the subtype. Adjust comment and users.
9137 (build_overlay): New function.
9138 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9139 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9140 (allocate_misc): Remove prototype.
9141 (build_overlay): Add prototype.
9142
9143 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9144
9145 Swap buffer text indirection counters in Fbuffer_swap_text.
9146 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9147 This avoids crash reported by Christoph Scholtes at
9148 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9149
9150 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9151
9152 * nsmenu.m (Popdown_data): New struct.
9153 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9154 free Popdown_data.
9155 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9156 (initWithContentRect): Make imgView and contentView non-static
9157 and autorelease them. Also autorelease img and matrix (Bug#12005).
9158 (dealloc): Remove (Bug#12005).
9159
9160 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9161
9162 Adjust consing_since_gc when objects are explicitly freed.
9163 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9164 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9165 (free_cons, free_misc): Subtract object size from consing_since_gc.
9166
9167 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9168
9169 Simplify and cleanup markers positioning code.
9170 * marker.c (attach_marker): More useful eassert.
9171 (live_buffer, set_marker_internal): New function.
9172 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9173 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9174
9175 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9176
9177 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9178 as it's limited by the amount of memory, not by INT_MAX.
9179
9180 2012-07-21 Eli Zaretskii <eliz@gnu.org>
9181
9182 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9183 in special-event-map. See the discussion at
9184 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9185 for the reasons.
9186
9187 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9188 info.dwItemData. Fixes crashes on 64-bit Windows.
9189 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9190
9191 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9192
9193 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
9194 (conversationIdentifier): Return value is NSInteger.
9195 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9196
9197 2012-07-21 Chong Yidong <cyd@gnu.org>
9198
9199 * window.c (decode_any_window): Signal an error if the window is
9200 on a dead frame (Bug#11984).
9201
9202 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9203
9204 Add indirection counting to speed up Fkill_buffer.
9205 * buffer.h (struct buffer): New member.
9206 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9207 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9208 base buffer indirection counter.
9209 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9210 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9211 through buffer list if indirection counter is 0.
9212
9213 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9214
9215 Extend the value returned by Fgarbage_collect with heap statistics.
9216 * alloc.c (Qheap): New symbol.
9217 (syms_of_alloc): DEFSYM it.
9218 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9219 (Fmemory_free): Remove.
9220 (syms_of_alloc): Don't defsubr it.
9221 * buffer.c (Fcompact_buffer): Remove.
9222 (syms_of_buffer): Don't defsubr it.
9223
9224 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9225
9226 Make maybe_gc inline.
9227 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9228 * lisp.h (consing_since_gc, gc_relative_threshold)
9229 (memory_full_cons_threshold): Revert declaration.
9230 (maybe_gc): Remove prototype, define as inline.
9231 * alloc.c: Remove old commented-out code.
9232 (consing_since_gc, gc_relative_threshold)
9233 (memory_full_cons_threshold): Revert to global.
9234 (maybe_gc): Remove.
9235
9236 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9237
9238 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9239 * lisp.h (build_unibyte_string): New function.
9240 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9241 * sysdep.c, w32fns.c, xfns.c: Use it.
9242 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9243 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9244 Adjust users accordingly.
9245 * font.h (font_open_by_name): Adjust prototype.
9246
9247 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9248
9249 Cleanup calls to Fgarbage_collect.
9250 * lisp.h (maybe_gc): New prototype.
9251 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9252 Remove declarations.
9253 * alloc.c (maybe_gc): New function.
9254 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9255 Make them static.
9256 * bytecode.c (MAYBE_GC): Use maybe_gc.
9257 * eval.c (eval_sub, Ffuncall): Likewise.
9258 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9259 to avoid dependency from auto-save feature.
9260
9261 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9262
9263 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9264 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9265 'for_each_per_buffer_object_at'.
9266 All uses changed. It's better to use upper-case for macros that
9267 cannot be implemented as functions, to give the reader a clue
9268 that they're special.
9269
9270 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9271
9272 * alloc.c (Fgarbage_collect): Tweak docstring.
9273
9274 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9275
9276 Tweak the value returned from Fgarbage_collect again.
9277 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9278 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9279 Adjust documentation.
9280 (total_vector_bytes): Rename to total_vector_slots, adjust
9281 accounting.
9282 (total_free_vector_bytes): Rename to total_free_vector_slots,
9283 adjust accounting.
9284 (Qstring_bytes, Qvector_slots): New symbols.
9285 (syms_of_alloc): DEFSYM them.
9286
9287 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9288
9289 Buffer compaction primitive which may be used from Lisp.
9290 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9291 (syms_of_buffer): Register Fcompact_buffer.
9292 * alloc.c (Fgarbage_collect): Use compact_buffer.
9293 * buffer.h (compact_buffer): New prototype.
9294 (struct buffer_text): New member.
9295
9296 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9297
9298 New macro to iterate over all buffers, miscellaneous cleanups.
9299 * lisp.h (all_buffers): Remove declaration.
9300 * buffer.h (all_buffers): Add declaration, with comment.
9301 (for_each_buffer): New macro.
9302 * alloc.c (Fgarbage_collect, mark_object): Use it.
9303 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9304 (init_buffer): Likewise.
9305 * data.c (Fset_default): Likewise.
9306 * coding.c (code_conversion_restore): Remove redundant check
9307 for dead buffer.
9308 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9309
9310 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9311
9312 Fix bug that created negative-length intervals.
9313 * intervals.c (merge_interval_right, merge_interval_left):
9314 Do not zero out this interval if it is absorbed by its children,
9315 as this interval's total length doesn't change in that case. See
9316 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9317
9318 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9319
9320 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9321 when invoking (make-bool-vector N t) and N is a positive
9322 multiple of 8 -- the last 8 bits were mistakenly cleared.
9323
9324 Remove some struct layout assumptions in bool vectors.
9325 * alloc.c (bool_header_size): New constant.
9326 (header_size, word_size): Move earlier, as they're now used earlier.
9327 Use 'word_size' in a few more places, where it's appropriate.
9328 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9329 padding before the data member of a bool vector.
9330 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9331 than doing the check by hand with an abort ().
9332
9333 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9334
9335 * eval.c (Fdefvar): Don't check constants since we only set the var if
9336 it's not yet defined anyway (bug#11904).
9337
9338 * lisp.h (last_undo_boundary): Declare new var.
9339 * keyboard.c (command_loop_1): Set it.
9340 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9341 were auto-added by the command loop (bug#11774).
9342
9343 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9344
9345 * w32font.c (Qsymbol): Remove local definition.
9346 (syms_of_w32font): Don't DEFSYM it.
9347
9348 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9349
9350 Fix sweep_vectors to handle large bool vectors correctly.
9351 * alloc.c (sweep_vectors): Account total_vector_bytes for
9352 bool vectors larger than VBLOCK_BYTES_MAX.
9353
9354 2012-07-18 Chong Yidong <cyd@gnu.org>
9355
9356 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9357 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9358
9359 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9360
9361 Return more descriptive data from Fgarbage_collect.
9362 Suggested by Stefan Monnier in
9363 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9364 * alloc.c (bounded_number): New function.
9365 (total_buffers, total_vectors): New variable.
9366 (total_string_size): Rename to total_string_bytes, adjust users.
9367 (total_vector_size): Rename to total_vector_bytes, adjust users.
9368 (sweep_vectors): Account total_vectors and total_vector_bytes.
9369 (Fgarbage_collect): New return value. Adjust documentation.
9370 (gc_sweep): Account total_buffers.
9371 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9372 (VECTOR_SIZE): Remove.
9373 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9374 (Qinterval, Qmisc): New symbols.
9375 (syms_of_data): Initialize them.
9376 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9377 (Qcons, Qbuffer): New declarations.
9378
9379 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9382 Round up, not down. Improve doc.
9383
9384 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9385
9386 Restore old code in allocate_string_data to avoid Faset breakage.
9387 Reported by Julien Danjou <julien@danjou.info> in
9388 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9389 * alloc.c (allocate_string_data): Restore old code with minor
9390 adjustments, fix comment to explain this subtle issue.
9391
9392 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9393
9394 Remove FILE_SYSTEM_CASE.
9395 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9396
9397 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9398 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9399 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9400 call-process-region passes it through expand-file-name.
9401
9402 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9403
9404 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9405
9406 Fix crash when creating indirect buffer (Bug#11917)
9407 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9408 Don't handle unbound variables specially if non-zero.
9409 (Fbuffer_local_variables): Pass zero.
9410 (clone_per_buffer_values): Pass non-zero.
9411
9412 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9413
9414 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9415 to make the loop interruptible.
9416
9417 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9418
9419 * gnutls.c (emacs_gnutls_handshake): Only retry if
9420 GNUTLS_E_INTERRUPTED.
9421
9422 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9423
9424 Cleanup and convert miscellaneous checks to eassert.
9425 * alloc.c (mark_interval): Fix comment, partially rephrase
9426 old comment from intervals.h (see below).
9427 * intervals.c (find_interval, adjust_intervals_for_insertion)
9428 (delete_interval, adjust_intervals_for_deletion)
9429 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9430 Convert to eassert.
9431 (adjust_intervals_for_insertion, make_new_interval):
9432 Remove obsolete and unused code.
9433 * intervals.h (struct interval): Remove obsolete comment.
9434 * textprotp.c (erase_properties): Remove unused code.
9435 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9436 (Fremove_list_of_text_properties): Convert to eassert.
9437
9438 2012-07-17 Chong Yidong <cyd@gnu.org>
9439
9440 * editfns.c (Finsert_char): Doc fix.
9441
9442 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9443
9444 Fix previous change to make Fmemory_free always accurate.
9445 * alloc.c (make_interval): Update total_free_intervals.
9446 (make_float): Likewise for total_free_floats.
9447 (free_cons, Fcons): Likewise for total_free_conses.
9448 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9449 Likewise for total_free_vector_bytes.
9450 (Fmake_symbol): Likewise for total_free_symbols.
9451 (bytes_free): Remove.
9452
9453 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9454
9455 Simple free memory accounting feature.
9456 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9457 (sweep_vectors): Accumulate size of free vectors.
9458 (Fgarbage_collect): Setup bytes_free.
9459 (Fmemory_free): New function.
9460 (syms_of_alloc): Register it.
9461
9462 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9463
9464 Cleanup overlays checking.
9465 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9466 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9467 eassert and OVERLAYP.
9468 (sort_overlays): Change to use OVERLAYP.
9469
9470 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9471
9472 * editfns.c (Finsert_char): Make it interactive, and make the
9473 second arg optional. Copy interactive spec and docstring from
9474 ucs-insert.
9475
9476 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9477
9478 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9479 Unlike the other wrapped functions, fabs has an unspecified
9480 effect on errno.
9481
9482 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9483
9484 * nsterm.m (keyDown): Interpret flags without left/right bits
9485 as the left key (Bug#11670).
9486
9487 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9488
9489 Remove empty and useless init functions.
9490 * lisp.h (init_character_once, init_fns, init_image)
9491 (init_filelock, init_sound): Remove prototype.
9492 * character.c (init_character_once): Remove.
9493 * filelock.c (init_filelock): Likewise.
9494 * fns.c (init_fns): Likewise.
9495 * image.c (init_image): Likewise.
9496 * sound.c (init_sound): Likewise.
9497 * emacs.c (main): Adjust accordingly.
9498
9499 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9500
9501 * gtkutil.h: Tiny cleanups.
9502 (use_old_gtk_file_dialog): Remove useless declaration.
9503 (xg_uses_old_file_dialog): Add suggested const attribute.
9504
9505 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9506
9507 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9508 (bidi_paragraph_init): Use it to limit search forward for a strong
9509 directional character in abnormally large paragraphs full of
9510 neutral or weak characters. (Bug#11943)
9511
9512 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9513
9514 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9515 the toolbar (Bug#9451).
9516 (xg_make_tool_item): Give the widget event box a transparent
9517 background.
9518
9519 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9520
9521 Cleanup basic allocation variables and functions.
9522 * alloc.c (ignore_warnings, init_intervals, init_float)
9523 (init_cons, init_symbol, init_marker): Remove.
9524 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9525 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9526 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9527 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9528 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9529 (staticidx, init_alloc_once, init_strings, free_ablock):
9530 Remove redundant initialization.
9531 * fns.c (init_weak_hash_tables): Remove.
9532 * lisp.h (init_weak_hash_tables): Remove prototype.
9533
9534 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9535
9536 Use zero_vector where appropriate.
9537 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9538 accordingly.
9539 * lisp.h (zero_vector): New declaration.
9540 * font.c (null_vector): Remove.
9541 (syms_of_font): Remove initialization and staticpro.
9542 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9543 * keymap.c (Faccessible_keymaps): Likewise.
9544
9545 2012-07-15 Leo Liu <sdl.web@gmail.com>
9546
9547 * fringe.c: Fix typo in comments.
9548
9549 2012-07-14 Leo Liu <sdl.web@gmail.com>
9550
9551 * fringe.c: Add a new bitmap exclamation-mark.
9552
9553 2012-07-14 Eli Zaretskii <eliz@gnu.org>
9554
9555 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9556
9557 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9558 (HAVE_MENUS): Don't define, defined by editing config.in with
9559 msdos/sed2v2.inp.
9560 (GMALLOC_INHIBIT_VALLOC): Don't define.
9561 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9562
9563 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
9564
9565 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9566
9567 2012-07-14 Glenn Morris <rgm@gnu.org>
9568
9569 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9570 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9571 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9572
9573 2012-07-13 Glenn Morris <rgm@gnu.org>
9574
9575 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9576
9577 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9578 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9579
9580 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9581
9582 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9583 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9584 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9585 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9586 where appropriate.
9587 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9588 as boolean expression.
9589 (x_set_window_size): Remove unused variable toolbar.
9590 (ns_get_color_default, ns_mod_to_lisp): Remove.
9591 (ns_mouse_position): Remove unused variables xchar and ychar.
9592 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9593 (ns_set_vertical_scroll_bar): Remove unused variable count.
9594 (ns_delete_terminal): Remove unused variable i.
9595 (ns_term_init): Remove unused variables r, g and b.
9596 (mouseDown): Remove unused variable window.
9597 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9598 (initFrameFromEmacs): Remove unused variable vbextra.
9599 (mouseEntered): Remove unused variables p and dpyinfo.
9600 (mouseExited): Remove unused variables p and r.
9601 (ns_define_frame_cursor, ns_clear_frame_area)
9602 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9603 (menuDown): Assign [sender tag] to variable and cast the variable.
9604
9605 * nsterm.h (menuDown): Add id as type to argument sender.
9606 (ns_display_info_for_name): Add Lisp_Object argument.
9607 (ns_term_init): Add Lisp_Object argument.
9608 (ns_map_event_to_object): Add void argument.
9609 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9610 prototype with arguments and only declare if __OBJC__.
9611 (nxatoms_of_nsselect): Add void argument.
9612 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9613 (ns_alloc_autorelease_pool): Add void argument.
9614 (ns_release_autorelease_pool): Add void* argument.
9615 (ns_get_defaults_value): Add const char* argument.
9616
9617 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9618 (initFromContents): Use SSDATA where appropriate.
9619 (ns_update_menubar): Add braces to ambigous if-else.
9620 (initWithTitle): Put () around assignment in if statement.
9621 (ns_menu_show): Remove unused variables window and keymap.
9622 (update_frame_tool_bar): Remove unused variable selected_p.
9623 (initWithContentRect): Remove unused variable this_cmd_name.
9624
9625 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9626 appropriate.
9627 (setXBMColor): Remove unused variable len.
9628 (setPixmapData): Put () around assignment in loop statement.
9629
9630 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9631 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9632 where appropriate.
9633 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9634 around assignment in loop statement.
9635 (nsfont_open): Remove unused variable i.
9636 (nsfont_open): Remove unused variable len.
9637 (nsfont_draw): Remove unused variable cs.
9638
9639 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9640 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9641 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9642 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9643 (Fns_font_name, Fns_perform_service)
9644 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9645 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9646 (ns_set_name): Remove unused variable view.
9647 (x_set_menu_bar_lines): Remove unused variable olines.
9648 (x_set_tool_bar_lines): Remove unused variable root_window.
9649 (Fns_list_colors): Put () around assignment in while statement.
9650 (Fns_perform_service): Remove unused variable len.
9651 (Fns_display_usable_bounds): Remove unused variable top.
9652 (syms_of_nsfns): Remove unused variable i.
9653
9654 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9655 memcpy (Bug#11907).
9656
9657 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
9658
9659 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9660 and free it with DestroyExceptionInfo (Bug#11558).
9661
9662 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
9663
9664 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9665 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9666 Set here, not in nt/config.nt.
9667
9668 2012-07-13 Eli Zaretskii <eliz@gnu.org>
9669
9670 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9671 cursor overflow into the last glyph on display line when the right
9672 fringe is off. (Bug#11832)
9673
9674 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9675
9676 * xdisp.c (produce_special_glyphs): Now static.
9677 * dispextern.h (produce_special_glyphs): Remove decl.
9678
9679 2012-07-13 Glenn Morris <rgm@gnu.org>
9680
9681 * s/bsd-common.h, s/cygwin.h: Remove empty files.
9682 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9683
9684 * s/usg5-4-common.h (USG, USG5):
9685 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9686 * s/sol2-6.h (SOLARIS2):
9687 * s/irix6-5.h (IRIX6_5):
9688 * s/hpux10-20.h (USG, USG5, HPUX):
9689 * s/gnu-linux.h (USG, GNU_LINUX):
9690 * s/freebsd.h (BSD_SYSTEM):
9691 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9692 * s/cygwin.h (CYGWIN):
9693 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9694 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9695
9696 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
9697
9698 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9699
9700 2012-07-13 Glenn Morris <rgm@gnu.org>
9701
9702 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9703
9704 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9705
9706 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9707 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9708
9709 2012-07-12 Glenn Morris <rgm@gnu.org>
9710
9711 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9712
9713 * process.c (init_process_emacs): Rename from init_process.
9714 The old name is also the name of a Mach system call.
9715 * lisp.h, emacs.c: Update for this name change.
9716 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9717 longer needed.
9718
9719 2012-07-12 Eli Zaretskii <eliz@gnu.org>
9720
9721 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9722 memmove call that removes glyphs covered by the left truncation
9723 glyph. Improve commentary.
9724 (display_line): Fix display of continuation glyphs on GUI frames
9725 when the right fringe is turned off and variable-size fonts are
9726 used in the window. Move the code that appends a stretch glyph to
9727 produce_special_glyphs, so that it could be used for truncation
9728 and continuation glyphs alike.
9729 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9730 glyph of a suitably computed width, to align the special glyphs at
9731 the window margin. Code moved from display_line. (Bug#11832)
9732
9733 2012-07-12 Glenn Morris <rgm@gnu.org>
9734
9735 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9736
9737 * s/gnu-linux.h, s/hpux10-20.h:
9738 Do not unconditionally define HAVE_XRMSETDATABASE.
9739
9740 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9741
9742 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9743
9744 Fix typos that broke OS X build.
9745 Reported by Randal L. Schwartz in
9746 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9747 * nsterm.m (ns_timeout): Add missing local decl.
9748 (ns_get_color): snprintf -> sprintf, to fix typo.
9749
9750 2012-07-12 Glenn Morris <rgm@gnu.org>
9751
9752 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9753 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9754 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9755 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9756
9757 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9758 Move PTY_OPEN to configure.
9759
9760 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9761 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9762 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9763
9764 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9765
9766 Use empty_unibyte_string where applicable.
9767 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9768 * lread.c (read1): Likewise.
9769 * xsettings.c (syms_of_xsettings): Likewise.
9770
9771 2012-07-12 Glenn Morris <rgm@gnu.org>
9772
9773 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9774 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9775 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9776 * s/hpux10-20.h (RUN_TIME_REMAP):
9777 * s/bsd-common.h (TABDLY): Move to configure.
9778
9779 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9780
9781 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9782
9783 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9784 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9785
9786 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9787
9788 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9789 * s/template.h: Move NARROWPROTO to configure.
9790
9791 2012-07-11 Glenn Morris <rgm@gnu.org>
9792
9793 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9794 unused since 2011-01-17 change to systty.h.
9795
9796 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9797 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9798 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9799
9800 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9801
9802 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9803
9804 2012-07-11 Glenn Morris <rgm@gnu.org>
9805
9806 * s/darwin.h, s/gnu-linux.h, s/template.h:
9807 Move INTERRUPT_INPUT to configure.
9808
9809 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9810
9811 Minor adjustments to interning code.
9812 * lisp.h (intern, intern_c_string): Redefine as static inline
9813 wrappers for intern_1 and intern_c_string_1, respectively.
9814 (intern_1, intern_c_string_1): Rename prototypes.
9815 * lread.c (intern_1, intern_c_string_1, oblookup):
9816 Simplify Vobarray checking.
9817 * font.c (font_intern_prop): Likewise. Adjust comment.
9818 * w32font.c (intern_font_name): Likewise.
9819
9820 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9821
9822 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9823
9824 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9825 of Fcar/Fcdr if possible.
9826 * font.c (check_otf_features): Likewise.
9827 * fontset.c (Fnew_fontset): Likewise.
9828 * gnutls.c (Fgnutls_boot): Likewise.
9829 * minibuf.c (read_minibuf): Likewise.
9830 * msdos.c (IT_set_frame_parameters): Likewise.
9831 * xmenu.c (Fx_popup_dialog): Likewise.
9832 * w32menu.c (Fx_popup_dialog): Likewise.
9833
9834 2012-07-11 Glenn Morris <rgm@gnu.org>
9835
9836 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9837 since nothing has defined it on these platforms.
9838
9839 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9840 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9841
9842 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9843 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9844 Move CLASH_DETECTION to configure.
9845
9846 * s/gnu.h: Remove file, which is now empty.
9847
9848 * s/gnu.h, s/gnu-linux.h:
9849 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9850
9851 2012-07-11 John Wiegley <johnw@newartisans.com>
9852
9853 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9854 function attribute, so we only use it if it exists in the
9855 compiler.
9856
9857 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9858
9859 Avoid call to strlen in fast_c_string_match_ignore_case.
9860 * search.c (fast_c_string_match_ignore_case): Change to use
9861 length argument. Adjust users accordingly.
9862 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9863
9864 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9865
9866 Assume mkdir, rmdir.
9867 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9868 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9869
9870 Assume rename.
9871 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9872
9873 Assume perror.
9874 * s/hpux10-20.h (HAVE_PERROR): Remove.
9875 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9876 Remove dummy definition, as this problem was obsolete long ago.
9877
9878 Assume strerror.
9879 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9880
9881 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9882
9883 Avoid calls to strlen in font processing functions.
9884 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9885 (font_open_by_name): Change to use length argument.
9886 Adjust users accordingly.
9887 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9888 Adjust prototypes.
9889 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9890 Change to return ptrdiff_t.
9891 (xfont_list_pattern, xfont_match): Use length returned by
9892 xfont_decode_coding_xlfd.
9893 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9894
9895 2012-07-11 Glenn Morris <rgm@gnu.org>
9896
9897 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9898 Move DONT_REOPEN_PTY to configure.
9899
9900 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9901 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9902
9903 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9904
9905 Remove "#define unix" that is no longer needed (Bug#11905).
9906 * s/aix4-2.h (unix): Remove; no longer needed.
9907
9908 EMACS_TIME simplification (Bug#11875).
9909 This replaces macros (which typically do not work in GDB)
9910 with functions, typedefs and enums, making the code easier to debug.
9911 The functional style also makes code easier to read and maintain.
9912 * systime.h: Include <sys/time.h> on all hosts, not just if
9913 WINDOWSNT, since 'struct timeval' is needed in general.
9914 (EMACS_TIME): Now a typedef, not a macro.
9915 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9916 not macros.
9917 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9918 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9919 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9920 (EMACS_TIME_LE): Now functions, not macros.
9921 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9922 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9923 which are not functions. All uses rewritten to use:
9924 (make_emacs_time): New function.
9925 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9926 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9927 not functions. All uses rewritten to use the following, respectively:
9928 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9929 (add_emacs_time, sub_emacs_time): New functions.
9930 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9931 * fileio.c (Fcopy_file):
9932 * xterm.c (XTflash): Get the current time closer to when it's used.
9933 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9934
9935 * bytecode.c (targets): Suppress -Woverride-init warnings.
9936
9937 Simplify by avoiding confusing use of strncpy etc.
9938 * doc.c (Fsnarf_documentation):
9939 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9940 * frame.c (Fmake_terminal_frame):
9941 * gtkutil.c (get_utf8_string):
9942 * lread.c (openp):
9943 * nsmenu.m (ns_update_menubar):
9944 * regex.c (regerror):
9945 Prefer memcpy to strncpy and strncat when either will do.
9946 * fileio.c (Fsubstitute_in_file_name):
9947 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9948 (menu_separator_name_p):
9949 * nsmenu.m (ns_update_menubar):
9950 Prefer memcmp to strncmp when either will do.
9951 * nsterm.m: Include <ftoastr.h>.
9952 (ns_get_color):
9953 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9954 Prefer snprintf to strncpy.
9955 * nsterm.m (ns_term_init):
9956 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9957 * nsterm.m (ns_term_init):
9958 Avoid the need for strncpy, by using build_string or
9959 make_unibyte_string directly. Use dtoastr, not snprintf.
9960 * process.c (Fmake_network_process): Diagnose service names that
9961 are too long, rather than silently truncating them or creating
9962 non-null-terminated names.
9963 (Fnetwork_interface_info): Likewise, for interface names.
9964 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9965 Prefer sprintf to strncat.
9966 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9967 Prefer vsnprintf to vsprintf + strncpy.
9968
9969 2012-07-10 Glenn Morris <rgm@gnu.org>
9970
9971 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9972 Clarify fallback case.
9973
9974 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9975
9976 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9977 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9978 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9979 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9980 where argument type is known to be a Lisp_Cons.
9981
9982 2012-07-10 Tom Tromey <tromey@redhat.com>
9983
9984 * bytecode.c (BYTE_CODE_THREADED): New macro.
9985 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9986 (enum byte_code_op): New type.
9987 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9988 (exec_byte_code): Use them. Use token threading when applicable.
9989
9990 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9991
9992 Optimize pure C strings initialization.
9993 * lisp.h (make_pure_string): Fix prototype.
9994 (build_pure_c_string): New function, defined as static inline. This
9995 provides a better opportunity to optimize away calls to strlen when
9996 the function is called with compile-time constant argument.
9997 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9998 argument, adjust users accordingly. Use build_pure_c_string where
9999 appropriate.
10000 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10001 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10002 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10003
10004 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10005
10006 Avoid calls to strlen in miscellaneous functions.
10007 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10008 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10009 * lread.c (openp): Likewise.
10010
10011 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10012
10013 Avoid calls to strlen in path processing functions.
10014 * fileio.c (file_name_as_directory): Add comment. Change to add
10015 srclen argument and return the length of result. Adjust users
10016 accordingly.
10017 (directory_file_name): Fix comment. Change to add srclen argument,
10018 swap 1st and 2nd arguments to obey the common convention.
10019 Adjust users accordingly.
10020 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10021
10022 2012-07-10 Glenn Morris <rgm@gnu.org>
10023
10024 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10025 Move PENDING_OUTPUT_COUNT definition to configure.
10026
10027 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10028 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10029 * s/gnu.h (DATA_START): Move definitions to configure.
10030
10031 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10032 We include usg5-4-common.h, which defines them both.
10033
10034 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10035 O_RDONLY already includes it).
10036
10037 Stop ns builds setting the EMACSLOADPATH environment variable.
10038 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10039 Now it does not set EMACSLOADPATH, just returns the load-path string.
10040 * nsterm.h: Update accordingly.
10041 * lread.c [HAVE_NS]: Include nsterm.h.
10042 (init_lread) [HAVE_NS]: Use ns_load_path.
10043 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10044
10045 2012-07-09 Glenn Morris <rgm@gnu.org>
10046
10047 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10048 since the included bsd-common.h does so.
10049
10050 Stop ns builds setting the EMACSPATH environment variable.
10051 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10052 (ns_init_paths): Do not set EMACSPATH.
10053 * nsterm.h (ns_exec_path): Add it.
10054 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10055 Use ns_exec_path.
10056
10057 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10058
10059 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10060
10061 * process.c (wait_reading_process_output): 'waitchannels' was unset
10062 when read_kbd || !NILP (wait_for_cell); fix this.
10063
10064 Add GCC-style 'const' attribute to functions that can use it.
10065 * character.h (char_resolve_modifier_mask):
10066 * keyboard.h (make_ctrl_char):
10067 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10068 (init_character_once, next_almost_prime, init_fns, init_image)
10069 (flush_pending_output, init_sound):
10070 * mem-limits.h (start_of_data):
10071 * menu.h (finish_menu_items):
10072 Add ATTRIBUTE_CONST.
10073 * emacs.c (DEFINE_DUMMY_FUNCTION):
10074 Declare the dummy function with ATTRIBUTE_CONST.
10075 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10076 Add decls with ATTRIBUTE_CONST.
10077
10078 Minor improvements to make_formatted_string.
10079 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10080 where int is good enough, as vsprintf returns an int.
10081 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10082
10083 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10084
10085 Use make_formatted_string to avoid double length calculation.
10086 * lisp.h (make_formatted_string): New prototype.
10087 * alloc.c (make_formatted_string): New function.
10088 * buffer.c (Fgenerate_new_buffer_name): Use it.
10089 * dbusbind.c (syms_of_dbusbind): Likewise.
10090 * editfns.c (Fcurrent_time_zone): Likewise.
10091 * filelock.c (get_boot_time): Likewise.
10092 * frame.c (make_terminal_frame, set_term_frame_name)
10093 (x_report_frame_params): Likewise.
10094 * image.c (gs_load): Likewise.
10095 * minibuf.c (get_minibuffer): Likewise.
10096 * msdos.c (dos_set_window_size): Likewise.
10097 * process.c (make_process): Likewise.
10098 * xdisp.c (ensure_echo_area_buffers): Likewise.
10099 * xsettings.c (apply_xft_settings): Likewise.
10100
10101 2012-07-09 Glenn Morris <rgm@gnu.org>
10102
10103 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10104 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10105 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10106 * nsterm.h (ns_etc_directory): Add it.
10107 * callproc.c [HAVE_NS]: Include nsterm.h.
10108 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10109
10110 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10111
10112 Move marker debugging code under MARKER_DEBUG.
10113 * marker.c (MARKER_DEBUG): Move marker debugging code under
10114 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10115 for bootstrap with --enable-checking (~3x slowdown reported
10116 by Juanma Barranquero <lekktu@gmail.com>).
10117 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10118
10119 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10120
10121 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10122 See <http://bugs.gnu.org/11825#29>.
10123
10124 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10125
10126 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10127 has no font, use the frame's font. (Bug#11813)
10128 (display_line): Add commentary about displaying truncation glyphs
10129 on GUI frames.
10130 (produce_special_glyphs): Move here from term.c.
10131
10132 * term.c (produce_special_glyphs): Move to xdisp.c.
10133
10134 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10135 section.
10136
10137 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10138
10139 * xdisp.c (display_line): Avoid warning about implicit declaration
10140 of FRAME_FONT.
10141
10142 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10143
10144 * lisp.h: Remove empty conditional.
10145
10146 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10147
10148 * lread.c (load_path_check): Now static.
10149
10150 Fix some minor --with-ns problems found by static checking.
10151 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10152 (x_set_font) [!HAVE_X_WINDOWS]:
10153 * image.c (xpm_load_image) [HAVE_NS]:
10154 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10155 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10156 Remove unused local.
10157 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10158 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10159 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10160 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10161 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10162 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10163 Fix pointer signedness problem.
10164 * xfaces.c (FRAME_X_FONT_TABLE):
10165 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10166
10167 2012-07-07 Glenn Morris <rgm@gnu.org>
10168
10169 * lread.c (load_path_check): New function, split from init_lread.
10170 (init_lread): Reorganize. Motivation:
10171 If EMACSLOADPATH is set, check/warn about that rather than the
10172 defaults, which we are not going to use. Hence we can remove
10173 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10174 Don't warn if site-lisp directories are missing.
10175 If not installed, start from a blank load-path, since
10176 PATH_LOADSEARCH refers to the eventual installation directories.
10177
10178 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10179
10180 Support truncation and continuation glyphs on GUI frames, when
10181 fringes are disabled. (Bug#11832)
10182 * xdisp.c (init_iterator): Get dimensions of truncation and
10183 continuation glyphs even if on GUI frames.
10184 Adjust it->last_visible_x on GUI frames when the left or right fringes,
10185 or both, are absent.
10186 (start_display, move_it_in_display_line_to): Handle the case of a
10187 GUI frame without a fringe to display continuation or truncation
10188 glyphs.
10189 (insert_left_trunc_glyphs): Support GUI frames: make sure
10190 truncation glyphs overwrite enough glyphs from the current line to
10191 have sufficient space in pixels.
10192 (display_line): Support truncation and continuation glyphs on GUI
10193 frames. If some spare pixels are left on the line after inserting
10194 the truncation glyphs, fill that space with a stretch glyph of a
10195 suitably computed width.
10196
10197 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10198 produce_glyphs, to support GUI sessions.
10199
10200 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10203
10204 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10205
10206 Do not require float-time's arg to fit in time_t (Bug#11825).
10207 This works better on hosts where time_t is unsigned, and where
10208 float-time is applied to the (negative) difference between two times.
10209 * editfns.c (decode_time_components): Last arg is now double *,
10210 not int *, and means to store all the result as a double, without
10211 worrying about whether the seconds part fits in time_t.
10212 All callers changed.
10213 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10214 All callers changed.
10215 (Ffloat_time): Do not fail merely because the specified time falls
10216 outside of time_t range.
10217
10218 2012-07-07 Glenn Morris <rgm@gnu.org>
10219
10220 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10221 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10222 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10223
10224 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10225
10226 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10227 Update dependencies.
10228
10229 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10230
10231 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10232
10233 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10234 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10235 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10236 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10237 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10238 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10239
10240 * xfont.c (compare_font_names): Redo to omit the need for casts.
10241
10242 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10243
10244 * xfns.c (Fx_change_window_property): Doc fix.
10245 * w32fns.c (Fx_change_window_property): Doc fix.
10246
10247 * w32fns.c (Fx_window_property): Accept the same arguments as the
10248 X Windows version. Doc fix.
10249 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10250
10251 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
10252 Eli Zaretskii <eliz@gnu.org>
10253
10254 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10255 Windows-specific code from nt/config.nt moved here.
10256 Obsolete settings removed.
10257
10258 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 * process.c: Avoid unnecessary calls to gettime.
10261 (wait_reading_process_output): Don't get the time of day
10262 when gobbling data immediately and not waiting, as there's no need
10263 for it in that case. This removes a FIXME.
10264
10265 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10266
10267 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10268 is defined (Bug#11768).
10269
10270 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10271
10272 Fix marker debugging code.
10273 * marker.c (byte_char_debug_check): Do not perform the check
10274 if buffer is not multibyte.
10275 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10276 Call byte_char_debug_check with correct arguments.
10277
10278 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10279
10280 Compile marker debugging code only if ENABLE_CHECKING is defined.
10281 * marker.c (byte_char_debug_check, count_markers):
10282 Use only if ENABLE_CHECKING is defined.
10283 (byte_debug_flag): Remove.
10284 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10285 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10286
10287 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10288
10289 Avoid code repetition in marker-related functions.
10290 * marker.c (attach_marker): New function.
10291 (Fset_marker, set_marker_restricted, set_marker_both)
10292 (set_marker_restricted_both): Use it.
10293 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10294 Consistently rename charno to charpos.
10295 (marker_position): Add eassert.
10296 (marker_byte_position): Convert to eassert.
10297
10298 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10299
10300 Simplify list operations in unchain_overlay and unchain_marker.
10301 * buffer.c (unchain_overlay): Simplify. Add comment.
10302 * marker.c (unchain_marker): Simplify. Fix comments.
10303
10304 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10305
10306 Introduce fast path for the widely used marker operation.
10307 * alloc.c (build_marker): New function.
10308 * lisp.h (build_marker): New prototype.
10309 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10310 * composite.c (autocmp_chars): Likewise.
10311 * editfns.c (buildmark): Remove.
10312 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10313 (save_restriction_save): Use build_marker.
10314 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10315 * window.c (save_window_save): Likewise.
10316
10317 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10318
10319 Do not use Fdelete_overlay in delete_all_overlays
10320 to avoid redundant calls to unchain_overlay.
10321 * buffer.c (drop_overlay): New function.
10322 (delete_all_overlays, Fdelete_overlay): Use it.
10323 * minibuf.c (get_minibuffer): Fix comment.
10324
10325 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10326
10327 Port to OpenBSD 5.1 amd64.
10328 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10329 This is needed for OpenBSD, and should be harmless on all BSD systems.
10330 Also, include <sys/sysctl.h>, as it should be available on all
10331 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10332 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10333 use p_pid member, not kp_proc.pid.
10334
10335 2012-07-06 Glenn Morris <rgm@gnu.org>
10336
10337 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10338
10339 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10340
10341 More xmalloc and related cleanup.
10342 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10343 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10344 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10345 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10346 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10347 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10348 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10349 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10350 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10351 * xterm.c:
10352 Omit needless casts involving void * pointers and allocation.
10353 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10354 as the former is more robust if P's type is changed.
10355 Prefer xzalloc to xmalloc + memset 0.
10356 Simplify malloc-or-realloc to realloc.
10357 Don't worry about xmalloc returning a null pointer.
10358 Prefer xstrdup to xmalloc + strcpy.
10359 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10360 growing it.
10361 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10362 alloca of a constant.
10363
10364 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10365
10366 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10367 hscroll is larger than the line width. Fixes long and futile
10368 looping inside extend_face_to_end_of_line (on a TTY) producing
10369 glyphs that are not needed and thrown away.
10370
10371 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10372
10373 * marker.c (set_marker_restricted_both): Simplify by using
10374 clip_to_bounds.
10375
10376 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10377
10378 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10379
10380 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10381
10382 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10383 not defined (Bug#11768).
10384 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10385 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10386 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10387 followed by gtk_box_set_homogeneous (Bug#11768).
10388 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10389 (update_theme_scrollbar_width, xg_create_scroll_bar):
10390 Use gtk_scrollbar_new (Bug#11768).
10391 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10392 (is_box_type): New function (Bug#11768).
10393 (xg_tool_item_stale_p): Call is_box_type.
10394 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10395 with default display (Bug#11768).
10396
10397 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10398
10399 * xdisp.c (window_hscroll_limited): New function.
10400 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10401 coordinates when window's hscroll is set to insanely large
10402 values. (Bug#11857)
10403
10404 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10405
10406 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10407 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10408
10409 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10410
10411 Cleanup xmalloc.
10412 * lisp.h (xzalloc): New prototype. Omit needless casts.
10413 * alloc.c (xzalloc): New function. Omit needless casts.
10414 * charset.c: Omit needless casts. Convert all calls to
10415 xmalloc with following memset to xzalloc.
10416 * dispnew.c: Likewise.
10417 * fringe.c: Likewise.
10418 * image.c: Likewise.
10419 * sound.c: Likewise.
10420 * term.c: Likewise.
10421 * w32fns.c: Likewise.
10422 * w32font.c: Likewise.
10423 * w32term.c: Likewise.
10424 * xfaces.c: Likewise.
10425 * xfns.c: Likewise.
10426 * xterm.c: Likewise.
10427 * atimer.c: Omit needless casts.
10428 * buffer.c: Likewise.
10429 * callproc.c: Likewise.
10430 * ccl.c: Likewise.
10431 * coding.c: Likewise.
10432 * composite.c: Likewise.
10433 * doc.c: Likewise.
10434 * doprnt.c: Likewise.
10435 * editfns.c: Likewise.
10436 * emacs.c: Likewise.
10437 * eval.c: Likewise.
10438 * filelock.c: Likewise.
10439 * fns.c: Likewise.
10440 * gtkutil.c: Likewise.
10441 * keyboard.c: Likewise.
10442 * lisp.h: Likewise.
10443 * lread.c: Likewise.
10444 * minibuf.c: Likewise.
10445 * msdos.c: Likewise.
10446 * print.c: Likewise.
10447 * process.c: Likewise.
10448 * region-cache.c: Likewise.
10449 * search.c: Likewise.
10450 * sysdep.c: Likewise.
10451 * termcap.c: Likewise.
10452 * terminal.c: Likewise.
10453 * tparam.c: Likewise.
10454 * w16select.c: Likewise.
10455 * w32.c: Likewise.
10456 * w32reg.c: Likewise.
10457 * w32select.c: Likewise.
10458 * w32uniscribe.c: Likewise.
10459 * widget.c: Likewise.
10460 * xdisp.c: Likewise.
10461 * xmenu.c: Likewise.
10462 * xrdb.c: Likewise.
10463 * xselect.c: Likewise.
10464
10465 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10466
10467 * fileio.c (time_error_value): Check the right error number.
10468 Problem reported by Troels Nielsen in
10469 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10470
10471 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10472
10473 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10474 This should be fixed in a better way; see Eli Zaretskii in
10475 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10476 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10477
10478 * fileio.c (time_error_value): Rename from special_mtime.
10479 The old name's problems were noted by Eli Zaretskii in
10480 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10481
10482 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10483 This variable's comment says Emacs needs at least one GDB-visible
10484 symbol of type enum pvec_type, to work around GDB problems.
10485 The symbol's value doesn't matter.
10486
10487 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10488 that causes compilation to fail on pre-C99 compilers.
10489
10490 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10491
10492 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10493 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10494
10495 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10496
10497 * buffer.c (init_buffer_once): Fix initialization of
10498 headers for buffer_defaults and buffer_local_symbols.
10499 Reported by Juanma Barranquero <lekktu@gmail.com>.
10500
10501 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10502
10503 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10504 * lisp.h (enum pvec_type): Use fewer bits.
10505 (PSEUDOVECTOR_SIZE_BITS): New constant.
10506 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10507 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10508 change in pvec_type.
10509 (PSEUDOVECTOR_TYPEP): New macro.
10510 (TYPED_PSEUDOVECTORP): Use it.
10511 * fns.c (internal_equal): Adapt code to extract pvectype.
10512 * emacs.c (gdb_pvec_type): Update type.
10513 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10514 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10515 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10516 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10517 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10518 abusing vector->header.next.nbytes.
10519 (live_vector_p): Use PVEC_TYPE.
10520 (mark_object): Adapt code to extract pvectype. Use switch.
10521
10522 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10523
10524 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10525 Tighten new eassert a bit.
10526
10527 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10528
10529 Fix compilation with --enable-gcc-warnings and -O1
10530 optimization level.
10531 * doprnt.c (doprnt): Change type of tem to int, initialize
10532 to avoid compiler warning. Add eassert.
10533 * search.c (simple_search): Initialize match_byte to avoid
10534 compiler warning. Add eassert.
10535
10536 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10537
10538 Avoid weird behavior with large horizontal scrolls.
10539 Without this change, for example, large hscroll values would
10540 mess up Emacs's display on Fedora 15 x86, presumably due to
10541 overflows in int calculations in the display code.
10542 Also, if buffers had long lines, Emacs would freeze.
10543 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10544 (set_window_hscroll): New function, containing the old guts of
10545 Fset_window_hscroll. Return the clipped value.
10546 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10547 This avoids the need to check against PTRDIFF_MAX.
10548
10549 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10550
10551 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10552
10553 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10554
10555 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10556
10557 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10558 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10559 since GCC 4.4.6 issues a bogus warning for them.
10560
10561 Fix bugs in file timestamp newness comparisons.
10562 * fileio.c (Ffile_newer_than_file_p):
10563 * lread.c (Fload): Use full timestamp resolution of files,
10564 not just the 1-second resolution, so that files that are only
10565 slightly newer still count as newer.
10566 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10567 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10568
10569 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10570
10571 * fileio.c: Improve handling of file time marker. (Bug#11852)
10572 (special_mtime): New function.
10573 (Finsert_file_contents, Fverify_visited_file_modtime):
10574 Use it to set special mtime values consistently.
10575
10576 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10577
10578 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10579 marker for non-existing file. (Bug#11852)
10580
10581 2012-07-03 Glenn Morris <rgm@gnu.org>
10582
10583 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10584 and did not make it into globals.h).
10585
10586 2012-07-03 Tom Tromey <tromey@redhat.com>
10587
10588 * window.c (Fset_window_margins, Fset_window_fringes)
10589 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10590 * textprop.c (Fprevious_property_change): No longer static.
10591 * syntax.c (Fsyntax_table_p): No longer static.
10592 * process.c (Fget_process, Fprocess_datagram_address): No longer
10593 static.
10594 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10595 * keyboard.c (Fcommand_execute): No longer static.
10596 Remove EXFUN.
10597 * insdel.c (Fcombine_after_change_execute): No longer static.
10598 * image.c (Finit_image_library): No longer static.
10599 * fileio.c (Fmake_symbolic_link): No longer static.
10600 * eval.c (Ffetch_bytecode): No longer static.
10601 * editfns.c (Fuser_full_name): No longer static.
10602 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10603 No longer static.
10604 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10605 static.
10606 * dired.c (Ffile_attributes): No longer static.
10607 * composite.c (Fcomposition_get_gstring): No longer static.
10608 * callproc.c (Fgetenv_internal): No longer static.
10609
10610 * ccl.h: Remove EXFUNs.
10611 * buffer.h: Remove EXFUNs.
10612 * dispextern.h: Remove EXFUNs.
10613 * intervals.h: Remove EXFUNs.
10614 * fontset.h: Remove EXFUN.
10615 * font.h: Remove EXFUNs.
10616 * dosfns.c (system_process_attributes): Remove EXFUN.
10617 * keymap.h: Remove EXFUNs.
10618 * lisp.h: Remove EXFUNs.
10619 * w32term.h: Remove EXFUNs.
10620 * window.h: Remove EXFUNs.
10621 * xsettings.h: Remove EXFUN.
10622 * xterm.h: Remove EXFUN.
10623
10624 2012-07-03 Glenn Morris <rgm@gnu.org>
10625
10626 * lisp.h (Frandom): Make it visible to C.
10627 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10628 buffer for invisible buffers. (Bug#1229)
10629
10630 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10631
10632 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10633 values which aren't power of 2.
10634 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10635 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
10636 accordingly.
10637
10638 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10639
10640 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10641
10642 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10643
10644 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10645
10646 * alloc.c (allocate_vector_block): Remove redundant
10647 calls to mallopt if DOUG_LEA_MALLOC is defined.
10648 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10649 avoid calls to mallopt if zero_vector is returned.
10650
10651 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10652
10653 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10654 is enabled, avoid dereferencing NULL current_sblock if
10655 running undumped.
10656
10657 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10658
10659 Cleanup basic buffer management.
10660 * buffer.h (struct buffer): Change layout to use generic vector
10661 marking code. Fix some comments. Change type of 'clip_changed'
10662 to bitfield. Remove unused #ifndef old.
10663 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10664 (GET_OVERLAYS_AT): Fix indentation.
10665 (for_each_per_buffer_object_at): New macro.
10666 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10667 (Fbuffer_local_variables): Use it.
10668 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10669 * alloc.c (allocate_buffer): Adjust to match new layout of
10670 struct buffer. Fix comment.
10671 (mark_overlay): New function.
10672 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10673 Lisp area of struct buffer.
10674 (mark_object): Use it. Adjust marking of misc objects
10675 and related comments.
10676
10677 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10678
10679 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10680 wrapper that is not needed because the wrapped code is a no-op (zero
10681 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10682 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10683
10684 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10685
10686 * alloc.c (mark_buffer): Simplify. Remove prototype.
10687 (mark_object): Add comment. Reorganize marking of vector-like
10688 objects. Use CHECK_LIVE for all vector-like objects except buffers
10689 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10690 Avoid redundant calls to mark_vectorlike for bool vectors.
10691
10692 2012-06-30 Glenn Morris <rgm@gnu.org>
10693
10694 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10695
10696 * epaths.in (PATH_SITELOADSEARCH): New.
10697 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10698 This is rather than relying on --enable-locallisppath elements
10699 having "site-lisp" in their names. (Bug#10208#25, 11658)
10700
10701 2012-06-30 Eli Zaretskii <eliz@gnu.org>
10702
10703 * w32proc.c (sys_select): Accept and ignore one more argument.
10704
10705 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10706
10707 * sysselect.h [DOS_NT]: Don't include sys/select.h.
10708 (pselect) [!MS_DOS]: Redirect to sys_select.
10709
10710 * sysdep.c: Don't include dos.h and dosfns.h.
10711
10712 * process.c (sys_select):
10713 * msdos.c (sys_select): Accept one more argument and ignore it.
10714
10715 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10716 adapt data types and code to that.
10717
10718 * dosfns.c:
10719 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10720 which clashes with the gnulib function of the same name.
10721
10722 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10723
10724 * font.c (font_style_to_value, font_style_symbolic)
10725 (font_prop_validate_style): Add type checks for values in
10726 font_style_table.
10727
10728 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10729 argument.
10730 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10731 uses.
10732
10733 2012-06-29 Eli Zaretskii <eliz@gnu.org>
10734
10735 * xdisp.c (try_window_id): Undo last change.
10736
10737 * w32.c (getwd): Adjust commentary about startup_dir.
10738 (init_environment): Always call sys_access, even in non-MSVC
10739 builds. Don't chdir to the directory of the Emacs executable.
10740 This undoes code from 1997 which was justified by the need to
10741 "avoid conflicts when removing and renaming directories". But its
10742 downside was that every relative file name was being interpreted
10743 relative to the directory of the Emacs executable, which can never
10744 be TRT. In particular, it broke sys_access when called with
10745 relative file names.
10746 (sys_access): Map GetLastError to errno.
10747
10748 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10749
10750 * window.h (struct window): Change type of 'fringes_outside_margins'
10751 to bitfield. Fix comment. Adjust users accordingly.
10752 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10753 Adjust comment.
10754 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10755 to ptrdiff_t.
10756
10757 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
10758
10759 * gnutls.c (emacs_gnutls_handshake):
10760 Add QUIT to make the loop interruptible.
10761
10762 2012-06-29 Glenn Morris <rgm@gnu.org>
10763
10764 * charset.c (init_charset): Make lack of etc/charsets fatal.
10765
10766 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10767
10768 * editfns.c (region_limit): Fix type mismatch.
10769
10770 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10771
10772 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10773 undefined. Convert from xassert to eassert.
10774 * nsmenu.m: Convert from xassert to eassert.
10775 * nsterm.m: Likewise.
10776
10777 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10778
10779 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10780
10781 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10782
10783 Avoid integer overflow on scroll-left and scroll-right.
10784 * window.c (HSCROLL_MAX): New macro.
10785 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10786 overflow when requested scroll falls outside ptrdiff_t range.
10787
10788 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10789
10790 * window.h (struct window): Change type of 'hscroll',
10791 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10792 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10793 Adjust users accordingly.
10794 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10795 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10796 from EMACS_INT to ptrdiff_t.
10797 (make_window): Omit redundant initialization.
10798
10799 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
10800
10801 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10802
10803 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10804
10805 * window.h (struct window): Change type of 'use_time' and
10806 'sequence_number' from Lisp_Object to int.
10807 * frame.c (make_frame): Adjust users accordingly.
10808 * print.c (print_object): Likewise.
10809 * window.c (select_window, Fwindow_use_time, make_parent_window)
10810 (make_window): Likewise.
10811
10812 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10813
10814 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10815 enabled with --enable-checking=[all,glyphs] configure option.
10816 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10817 adjust comments accordingly.
10818 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10819 undefined, adjust comments accordingly.
10820 * image.c: Likewise.
10821 * scroll.c: Likewise.
10822 * w32fns.c: Likewise.
10823 * w32term.c: Likewise.
10824 * xdisp.c: Likewise.
10825 * xfaces.c: Likewise.
10826 * xfns.c: Likewise.
10827 * xterm.c: Likewise.
10828
10829 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10830
10831 Generalize run-time debugging checks.
10832 * dispextern.h (XASSERTS): Remove.
10833 * fontset.c (xassert): Remove.
10834 Convert from xassert to eassert.
10835 * alloc.c: Convert from xassert to eassert.
10836 * bidi.c: Likewise.
10837 * dispnew.c: Likewise.
10838 * fns.c: Likewise.
10839 * fringe.c: Likewise.
10840 * ftfont.c: Likewise.
10841 * gtkutil.c: Likewise.
10842 * image.c: Likewise.
10843 * keyboard.c: Likewise.
10844 * menu.c: Likewise.
10845 * process.c: Likewise.
10846 * scroll.c: Likewise.
10847 * sound.c: Likewise.
10848 * term.c: Likewise.
10849 * w32console.c: Likewise.
10850 * w32fns.c: Likewise.
10851 * w32term.c: Likewise.
10852 * window.c: Likewise.
10853 * xdisp.c: Likewise.
10854 * xfaces.c: Likewise.
10855 * xfns.c: Likewise.
10856 * xselect.c: Likewise.
10857 * xterm.c: Likewise.
10858
10859 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10860
10861 * fns.c (maybe_resize_hash_table): Output message when growing the
10862 purify-hashtable.
10863
10864 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10865
10866 * alloc.c (allocate_string_data): Remove dead code.
10867 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10868 avoid GCC warning about unused macro.
10869
10870 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10871
10872 * alloc.c (allocate_string): Omit intervals initialization.
10873 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10874 as in make_pure_string and make_pure_c_string.
10875
10876 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10877
10878 * alloc.c (allocate_string): Fix last change.
10879
10880 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10881
10882 * alloc.c (allocate_string): Remove two redundant calls
10883 to memset, add explicit initialization where appropriate.
10884
10885 2012-06-27 Glenn Morris <rgm@gnu.org>
10886
10887 * lisp.mk (lisp): Remove paths.elc.
10888
10889 2012-06-27 Chong Yidong <cyd@gnu.org>
10890
10891 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10892
10893 2012-06-26 John Wiegley <johnw@newartisans.com>
10894
10895 * unexmacosx.c (copy_data_segment): Add two section names used
10896 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10897
10898 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10899 when building with Clang.
10900
10901 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10902
10903 * eval.c (Fapply): Allow calling it with a single argument.
10904
10905 2012-06-26 Eli Zaretskii <eliz@gnu.org>
10906
10907 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10908 _stricmp and _strnicmp.
10909 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10910
10911 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10912
10913 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10914 allocated window.
10915 (allocate_process): Likewise for new process.
10916 (allocate_terminal): Change to use offsetof.
10917 (allocate_frame): Likewise.
10918 * frame.c (make_frame): Omit redundant initialization.
10919 * window.c (make_parent_window): Use memset.
10920 (make_window): Omit redundant initialization.
10921 * process.c (make_process): Omit redundant initialization.
10922 * terminal.c (create_terminal): Likewise.
10923
10924 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10925
10926 * term.c (delete_tty): Remove redundant call to memset.
10927
10928 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10929
10930 * alloc.c: Remove build_string.
10931 * lisp.h: Define build_string as static inline. This provides
10932 a better opportunity to optimize away calls to strlen when the
10933 function is called with compile-time constant argument.
10934 * image.c (imagemagick_error): Convert to build_string.
10935 * w32proc.c (sys_spawnve): Likewise.
10936 * xterm.c (x_term_init): Likewise.
10937
10938 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10939
10940 Use sprintf return value instead of invoking strlen on result.
10941 In the old days this wasn't portable, since some sprintf
10942 implementations returned char *. But they died out years ago and
10943 Emacs already assumes sprintf returns int.
10944 Similarly for float_to_string.
10945 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10946 * ccl.c (ccl_driver):
10947 * character.c (string_escape_byte8):
10948 * data.c (Fnumber_to_string):
10949 * doprnt.c (doprnt):
10950 * print.c (print_object):
10951 * xdisp.c (message_dolog):
10952 * xfns.c (syms_of_xfns):
10953 Use sprintf or float_to_string result to avoid need to call strlen.
10954 * data.c (Fnumber_to_string):
10955 Use make_unibyte_string, since the string must be ASCII.
10956 * lisp.h, print.c (float_to_string): Now returns int length.
10957 * term.c (produce_glyphless_glyph):
10958 Use sprintf result rather than recomputing it.
10959
10960 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10961 * Makefile.in (ALL_CFLAGS):
10962 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10963 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10964
10965 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10966
10967 * dispextern.h (xstrcasecmp): Define to library function
10968 strcasecmp if available.
10969 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10970
10971 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10972
10973 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10974 Avoid comma operator.
10975 * menu.c (push_submenu_start, push_submenu_end)
10976 (push_left_right_boundary, push_menu_pane): Likewise.
10977 * msdos.c (dos_rawgetc): Likewise.
10978
10979 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10980
10981 * xfns.c (xic_create_fontsetname): Remove redundant calls
10982 to memset.
10983
10984 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10985
10986 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10987 sprintf already null-terminates its output.
10988
10989 * xfns.c (x_window): Remove redundant cast.
10990
10991 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10992
10993 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10994 `const char *' to `char *' to avoid compiler warning.
10995
10996 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10997
10998 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10999 instead of truncating it to 63 (admittedly a generous limit).
11000
11001 * process.c: Fix spelling and caps in comments.
11002
11003 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11004
11005 * emacs.c (setpgrp): Remove definition, unused.
11006 * sysdep.c (setpgrp): Remove definition, not used in this file.
11007
11008 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11009
11010 * makefile.w32-in: Update dependencies.
11011
11012 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11013
11014 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11015 (SYSTIME_H): Add nt/inc/sys/time.h.
11016
11017 * systime.h [WINDOWSNT]: Include sys/time.h.
11018
11019 * s/ms-w32.h (struct timespec): Definition moved from
11020 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11021
11022 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11023
11024 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11025 * buffer.h (buffer_slot_type_mismatch):
11026 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11027 * eval.c (unwind_to_catch):
11028 * image.c (my_png_error, my_error_exit):
11029 * keyboard.c (quit_throw_to_read_char, user_error)
11030 (Fexit_recursive_edit, Fabort_recursive_edit):
11031 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11032 (wrong_type_argument, buffer_overflow, __executable_start)
11033 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11034 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11035 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11036 (fatal):
11037 (child_setup) [!DOS_NT]:
11038 * lread.c (end_of_file_error, invalid_syntax):
11039 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11040 * puresize.h (pure_write_error):
11041 * search.c (matcher_overflow):
11042 * sound.c (sound_perror, alsa_sound_perror):
11043 * sysdep.c, syssignal.h (croak):
11044 * term.c (maybe_fatal, vfatal):
11045 * textprop.c (text_read_only):
11046 * undo.c (user_error):
11047 * unexmacosx.c (unexec_error):
11048 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11049 Use _Noreturn rather than NO_RETURN.
11050 No need for separate decl merely because of _Noreturn.
11051 * sound.c (sound_warning, parse_sound):
11052 Remove unnecessary forward decls.
11053
11054 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11055
11056 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11057 * lisp.h (WAIT_READING_MAX): New macro.
11058 * dispnew.c (Fsleep_for, sit_for):
11059 * keyboard.c (kbd_buffer_get_event):
11060 * process.c (Faccept_process_output):
11061 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11062 This improves on the previous patch, which introduced a bug
11063 when time_t is unsigned and as wide as intmax_t.
11064 See <http://bugs.gnu.org/9000#51>.
11065
11066 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11067
11068 * dispnew.c (sit_for, Fsleep_for):
11069 * keyboard.c (kbd_buffer_get_event):
11070 * process.c (Faccept_process_output): Avoid compiler warnings when
11071 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11072
11073 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11074
11075 * makefile.w32-in: Update dependencies.
11076
11077 * w32.c (ltime): Add return type and declare static.
11078 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11079
11080 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11081
11082 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11083 Privately reported by Herbert J. Skuhra.
11084 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11085 All uses changed.
11086 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11087 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11088
11089 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11090
11091 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11092 last argument of make_unibyte_string.
11093
11094 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11095 language ID in the event parameters.
11096
11097 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11098 event.code, not the obscure "character set ID".
11099
11100 2012-06-23 Chong Yidong <cyd@gnu.org>
11101
11102 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11103
11104 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11105
11106 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11107 * w32.c (fdutimens): New function.
11108
11109 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11110
11111 * s/ms-w32.h (pselect): Redirect to sys_select.
11112
11113 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11114
11115 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11116 in the logic of incrementing and decrementing the value of
11117 use_relocatable_buffers.
11118
11119 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11120
11121 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11122 Privately reported by Herbert J. Skuhra.
11123 [__FreeBSD__]: Remove "*/" typo after "#include".
11124 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11125 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11126 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11127 Don't assume EMACS_TIME and struct timeval are the same type.
11128
11129 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11130
11131 Support higher-resolution time stamps (Bug#9000).
11132 The time stamps are only nanosecond-resolution at the C level,
11133 since that's the best that any real-world system supports now.
11134 But they are picosecond-resolution at the Lisp level, as that's
11135 easy, and leaves room for future OS improvements.
11136
11137 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11138 (LIBES): Use it.
11139
11140 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11141 Don't get current time unless it's needed.
11142
11143 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11144 now provides it if it's absent.
11145 (start_atimer): Port to higher-res time stamps.
11146 Check for time stamp overflow. Don't get current time more
11147 often than is needed.
11148
11149 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11150 Include systime.h, not time.h.
11151 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11152
11153 * dired.c: Include stat-time.h.
11154 (Ffile-attributes): File times now have higher resolution.
11155
11156 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11157 (struct image): Timestamp now has higher resolution.
11158
11159 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11160 has at least microseconds now. All uses removed.
11161 (update_frame, update_single_window, update_window, update_frame_1)
11162 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11163 (duration_to_sec_usec): Remove; no longer needed.
11164
11165 * editfns.c (time_overflow): Now extern.
11166 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11167 (float-time, Fformat_time_string, Fcurrent_time_string)
11168 (Fcurrent_time_zone): Accept and generate higher-resolution
11169 time stamps.
11170 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11171 (decode_time_components, lisp_seconds_argument): New functions.
11172 (make_time): Now static.
11173 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11174 Report an error if the time is invalid, rather than having the caller
11175 do that.
11176
11177 * fileio.c: Include <stat-time.h>
11178 (Fcopy_file): Copy higher-resolution time stamps.
11179 Prefer to set the time stamp via a file descriptor if that works.
11180 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11181 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11182 (Fvisited_file_modtime, Fset_visited_file_modtime):
11183 Support higher-resolution time stamps.
11184
11185 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11186
11187 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11188
11189 * image.c (prepare_image_for_display, clear_image_cache)
11190 (lookup_image): Port to higer-resolution time stamps.
11191
11192 * keyboard.c (start_polling, bind_polling_period):
11193 Check for time stamp overflow.
11194 (read_char, kbd_buffer_get_event, timer_start_idle)
11195 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11196 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11197 Port to higher-resolution time stamps. Do not assume time_t is signed.
11198 (decode_timer): New function. Timers are now vectors of length 9,
11199 not 8, to accommodate the picosecond component.
11200 (timer_check_2): Use it.
11201
11202 * nsterm.m (select_timeout, timeval_subtract): Remove.
11203 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11204 as they're a bit more accurate and handle overflow better.
11205 (ns_select): Change prototype to be compatible with pselect.
11206 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11207 * nsterm.h (ns_select): Adjust prototype.
11208
11209 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11210 us-resolution time stamps.
11211 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11212
11213 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11214
11215 * lisp.h (time_overflow): New decl.
11216 (wait_reading_process_output): First arg is now intmax_t, not int,
11217 to accommodate larger waits.
11218
11219 * process.h (struct Lisp_Process.read_output_delay):
11220 Now counts nanoseconds, not microseconds.
11221 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11222 EMACS_HAS_USECS.
11223 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11224 (wait_reading_process_output):
11225 Port to ns-resolution time stamps.
11226 (Faccept_process_output, wait_reading_process_output):
11227 Check for time stamp overflow. Do not assume time_t is signed.
11228 (select_wrapper): Remove; we now use pselect.
11229 (Fprocess_attributes): Now generates ns-resolution time stamps.
11230
11231 * sysdep.c: Include utimens.h. Don't include utime.h
11232 or worry about struct utimbuf; gnulib does that for us now.
11233 (gettimeofday): Remove; gnulib provides a substitute.
11234 (make_timeval): New function.
11235 (set_file_times): Now sets ns-resolution time stamps.
11236 New arg FD; all uses changed.
11237 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11238 (system_process_attributes):
11239 Now returns ns-resolution time stamp. All uses changed.
11240 Check for time stamp overflow.
11241
11242 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11243 provides a substitute now.
11244
11245 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11246 since it guarantees struct timespec.
11247 (EMACS_TIME): Now struct timespec, so that we can support
11248 ns-resolution time stamps.
11249 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11250 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11251 (EMACS_USECS): Remove.
11252 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11253 so multiply the arg by 1000 before storing it.
11254 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11255 New macros.
11256 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11257 Port to ns-resolution time stamps.
11258 (EMACS_TIME_NEG_P): Remove; replaced by....
11259 (EMACS_TIME_SIGN): New macro.
11260 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11261 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11262 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11263 (make_timeval, make_lisp_time, decode_time_components): New decls.
11264 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11265 that it mishandled time_t overflow. You can't compare by subtracting!
11266 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11267 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11268
11269 * term.c: Include <sys/time.h>.
11270 (timeval_to_Time): New function, for proper overflow wraparound.
11271 (term_mouse_position, term_mouse_click): Use it.
11272
11273 * undo.c (record_first_change): Support higher-resolution time stamps
11274 in the undo buffer.
11275 (Fprimitive_undo): Use them when restoring time stamps.
11276
11277 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11278 (w32_get_internal_run_time):
11279 Port to higher-resolution Emacs time stamps.
11280 (ltime): Now accepts single 64-bit integer, as that's more convenient
11281 for callers.
11282
11283 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11284
11285 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11286 for compatibility with pselect. Support ns-resolution time stamps.
11287
11288 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11289
11290 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11291 Check for time stamp overflow, and support ns-resolution time stamps.
11292
11293 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11294 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11295 (timeval_subtract): Remove; no longer needed.
11296 (XTflash, XTring_bell, x_wait_for_event):
11297 Port to ns-resolution time stamps. Don't assume time_t is signed.
11298
11299 2012-06-22 Chong Yidong <cyd@gnu.org>
11300
11301 * xdisp.c (x_consider_frame_title): Revert last change.
11302
11303 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11304
11305 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11306 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11307 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11308 staticidx goes up to 1597 out of 1600 = 0x640.)
11309
11310 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11311
11312 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11313 Otherwise, the umask might be mistakenly 0 while handling input signals.
11314
11315 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11316
11317 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11318
11319 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11320
11321 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11322 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11323 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11324 access to `contents' member of Lisp_Vector objects with AREF and ASET
11325 where appropriate.
11326
11327 2012-06-19 Chong Yidong <cyd@gnu.org>
11328
11329 * frame.c (delete_frame): When selecting a frame on a different
11330 text terminal, do not alter the terminal's top-frame.
11331
11332 * xdisp.c (format_mode_line_unwind_data): Record the target
11333 frame's selected window and its terminal's top-frame.
11334 (unwind_format_mode_line): Restore them.
11335 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11336 Callers changed.
11337 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11338 since tty frames can be explicitly named.
11339 (prepare_menu_bars): Likewise.
11340
11341 * term.c (Ftty_top_frame): New function.
11342
11343 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11344
11345 Port byte-code-meter to modern targets.
11346 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11347 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11348 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11349 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11350 (METER_1, METER_2): Simplify.
11351
11352 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11353
11354 * data.c (Fdefalias): Return `symbol' (bug#11686).
11355
11356 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11357
11358 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11359 gets killed during executing of this function (Bug#11665).
11360 Try to always return Qt when the buffer has been actually killed.
11361 (Vkill_buffer_query_functions): In doc-string say that functions
11362 run by this hook should not change the current buffer.
11363
11364 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11365
11366 Fix recently-introduced process.c problems found by static checking.
11367 * process.c (write_queue_push, write_queue_pop, send_process):
11368 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11369 (write_queue_pop): Fix pointer signedness problem.
11370 (send_process): Remove unused local.
11371
11372 2012-06-17 Chong Yidong <cyd@gnu.org>
11373
11374 * xdisp.c (redisplay_internal): No need to redisplay terminal
11375 frames that are not on top.
11376
11377 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11378
11379 * process.c (make_process): Initialize write_queue.
11380 (write_queue_push, write_queue_pop): New functions.
11381 (send_process): Use them to maintain correct ordering of process
11382 writes (Bug#10815).
11383
11384 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11385
11386 * lisp.h (eassert): Assume C89 or later.
11387 This removes the need for CHECK.
11388 (CHECK): Remove. Its comments about always evaluating its
11389 argument were confusing, as 'eassert' typically does not evaluate
11390 its argument.
11391
11392 * coding.c (produce_chars): Use ptrdiff_t, not int.
11393
11394 * xterm.c (x_draw_underwave): Check for integer overflow.
11395 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11396
11397 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11398
11399 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11400 referenced (Bug#11583).
11401
11402 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11403
11404 Implement wave-style variant of underlining.
11405 * dispextern.h (face_underline_type): New enum.
11406 (face): Add field for underline type.
11407 * nsterm.m (ns_draw_underwave): New function.
11408 (ns_draw_text_decoration): Use it.
11409 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11410 New functions.
11411 (x_draw_glyph_string): Use them.
11412 * xfaces.c (Qline, Qwave): New Lisp objects.
11413 (check_lface_attrs, merge_face_ref)
11414 (Finternal_set_lisp_face_attribute, realize_x_face):
11415 Handle wave-style underline face attributes.
11416 * xterm.c (x_draw_underwave): New function.
11417 (x_draw_glyph_string): Use it.
11418
11419 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11420
11421 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11422 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11423 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11424 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11425 ($(BLD)/w32select.$(O)): Update dependencies.
11426
11427 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11428
11429 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11430 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11431 * character.c (_fetch_multibyte_char_p): Remove.
11432 * alloc.c: Include "character.h" before "buffer.h".
11433 * bidi.c: Likewise.
11434 * buffer.c: Likewise.
11435 * bytecode.c: Likewise.
11436 * callint.c: Likewise.
11437 * callproc.c: Likewise.
11438 * casefiddle.c: Likewise.
11439 * casetab.c: Likewise.
11440 * category.c: Likewise.
11441 * cmds.c: Likewise.
11442 * coding.c: Likewise.
11443 * composite.c: Likewise.
11444 * dired.c: Likewise.
11445 * dispnew.c: Likewise.
11446 * doc.c: Likewise.
11447 * dosfns.c: Likewise.
11448 * editfns.c: Likewise.
11449 * emacs.c: Likewise.
11450 * fileio.c: Likewise.
11451 * filelock.c: Likewise.
11452 * font.c: Likewise.
11453 * fontset.c: Likewise.
11454 * fringe.c: Likewise.
11455 * indent.c: Likewise.
11456 * insdel.c: Likewise.
11457 * intervals.c: Likewise.
11458 * keyboard.c: Likewise.
11459 * keymap.c: Likewise.
11460 * lread.c: Likewise.
11461 * macros.c: Likewise.
11462 * marker.c: Likewise.
11463 * minibuf.c: Likewise.
11464 * nsfns.m: Likewise.
11465 * nsmenu.m: Likewise.
11466 * print.c: Likewise.
11467 * process.c: Likewise.
11468 * regex.c: Likewise.
11469 * region-cache.c: Likewise.
11470 * search.c: Likewise.
11471 * syntax.c: Likewise.
11472 * term.c: Likewise.
11473 * textprop.c: Likewise.
11474 * undo.c: Likewise.
11475 * unexsol.c: Likewise.
11476 * w16select.c: Likewise.
11477 * w32fns.c: Likewise.
11478 * w32menu.c: Likewise.
11479 * window.c: Likewise.
11480 * xdisp.c: Likewise.
11481 * xfns.c: Likewise.
11482 * xmenu.c: Likewise.
11483 * xml.c: Likewise.
11484 * xselect.c: Likewise.
11485
11486 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11487
11488 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11489 If all the glyphs of the glyph row came from strings, and we have no
11490 cursor positioning clues, put the cursor on the first glyph of the
11491 row.
11492 (handle_face_prop): Use chunk-relative overlay string index when
11493 indexing into it->string_overlays array. (Bug#11653)
11494 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11495 the rightmost. (Bug#11720)
11496
11497 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11498
11499 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11500 (CATEGORY_MEMBER): Enforce 1/0 value.
11501 * category.c (_temp_category_set): Remove.
11502
11503 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11504
11505 * window.c (Fdelete_other_windows_internal)
11506 (Fdelete_window_internal): Don't access frame's mouse highlight
11507 info of the initial frame. (Bug#11677)
11508
11509 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11510
11511 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11512 Assume USE_2_TAGS_FOR_INTS.
11513 (xreload): Adjust $tagmask width to match recent lisp.h change.
11514
11515 Simplify lisp.h in minor ways that should not affect code.
11516 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11517 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11518 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11519 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11520 (INTTYPEBITS): New macro, for clarity.
11521 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11522 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11523 Simplify now that USE_LSB_TAG is always defined.
11524 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11525 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11526
11527 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11528
11529 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11530
11531 2012-06-13 Glenn Morris <rgm@gnu.org>
11532
11533 * s/bsd-common.h (BSD4_3):
11534 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11535
11536 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11537
11538 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11539 instead of union.
11540 (XLI, XIL): Define.
11541 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11542 Use them.
11543 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11544 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11545 * alloc.c (widen_to_Lisp_Object): Remove.
11546 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11547 * frame.c (delete_frame): Remove outdated comment.
11548 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11549 USE_LISP_UNION_TYPE.
11550 (Fw32_unregister_hot_key): Likewise.
11551 (Fw32_toggle_lock_key): Likewise.
11552 * w32menu.c (add_menu_item): Likewise.
11553 (w32_menu_display_help): Use XIL instead of checking
11554 USE_LISP_UNION_TYPE.
11555 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11556 (init_heap): Likewise.
11557 * w32term.c (w32_read_socket): Update comment.
11558
11559 2012-06-13 Glenn Morris <rgm@gnu.org>
11560
11561 * s/usg5-4-common.h, src/s/unixware.h:
11562 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11563
11564 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11565
11566 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11569 * alloc.c (make_number) [!defined make_number]:
11570 Remove, as lisp.h always defines this now.
11571 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11572 (roundup_size): Verify that it is a power of 2.
11573 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11574 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11575 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11576 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11577 USE_LSB_TAG now is always defined to be either 0 or 1.
11578 All uses changed.
11579 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11580 code works fine either way, and efficiency is not a concern here,
11581 as the union type is for debugging, not for production.
11582 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11583 Use an inline function on all platforms when using the union type,
11584 since this is simpler and 'static inline' can be used portably
11585 within Emacs now.
11586 (LISP_INITIALLY_ZERO): New macro.
11587 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11588 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11589
11590 2012-06-12 Glenn Morris <rgm@gnu.org>
11591
11592 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11593
11594 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11595
11596 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11597 Move BROKEN_SIGIO to configure.
11598
11599 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11600 Move NO_TERMIO to configure.
11601
11602 2012-06-12 Chong Yidong <cyd@gnu.org>
11603
11604 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11605 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11606 MagickExportImagePixels is undefined.
11607
11608 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11609
11610 * image.c (imagemagick_load_image): Remove unused label.
11611
11612 2012-06-11 Glenn Morris <rgm@gnu.org>
11613
11614 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11615 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11616 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11617 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11618
11619 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11620
11621 * alloc.c (make_byte_code): New function.
11622 (Fmake_byte_code): Use it. Don't purify here.
11623 * lread.c (read1): Use it as well to avoid extra allocation.
11624
11625 2012-06-11 Chong Yidong <cyd@gnu.org>
11626
11627 * image.c (imagemagick_load_image): Implement transparency.
11628
11629 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11630
11631 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11632 account for preceding backslashes. (Bug#11663)
11633
11634 2012-06-09 Chong Yidong <cyd@gnu.org>
11635
11636 * term.c: Support italics in capable terminals (Bug#9652).
11637 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11638 (turn_on_face): Output using TS_enter_italic_mode if available.
11639 Don't handle unused blinking and alt-charset cases.
11640 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11641 and tty_alt_charset_p cases.
11642 (tty_capable_p, init_tty): Support italics.
11643
11644 * termchar.h (struct tty_display_info): Add field for italics.
11645 Remove unused blink field.
11646
11647 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11648 Handle slant.
11649
11650 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11651 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11652 tty_alt_charset_p. Add tty_italic_p.
11653
11654 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
11655
11656 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11657 dbus_type_is_basic if available.
11658 (xd_extract_signed, xd_extract_unsigned): Rename from
11659 extract_signed and extract_unsigned, respectively. Adapt callers.
11660
11661 2012-06-09 Chong Yidong <cyd@gnu.org>
11662
11663 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11664
11665 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11666 case (Bug#9752).
11667
11668 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 * xdisp.c (vmessage): Treat frame message as multibyte.
11671 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11672 would generate the diagnostic "Making \302\247 buffer-local while
11673 let-bound!".
11674
11675 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11676
11677 * dispnew.c (showing_window_margins_p): Undo last change, which
11678 was done due to an inadvertent commit.
11679 (adjust_frame_glyphs_for_frame_redisplay): Do call
11680 showing_window_margins_p.
11681
11682 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11683
11684 * eval.c (Fmake_var_non_special): New primitive.
11685 (syms_of_eval): Defsubr it.
11686 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11687
11688 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
11689
11690 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11691 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11692
11693 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11694
11695 * alloc.c (allocate_vectorlike): Fix last change.
11696
11697 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11698
11699 Block-based vector allocation of small vectors.
11700 * lisp.h (struct vectorlike_header): New field `nbytes',
11701 adjust comment accordingly.
11702 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11703 to denote vector blocks. Adjust users (live_vector_p,
11704 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11705 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11706 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11707 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11708 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11709 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11710 (roundup_size): New constant.
11711 (struct vector_block): New data type.
11712 (vector_blocks, vector_free_lists, zero_vector): New variables.
11713 (all_vectors): Rename to `large_vectors'.
11714 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11715 (sweep_vectors): New functions.
11716 (allocate_vectorlike): Return `zero_vector' as the only vector of
11717 0 items. Allocate new vector from block if vector size is less than
11718 or equal to VBLOCK_BYTES_MAX.
11719 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11720 (init_alloc_once): Add call to init_vectors.
11721
11722 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11723
11724 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11725
11726 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11727
11728 * doprnt.c (doprnt): Truncate multibyte char correctly.
11729 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11730 would mishandle a string argument "Xc" if X was a multibyte
11731 character of length 2: it would truncate after X's first byte
11732 rather than including all of X.
11733
11734 2012-06-06 Chong Yidong <cyd@gnu.org>
11735
11736 * buffer.c (word_wrap): Doc fix.
11737
11738 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11739
11740 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11741
11742 2012-06-03 Glenn Morris <rgm@gnu.org>
11743
11744 * xdisp.c (tool-bar-style): Doc fix.
11745
11746 2012-06-03 Ulrich Müller <ulm@gentoo.org>
11747
11748 * Makefile.in (PAXCTL): Define.
11749 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11750 binary via PaX flags if the paxctl utility is available.
11751 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11752 Restore PaX flags to their default. (Bug#11398)
11753
11754 2012-06-03 Chong Yidong <cyd@gnu.org>
11755
11756 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11757 buffer (Bug#11226).
11758
11759 2012-06-03 Chong Yidong <cyd@gnu.org>
11760
11761 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11762 (note_mode_line_or_margin_highlight): If there is no help echo,
11763 use mode-line-default-help-echo. Handle the case where the mouse
11764 position is past the end of the mode line string.
11765
11766 * buffer.c (buffer_local_value_1): New function, split from
11767 Fbuffer_local_value; can return Qunbound.
11768 (Fbuffer_local_value): Use it.
11769 (Vmode_line_format): Docstring tweaks.
11770
11771 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11772
11773 * sysdep.c (system_process_attributes): Improve comment.
11774
11775 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11776
11777 * keyboard.c: Export real-this-command to Elisp.
11778 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11779 and DEFVAR it. Update all users.
11780
11781 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11782
11783 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11784
11785 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11786 Convert pctcpu and pctmem to Lisp float properly.
11787 Let the compiler fold better, as 100.0/0x8000 is exact.
11788
11789 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11790
11791 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11792 cons_block.
11793
11794 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11795
11796 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11797
11798 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11799
11800 For a 'struct window', replace some Lisp_Object fields to
11801 bitfields where appropriate, remove unused fields.
11802 * window.h (struct window): Remove unused 'last_mark_x' and
11803 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
11804 change its type from Lisp_Object to bitfield.
11805 Change type of 'force_start', 'optional_new_start',
11806 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11807 fields from Lisp_Object to bitfield. Adjust users accordingly.
11808
11809 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11810
11811 Pacify gcc -Wdouble-precision when using Xaw.
11812 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11813 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11814 Use 'float' consistently, rather than 'float' in most places
11815 and 'double' in a couple of places.
11816
11817 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11818
11819 * xdisp.c (handle_stop): Detect whether we have overlay strings
11820 loaded by testing it->current.overlay_string_index to be
11821 non-negative, instead of checking whether n_overlay_strings is
11822 positive. (Bug#11587)
11823
11824 2012-05-31 Chong Yidong <cyd@gnu.org>
11825
11826 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11827
11828 * doc.c (Fsubstitute_command_keys): Doc fix.
11829
11830 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11831
11832 * search.c (search_buffer): Remove calls to
11833 r_alloc_inhibit_buffer_relocation, as it is now called by
11834 maybe_unify_char, which was the cause of relocation of buffer text
11835 in bug#11519.
11836
11837 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11838
11839 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11840 for the duration of call to load_charset, to avoid problems with
11841 callers of maybe_unify_char that access buffer text through C
11842 pointers.
11843
11844 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11845 decrement the inhibition flag, instead of just setting or
11846 resetting it.
11847
11848 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11849
11850 Remove obsolete '#define static' cruft.
11851 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11852 This #undef was "temporary" in 2000; it is no longer needed
11853 now that '#define static' has gone away.
11854 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11855 (gray_bitmap_bits): Remove; no longer needed.
11856 All uses replaced with definiens.
11857 * xterm.c: Include "bitmaps/gray.xbm".
11858
11859 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11860
11861 Clean up __executable_start, monstartup when --enable-profiling.
11862 The following changes affect the code only when profiling.
11863 * dispnew.c (__executable_start): Rename from safe_bcopy.
11864 Define only on platforms that need it.
11865 * emacs.c: Include <sys/gmon.h> when profiling.
11866 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11867 (__executable_start): Remove decl, since lisp.h does it now.
11868 (safe_bcopy): Remove decl; no longer has that name.
11869 (main): Coalesce #if into single bit of code, for simplicity.
11870 Cast pointers to uintptr_t, since standard libraries want integers
11871 and not pointers.
11872 * lisp.h (__executable_start): New decl.
11873
11874 2012-05-31 Glenn Morris <rgm@gnu.org>
11875
11876 * image.c (Fimagemagick_types): Doc fix.
11877
11878 2012-05-30 Jim Meyering <meyering@redhat.com>
11879
11880 * callproc.c (Fcall_process_region): Include directory component
11881 in mkstemp error message (Bug#11586).
11882
11883 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11884
11885 * alloc.c, lisp.h (make_pure_vector): Now static.
11886
11887 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11888
11889 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11890 Move to byte-run.el.
11891 (Fautoload): Do the hash-doc more carefully.
11892 * data.c (Fdefalias): Purify definition, except for keymaps.
11893 (Qdefun): Move from eval.c.
11894 * lisp.h (Qdefun): Remove.
11895 * lread.c (read1): Tiny simplification.
11896
11897 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
11898
11899 Do not create empty overlays with the evaporate property (Bug#9642).
11900 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11901 Bug#9642, but explicitly check that the buffer the overlay would
11902 be moved to is live and rearrange lines to make sure that errors
11903 will not put the overlay in an inconsistent state.
11904 (Fdelete_overlay): Cosmetics.
11905
11906 2012-05-28 Eli Zaretskii <eliz@gnu.org>
11907
11908 * w32term.c (my_bring_window_to_top): New function.
11909 (x_raise_frame): Use handle returned by DeferWindowPos, which
11910 could be different from the original one.
11911 Call my_bring_window_to_top instead of my_set_foreground_window.
11912 (Bug#11513)
11913
11914 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11915 by calling BringWindowToTop.
11916
11917 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11918 (WM_EMACS_END): Increase by one.
11919
11920 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11921
11922 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11923 This avoids undefined behavior that might cause the eassert
11924 to not catch an out-of-range value.
11925
11926 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
11927
11928 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11929 Update dependencies.
11930
11931 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11932
11933 * bidi.c (bidi_mirror_char): Fix last change.
11934
11935 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11936
11937 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11938 when referring to sectname field in printf format.
11939
11940 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11941
11942 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11943 Only r_alloc_inhibit_buffer_relocation needed to be added;
11944 the others were already declared.
11945
11946 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11947 before checking whether it's out of range. Put the check inside
11948 eassert. See
11949 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11950
11951 2012-05-27 Ken Brown <kbrown@cornell.edu>
11952
11953 * callproc.c (Fcall_process): Restore a line that was accidentally
11954 commented out in the 2011-02-13 change (bug#11547).
11955
11956 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11957
11958 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11959 defined on ralloc.c.
11960
11961 * buffer.c [REL_ALLOC]: Remove prototypes of
11962 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11963 they are now on lisp.h.
11964
11965 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11966
11967 * search.c (search_buffer): Use it to inhibit relocation of buffer
11968 text while re_search_2 is doing its job, because re_search_2 is
11969 passed C pointers to buffer text. (Bug#11519)
11970
11971 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11972 Update value to 24.
11973
11974 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11975 state after an additional call to move_it_in_display_line_to, keep
11976 the values of it->max_ascent and it->max_descent found for the
11977 entire line.
11978 (pos_visible_p): Revert the comparison against bottom_y to what it
11979 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11980 (Bug#11464)
11981
11982 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11983
11984 Fix coding-related core dumps with gcc -ftrapv.
11985 The code was computing A - B, where A and B are pointers, and B is
11986 random garbage. This can lead to core dumps on platforms that
11987 have special pointer registers, and it also leads to core dumps on
11988 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11989 A - B only when B is initialized properly.
11990 * coding.c (coding_set_source, coding_set_destination): Return void.
11991 (coding_change_source, coding_change_destinations): New functions,
11992 with the old behaviors of coding_set_source and coding_set_destination.
11993 All callers that need an offset changed to use these new functions.
11994
11995 2012-05-26 Glenn Morris <rgm@gnu.org>
11996
11997 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11998
11999 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12000
12001 Extend mouse support on W32 text-mode console.
12002 * xdisp.c (draw_row_with_mouse_face):
12003 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12004
12005 * w32console.c: Include window.h.
12006 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12007 New functions.
12008 (initialize_w32_display): Initialize mouse-highlight data.
12009
12010 * w32inevt.c: Include termchar.h and window.h.
12011 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12012 moves, call note_mouse_highlight. If help_echo changed, call
12013 gen_help_event to produce help-echo message in the echo area.
12014 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12015 highlight info.
12016
12017 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 * lread.c (read1): Simplify slightly to avoid an overflow warning
12020 with GCC 4.7.0 on x86-64.
12021
12022 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12023
12024 * bidi.c (bidi_mirror_char): Revert last change: an int is
12025 definitely wide enough here.
12026
12027 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12028
12029 Fix integer width and related bugs (Bug#9874).
12030 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12031 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12032 (string_bytes, check_sblock, allocate_string_data):
12033 (compact_small_strings, Fmake_bool_vector, make_string)
12034 (make_unibyte_string, make_multibyte_string)
12035 (make_string_from_bytes, make_specified_string)
12036 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12037 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12038 (mark_vectorlike):
12039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12040 (allocate_pseudovector):
12041 Use int, not EMACS_INT, where int is wide enough.
12042 (inhibit_garbage_collection, Fgarbage_collect):
12043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12044 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12045 int might not be wide enough.
12046 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12047 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12048 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12049 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12050 (bidi_level_of_next_char, bidi_move_to_visually_next):
12051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12052 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12053 (Fkill_buffer, Fset_buffer_major_mode)
12054 (advance_to_char_boundary, Fbuffer_swap_text)
12055 (Fset_buffer_multibyte, overlays_at, overlays_in)
12056 (overlay_touches_p, struct sortvec, record_overlay_string)
12057 (overlay_strings, recenter_overlay_lists)
12058 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12059 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12060 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12061 (Foverlay_recenter, last_overlay_modification_hooks_used)
12062 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12064 (validate_region): Omit unnecessary test for b <= e,
12065 since that's guaranteed by the previous test.
12066 (adjust_overlays_for_delete): Avoid pos + length overflow.
12067 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12068 (report_overlay_modification):
12069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12070 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12071 Omit pointer cast, which isn't needed anyway, and doesn't work
12072 after the EMACS_INT -> ptrdiff_t change.
12073 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12074 * buffer.h: Adjust decls to match defn changes elsewhere.
12075 (struct buffer_text, struct buffer):
12076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12077 Use EMACS_INT, not int, where int might not be wide enough.
12078 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12079 not int, to avoid needless 32-bit limit on 64-bit hosts.
12080 (exec_byte_code): Use tighter memory-full test, one that checks
12081 for alloca overflow. Don't compute the address of the object just
12082 before an array, as that's not portable. Use EMACS_INT, not
12083 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12084 * callint.c (Fcall_interactively):
12085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12086 * callproc.c (call_process_kill, Fcall_process):
12087 Don't assume pid_t fits into an Emacs fixnum.
12088 (call_process_cleanup, Fcall_process, child_setup):
12089 Don't assume pid_t fits into int.
12090 (call_process_cleanup, Fcall_process, delete_temp_file)
12091 (Fcall_process_region):
12092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12093 (Fcall_process): Simplify handling of volatile integers.
12094 Use int, not EMACS_INT, where int will do.
12095 * casefiddle.c (casify_object, casify_region, operate_on_word)
12096 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12098 (casify_object): Avoid integer overflow when overallocating buffer.
12099 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12100 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12101 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12102 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12103 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12104 integers are now checked earlier. All uses replaced with XINT.
12105 (ccl_driver):
12106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12107 For CCL_MapSingle, check that content and value are in int range.
12108 (ccl_driver, Fregister_code_conversion_map):
12109 Check that Vcode_version_map_vector is a vector.
12110 (resolve_symbol_ccl_program): Check that vector header is in range.
12111 Always copy the vector, so that we can check its contents reliably
12112 now rather than having to recheck each instruction as it's being
12113 executed. Check that vector words fit in 'int'.
12114 (ccl_get_compiled_code, Fregister_ccl_program)
12115 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12116 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12117 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12118 contents are in range.
12119 (Fccl_execute_on_string): Check that status is in range.
12120 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12121 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12122 Accept and return EMACS_INT, not int, because callers can pass values
12123 out of 'int' range.
12124 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12125 (multibyte_chars_in_text, parse_str_as_multibyte)
12126 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12127 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12128 (string_escape_byte8, Fget_byte):
12129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12130 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12131 avoid mishandling large integers.
12132 * character.h: Adjust decls to match defn changes elsewhere.
12133 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12134 (Ffind_charset_region):
12135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12136 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12137 (load_charset_map_from_vector, Fdefine_charset_internal):
12138 Don't assume fixnum fits in int.
12139 (load_charset_map_from_vector, Fmap_charset_chars):
12140 Remove now-unnecessary CHECK_NATNUMs.
12141 (Fdefine_charset_internal): Check ranges here, more carefully.
12142 Don't rely on undefined behavior with signed left shift overflow.
12143 Don't assume unsigned int fits into fixnum, or that fixnum fits
12144 into unsigned int. Don't require max_code to be a valid fixnum;
12145 that's not true for gb10830 4-byte on a 32-bit host. Allow
12146 invalid_code to be a cons, for the same reason. Require code_offset
12147 to be a character. Avoid int overflow if max_char is close
12148 to INT_MAX.
12149 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12150 this is intended anyway and avoids some undefined behavior.
12151 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12152 INDEX_TO_CODE_POINT, as that's what it expects.
12153 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12154 * charset.h (DECODE_CHAR): Return int, not unsigned;
12155 this is what was intended anyway, and it avoids undefined behavior.
12156 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12157 integer-overflow issues.
12158 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12159 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12160 where the argument is EMACS_INT, and this behavior is not intended.
12161 * chartab.c (Fmake_char_table, Fset_char_table_range)
12162 (uniprop_get_decoder, uniprop_get_encoder):
12163 Don't assume fixnum fits in int.
12164 * cmds.c (move_point): New function, that does the gist of
12165 Fforward_char and Fbackward_char, but does so while checking
12166 for integer overflow more accurately.
12167 (Fforward_char, Fbackward_char): Use it.
12168 (Fforward_line, Fend_of_line, internal_self_insert)
12169 (internal_self_insert):
12170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12171 Fix a FIXME, by checking for integer overflow when calculating
12172 target_clm and actual_clm.
12173 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12174 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12175 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12176 (coding_alloc_by_making_gap, alloc_destination)
12177 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12178 (encode_coding_utf_16, detect_coding_emacs_mule)
12179 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12180 (detect_coding_iso_2022, decode_coding_iso_2022)
12181 (encode_invocation_designation, encode_designation_at_bol)
12182 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12183 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12184 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12185 (encode_coding_ccl, encode_coding_raw_text)
12186 (detect_coding_charset, decode_coding_charset)
12187 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12188 (produce_composition, produce_charset, produce_annotation)
12189 (decode_coding, handle_composition_annotation)
12190 (handle_charset_annotation, consume_chars, decode_coding_gap)
12191 (decode_coding_object, encode_coding_object, detect_coding_system)
12192 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12193 (code_convert_region, code_convert_string)
12194 (Fdefine_coding_system_internal)
12195 (coding_set_source, coding_set_destination):
12196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12197 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12198 (Fdefine_coding_system_internal):
12199 Don't assume fixnums fit in int.
12200 (decode_coding_gap, decode_coding_object, encode_coding_object)
12201 (Fread_coding_system, Fdetect_coding_region)
12202 (Funencodable_char_position, Fcheck_coding_systems_region)
12203 (get_translation, handle_composition_annotation, consume_chars):
12204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12205 (consume_chars): Rewrite to not calculate an address outside buffer.
12206 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12207 Don't access memory outside of the args array.
12208 (Fdefine_coding_system_internal): Check for charset-id overflow.
12209 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12210 result of ENCODE_CHAR.
12211 * coding.h: Adjust decls to match defn changes elsewhere.
12212 (struct coding_system):
12213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12214 * composite.c (get_composition_id, find_composition)
12215 (run_composition_function, update_compositions)
12216 (compose_text, composition_gstring_put_cache)
12217 (composition_gstring_p, composition_gstring_width)
12218 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12219 (composition_compute_stop_pos, composition_reseat_it)
12220 (composition_update_it, struct position_record)
12221 (find_automatic_composition, composition_adjust_point)
12222 (Fcomposition_get_gstring, Ffind_composition_internal):
12223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12224 (update_compositions):
12225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12226 * composite.h: Adjust decls to match defn changes elsewhere.
12227 (struct composition):
12228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12229 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12230 Do not attempt to compute the address of the object just before a
12231 buffer; this is not portable.
12232 (Faref, Faset):
12233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12234 (Faset): Use int, not EMACS_INT, where int is wide enough.
12235 (Fstring_to_number): Don't assume fixnums fit in int.
12236 (Frem): Don't assume arg is nonnegative.
12237 * dbusbind.c (xd_append_arg): Check for integers out of range.
12238 (Fdbus_call_method): Don't overflow the timeout int.
12239 (extract_signed, extract_unsigned): New functions.
12240 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12241 (xd_get_connection_references): Return ptrdiff_t, not int.
12242 All uses changed.
12243 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12244 (xd_read_message_1):
12245 Use int, not unsigned, where the dbus API uses int.
12246 (Fdbus_message_internal): Don't overflow mtype.
12247 (syms_of_dbusbind): Allocate right-sized buffer for integers.
12248 * dired.c (directory_files_internal, file_name_completion, scmp)
12249 (file_name_completion_stat):
12250 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12251 (file_name_completion): Don't overflow matchcount.
12252 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12253 * dispextern.h: Adjust decls to match defn changes elsewhere.
12254 (struct text_pos, struct glyph, struct bidi_saved_info)
12255 (struct bidi_string_data, struct bidi_it, struct composition_it)
12256 (struct it):
12257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12258 (struct display_pos, struct composition_it, struct it):
12259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12260 * dispnew.c (increment_matrix_positions)
12261 (increment_row_positions, mode_line_string)
12262 (marginal_area_string):
12263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12264 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12266 (duration_to_sec_usec): New function, to check for overflow better.
12267 (Fsleep_for, sit_for): Use it.
12268 * doc.c (get_doc_string, store_function_docstring):
12269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12270 (get_doc_string, Fsnarf_documentation):
12271 Use int, not EMACS_INT, where int is wide enough.
12272 (get_doc_string):
12273 Use SAFE_ALLOCA, not alloca.
12274 Check for overflow when converting EMACS_INT to off_t.
12275 * doprnt.c (doprnt):
12276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12277 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12278 Don't assume uid_t fits into fixnum.
12279 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12280 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12281 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12282 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12283 (general_insert_function)
12284 (Finsert_char, make_buffer_string, make_buffer_string_both)
12285 (update_buffer_properties, Fbuffer_substring)
12286 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12287 (Fsubst_char_in_region, check_translation)
12288 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12289 (transpose_markers, Ftranspose_regions):
12290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12291 (clip_to_bounds): Move to lisp.h as an inline function).
12292 (Fconstrain_to_field): Don't assume integers are nonnegative.
12293 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12294 (Fsubst_char_in_region, Fsave_restriction):
12295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12296 (Femacs_pid): Don't assume pid_t fits into fixnum.
12297 (lo_time): Use int, not EMACS_INT, when int suffices.
12298 (lisp_time_argument): Check for usec out of range.
12299 (Fencode_time): Don't assume fixnum fits in int.
12300 (Fuser_login_name, Fuser_full_name): Signal an error
12301 if a uid argument is out of range, rather than relying on
12302 undefined behavior.
12303 (Fformat_time_string): Remove now-unnecessary check.
12304 lisp_time_argument checks for out-of-range usec now.
12305 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12306 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12307 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12308 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12309 (init_cmdargs, Fdump_emacs):
12310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12311 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12312 the bottom (typically) 32 bits of the fixnum.
12313 * eval.c (specpdl_size, call_debugger):
12314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12315 (when_entered_debugger, Fbacktrace_debug):
12316 Don't assume fixnum can fit in int.
12317 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12318 the object just before a buffer; this is not portable.
12319 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12320 (grow_specpdl, unbind_to):
12321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12322 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12323 (grow_specpdl): Simplify allocation by using xpalloc.
12324 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12325 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12326 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12328 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12329 (a_write, e_write):
12330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12331 (Fcopy_file, non_regular_nbytes, read_non_regular)
12332 (Finsert_file_contents):
12333 Use int, not EMACS_INT, where int is wide enough.
12334 (READ_BUF_SIZE): Verify that it fits in int.
12335 (Finsert_file_contents): Check that counts are in proper range,
12336 rather than assuming fixnums fit into ptrdiff_t etc.
12337 Don't assume fixnums fit into int.
12338 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12339 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12340 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12341 (string_char_to_byte, string_byte_to_char)
12342 (string_make_multibyte, string_to_multibyte)
12343 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12344 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12345 (substring_both, Fdelete, internal_equal, Ffillarray)
12346 (Fclear_string, mapcar1)
12347 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12348 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12349 (larger_vector, make_hash_table, maybe_resize_hash_table)
12350 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12351 (Fmaphash, secure_hash):
12352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12353 (concat): Check for string index and length overflow.
12354 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12355 (Frequire):
12356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12357 (larger_vector): New API (vec, incr_min, size_max) replaces old
12358 one (vec, new_size, init). This catches size overflow.
12359 INIT was removed because it was always Qnil.
12360 All callers changed.
12361 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12362 the upper bound on a hash table index size.
12363 (make_hash_table, maybe_resize_hash_table): Use it.
12364 (secure_hash): Computer start_byte and end_byte only after
12365 they're known to be in ptrdiff_t range.
12366 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12367 (Ffont_get_glyphs, Ffont_at):
12368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12369 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12370 (Flist_fonts, Fopen_font):
12371 Don't assume fixnum can fit in int.
12372 (check_gstring): Don't assume index can fit in int.
12373 (font_match_p): Check that fixnum is a character, not a nonnegative
12374 fixnum, since the later code needs to stuff it into an int.
12375 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12376 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12377 conversion overflow issues.
12378 (Fopen_font): Check for integer out of range.
12379 (Ffont_get_glyphs): Don't assume index can fit in int.
12380 * font.h: Adjust decls to match defn changes elsewhere.
12381 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12382 integer overflow.
12383 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12384 printmax_t, where ptrdiff_t is wide enough.
12385 (Finternal_char_font):
12386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12387 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12388 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12389 (Fset_frame_position, x_set_frame_parameters)
12390 (x_set_line_spacing, x_set_border_width)
12391 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12392 Check that fixnums are in proper range for system types.
12393 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12395 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12396 Use SAFE_ALLOCA_LISP, not alloca.
12397 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12398 intptr_t is wide enough.
12399 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12400 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12401 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12402 Check for fixnum out of range.
12403 * ftfont.c (ftfont_list): Don't assume index fits in int.
12404 Check that fixnums are in proper range for system types.
12405 (ftfont_shape_by_flt):
12406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12407 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12409 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12410 Check that fixnums are in proper range for system types.
12411 * gnutls.h: Adjust decls to match defn changes elsewhere.
12412 * gtkutil.c (xg_dialog_run):
12413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12414 (update_frame_tool_bar):
12415 Check that fixnums are in proper range for system types.
12416 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12417 (lookup_image): Check that fixnums are in range for system types.
12418 * indent.c (last_known_column, last_known_column_point):
12419 (current_column_bol_cache):
12420 (skip_invisible, current_column, check_display_width):
12421 (check_display_width, scan_for_column, current_column_1)
12422 (Findent_to, Fcurrent_indentation, position_indentation)
12423 (indented_beyond_p, Fmove_to_column, compute_motion):
12424 (Fcompute_motion, Fvertical_motion):
12425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12426 (last_known_column_modified): Use EMACS_INT, not int.
12427 (check_display_width):
12428 (Fcompute_motion):
12429 Check that fixnums and floats are in proper range for system types.
12430 (compute_motion): Don't assume index or fixnum fits in int.
12431 (compute_motion, Fcompute_motion):
12432 Use int, not EMACS_INT, when it is wide enough.
12433 (vmotion): Omit local var start_hpos that is always 0; that way
12434 we don't need to worry about overflow in expressions involving it.
12435 * indent.h: Adjust decls to match defn changes elsewhere.
12436 (struct position):
12437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12438 Use int, not EMACS_INT, where int is wide enough.
12439 Remove unused members ovstring_chars_done and tab_offset;
12440 all uses removed.
12441 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12442 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12443 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12444 (make_gap, copy_text, insert, insert_and_inherit)
12445 (insert_before_markers, insert_before_markers_and_inherit)
12446 (insert_1, count_combining_before, count_combining_after)
12447 (insert_1_both, insert_from_string)
12448 (insert_from_string_before_markers, insert_from_string_1)
12449 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12450 (adjust_after_replace, adjust_after_insert, replace_range)
12451 (replace_range_2, del_range, del_range_1, del_range_byte)
12452 (del_range_both, del_range_2, modify_region)
12453 (prepare_to_modify_buffer, signal_before_change)
12454 (signal_after_change, Fcombine_after_change_execute):
12455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12456 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12457 (balance_an_interval, split_interval_right, split_interval_left)
12458 (find_interval, next_interval, update_interval)
12459 (adjust_intervals_for_insertion, delete_node, delete_interval)
12460 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12461 (static_offset_intervals, offset_intervals)
12462 (merge_interval_right, merge_interval_left, make_new_interval)
12463 (graft_intervals_into_buffer, temp_set_point_both)
12464 (temp_set_point, set_point, adjust_for_invis_intang)
12465 (set_point_both, move_if_not_intangible, get_property_and_range)
12466 (get_local_map, copy_intervals, copy_intervals_to_string)
12467 (compare_string_intervals, set_intervals_multibyte_1):
12468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12469 * intervals.h: Adjust decls to match defn changes elsewhere.
12470 (struct interval):
12471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12472 * keyboard.c (this_command_key_count, this_single_command_key_start)
12473 (before_command_key_count, before_command_echo_length, echo_now)
12474 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12475 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12476 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12477 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12479 (last_non_minibuf_size, last_point_position, echo_truncate)
12480 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12481 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12482 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12483 (stuff_buffered_input):
12484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12485 (last_auto_save, command_loop_1, read_char):
12486 Use EMACS_INT, not int, to avoid integer overflow.
12487 (record_char): Avoid overflow in total_keys computation.
12488 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12489 * keyboard.h: Adjust decls to match defn changes elsewhere.
12490 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12491 (Fkey_description, Fdescribe_vector, Flookup_key):
12492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12493 (click_position): New function, to check that positions are in range.
12494 (Fcurrent_active_maps):
12495 (describe_command):
12496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12497 (Faccessible_keymaps, Fkey_description):
12498 (preferred_sequence_p):
12499 Don't assume fixnum can fit into int.
12500 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12501 Check for integer overflow in size calculations.
12502 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12503 avoid mishandling large integers.
12504 * lisp.h: Adjust decls to match defn changes elsewhere.
12505 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12506 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12507 (struct Lisp_Marker):
12508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12509 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12510 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12511 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12512 All callers changed.
12513 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12514 Assume the arg has valid form, since it always does.
12515 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12516 unsigned integer system type.
12517 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12518 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12520 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12521 (duration_to_sec_usec): New decl.
12522 * lread.c (read_from_string_index, read_from_string_index_byte)
12523 (read_from_string_limit, readchar, unreadchar, openp)
12524 (read_internal_start, read1, oblookup):
12525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12526 (Fload, readevalloop, Feval_buffer, Feval_region):
12527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12528 (openp): Check for out-of-range argument to 'access'.
12529 (read1): Use int, not EMACS_INT, where int is wide enough.
12530 Don't assume fixnum fits into int.
12531 Fix off-by-one error that can read outside a buffer.
12532 (read_filtered_event): Use duration_to_sec_usec
12533 to do proper overflow checking on durations.
12534 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12535 in size calculation.
12536 (Fexecute_kbd_macro):
12537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12538 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12539 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12540 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12541 (set_marker_both, set_marker_restricted_both, marker_position)
12542 (marker_byte_position, Fbuffer_has_markers_at):
12543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12544 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12545 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12546 It now merely ensures that the menu is large enough, without
12547 necessarily growing it, as this avoids some integer overflow issues.
12548 All callers changed.
12549 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12551 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12552 Use SAFE_ALLOCA_LISP, not alloca.
12553 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12554 to EMACS_INT. Check that fixnums are in proper range for system types.
12555 * minibuf.c (minibuf_prompt_width, string_to_object)
12556 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12557 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12559 (get_minibuffer, read_minibuf_unwind):
12560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12561 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12562 this simplifies overflow checking. All callers changed.
12563 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12564 (Ftest_completion):
12565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12566 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12567 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12568 Check that fixnums are in proper range for system types.
12569 (Fx_create_frame, Fx_show_tip):
12570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12571 * nsfont.m (ns_findfonts, nsfont_list_family):
12572 Don't assume fixnum fits in long.
12573 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12575 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12576 wide enough.
12577 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12579 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12580 (PRINTDECLARE, PRINTPREPARE):
12581 (strout, print_string):
12582 (print, print_preprocess, print_check_string_charset_prop)
12583 (print_object):
12584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12585 (PRINTDECLARE):
12586 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12588 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12589 (printchar, strout): Use xpalloc to catch size calculation overflow.
12590 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12591 (print_error_message): Use SAFE_ALLOCA, not alloca.
12592 (print_object): Use int, not EMACS_INT, where int is wide enough.
12593 (print_depth, new_backquote_output, print_number_index):
12594 Use ptrdiff_t, not int, where int might not be wide enough.
12595 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12596 (Fset_process_window_size, Fformat_network_address)
12597 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12598 (sigchld_handler):
12599 Check that fixnums are in proper range for system types.
12600 (Fsignal_process): Simplify by avoiding a goto.
12601 Check for process-ids out of pid_t range rather than relying on
12602 undefined behavior.
12603 (process_tick, update_tick): Use EMACS_INT, not int.
12604 (Fformat_network_address, read_process_output, send_process)
12605 (Fprocess_send_region, status_notify):
12606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12607 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12608 (wait_reading_process_output, read_process_output, exec_sentinel):
12609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12610 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12611 (Faccept_process_output): Use duration_to_sec_usec to do proper
12612 overflow checking on durations.
12613 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12614 Don't assume pid_t fits in int.
12615 * process.h (struct Lisp_Process): Members tick and update_tick
12616 are now of type EMACS_INT, not int.
12617 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12618 configured --with-wide-int.
12619 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12620 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12621 * search.c (looking_at_1, string_match_1):
12622 (fast_string_match, fast_c_string_match_ignore_case)
12623 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12624 (scan_newline, find_before_next_newline, search_command)
12625 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12626 (set_search_regs, wordify):
12627 (Freplace_match):
12628 (Fmatch_data):
12629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12630 (string_match_1, search_buffer, set_search_regs):
12631 (Fmatch_data):
12632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12633 (wordify): Check for overflow in size calculation.
12634 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12635 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12636 Check that fixnums are in proper range for system types.
12637 * sound.c (struct sound_device)
12638 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12640 (Fplay_sound_internal):
12641 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12642 * syntax.c (struct lisp_parse_state, find_start_modiff)
12643 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12644 (Fparse_partial_sexp):
12645 Don't assume fixnums can fit in int.
12646 (struct lisp_parse_state, find_start_pos, find_start_value)
12647 (find_start_value_byte, find_start_begv)
12648 (update_syntax_table, char_quoted, dec_bytepos)
12649 (find_defun_start, prev_char_comend_first, back_comment):
12650 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12651 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12653 (Finternal_describe_syntax_value): Check that match_lisp is a
12654 character, not an integer, since the code stuffs it into int.
12655 (scan_words, scan_sexps_forward):
12656 Check that fixnums are in proper range for system types.
12657 (Fforward_word):
12658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12659 (scan_sexps_forward):
12660 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12661 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12662 * syntax.h: Adjust decls to match defn changes elsewhere.
12663 (struct gl_state_s):
12664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12665 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12666 MOST_POSITIVE_FIXNUM.
12667 * sysdep.c (wait_for_termination_1, wait_for_termination)
12668 (interruptible_wait_for_termination, mkdir):
12669 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12670 (emacs_read, emacs_write):
12671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12672 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12673 and double all fit in int.
12674 * term.c (set_tty_color_mode):
12675 Check that fixnums are in proper range for system types.
12676 * termhooks.h (struct input_event):
12677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12678 * textprop.c (validate_interval_range, interval_of)
12679 (Fadd_text_properties, set_text_properties_1)
12680 (Fremove_text_properties, Fremove_list_of_text_properties)
12681 (Ftext_property_any, Ftext_property_not_all)
12682 (copy_text_properties, text_property_list, extend_property_ranges)
12683 (verify_interval_modification):
12684 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12685 (Fnext_single_char_property_change)
12686 (Fprevious_single_char_property_change):
12687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12688 (copy_text_properties):
12689 Check for integer overflow in index calculation.
12690 * undo.c (last_boundary_position, record_point, record_insert)
12691 (record_delete, record_marker_adjustment, record_change)
12692 (record_property_change):
12693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12694 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12696 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12697 (Fx_hide_tip, Fx_file_dialog):
12698 * w32menu.c (set_frame_menubar):
12699 Use ptrdiff_t, not int, for consistency with rest of code.
12700 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12701 (select_window, Fdelete_other_windows_internal)
12702 (window_scroll_pixel_based, window_scroll_line_based)
12703 (Frecenter, Fset_window_configuration):
12704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12705 (Fset_window_hscroll, run_window_configuration_change_hook)
12706 (set_window_buffer, temp_output_buffer_show, scroll_command)
12707 (Fscroll_other_window, Frecenter):
12708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12709 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12710 Don't assume fixnum fits in int.
12711 (Fset_window_scroll_bars):
12712 Check that fixnums are in proper range for system types.
12713 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12714 (string_pos, c_string_pos, number_of_chars, init_iterator)
12715 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12716 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12717 (compute_display_string_end, handle_face_prop)
12718 (face_before_or_after_it_pos, handle_invisible_prop)
12719 (handle_display_prop, handle_display_spec, handle_single_display_spec)
12720 (display_prop_intangible_p, string_buffer_position_lim)
12721 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12722 (get_overlay_strings_1, get_overlay_strings)
12723 (iterate_out_of_display_property, forward_to_next_line_start)
12724 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12725 (get_next_display_element, set_iterator_to_next)
12726 (get_visually_first_element, compute_stop_pos_backwards)
12727 (handle_stop_backwards, next_element_from_buffer)
12728 (move_it_in_display_line_to, move_it_in_display_line)
12729 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12730 (add_to_log, message_dolog, message_log_check_duplicate)
12731 (message2, message2_nolog, message3, message3_nolog
12732 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12733 (current_message_1, truncate_echo_area, truncate_message_1)
12734 (set_message, set_message_1, store_mode_line_noprop)
12735 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12736 (text_outside_line_unchanged_p, check_point_in_composition)
12737 (reconsider_clip_changes)
12738 (redisplay_internal, set_cursor_from_row, try_scrolling)
12739 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12740 (redisplay_window, find_last_unchanged_at_beg_row)
12741 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12742 (trailing_whitespace_p, find_row_edges, display_line)
12743 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12744 (display_mode_element, store_mode_line_string)
12745 (pint2str, pint2hrstr, decode_mode_spec)
12746 (display_count_lines, display_string, draw_glyphs)
12747 (x_produce_glyphs, x_insert_glyphs)
12748 (rows_from_pos_range, mouse_face_from_buffer_pos)
12749 (fast_find_string_pos, mouse_face_from_string_pos)
12750 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12752 (safe_call, init_from_display_pos, handle_fontified_prop)
12753 (handle_single_display_spec, load_overlay_strings)
12754 (with_echo_area_buffer, setup_echo_area_for_printing)
12755 (display_echo_area, echo_area_display)
12756 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12757 (update_tool_bar, hscroll_window_tree, redisplay_internal)
12758 (redisplay_window, dump_glyph_row, display_mode_line)
12759 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12760 (handle_display_spec, display_prop_string_p):
12761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12762 (handle_single_display_spec, build_desired_tool_bar_string)
12763 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12764 (get_specified_cursor_type):
12765 Check that fixnums are in proper range for system types.
12766 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12767 (Flookup_image_map):
12768 Don't assume fixnums fit in int.
12769 (compare_overlay_entries):
12770 Avoid mishandling comparisons due to subtraction overflow.
12771 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12772 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12773 (handle_tool_bar_click):
12774 Use int, not unsigned, since we prefer signed and the signedness
12775 doesn't matter here.
12776 (get_next_display_element, next_element_from_display_vector):
12777 Use int, not EMACS_INT, when int is wide enough.
12778 (start_hourglass): Use duration_to_sec_usec to do proper
12779 overflow checking on durations.
12780 * xfaces.c (Fbitmap_spec_p):
12781 Check that fixnums are in proper range for system types.
12782 (compare_fonts_by_sort_order):
12783 Avoid mishandling comparisons due to subtraction overflow.
12784 (Fx_family_fonts, realize_basic_faces):
12785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12786 (Fx_family_fonts):
12787 Don't assume fixnum fits in int.
12788 Use SAFE_ALLOCA_LISP, not alloca.
12789 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12790 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12791 (face_at_buffer_position, face_for_overlay_string)
12792 (face_at_string_position):
12793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12794 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12795 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12796 (Fx_show_tip):
12797 Check that fixnums are in proper range for system types.
12798 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12799 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12801 (Fx_change_window_property): Don't assume fixnums fit in int.
12802 * xfont.c (xfont_chars_supported):
12803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12804 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12805 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12807 * xml.c (parse_region):
12808 * xrdb.c (magic_file_p):
12809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12810 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12811 (x_get_local_selection, x_reply_selection_request)
12812 (x_handle_selection_request, wait_for_property_change):
12813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12814 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12815 short is wide enough.
12816 (x_send_client_event): Don't assume fixnum fits in int.
12817 * xterm.c (x_x_to_emacs_modifiers):
12818 Don't assume EMACS_INT overflows nicely into int.
12819 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12820 may come from Lisp.
12821 (handle_one_xevent): NATNUMP can eval its arg twice.
12822 (x_connection_closed):
12823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12824 * xterm.h: Adjust decls to match defn changes elsewhere.
12825 (struct scroll_bar): Use struct vectorlike_header
12826 rather than rolling our own approximation.
12827 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12828
12829 2012-05-25 Glenn Morris <rgm@gnu.org>
12830
12831 * lisp.mk (lisp): Update for more files being compiled now.
12832
12833 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12834
12835 * lread.c: Remove `read_pure' which makes no difference.
12836 (read_pure): Remove var.
12837 (unreadpure): Remove function.
12838 (readevalloop): Don't call read_list with -1 flag.
12839 (read1, read_vector): Don't test read_pure any more.
12840 (read_list): Simplify.
12841
12842 * fileio.c, character.h: Minor style tweaks.
12843
12844 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12845
12846 * window.h (clip_changed): Remove useless declaration.
12847
12848 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
12849
12850 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12851 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12852
12853 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12854
12855 Remove src/m/*.
12856 This directory predates autoconf and is no longer needed nowadays.
12857 Move its few remaining bits of functionality to where they're needed.
12858 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12859 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12860 * m/template.h: Remove.
12861 * Makefile.in (M_FILE): Remove. All uses removed.
12862 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12863 * lisp.h (USE_LSB_TAG):
12864 * mem-limits.h (EXCEEDS_LISP_PTR):
12865 Use VAL_MAX, not VALBITS, in #if.
12866 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12867 (EMACS_UINT): Define unconditionally now.
12868 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12869 (BITS_PER_EMACS_INT): New constants, replacing
12870 what used to be in config.h, but not useful in #if.
12871 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12872 define them any more.
12873 (VAL_MAX): New macro.
12874 (VALMASK): Use it.
12875 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12876 BITS_PER_EMACS_INT, in #if.
12877 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12878 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12879 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12880 * s/ms-w32.h (DATA_START):
12881 Move here from removed file m/intel386.h.
12882 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12883 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12884
12885 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12886
12887 Assume C89 or later.
12888 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12889 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12890 (xrealloc):
12891 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12892 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12893 * textprop.c, tparam.c (NULL): Remove.
12894 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12895 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12896 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12897 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12898 * xterm.c (input_signal_count): Assume volatile works.
12899
12900 2012-05-21 Ken Brown <kbrown@cornell.edu>
12901
12902 * xgselect.c (xg_select): Fix first argument in call to 'select'
12903 (bug#11508).
12904
12905 2012-05-20 Ken Brown <kbrown@cornell.edu>
12906
12907 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12908 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12909
12910 2012-05-19 Ken Brown <kbrown@cornell.edu>
12911
12912 * xfns.c (x_in_use): Remove `static' qualifier.
12913 * xterm.h (x_in_use): Declare.
12914 * xgselect.c: Include xterm.h.
12915 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12916 and `display_arg' (bug#9754).
12917
12918 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12919
12920 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12921
12922 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12923 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12924
12925 2012-05-18 Eli Zaretskii <eliz@gnu.org>
12926
12927 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12928
12929 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12930 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12931
12932 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12933 reference to image_cache->refcount.
12934 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12935
12936 2012-05-17 Juri Linkov <juri@jurta.org>
12937
12938 * search.c (Fword_search_regexp, Fword_search_backward)
12939 (Fword_search_forward, Fword_search_backward_lax)
12940 (Fword_search_forward_lax): Move functions to isearch.el
12941 (bug#10145, bug#11381).
12942
12943 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12944
12945 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12946
12947 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12948
12949 * lread.c (init_obarray): Declare Qt and Qnil as special.
12950
12951 2012-05-14 Glenn Morris <rgm@gnu.org>
12952
12953 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12954 Put "libexec" before "bin", for the sake of init_callproc_1.
12955
12956 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12957
12958 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12959
12960 * unexaix.c: Port to more-recent AIX compilers.
12961 (report_error, report_error_1, make_hdr, copy_sym)
12962 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12963 Make arguments const char *, not char *, to avoid violations of C
12964 standard and to fix some AIX warnings reported by Gilles Pion.
12965
12966 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12967
12968 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12969 already have overlays loaded.
12970 (handle_single_display_spec): Before returning without displaying
12971 fringe bitmap, synchronize the bidi iterator with the main display
12972 iterator, by calling iterate_out_of_display_property.
12973 (iterate_out_of_display_property): Detect buffer iteration by
12974 testing that it->string is a Lisp string.
12975 (get_next_display_element): When the current object is exhausted,
12976 and there's something on it->stack, call set_iterator_to_next to
12977 proceed with what's on the stack, instead of returning zero.
12978 (set_iterator_to_next): If called at the end of a Lisp string,
12979 proceed to consider_string_end without incrementing string
12980 position. Don't increment display vector index past the end of
12981 the display vector. (Bug#11417)
12982 (pos_visible_p): Don't report a position visible when move_it_to
12983 stopped at the last line of window, which happens to be scanned
12984 backwards by the bidi iteration. (Bug#11464)
12985
12986 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12987
12988 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12989 and right-margin display specs even if the spec is invalid or we
12990 are on a TTY, and thus unable to display on the fringes.
12991 That's because the text with the property will not be displayed anyway,
12992 so we need to signal to the caller that this is a "replacing"
12993 display spec. This fixes display when the spec is invalid or we
12994 are on a TTY.
12995
12996 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12997
12998 * unexaix.c (make_hdr): Fix typo in prototype.
12999 This bug broke the build on AIX. Problem reported by Gilles Pion.
13000
13001 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13002
13003 * keyboard.c (kbd_buffer_get_event): Read special events also in
13004 batch mode. (Bug#11415)
13005
13006 2012-05-12 Glenn Morris <rgm@gnu.org>
13007
13008 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13009
13010 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13011
13012 * lisp.mk (lisp): Add newcomment.elc.
13013
13014 2012-05-12 Glenn Morris <rgm@gnu.org>
13015
13016 * Makefile.in (MKDIR_P): New, set by configure.
13017 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13018
13019 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13020
13021 Remove unused function hourglass_started.
13022 * dispextern.h (hourglass_started):
13023 * w32fns.c (hourglass_started):
13024 * xdisp.c (hourglass_started): Remove.
13025
13026 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13027
13028 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13029 Update dependencies.
13030
13031 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13032
13033 * xgselect.c (xg_select): Put maxfds+1 into a var.
13034 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13035
13036 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13037
13038 2012-05-10 Dave Abrahams <dave@boostpro.com>
13039
13040 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13041 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13042
13043 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13044
13045 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13046 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13047 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13048 Initialize xd_registered_buses.
13049
13050 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13051
13052 Untag more efficiently if USE_LSB_TAG.
13053 This is based on a proposal by YAMAMOTO Mitsuharu in
13054 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13055 For an admittedly artificial (nth 8000 longlist) benchmark on
13056 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13057 Emacs's overall text size by 1%.
13058 * lisp.h (XUNTAG): New macro.
13059 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13060 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13061 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13062 * eval.c (Fautoload):
13063 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13064 * frame.h (XFRAME): Use XUNTAG.
13065
13066 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13067 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13068 Remove unportable assumptions about print widths of types like
13069 dbus_uint32_t.
13070 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13071 intptr_t when converting between pointer and integer, to avoid GCC
13072 warnings about wrong width.
13073
13074 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13075
13076 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13077 stack for each reader_thread, instead of defaulting to 8MB
13078 determined by the linker. This avoids failures in creating
13079 subprocesses on Windows 7, see the discussion in this thread:
13080 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13081
13082 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13083
13084 Fix up display of the *Minibuf-0* buffer in the mini window.
13085 * keyboard.c (read_char): Don't clear the echo area if there's no
13086 message to clear.
13087 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13088 contents of *Minibuf-0*) if there's no message displayed in its stead.
13089
13090 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13091
13092 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13093 batch mode.
13094
13095 2012-05-06 Chong Yidong <cyd@gnu.org>
13096
13097 * lisp.mk (lisp): Update.
13098
13099 2012-05-05 Jim Meyering <meyering@redhat.com>
13100
13101 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13102
13103 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13104
13105 * data.c (PUT_ERROR): New macro.
13106 (syms_of_data): Use it. Add new error type `user-error'.
13107 * undo.c (user_error): New function.
13108 (Fprimitive_undo): Use it.
13109 * print.c (print_error_message): Adjust print style for `user-error'.
13110 * keyboard.c (user_error): New function.
13111 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13112
13113 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13114
13115 Do not limit current-time-string to years 1000..9999.
13116 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13117 (Fcurrent_time_string): Support any year that is supported by the
13118 underlying localtime representation. Don't use asctime, as it
13119 has undefined behavior for years outside the range -999..9999.
13120
13121 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13122
13123 Fix race conditions involving setenv, gmtime, localtime, asctime.
13124 Without this fix, interrupts could mess up code that uses these
13125 nonreentrant functions, since setting TZ invalidates existing
13126 tm_zone or tzname values, and since most of these functions return
13127 pointers to static storage.
13128 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13129 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13130 Grow the critical sections to include not just invoking
13131 localtime/gmtime, but also accessing these functions' results
13132 including their tm_zone values if any, and any related TZ setting.
13133 (format_time_string): Last arg is now struct tm *, not struct tm **,
13134 so that the struct tm is saved in the critical section.
13135 All callers changed. Simplify allocation of initial buffer, partly
13136 motivated by the fact that memory allocation needs to be outside
13137 the critical section.
13138
13139 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13140
13141 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13142 with RESET_INTERVAL.
13143
13144 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13145 Remove duplicated buffer name initialization.
13146
13147 2012-05-02 Jim Meyering <jim@meyering.net>
13148
13149 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13150
13151 * xfns.c (x_window): Use xstrdup (Bug#11375).
13152
13153 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13154
13155 * xdisp.c (pos_visible_p): If already at a newline from the
13156 display string before the 'while' loop, don't walk back the glyphs
13157 from it3.glyph_row. Solves assertion violation when the display
13158 string begins with a newline (egg.el). (Bug#11367)
13159
13160 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13161
13162 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13163 Move to simple.el.
13164
13165 2012-05-01 Glenn Morris <rgm@gnu.org>
13166
13167 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13168 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13169 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13170 All were removed before 23.1.
13171
13172 * dispnew.c: Remove HAVE_LIBNCURSES test;
13173 it is always true on relevant platforms.
13174
13175 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13176 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13177
13178 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13179
13180 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13181
13182 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13183 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13184 Remove.
13185
13186 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13187
13188 Do not avoid creating empty evaporating overlays (Bug#9642).
13189 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13190 That is, do not delete an evaporating overlay if it becomes
13191 empty after its bounds are adjusted to fit within its buffer.
13192 This fix caused other problems, and I'm reverting it until we get
13193 to the bottom of them.
13194
13195 2012-04-27 Chong Yidong <cyd@gnu.org>
13196
13197 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13198
13199 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13200
13201 * xdisp.c (pos_visible_p): If the window start position is beyond
13202 ZV, start the display from buffer beginning. Prevents assertion
13203 violation in init_iterator when the minibuffer window is scrolled
13204 via the scroll bar.
13205
13206 * window.c (window_scroll_pixel_based): Likewise.
13207
13208 2012-04-27 Chong Yidong <cyd@gnu.org>
13209
13210 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13211
13212 2012-04-27 Glenn Morris <rgm@gnu.org>
13213
13214 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13215 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13216
13217 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13218
13219 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13220 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13221
13222 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13223
13224 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13225 display element, check also the underlying string or buffer
13226 character. (Bug#11341)
13227
13228 * w32menu.c: Include w32heap.h.
13229 (add_menu_item): If the call to AppendMenuW (via
13230 unicode_append_menu) fails, disable Unicode menus only if we are
13231 running on Windows 9X/Me.
13232
13233 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13234
13235 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13236 (xgetint): Add missing shift for LSB tags.
13237
13238 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13239
13240 * keyboard.c (read_char): Don't wipe echo area for select window
13241 events: These might get delayed via `mouse-autoselect-window'
13242 (Bug#11304).
13243
13244 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
13245
13246 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13247 manipulation of :loaded-from data.
13248
13249 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
13250
13251 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13252 now a cons (bug#11311).
13253
13254 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13255
13256 Do not create empty overlays with the evaporate property (Bug#9642).
13257 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13258 if it becomes empty after its bounds are adjusted to fit within
13259 its buffer. Without this fix, in a nonempty buffer (let ((o
13260 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13261 yields an empty overlay that has the evaporate property, which is
13262 not supposed to happen.
13263
13264 Fix minor GTK3 problems found by static checking.
13265 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13266 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13267 (struct _EmacsFixedClass, emacs_fixed_get_type):
13268 Move decls here from emacsgtkfixed.h, since they needn't be public.
13269 (emacs_fixed_get_type): Now static.
13270 (emacs_fixed_class_init): Omit unused local.
13271 (emacs_fixed_child_type): Remove; unused.
13272 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13273 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13274 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13275 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13276 (EMACS_FIXED_GET_CLASS): Remove; unused.
13277 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13278
13279 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13280 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13281
13282 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13283
13284 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13285 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13286 (__malloc_size_t, __malloc_ptrdiff_t):
13287 Remove. All uses removed, replaced by the definiens if needed,
13288 since we can assume C89 or better now.
13289 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13290 (protect_malloc_state, align, get_contiguous_space)
13291 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13292 (malloc_atfork_handler_child, malloc_enable_thread)
13293 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13294 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13295 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13296 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13297 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13298 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13299 Define using prototypes, not old style.
13300 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13301 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13302 (align): Don't assume that signed integer overflow wraps around.
13303 Omit unused local var.
13304 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13305 (_free_internal_nolock, memalign, mallochook, reallochook):
13306 Omit no-longer-needed casts.
13307 (valloc): Use getpagesize, not __getpagesize.
13308 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13309 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13310
13311 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13312
13313 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13314
13315 Move functions from C to Lisp. Make non-blocking method calls
13316 the default. Implement further D-Bus standard interfaces.
13317
13318 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13319 (QCdbus_request_name_allow_replacement)
13320 (QCdbus_request_name_replace_existing)
13321 (QCdbus_request_name_do_not_queue)
13322 (QCdbus_request_name_reply_primary_owner)
13323 (QCdbus_request_name_reply_in_queue)
13324 (QCdbus_request_name_reply_exists)
13325 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13326 (QCdbus_registered_serial, QCdbus_registered_method)
13327 (QCdbus_registered_signal): New Lisp objects.
13328 (XD_DEBUG_MESSAGE): Use sizeof.
13329 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13330 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13331 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13332 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13333 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13334 (xd_signature, xd_append_arg): Allow float for integer types.
13335 (xd_get_connection_references): New function.
13336 (xd_get_connection_address): Rename from xd_initialize.
13337 Return cached address.
13338 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13339 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13340 level.
13341 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13342 Return number of refcounts.
13343 (Fdbus_get_unique_name): Make stronger parameter check.
13344 (Fdbus_message_internal): New defun.
13345 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13346 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13347 (Fdbus_send_signal, Fdbus_register_service)
13348 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13349 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13350 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13351 (Vdbus_compiled_version, Vdbus_runtime_version)
13352 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13353 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13354 (Vdbus_message_type_signal): New defvars.
13355 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13356 Adapt docstring.
13357
13358 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13359
13360 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13361 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13362 Do not assume ptrdiff_t is the same width as 'int'.
13363
13364 * alloc.c: Handle unusual debugging option combinations.
13365 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13366 since the two debugging options are incompatible.
13367 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13368 is defined.
13369 (mem_init, mem_insert, mem_insert_fixup):
13370 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13371 (NEED_MEM_INSERT): Remove; no longer needed.
13372
13373 2012-04-22 Leo Liu <sdl.web@gmail.com>
13374
13375 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13376
13377 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13378
13379 * sysdep.c [__FreeBSD__]: Minor cleanups.
13380 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13381 Use Emacs indenting style more consistently. Avoid some casts.
13382 Use 'double' consistently rather than mixing 'float' and 'double'.
13383
13384 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13385
13386 * sysdep.c (list_system_processes, system_process_attributes):
13387 Add implementation for FreeBSD (Bug#5243).
13388
13389 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13390
13391 * lisp.mk (lisp): Update.
13392
13393 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13394
13395 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13396 It is never used otherwise.
13397
13398 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13399
13400 * print.c (print_preprocess): Only check print_depth if print-circle
13401 is nil.
13402 (print_object): Check for cycles even when print-circle is nil and
13403 print-gensym is t, but only check print_depth if print-circle is nil.
13404
13405 2012-04-20 Chong Yidong <cyd@gnu.org>
13406
13407 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13408 set the status to "failed" and ensure that sentinel is run.
13409
13410 2012-04-20 Glenn Morris <rgm@gnu.org>
13411
13412 * process.c (Fset_process_inherit_coding_system_flag)
13413 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13414 (Fmake_network_process, Fmake_serial_process): Doc fix.
13415
13416 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13417
13418 * xdisp.c (string_buffer_position_lim): Limit starting position to
13419 BEGV.
13420 (set_cursor_from_row): If called for a mode-line or header-line
13421 row, return zero immediately.
13422 (try_cursor_movement): If inside continuation line, don't back up
13423 farther than the first row after the header line, if any.
13424 Don't consider the header-line row as "partially visible", even if
13425 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13426
13427 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13428
13429 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13430 (bug#11238).
13431
13432 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13433 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13434
13435 configure: new option --enable-gcc-warnings (Bug#11207)
13436 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13437 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13438 (ALL_CFLAGS): Use new macros rather than old.
13439 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13440 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13441 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13442 -Wunused-result, -Wunused-variable. This should go away once
13443 the Emacs and Gnulib regex code is merged.
13444 (xmalloc, xrealloc): Now static.
13445
13446 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13447
13448 * dired.c (Fsystem_groups): Remove unused local.
13449
13450 2012-04-17 Glenn Morris <rgm@gnu.org>
13451
13452 * dired.c (Fsystem_users): Doc fix.
13453
13454 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13455
13456 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13457 (syms_of_dired): Add them.
13458
13459 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13460
13461 Fix minor alloc.c problems found by static checking.
13462 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13463 New extern decls, to avoid calling undeclared functions.
13464 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13465 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13466 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13467 (NEED_MEM_INSERT): New macro.
13468 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13469 Remove one incorrect comment and fix another.
13470
13471 Fix minor ralloc.c problems found by static checking.
13472 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13473 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13474 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13475 (r_alloc_sbrk): Now static.
13476
13477 Improve ralloc.c interface checking.
13478 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13479 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13480 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13481 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13482 [REL_ALLOC]: ... to here, to check interface.
13483 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13484 Remove decls. This fixes an "It stinks!".
13485
13486 * alloc.c (which_symbols): Fix alignment issue / type clash.
13487
13488 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13489
13490 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13491 (struct Lisp_Misc_Any): Likewise.
13492 (struct Lisp_Free): Likewise.
13493 * alloc.c (union aligned_Lisp_Symbol): Define.
13494 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13495 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13496 (union aligned_Lisp_Misc): Define.
13497 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13498 aligned_Lisp_Misc instead of union Lisp_Misc.
13499 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13500
13501 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13502
13503 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13504 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13505 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13506 * s/netbsd.h, s/sol2-6.h:
13507 Remove definition of GC_MARK_STACK, since the default now works.
13508 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13509 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13510 no longer the default.
13511 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13512
13513 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13514
13515 * lread.c (lisp_file_lexically_bound_p):
13516 Fix hang at ";-*-\n" (bug#11238).
13517
13518 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13519
13520 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13521 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13522
13523 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13524
13525 * nsterm.m (constrainFrameRect): Always constrain when there is only
13526 one screen (Bug#10962).
13527
13528 2012-04-13 Ken Brown <kbrown@cornell.edu>
13529
13530 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13531
13532 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13533
13534 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13535
13536 2012-04-11 Daniel Colascione <dancol@dancol.org>
13537
13538 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13539 against is gone. It's better to use vfork now so that when Cygwin
13540 gains a new, working vfork, we use it automatically (bug#10398).
13541
13542 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13543
13544 * window.c (save_window_save): Obey window-point-insertion-type.
13545
13546 2012-04-11 Glenn Morris <rgm@gnu.org>
13547
13548 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13549
13550 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13551
13552 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13553
13554 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
13555
13556 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13557 (force_quit_count): New var.
13558 (handle_interrupt): Use it.
13559
13560 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
13561
13562 * w32.c (w32_delayed_load): Record the full path of the library
13563 being loaded (bug#10424).
13564
13565 2012-04-09 Glenn Morris <rgm@gnu.org>
13566
13567 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13568 not just in the obarray, before snarfing them. (Bug#11036)
13569
13570 * Makefile.in ($(leimdir)/leim-list.el):
13571 Pass EMACS rather than BUILT_EMACS.
13572
13573 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13574
13575 * process.c (make_process):
13576 * process.h: Add integer `gnutls_handshakes_tried' member to
13577 process struct.
13578
13579 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13580 Add convenience `GNUTLS_LOG2i' macro.
13581
13582 * gnutls.c (gnutls_log_function2i): Convenience log function.
13583 (emacs_gnutls_read): Use new log functions,
13584 `gnutls_handshakes_tried' process member, and
13585 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13586 attempts per process (connection).
13587
13588 2012-04-09 Chong Yidong <cyd@gnu.org>
13589
13590 * eval.c (Fuser_variable_p, user_variable_p_eh)
13591 (lisp_indirect_variable): Functions deleted.
13592 (Fdefvar): Caller changed.
13593
13594 * callint.c (Finteractive, Fcall_interactively):
13595 * minibuf.c (Fread_variable): Callers changed.
13596
13597 2012-04-09 Eli Zaretskii <eliz@gnu.org>
13598
13599 * xdisp.c (set_cursor_from_row): If the display string appears in
13600 the buffer at position that is closer to point than the position
13601 after the display string, display the cursor on the first glyph of
13602 the display string. Fixes cursor display when a 'display' text
13603 property immediately follows invisible text. (Bug#11094)
13604
13605 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13606
13607 composite.c: use 'double' consistently
13608 * composite.c (get_composition_id): Use 'double' consistently
13609 instead of converting 'float' to 'double' and vice versa; this is
13610 easier to understand and avoids a GCC warning.
13611
13612 2012-04-09 Glenn Morris <rgm@gnu.org>
13613
13614 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13615 preparation for dumping it with emacs. (Bug#4789)
13616 (leimdir): New variable.
13617 ($(leimdir)/leim-list.el): New rule.
13618 (emacs$(EXEEXT)): Depend on leim-list.el.
13619
13620 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13621 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13622 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13623
13624 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13625
13626 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13627 proper alignment.
13628
13629 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
13630
13631 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13632 Remove unused local variable.
13633
13634 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13635
13636 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13637 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13638 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13639 objects, as mark_maybe_pointer will catch them otherwise.
13640 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13641 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13642
13643 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13644
13645 Fix typo that broke non-Windows builds.
13646 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13647
13648 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13649
13650 Support building on MS-Windows with libxml2.
13651
13652 * makefile.w32-in (OBJ2): Add xml.$(O).
13653 (GLOBAL_SOURCES): Add xml.c.
13654 ($(BLD)/xml.$(O)): New dependency list.
13655
13656 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13657 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13658 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13659 [!WINDOWSNT]: New macros.
13660 (init_libxml2_functions, libxml2_loaded_p): New functions.
13661 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13662 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13663 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13664 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13665 linked in).
13666 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13667 Call init_libxml2_functions before calling libxml2 functions.
13668 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13669
13670 * emacs.c: Don't include libxml/parser.h.
13671 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13672 xmlCleanupParser directly.
13673
13674 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13675
13676 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13677
13678 * indent.c (Fvertical_motion): If there is a display string at
13679 point, use it.vpos to compute how many lines to backtrack after
13680 move_it_to point. (Bug#11133)
13681
13682 2012-04-06 Eli Zaretskii <eliz@gnu.org>
13683
13684 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13685 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13686 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13687 macros related to unification of CJK characters. For the details,
13688 see the discussion following the message here:
13689 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13690
13691 2012-04-04 Chong Yidong <cyd@gnu.org>
13692
13693 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13694
13695 2012-04-01 Eli Zaretskii <eliz@gnu.org>
13696
13697 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13698 instead of alloca. (Bug#11138)
13699
13700 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13701
13702 * w32menu.c (is_simple_dialog): Properly check lisp types.
13703 (Bug#11141)
13704
13705 2012-03-31 Eli Zaretskii <eliz@gnu.org>
13706
13707 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13708 position we get to after a call to move_it_to fails the
13709 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13710 only if we wind up in a string from display property. (Bug#11063)
13711
13712 * window.c (Fdelete_other_windows_internal): Invalidate the row
13713 and column information about mouse highlight, so that redisplay
13714 restores it after reallocating the glyph matrices. (Bug#7464)
13715
13716 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13717 string comes from a `display' text property, use the buffer
13718 position of that property as if we actually saw that position in
13719 the row's glyphs.
13720 (move_it_by_lines): Remove the assertion that
13721 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13722 violated when there's a before-string at the beginning of a line.
13723 (Bug#11063)
13724
13725 2012-03-30 Eli Zaretskii <eliz@gnu.org>
13726
13727 * xdisp.c (append_space_for_newline): If the default face was
13728 remapped, use the remapped face for the appended newline.
13729 (extend_face_to_end_of_line): Use the remapped default face for
13730 extending the face to the end of the line.
13731 (display_line): Call extend_face_to_end_of_line when the default
13732 face was remapped. (Bug#11068)
13733
13734 2012-03-29 Eli Zaretskii <eliz@gnu.org>
13735
13736 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13737
13738 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13739
13740 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13741
13742 2012-03-27 Glenn Morris <rgm@gnu.org>
13743
13744 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13745 Doc fixes.
13746
13747 2012-03-26 Kenichi Handa <handa@m17n.org>
13748
13749 * dispextern.h (struct glyph): Fix previous change. Change the
13750 bit length of glyphless.ch to 25 (Bug#11082).
13751
13752 2012-03-26 Chong Yidong <cyd@gnu.org>
13753
13754 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13755 (command_loop_1): Use it; inhibit selection update for
13756 handle-select-window too (Bug#8996).
13757
13758 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13759
13760 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13761
13762 2012-03-25 Kenichi Handa <handa@m17n.org>
13763
13764 * dispextern.h (struct glyph): Change the bit length of
13765 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13766
13767 2012-03-24 Eli Zaretskii <eliz@gnu.org>
13768
13769 * s/ms-w32.h (tzname): Include time.h before redirecting to
13770 _tzname. Fixes the MSVC build. (Bug#9960)
13771
13772 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13773
13774 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13775 characters.
13776
13777 * xterm.c (XTread_socket): Only modify handling_signal if
13778 !SYNC_INPUT. (Bug#11080)
13779
13780 2012-03-23 Eli Zaretskii <eliz@gnu.org>
13781
13782 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13783 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13784 when fetching a multibyte character consumes more bytes than
13785 CHAR_BYTES returns, due to unification of CJK characters in
13786 string_char. (Bug#11073)
13787
13788 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13789
13790 * process.c (wait_reading_process_output): Handle pty disconnect
13791 by refraining from sending oneself a SIGCHLD (bug#10933).
13792
13793 2012-03-22 Chong Yidong <cyd@gnu.org>
13794
13795 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13796
13797 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13798 Mark string as coming from a prefix property.
13799 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13800 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13801
13802 2012-03-21 Chong Yidong <cyd@gnu.org>
13803
13804 * xfaces.c (Vface_remapping_alist): Doc fix.
13805
13806 2012-03-20 Eli Zaretskii <eliz@gnu.org>
13807
13808 * w32proc.c (Fw32_set_console_codepage)
13809 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13810 Doc fixes.
13811
13812 2012-03-20 Chong Yidong <cyd@gnu.org>
13813
13814 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13815 to reflect default non-nil value of redisplay-dont-pause.
13816
13817 2012-03-19 Kenichi Handa <handa@m17n.org>
13818
13819 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13820 it fit in a valid range (Bug#11003).
13821
13822 2012-03-18 Eli Zaretskii <eliz@gnu.org>
13823
13824 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13825 that is not from display property, accept the row as a "cursor
13826 row" if one of the string's character has a non-nil `cursor'
13827 property. Fixes cursor positioning when there are newlines in
13828 overlay strings, e.g. in icomplete.el. (Bug#11035)
13829
13830 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13831
13832 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13833
13834 2012-03-12 Chong Yidong <cyd@gnu.org>
13835
13836 * eval.c (inhibit_lisp_code): Rename from
13837 inhibit_window_configuration_change_hook; move from window.c.
13838
13839 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13840 * window.c (run_window_configuration_change_hook)
13841 (syms_of_window): Callers changed.
13842
13843 2012-03-11 Chong Yidong <cyd@gnu.org>
13844
13845 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13846
13847 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13848
13849 2012-03-10 Chong Yidong <cyd@gnu.org>
13850
13851 * frame.c (other_visible_frames): Don't assume the selected frame
13852 is visible (Bug#10955).
13853
13854 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13855
13856 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13857
13858 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13859
13860 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13861 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13862 zero (Bug#10954).
13863
13864 2012-03-03 Glenn Morris <rgm@gnu.org>
13865
13866 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13867
13868 2012-03-02 Eli Zaretskii <eliz@gnu.org>
13869
13870 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13871 position past the first glyph_row that ends at ZV. (Bug#10902)
13872 (redisplay_window, next_element_from_string): Fix typos in
13873 comments.
13874 (redisplay_window): Pass to move_it_vertically the margin in
13875 pixels, not in screen lines.
13876
13877 2012-03-02 Glenn Morris <rgm@gnu.org>
13878
13879 * buffer.c (buffer-list-update-hook): Doc fix.
13880
13881 2012-02-29 Eli Zaretskii <eliz@gnu.org>
13882
13883 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13884 push_it before setting up the iterator for the first overlay
13885 string, even if we have an empty string loaded.
13886 (next_overlay_string): If there's an empty string on the iterator
13887 stack, pop the stack. (Bug#10903)
13888
13889 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13890
13891 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13892 Suggested by Stefan Monnier in
13893 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13894 * alloc.c (widen_to_Lisp_Object): New static function.
13895 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13896 and widening them to Lisp_Objects. This would work even if
13897 USE_LSB_TAG is defined and wide integers are used, which might
13898 happen in a future version of Emacs.
13899
13900 2012-02-25 Chong Yidong <cyd@gnu.org>
13901
13902 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13903 Doc fix.
13904
13905 * xselect.c (Fx_selection_exists_p): Doc fix.
13906 (x_clipboard_manager_save_all): Print an informative message
13907 before saving to clipboard manager.
13908
13909 2012-02-24 Chong Yidong <cyd@gnu.org>
13910
13911 * keyboard.c (process_special_events): Handle all X selection
13912 requests in kbd_buffer, not just the next one (Bug#8869).
13913
13914 2012-02-23 Chong Yidong <cyd@gnu.org>
13915
13916 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13917 call when setting menu-bar-lines and tool-bar-lines parameters.
13918 (unwind_create_frame_1): New helper function.
13919
13920 * window.c (inhibit_window_configuration_change_hook): New var.
13921 (run_window_configuration_change_hook): Obey it.
13922 (syms_of_window): Initialize it.
13923
13924 2012-02-22 Chong Yidong <cyd@gnu.org>
13925
13926 * xterm.c (x_draw_image_relief): Add missing type check for
13927 Vtool_bar_button_margin (Bug#10743).
13928
13929 2012-02-21 Chong Yidong <cyd@gnu.org>
13930
13931 * fileio.c (Vfile_name_handler_alist): Doc fix.
13932
13933 * buffer.c (Fget_file_buffer): Protect against invalid file
13934 handler return value.
13935
13936 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13937
13938 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13939 when computing $valmask.
13940
13941 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13942 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13943 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13944 It's useless in that case, and it can cause problems on hosts
13945 that allocate halves of EMACS_INT values separately.
13946 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13947 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13948 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13949 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13950 it avoids undefined behavior on hosts where shifting right by more
13951 than the word width has undefined behavior.
13952
13953 2012-02-19 Chong Yidong <cyd@gnu.org>
13954
13955 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13956 (Funhandled_file_name_directory, Ffile_name_as_directory)
13957 (Fdirectory_file_name, Fexpand_file_name)
13958 (Fsubstitute_in_file_name): Protect against invalid file handler
13959 return values (Bug#10845).
13960
13961 2012-02-18 Eli Zaretskii <eliz@gnu.org>
13962
13963 * .gdbinit (pitx): Fix incorrect references to fields of the
13964 iterator stack.
13965
13966 2012-02-17 Chong Yidong <cyd@gnu.org>
13967
13968 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13969
13970 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13971
13972 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13973 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13974
13975 2012-02-15 Chong Yidong <cyd@gnu.org>
13976
13977 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13978 marked as special. Also, starting docstrings with * is obsolete.
13979
13980 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13981
13982 * gnutls.c (emacs_gnutls_write): Fix last change.
13983
13984 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13985
13986 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13987 send_process.
13988
13989 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13990
13991 * keymap.c (Fsingle_key_description): Handle char ranges.
13992
13993 2012-02-12 Chong Yidong <cyd@gnu.org>
13994
13995 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13996 as that creates a dangerous corner case.
13997
13998 * window.c (Fdelete_window_internal): Invalidate the mouse
13999 highlight (Bug#9904).
14000
14001 2012-02-12 Glenn Morris <rgm@gnu.org>
14002
14003 * xselect.c (Fx_own_selection_internal)
14004 (Fx_get_selection_internal, Fx_disown_selection_internal)
14005 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14006 * nsselect.m (Fx_own_selection_internal)
14007 (Fx_disown_selection_internal, Fx_selection_exists_p)
14008 (Fx_selection_owner_p, Fx_get_selection_internal):
14009 Sync docs and argument specs with the xselect.c versions.
14010
14011 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14012
14013 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14014
14015 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14016
14017 * w32select.c (Fx_selection_exists_p): Sync doc string and
14018 argument list with xselect.c. (Bug#10783)
14019
14020 * w16select.c (Fx_selection_exists_p): Sync doc string and
14021 argument list with xselect.c. (Bug#10783)
14022
14023 2012-02-10 Glenn Morris <rgm@gnu.org>
14024
14025 * fns.c (Fsecure_hash): Doc fix.
14026
14027 2012-02-09 Kenichi Handa <handa@m17n.org>
14028
14029 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14030
14031 2012-02-07 Chong Yidong <cyd@gnu.org>
14032
14033 * buffer.c (Fbuffer_local_variables)
14034 (buffer_lisp_local_variables): Handle unbound vars correctly;
14035 don't let Qunbound leak into Lisp.
14036
14037 2012-02-07 Glenn Morris <rgm@gnu.org>
14038
14039 * image.c (Fimagemagick_types): Doc fix.
14040
14041 * image.c (imagemagick-render-type): Change it from a lisp object
14042 to an integer. Move the doc here from the lisp manual.
14043 Treat all values not equal to 0 the same.
14044
14045 2012-02-06 Chong Yidong <cyd@gnu.org>
14046
14047 * doc.c (store_function_docstring): Avoid applying docstring of
14048 alias to base function (Bug#2603).
14049
14050 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14051
14052 * .gdbinit (pp1, pv1): Remove redundant defines.
14053 (pr): Use pp.
14054
14055 2012-02-04 Chong Yidong <cyd@gnu.org>
14056
14057 * nsterm.m: Declare a global (Bug#10694).
14058
14059 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14060
14061 * w32.c (get_emacs_configuration_options):
14062 Include --enable-checking, if specified, in the return value.
14063
14064 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14065
14066 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14067 after rounding frame sizes. (Bug#9723)
14068
14069 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14070
14071 * keyboard.c (adjust_point_for_property): Don't position point
14072 before BEGV. (Bug#10696)
14073
14074 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14075
14076 Handle overflow when computing char display width (Bug#9496).
14077 * character.c (char_width): Return EMACS_INT, not int.
14078 (char_width, c_string_width): Check for overflow when
14079 computing the width; this is possible now that individual
14080 characters can have unbounded width. Problem introduced
14081 by merge from Emacs 23 on 2012-01-19.
14082
14083 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14084
14085 * dbusbind.c (Fdbus_register_method): Mention the return value
14086 :ignore in the docstring.
14087
14088 2012-02-02 Glenn Morris <rgm@gnu.org>
14089
14090 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14091
14092 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14093 Unconditionally set to t. (Bug#10673)
14094 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14095 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14096 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14097
14098 2012-02-02 Kenichi Handa <handa@m17n.org>
14099
14100 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14101 0, do not call append_composite_glyph.
14102
14103 2012-02-02 Kenichi Handa <handa@m17n.org>
14104
14105 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14106 NULL (Bug#6988).
14107 (x_produce_glyphs): If the component of a composition is a null
14108 string, set it->pixel_width to 1 to avoid zero-width glyph.
14109
14110 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14111
14112 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14113 first 2 arguments are identical. This makes inserting large
14114 output from a subprocess an order of magnitude faster on
14115 MS-Windows, where all sbrk'ed memory is always contiguous.
14116
14117 2012-01-31 Glenn Morris <rgm@gnu.org>
14118
14119 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14120 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14121 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14122
14123 2012-01-29 Glenn Morris <rgm@gnu.org>
14124
14125 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14126
14127 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14128
14129 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14130
14131 2012-01-28 Chong Yidong <cyd@gnu.org>
14132
14133 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14134
14135 2012-01-26 Chong Yidong <cyd@gnu.org>
14136
14137 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14138
14139 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14140 repeat counts (Bug#10507).
14141
14142 2012-01-26 Glenn Morris <rgm@gnu.org>
14143
14144 * lread.c (syms_of_lread): Doc fix.
14145
14146 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14147
14148 * coding.c (encode_designation_at_bol): Change return value to
14149 EMACS_INT.
14150
14151 2012-01-25 Chong Yidong <cyd@gnu.org>
14152
14153 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14154
14155 2012-01-21 Chong Yidong <cyd@gnu.org>
14156
14157 * floatfns.c (Fcopysign): Make the second argument non-optional,
14158 since nil is not allowed anyway.
14159
14160 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14161
14162 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14163 (send_process): Likewise.
14164
14165 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14166
14167 * window.c (save_window_save, Fcurrent_window_configuration)
14168 (Vwindow_persistent_parameters): Do not use Qstate.
14169 Rewrite doc-strings.
14170
14171 2012-01-19 Kenichi Handa <handa@m17n.org>
14172
14173 * character.c (char_width): New function.
14174 (Fchar_width, c_string_width, lisp_string_width):
14175 Use char_width (Bug#9496).
14176
14177 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14178
14179 * window.c (Vwindow_persistent_parameters): New variable.
14180 (Fset_window_configuration, save_window_save): Handle persistent
14181 window parameters.
14182
14183 2012-01-14 Eli Zaretskii <eliz@gnu.org>
14184
14185 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14186 thrashing the stack of the thread. (Bug#9087)
14187
14188 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14189
14190 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14191
14192 2012-01-11 Eli Zaretskii <eliz@gnu.org>
14193
14194 * xdisp.c (rows_from_pos_range): Handle the case where the
14195 highlight ends on a newline. (Bug#10464)
14196 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14197 he end column for display of highlight that ends on a newline
14198 before a R2L line.
14199
14200 2012-01-11 Glenn Morris <rgm@gnu.org>
14201
14202 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14203 from load-path also when installation-directory is nil. (Bug#10208)
14204
14205 2012-01-10 Glenn Morris <rgm@gnu.org>
14206
14207 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14208
14209 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14210 Update template values to be closer to their typical values these days.
14211
14212 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14213
14214 * xdisp.c (rows_from_pos_range): Accept additional argument
14215 DISP_STRING, and accept any glyph in a row whose object is that
14216 string as eligible for mouse highlight. Fixes mouse highlight of
14217 display strings from overlays. (Bug#10464)
14218
14219 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14220
14221 emacs: fix an auto-save permissions race condition (Bug#10400)
14222 * fileio.c (auto_saving_dir_umask): New static var.
14223 (Fmake_directory_internal): Use it.
14224 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14225 creating the directory. The old code temporarily assigns
14226 too-generous permissions to the directory.
14227 (do_auto_save_eh): Clear it.
14228 (Fdo_auto_save): Catch all errors, not just file errors, so
14229 that the var is always cleared.
14230
14231 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14232
14233 * search.c (scan_buffer): Pass character positions to
14234 know_region_cache, not byte positions. (Bug#6540)
14235
14236 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14237
14238 * w32.c (sys_rename): Report EXDEV when rename of a directory
14239 fails because the target is on another logical disk. (Bug#10284)
14240
14241 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14242
14243 * xterm.c (x_embed_request_focus): New function.
14244
14245 * xterm.h: Add prototype.
14246
14247 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14248
14249 2012-01-05 Glenn Morris <rgm@gnu.org>
14250
14251 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14252
14253 2012-01-01 Eli Zaretskii <eliz@gnu.org>
14254
14255 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14256 Load gnutls_transport_set_lowat only if GnuTLS version is below
14257 2.11.1.
14258 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14259 GnuTLS versions below 2.11.1.
14260
14261 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14262
14263 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14264 to the doc string advising against its use for altering the way
14265 windows are scrolled.
14266
14267 2011-12-28 Kenichi Handa <handa@m17n.org>
14268
14269 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14270 coding-system ASCII compatible only when it does not produce BOM
14271 on encoding (Bug#10383).
14272
14273 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14274
14275 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14276 can scroll.
14277 (create_and_show_popup_menu): Always use menu_position_func for
14278 Gtk3 (Bug#10361).
14279
14280 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14281
14282 * callint.c (Fcall_interactively): Don't truncate prompt string.
14283
14284 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14285
14286 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14287 property that ends at ZV, so that the bidi iteration could be
14288 resumed from there (after widening). (Bug#10360)
14289
14290 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14291
14292 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14293
14294 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14295
14296 * nsterm.m (x_free_frame_resources):
14297 Release f->output_data.ns->miniimage.
14298 (ns_index_color): Fix indentation. Do not retain
14299 color_table->colors[i].
14300
14301 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14302 before returning.
14303
14304 * nsfns.m (x_set_background_color): Assign return value from
14305 ns_index_color to face-background instead of NSColor*.
14306 (ns_implicitly_set_icon_type): Fix indentation.
14307 Change assignment in for loop to comparison.
14308
14309 * emacs.c (ns_pool): New variable.
14310 (main): Assign ns_pool.
14311 (Fkill_emacs): Call ns_release_autorelease_pool.
14312
14313 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14314 autorelease fdesc, release fdAttrs and tdict.
14315 (ns_get_covering_families): Release charset.
14316 (ns_findfonts): Release NSFontDescriptor created with new.
14317 (ns_uni_to_glyphs): Fix indentation.
14318 (setString): Release attrStr before assigning new value.
14319
14320 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14321
14322 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14323 and NS_IMPL_COCOA.
14324 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14325 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14326
14327 2011-12-18 David Reitter <reitter@cmu.edu>
14328
14329 * nsterm.m (ns_term_init): Subscribe for notifications
14330 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14331 to method trackingNotification in EmacsMenu.
14332
14333 * nsmenu.m (trackingMenu): New variable.
14334 (trackingNotification): New method (from Aquamacs).
14335 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14336 from Aquamacs (Bug#7030).
14337
14338 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14339
14340 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14341 (symbol_to_nsstring): Fix indentation.
14342 (ns_symbol_to_pb): New function.
14343 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14344 (Fns_rotate_cut_buffers_internal): Remove.
14345 (Fns_store_selection_internal): Rename from
14346 Fns_store_cut_buffer_internal.
14347 (ns_get_foreign_selection, Fx_own_selection_internal)
14348 (Fx_disown_selection_internal, Fx_selection_exists_p)
14349 (Fns_get_selection_internal, Fns_store_selection_internal):
14350 Use ns_symbol_to_pb and check if return value is nil.
14351 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14352 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14353 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14354 renamed to Sns_store_selection_internal.
14355 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14356 and remove this function.
14357 (ns_handle_selection_clear): Remove, never used.
14358 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14359 here.
14360
14361 2011-12-17 Ken Brown <kbrown@cornell.edu>
14362
14363 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14364 GID is unknown (Bug#10257).
14365
14366 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14367
14368 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14369 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14370 which caused a build failure on GNU/Linux IA-64. This problem was
14371 introduced by my 2011-10-07 patch.
14372
14373 2011-12-15 Juri Linkov <juri@jurta.org>
14374
14375 * image.c (imagemagick_error): New function. (Bug#10112)
14376 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14377 Use `imagemagick_error' where ImageMagick functions return
14378 `MagickFalse'.
14379 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14380 proper order.
14381
14382 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14383
14384 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14385 fill background (Bug#8992).
14386
14387 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14388
14389 * window.c (Vwindow_combination_resize)
14390 (Vwindow_combination_limit): Use t instead of non-nil in
14391 doc-strings.
14392 (Vrecenter_redisplay): Add first sentence of doc-string on
14393 separate line.
14394 (Frecenter): Fix doc-string typo.
14395
14396 2011-12-11 Kenichi Handa <handa@m17n.org>
14397
14398 * coding.c (Funencodable_char_position): Pay attention to the
14399 buffer text relocation (Bug#9389).
14400
14401 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14402
14403 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14404 gtk_init (Bug#10100).
14405
14406 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14407
14408 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14409 IT->string is nil. (Bug#10263)
14410
14411 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14412
14413 * nsterm.h (x_free_frame_resources): Declare.
14414
14415 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14416 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14417
14418 * nsterm.h (ns_get_defaults_value): Declare.
14419
14420 * nsterm.m (ns_default): Call ns_get_defaults_value.
14421
14422 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14423
14424 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14425 (Bug#10170)
14426
14427 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14428
14429 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14430 that where the value of an _OBJC_* symbol points to is in the .bss
14431 section (Bug#10240).
14432
14433 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14434
14435 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14436 after the loop to call ccl_driver at least once (Bug#8619).
14437
14438 2011-12-08 Kenichi Handa <handa@m17n.org>
14439
14440 * ftfont.c (get_adstyle_property): Fix previous change
14441 (Bug#10233).
14442
14443 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14444
14445 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14446 dirs from the default value of EMACSLOADPATH (bug#10208).
14447
14448 2011-12-07 Glenn Morris <rgm@gnu.org>
14449
14450 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14451 installation and source directories as well. (Bug#10208)
14452
14453 2011-12-06 Chong Yidong <cyd@gnu.org>
14454
14455 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14456
14457 2011-12-06 Glenn Morris <rgm@gnu.org>
14458
14459 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14460 as an error, not just -1. (Bug#10217)
14461
14462 2011-12-05 Chong Yidong <cyd@gnu.org>
14463
14464 * keyboard.c (process_special_events): New function.
14465 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14466
14467 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14468
14469 * coding.c (encode_designation_at_bol): Don't use uninitialized
14470 local variable (Bug#9318).
14471
14472 2011-12-05 Kenichi Handa <handa@m17n.org>
14473
14474 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14475 return Qnil (Bug#8046, Bug#10193).
14476
14477 2011-12-05 Kenichi Handa <handa@m17n.org>
14478
14479 * coding.c (encode_designation_at_bol): New args charbuf_end and
14480 dst. Return the number of produced bytes. Callers changed.
14481 (coding_set_source): Return how many bytes coding->source was
14482 relocated.
14483 (coding_set_destination): Return how many bytes
14484 coding->destination was relocated.
14485 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14486 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14487
14488 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14489
14490 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14491 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14492 macro (Bug#9318).
14493
14494 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14495
14496 The following changes are to fix Bug#9318.
14497
14498 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14499 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14500 (encode_coding_iso_2022, encode_coding_sjis)
14501 (encode_coding_big5, encode_coding_charset): Use the above macros.
14502
14503 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14504
14505 * lisp.h (process_quit_flag): Fix external declaration.
14506
14507 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14508
14509 Don't macro-inline non-performance-critical code.
14510 * eval.c (process_quit_flag): New function.
14511 * lisp.h (QUIT): Use it.
14512
14513 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14514
14515 * nsfns.m (get_geometry_from_preferences): New function.
14516 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14517
14518 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14519
14520 * emacs.c (Qkill_emacs): Define.
14521 (syms_of_emacs): Initialize it.
14522 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14523 Qquit_flag to `kill-emacs' instead.
14524 (quit_throw_to_read_char): Add parameter `from_signal'.
14525 All callers changed. Call Fkill_emacs if requested and safe.
14526 * lisp.h (QUIT): Call Fkill_emacs if requested.
14527
14528 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14529
14530 * widget.c (update_wm_hints): Return if wmshell is null.
14531 (widget_update_wm_size_hints): New function.
14532
14533 * widget.h (widget_update_wm_size_hints): Declare.
14534
14535 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14536 widget_update_wm_size_hints (Bug#10104).
14537
14538 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14539
14540 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14541 before a newline, prepare the bidi iterator for consuming the
14542 newline, and keep the current paragraph direction. (Bug#10183)
14543 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14544
14545 2011-12-02 Juri Linkov <juri@jurta.org>
14546
14547 * search.c (Fword_search_regexp): New Lisp function created from
14548 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14549 (Fword_search_backward, Fword_search_forward)
14550 (Fword_search_backward_lax, Fword_search_forward_lax):
14551 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14552 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14553
14554 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14555
14556 * fileio.c (Finsert_file_contents): Move after-change-function call
14557 to before the "handled:" label, since all "goto handled" appear in
14558 cases where the *-change-functions have already been properly called
14559 (bug#10117).
14560
14561 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14562
14563 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14564 waiting for input. (Bug#10169)
14565
14566 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14567
14568 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14569 verifies glyph row's hash code--we have just reallocated the
14570 glyphs, so their contents can be complete garbage. (Bug#10164)
14571
14572 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
14573
14574 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14575
14576 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14577
14578 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14579 attributes are tested _before_ calling verify_row_hash, to protect
14580 against GCC re-ordering of the tests. (Bug#10164)
14581
14582 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14583
14584 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14585
14586 * xterm.c (handle_one_xevent): Only set async_visible and friends
14587 if net_wm_state_hidden_seen is non-zero (Bug#10002)
14588 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14589 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14590
14591 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14592
14593 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14594 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14595 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14596 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14597 All uses changed to use GCPRO1 etc.
14598 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14599 Revert to old implementation (i.e., before 2011-03-11).
14600
14601 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14602
14603 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14604 of scroll runs so as to avoid assigning disabled bogus rows and
14605 unnecessary graphics copy operations.
14606
14607 2011-11-27 Eli Zaretskii <eliz@gnu.org>
14608
14609 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14610 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14611 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14612 (malloc, free, realloc, calloc): Redirect to e_* only when
14613 compiling Emacs.
14614
14615 * lisp.h (GCTYPEBITS): Move before first use.
14616 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14617 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14618 this macro definition.
14619
14620 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14621 _MSC_VER.
14622
14623 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14624
14625 * gtkutil.c (xg_create_frame_widgets):
14626 Call gtk_window_set_has_resize_grip (FALSE) if that function is
14627 present with Gtk+ 2.0.
14628
14629 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14630
14631 * fileio.c (Finsert_file_contents): Undo previous change; see
14632 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14633
14634 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14635
14636 Rename locals to avoid shadowing.
14637 * fileio.c (Finsert_file_contents):
14638 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14639 * process.c (wait_reading_process_output):
14640 Rename inner 'proc' to 'p' to avoid shadowing.
14641 Indent for consistency with usual Emacs style.
14642
14643 2011-11-25 Eli Zaretskii <eliz@gnu.org>
14644
14645 * xdisp.c (redisplay_window): If cursor row is not fully visible
14646 after recentering, and scroll-conservatively is set to a large
14647 number, scroll window by a few more lines to make the cursor fully
14648 visible and out of scroll-margin. (Bug#10105)
14649 (start_display): Don't move to the next line if the display should
14650 start at a newline that is part of a display vector or an overlay
14651 string. (Bug#10119)
14652
14653 2011-11-24 Juri Linkov <juri@jurta.org>
14654
14655 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14656 after the `MagickPingImage' call. (Bug#10112)
14657
14658 2011-11-23 Chong Yidong <cyd@gnu.org>
14659
14660 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14661
14662 2011-11-23 Martin Rudalics <rudalics@gmx.at>
14663
14664 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14665 making another buffer current. (Bug#10114)
14666
14667 2011-11-23 Glenn Morris <rgm@gnu.org>
14668
14669 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14670
14671 2011-11-23 Chong Yidong <cyd@gnu.org>
14672
14673 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14674 using it (Bug#5984).
14675
14676 2011-11-22 Eli Zaretskii <eliz@gnu.org>
14677
14678 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14679 and header-lines, as they don't have one computed for them.
14680 (Bug#10098)
14681
14682 * .gdbinit (prow): Make displayed values more self-explaining.
14683 Add row's hash code.
14684
14685 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14686
14687 * process.c (wait_reading_process_output): Fix asynchrounous
14688 GnuTLS socket handling on some versions of the GnuTLS library.
14689 (wait_reading_process_output): Add comment and URL.
14690
14691 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14692
14693 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14694
14695 2011-11-21 Chong Yidong <cyd@gnu.org>
14696
14697 * window.c (Fnext_window, Fprevious_window): Doc fix.
14698
14699 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14700
14701 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14702
14703 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14704
14705 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14706
14707 2011-11-20 Martin Rudalics <rudalics@gmx.at>
14708
14709 * window.c (Fset_window_combination_limit): Rename argument
14710 STATUS to LIMIT.
14711 (Vwindow_combination_limit): Remove "status" from doc-string.
14712
14713 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14714
14715 * m/ibms390.h: Remove.
14716 * m/ibms390x.h: Don't include "ibms390.h".
14717
14718 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14719
14720 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14721 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14722
14723 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14724
14725 * casetab.c (Fset_case_table):
14726 * charset.c (Fcharset_after): Fix typos.
14727
14728 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
14729
14730 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14731 Otherwise, valgrind does not work on some platforms.
14732 Problem reported by Andreas Schwab in
14733 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14734 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14735 is set, removing the need for VIRT_ADDRESS_VARIES.
14736 (PURE_P): Use a more-efficient implementation that needs just one
14737 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14738 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14739 to 4 (xorl, subq, cmpq, setbe).
14740 * alloc.c (pure): Always extern now, since that's the
14741 VIRT_ADDR_VARIES behavior.
14742 (PURE_POINTER_P): Use a single comparison, not two, for
14743 consistency with the new puresize.h.
14744 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14745 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14746 Remove VIRT_ADDR_VARIES no longer needed.
14747
14748 2011-11-19 Eli Zaretskii <eliz@gnu.org>
14749
14750 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14751 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14752 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14753 behave as if the cursor position were at the window margin.
14754
14755 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14756 and the cursor position is out of bounds, behave as if the cursor
14757 position were at the window margin. (Bug#10075)
14758
14759 2011-11-18 Chong Yidong <cyd@gnu.org>
14760
14761 * window.c (Fwindow_combination_limit): Make first argument
14762 non-optional, since it is meaningless for live windows like the
14763 selected window.
14764
14765 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14766
14767 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14768
14769 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14770
14771 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14772 (graft_intervals_into_buffer): Simplify.
14773
14774 2011-11-18 Eli Zaretskii <eliz@gnu.org>
14775
14776 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14777 hash values of the two rows.
14778 (copy_row_except_pointers): Preserve the used[] arrays and the
14779 hash values of the two rows. (Bug#10035)
14780 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14781
14782 * xdisp.c (row_hash): New function, body extracted from
14783 compute_line_metrics.
14784 (compute_line_metrics): Call row_hash, instead of computing the
14785 hash code inline.
14786
14787 * dispnew.c (verify_row_hash): Call row_hash for computing the
14788 hash code of a row, instead of duplicating code from xdisp.c.
14789
14790 * dispextern.h (row_hash): Add prototype.
14791
14792 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14793
14794 * frame.c (delete_frame): Don't delete the terminal when the last
14795 X frame is closed if emacs is built with GTK toolkit.
14796
14797 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
14798
14799 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14800
14801 2011-11-17 Martin Rudalics <rudalics@gmx.at>
14802
14803 * window.c (Vwindow_splits): Rename to
14804 Vwindow_combination_resize. Suggested by Juri Linkov.
14805 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14806 of Vwindow_splits.
14807
14808 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
14809
14810 * nsfns.m (Fns_font_name):
14811 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14812
14813 2011-11-16 Martin Rudalics <rudalics@gmx.at>
14814
14815 * window.h (window): Rename slot "nest" to "combination_limit".
14816 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14817 (Fset_window_nest): Rename to Fset_window_combination_limit.
14818 (Vwindow_nest): Rename to Vwindow_combination_limit.
14819 (recombine_windows, make_parent_window, make_window)
14820 (Fsplit_window_internal, saved_window)
14821 (Fset_window_configuration, save_window_save): Rename all
14822 occurrences of window_nest to window_combination_limit.
14823
14824 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
14825
14826 * image.c (imagemagick_load_image): Fix typo.
14827
14828 2011-11-14 Eli Zaretskii <eliz@gnu.org>
14829
14830 * xdisp.c (display_line): Move the call to
14831 highlight_trailing_whitespace before the call to
14832 compute_line_metrics, since the latter needs to see the final
14833 faces of all the glyphs to compute ROW's hash value.
14834 Fixes assertion violations in row_equal_p. (Bug#10035)
14835
14836 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
14837
14838 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14839 just return (bug#10044).
14840
14841 2011-11-12 Eli Zaretskii <eliz@gnu.org>
14842
14843 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14844 with user-defined heap size. Bump the default size of the temacs
14845 heap to 27MB, to avoid memory warning when running temacs.
14846 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14847
14848 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14849 current_matrix and desired_matrix. (Bug#9990)
14850 (verify_row_hash) [XASSERTS]: New function.
14851 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14852 that the hash value of glyph rows is correct.
14853
14854 2011-11-12 Martin Rudalics <rudalics@gmx.at>
14855
14856 * window.h (window): Remove splits slot.
14857 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14858 (Fdelete_other_windows_internal, make_parent_window)
14859 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14860 (Fset_window_configuration, save_window_save): Don't deal with
14861 split status of windows.
14862 (saved_window): Remove splits slot.
14863 (Vwindow_splits): Rewrite doc-string.
14864
14865 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14866
14867 * xfns.c (unwind_create_frame):
14868 * nsfns.m (unwind_create_frame):
14869 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14870 Vframe_list (Bug#9999).
14871
14872 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14873
14874 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14875
14876 2011-11-11 Kenichi Handa <handa@m17n.org>
14877
14878 * callproc.c (Fcall_process): Set the member dst_multibyte of
14879 process_coding.
14880
14881 2011-11-11 Johan Bockgård <bojohan@gnu.org>
14882
14883 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14884 avoid a crash (bug#9496).
14885
14886 2011-11-09 Chong Yidong <cyd@gnu.org>
14887
14888 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14889 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14890
14891 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14892
14893 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14894
14895 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14896
14897 Avoid some portability problems by eschewing 'extern inline' functions.
14898 The trivial performance wins aren't worth the portability hassles; see
14899 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14900 et seq.
14901 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14902 (window_box_width, window_box_left, window_box_left_offset)
14903 (window_box_right, window_box_right_offset): Undo previous change,
14904 by removing the "extern"s.
14905 * intervals.c (adjust_intervals_for_insertion)
14906 (adjust_intervals_for_deletion): Undo previous change,
14907 making these static again.
14908 (offset_intervals, temp_set_point_both, temp_set_point)
14909 (copy_intervals_to_string): No longer inline.
14910 * xdisp.c (window_text_bottom_y, window_box_width)
14911 (window_box_height, window_box_left_offset)
14912 (window_box_right_offset, window_box_left, window_box_right)
14913 (window_box): No longer inline.
14914
14915 2011-11-08 Chong Yidong <cyd@gnu.org>
14916
14917 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14918 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14919 Signal an error if not a live window.
14920 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14921 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14922
14923 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
14924
14925 * lisp.h (syms_of_abbrev): Remove declaration.
14926 Reported by CHENG Gao <chenggao@royau.me>.
14927
14928 2011-11-07 Eli Zaretskii <eliz@gnu.org>
14929
14930 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14931 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14932 of temacs in GUI mode.
14933
14934 2011-11-07 Martin Rudalics <rudalics@gmx.at>
14935
14936 * window.h: Declare delete_all_child_windows instead of
14937 delete_all_subwindows.
14938 * window.c (Fwindow_nest, Fset_window_nest)
14939 (Fset_window_new_total, Fset_window_new_normal)
14940 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14941 (delete_all_subwindows): Rename to delete_all_child_windows.
14942 (Fdelete_other_windows_internal, Fset_window_configuration):
14943 Call delete_all_child_windows instead of delete_all_subwindows.
14944 * frame.c (delete_frame): Call delete_all_child_windows instead
14945 of delete_all_subwindows.
14946
14947 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14948
14949 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14950 This is also needed for porting to any host where GC_MARK_STACK is
14951 not GC_MAKE_GCPROS_NOOPS.
14952 (which_symbols): Use it.
14953
14954 2011-11-07 Kenichi Handa <handa@m17n.org>
14955
14956 * coding.c (coding_set_destination): Check coding->src_pos only
14957 when coding->src_object is a buffer (bug#9910).
14958
14959 * process.c (send_process): Set the member src_multibyte of coding
14960 to 0 (bug#9911) when sending a unibyte text.
14961
14962 * callproc.c (Fcall_process): Set the member src_multibyte of
14963 process_coding to 0 (bug#9912).
14964
14965 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14966
14967 * xmenu.c (cleanup_widget_value_tree): New function.
14968 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14969 calling free_menubar_widget_value_tree directly (Bug#9830).
14970
14971 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14972
14973 Fix some portability problems with 'inline'.
14974 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14975 (window_box_width, window_box_left, window_box_left_offset)
14976 (window_box_right, window_box_right_offset): Declare extern.
14977 Otherwise, these inline functions do not conform to C99 and
14978 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14979 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14980 * intervals.c (adjust_intervals_for_insertion)
14981 (adjust_intervals_for_deletion): Now extern, because otherwise the
14982 extern inline functions 'offset_intervals' couldn't refer to it.
14983 (static_offset_intervals): Remove.
14984 (offset_intervals): Rewrite using the old contents of
14985 static_offset_intervals. The old version didn't conform to C99
14986 because an extern inline function contained a reference to an
14987 identifier with static linkage.
14988
14989 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14990
14991 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14992 GC.
14993
14994 2011-11-06 Eli Zaretskii <eliz@gnu.org>
14995
14996 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14997 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14998 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14999 return Qleft_to_right.
15000
15001 2011-11-06 Chong Yidong <cyd@gnu.org>
15002
15003 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15004 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15005 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15006 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15007 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15008 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15009 (Fwindow_vscroll): Doc fix.
15010 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15011 argument, since it makes no sense to pass a live window and for
15012 consistency with window-child.
15013
15014 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15015
15016 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15017 support MSVC.
15018
15019 2011-11-05 Jason Rumney <jasonr@gnu.org>
15020
15021 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15022 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15023 fonts (Bug#6029).
15024 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15025 bitwise arithmetic preventing use of unicode-sip and non-truetype
15026 opentype fonts.
15027
15028 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15029
15030 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15031 "emacs"-only part.
15032
15033 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15034 initialization code to keep similarity to xfns.c after changes
15035 from 2011-11-05.
15036
15037 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15038
15039 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15040 (unwind_create_frame): New function (Bug#9943).
15041 (Fx_create_frame): Restructure code to be more similar to the one in
15042 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15043 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15044 Move terminal->reference_count++ just before making the frame official
15045 (Bug#9943).
15046
15047 * nsterm.m (x_free_frame_resources): New function.
15048 (x_destroy_window): Move code to x_free_frame_resources.
15049
15050 * xfns.c (unwind_create_frame): Fix comment.
15051 (Fx_create_frame, x_create_tip_frame):
15052 Move terminal->reference_count++ just before making the frame
15053 official. Move initialization of image_cache_refcount and
15054 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15055
15056 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15057
15058 Support MSVC build with newer versions of Visual Studio.
15059 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15060 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15061 nt/gmake.defs.
15062
15063 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15064 which are not supported by MSVC.
15065 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15066 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15067 bitfields.
15068 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15069 types in bitfields.
15070 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15071
15072 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15073
15074 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15075
15076 Support MSVC build with newer versions of Visual Studio.
15077 * w32.c: Don't include w32api.h for MSVC.
15078 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15079
15080 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15081 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15082 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15083 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15084 e_* cousins.
15085 (alloca) [_MSC_VER]: Define to _alloca.
15086
15087 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15088
15089 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15090
15091 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15092
15093 * xdisp.c (note_mouse_highlight): If either of
15094 previous/next-single-property-change returns nil, treat that as
15095 the beginning or the end of the buffer. (Bug#9955)
15096
15097 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15098
15099 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15100 label is not null (Bug#9951).
15101 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15102 may be NULL.
15103
15104 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15105
15106 * window.c (Fwindow_body_size): Mention in the doc string that the
15107 return value is in frame's canonical units. (Bug#9949)
15108
15109 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15110
15111 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15112
15113 * w32fns.c (unwind_create_frame): If needed, free the glyph
15114 matrices of the partially constructed frame. (Bug#9943)
15115 * xfns.c (unwind_create_frame): Likewise.
15116
15117 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15118
15119 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15120 Don't stop backward scan on the continuation glyph, even though
15121 its CHARPOS is positive.
15122 (mouse_face_from_buffer_pos, note_mouse_highlight):
15123 Rename cover_string to disp_string.
15124
15125 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15126
15127 * window.c (temp_output_buffer_show): Don't use
15128 Vtemp_buffer_show_specifiers.
15129 (Vtemp_buffer_show_specifiers): Remove unused variable.
15130
15131 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15132
15133 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15134 past the beginning of the current glyph matrix.
15135
15136 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15137
15138 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15139 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15140 HAVE_GTK3 (Bug#9869).
15141
15142 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15143 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15144
15145 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15146
15147 * xterm.c: Declare x_handle_net_wm_state to return int.
15148 (handle_one_xevent): Check if we are iconified but don't have
15149 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15150 (get_current_wm_state): Return non-zero if not hidden,
15151 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15152 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15153 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15154 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15155
15156 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15157
15158 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15159 so that this new function doesn't get optimized away by a
15160 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15161
15162 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15163
15164 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15165
15166 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15167
15168 Fix the `xbytecode' command.
15169 * .gdbinit (xprintbytestr): New command.
15170 (xwhichsymbols): Rename from `which'; all callers changed.
15171 (xbytecode): Print the byte-code string as well.
15172
15173 2011-10-29 Kim Storm <storm@cua.dk>
15174
15175 * alloc.c (which_symbols): New function.
15176
15177 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15178
15179 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15180 line. (Bug#9903)
15181
15182 2011-10-29 Glenn Morris <rgm@gnu.org>
15183
15184 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15185 Not clear what it was for, and it causes various bugs. (Bug#9839)
15186
15187 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15188
15189 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15190 possible random value that matches one of those tested as
15191 condition to clear the mouse face.
15192
15193 2011-10-28 Chong Yidong <cyd@gnu.org>
15194
15195 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15196
15197 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15198
15199 * window.c (make_window): Initialize phys_cursor_on_p.
15200
15201 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15202
15203 * lisp.h (struct Lisp_Symbol): Update comments.
15204
15205 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
15206
15207 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15208
15209 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15210
15211 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15212 <oslsachem@gmail.com> for helping to debug this.
15213
15214 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15215 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15216 (g_b_init_get_glyph_outline_w): New static variables.
15217 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15218 (GetGlyphOutlineW_Proc): New typedefs.
15219 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15220 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15221 New functions.
15222 (w32font_open_internal, compute_metrics):
15223 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15224 instead of calling the "wide" APIs directly.
15225
15226 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15227
15228 * w32.h (syms_of_w32font): Add prototype.
15229
15230 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15231
15232 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15233 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15234 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15235 (Fmove_to_window_line): Doc fix.
15236
15237 2011-10-27 Chong Yidong <cyd@gnu.org>
15238
15239 * process.c (make_process): Set gnutls_state to NULL.
15240
15241 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15242 non-NULL, regardless of GNUTLS_INITSTAGE.
15243 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15244 an error. Set process slots as soon as we allocate them.
15245
15246 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15247
15248 2011-10-27 Chong Yidong <cyd@gnu.org>
15249
15250 * gnutls.c (emacs_gnutls_deinit): New function.
15251 Deallocate credentials structures as well as calling gnutls_deinit.
15252 (Fgnutls_deinit, Fgnutls_boot): Use it.
15253
15254 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15255 (deactivate_process): Call emacs_gnutls_deinit.
15256
15257 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15258
15259 * image.c (x_create_x_image_and_pixmap):
15260 * w32.c (sys_rename, w32_delayed_load):
15261 * w32font.c (fill_in_logfont):
15262 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15263
15264 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
15265
15266 * w32fns.c (w32_default_color_map): New function,
15267 extracted from Fw32_default_color_map.
15268 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
15269
15270 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15271
15272 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15273
15274 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15275
15276 * keyboard.c (test_undefined): New function (bug#9751).
15277 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15278
15279 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15280
15281 * sysdep.c (init_sys_modes): Fix the check for the controlling
15282 terminal (Bug#6649).
15283
15284 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15285
15286 * dispextern.h (struct bidi_it): New member next_en_type.
15287
15288 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15289 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15290 current character, check also for next_en_type being WEAK_EN.
15291 (bidi_resolve_weak): Don't enter the expensive loop if the current
15292 position is before next_en_pos. Record the bidi type of the first
15293 non-ET, non-BN character we find, in addition to its position.
15294 (bidi_level_of_next_char): Invalidate next_en_type when
15295 next_en_pos is over-stepped.
15296
15297 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15298
15299 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15300 * editfns.c: Rewrite current-time-zone so that it invokes
15301 the equivalent of (format-time-string "%Z") to get the time zone name.
15302 This fixes a bug when the time zone name contains characters that
15303 need converting from the system time locale to Emacs internal format.
15304 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15305 that patch fixed format-time-string to do the conversion, but
15306 I forgot to fix current-time-zone.
15307 (format_time_string): New function, containing most of
15308 what Fformat_time_string used to contain.
15309 (Fformat_time_string): Rewrite in terms of format_time_string.
15310 This doesn't change this function's behavior.
15311 (current-time-zone): Rewrite to use format_time_string.
15312 This fixes the bug reported by Michael Schierl in
15313 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15314 Jason Rumney's 2007-06-07 change worked around this bug, but
15315 didn't fix it.
15316 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15317
15318 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15319
15320 * xdisp.c (start_display): If the character at POS is displayed
15321 via a display vector, reset IT->current.dpvec_index to zero.
15322 (try_window_reusing_current_matrix): If a line ends in a display
15323 vector or the next line starts in a display vector, continue
15324 redrawing the window even though the character position of
15325 start_row was reached.
15326 (Bug#9771, part 2)
15327
15328 2011-10-18 Chong Yidong <cyd@gnu.org>
15329
15330 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15331 with nobreak-char-display too.
15332
15333 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15334
15335 Fix part 3 of bug#9771.
15336 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15337 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15338 non-neutral characters if the current character is a paragraph
15339 separator (a.k.a. Newline). This avoids running the same
15340 expensive loop twice, once when we consume the preceding newline
15341 and the other time when the line actually needs to be displayed.
15342 Avoid the loop when we see neutrals on the base embedding level
15343 following a character whose directionality is the same as the
15344 paragraph's. This avoids running the expensive loop when a line
15345 ends in a long sequence of neutrals, like control characters.
15346 Add assertion against STRONG_AL type. Slightly rearrange code
15347 that determines the type of a neutral given the first non-neutral
15348 that follows it.
15349 (bidi_level_of_next_char): Set next_en_pos to zero when
15350 invalidating its info.
15351
15352 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15353
15354 * xdisp.c (push_display_prop): Determine whether to record string
15355 or buffer position by IT->string, not by IT->method. Allow
15356 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15357 (move_it_vertically_backward): Don't look for character position
15358 immediately after the newline when in a continuation line.
15359 (Bug#9771, part 1)
15360
15361 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15362
15363 * window.c (coordinates_in_window): Rewrite and delabelize
15364 vertical border check. (Bug#5357) (Bug#9618)
15365
15366 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15367
15368 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15369 errors in XSetWindowBorder (bug#9310).
15370
15371 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15372
15373 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15374 avoid crash when xmalloc overrun checking is enabled.
15375
15376 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15377
15378 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15379 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15380 cursor motion with <left> and <right> arrow keys.
15381
15382 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15383 some callers set that themselves.
15384
15385 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15386
15387 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15388 display string and the previous row comes from the same string and
15389 is empty. (Bug#9739) (Bug#9738)
15390
15391 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15392
15393 * doc.c (get_doc_string): Encode file name (bug#9735).
15394
15395 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15396
15397 * bidi.c (bidi_level_of_next_char):
15398 * xdisp.c (get_visually_first_element): Remove old incorrect
15399 comments regarding the Unicode Line Separator character.
15400
15401 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15402
15403 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15404
15405 * alloc.c (Fgc_status): Do not access beyond zombies array
15406 boundary if nzombies > MAX_ZOMBIES.
15407 * alloc.c (dump_zombies): Add missing format specifier.
15408
15409 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15410
15411 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15412 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15413
15414 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15415 Some packages use them to denote characters with modifiers.
15416
15417 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15418
15419 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15420 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15421 matching a pp-number. Rename parameter var to var1.
15422
15423 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15424
15425 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15426
15427 2011-10-08 Glenn Morris <rgm@gnu.org>
15428
15429 * callint.c (Fcall_interactively): Give a more explicit error for the
15430 'c' case with a non-character input. (Bug#8479)
15431
15432 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15433
15434 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15435 lines.
15436 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15437 lines that are hscrolled on the left.
15438
15439 * dispnew.c (buffer_posn_from_coords): Account for a possible
15440 presence of header-line. (Bug#4426)
15441
15442 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15443
15444 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15445 Don't advertise functionality which we discourage or doesn't work.
15446
15447 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15448
15449 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15450 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15451 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15452 this makes Emacs dump core during garbage collection on rare
15453 occasions. sizeof is obviously inferior to offsetof here, so
15454 stick with offsetof.
15455 (GC_POINTER_ALIGNMENT): New macro.
15456 (mark_memory): Omit 3rd (offset) arg; caller changed.
15457 Don't assume EMACS_INT alignment is the same as pointer alignment.
15458
15459 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15460
15461 * keyboard.c (read_key_sequence_remapped): New var.
15462 (read_key_sequence): Compute remapping in the right buffer.
15463 (command_loop_1): Use read_key_sequence's remapping directly.
15464
15465 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15466
15467 * dired.c (file_name_completion): Don't expand file name.
15468 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15469 before checking file name handler.
15470
15471 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15472 they've been requested explicitly (bug#9591).
15473
15474 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
15475
15476 * keymap.c (Fsingle_key_description): Use make_specified_string
15477 instead of build_string to build string from push_key_description.
15478 (Bug#5193)
15479
15480 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15481
15482 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15483 This fixes a Y2038 bug on 64-bit hosts.
15484 * buffer.c (reset_buffer):
15485 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15486 (Fclear_buffer_auto_save_failure):
15487 Use 0, not -1, to represent an unset failure time, since time_t
15488 might not be signed.
15489
15490 Remove dependency on glibc malloc internals.
15491 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15492 Move back here from lisp.h, but with their new implementations.
15493 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15494 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15495 * charset.c (charset_table_init): New static var.
15496 (syms_of_charset): Use it instead of xmalloc. This removes a
15497 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15498 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15499 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15500 Move back to alloc.c.
15501 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15502 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15503
15504 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15505
15506 * nsterm.m (windowDidResize): Call x_set_window_size only when
15507 ns_in_resize is true. Otherwise set pixelwidth/height and
15508 call change_frame_size (Bug#9628).
15509
15510 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15511
15512 Port --enable-checking=all to Fedora 14 x86-64.
15513 * charset.c (syms_of_charset): Also account for glibc malloc's
15514 internal overhead when calculating the initial malloc maximum.
15515
15516 Port --enable-checking=all to Fedora 14 x86.
15517 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15518 Move to lisp.h.
15519 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15520 (overrun_check_realloc, overrun_check_free):
15521 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15522 That way, xmalloc returns a properly-aligned pointer even if
15523 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15524 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15525 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15526 into account when calculating the initial malloc maximum.
15527 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15528 Move here from alloc.c, so that charset.c can use it too.
15529 Properly align; the old code wasn't right for common 32-bit hosts
15530 when configured with --enable-checking=all.
15531 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15532 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15533
15534 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15535
15536 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15537 use EDOM.
15538
15539 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15540
15541 * xdisp.c (compute_display_string_end): If there's no display
15542 string at CHARPOS, return -1.
15543
15544 * bidi.c (bidi_fetch_char): When compute_display_string_end
15545 returns a negative value, treat the character as a normal
15546 character not covered by a display string. (Bug#9624)
15547
15548 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15549
15550 * lread.c (Fread_from_string): Fix typo in docstring.
15551
15552 2011-09-27 Eli Zaretskii <eliz@gnu.org>
15553
15554 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15555 newline, reseat the iterator instead of bidi-iterating there one
15556 character at a time. (Bug#9610)
15557 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15558 TO_CHARPOS if the bidi iterator is at base embedding level.
15559
15560 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15561
15562 * lread.c (readevalloop): Use correct code for NBSP.
15563 (read1): Likewise. (Bug#9608)
15564
15565 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
15566
15567 * dbusbind.c (Fdbus_register_signal): When service is not
15568 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15569
15570 2011-09-25 Glenn Morris <rgm@gnu.org>
15571
15572 * buffer.c (truncate-lines): Doc fix.
15573
15574 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
15575
15576 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15577 (Fset_window_next_buffers): Doc fix.
15578
15579 2011-09-24 Glenn Morris <rgm@gnu.org>
15580
15581 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15582
15583 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15584
15585 Fix minor problems found by static checking.
15586 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15587 * indent.c (Fvertical_motion): Fix == vs = typo.
15588
15589 2011-09-24 Eli Zaretskii <eliz@gnu.org>
15590
15591 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15592 Default value is now t. Doc fix.
15593
15594 * indent.c (Fvertical_motion): Compute and apply the overshoot
15595 logic when moving up, not only when moving down. Fix the
15596 confusing name and values of the it_overshoot_expected variable;
15597 logic changes accordingly. (Bug#9254) (Bug#9549)
15598
15599 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15600 CHARPOS is covered by a display string which includes newlines.
15601 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15602 is covered by a display string with embedded newlines.
15603
15604 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
15605
15606 * dbusbind.c (Fdbus_register_signal): Add match rule to
15607 Vdbus_registered_objects_table. (Bug#9581)
15608 (Fdbus_register_method, Vdbus_registered_objects_table):
15609 Fix docstring.
15610
15611 2011-09-24 Jim Meyering <meyering@redhat.com>
15612
15613 do not ignore write error for any output size
15614 The previous change was incomplete.
15615 While it makes emacs --batch detect the vast majority of stdout
15616 write failures, errors were still ignored whenever the output size is
15617 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15618 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15619 && echo FAIL: ignored write error
15620 FAIL: ignored write error
15621 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15622 && echo FAIL: ignored write error
15623 FAIL: ignored write error
15624 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15625
15626 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15627
15628 * emacs.c (Fkill_emacs): In noninteractive mode exit
15629 non-successfully if a write error occurred on stdout. (Bug#9574)
15630
15631 2011-09-21 Eli Zaretskii <eliz@gnu.org>
15632
15633 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15634 the xassert test.
15635
15636 * dispextern.h (struct it): Update the comment documenting what
15637 can it->OBJECT be.
15638
15639 2011-09-20 Eli Zaretskii <eliz@gnu.org>
15640
15641 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15642 a display string, extend search for cursor position to end of row.
15643 (find_row_edges): If the row ends in a newline from a display
15644 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15645 Handle the case of a display string with multiple newlines.
15646 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15647 non-empty line. Fixes confusing cursor motion with arrow keys at
15648 the beginning of a line that starts with whitespace.
15649
15650 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15651
15652 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15653 (bug#9493).
15654
15655 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
15656
15657 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15658 boolean (Bug#9154).
15659
15660 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15661
15662 * xdisp.c (display_line): Record maximum and minimum buffer
15663 positions even if no glyphs were produced (e.g., by a zero-width
15664 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15665 buffer positions that will be removed from the glyph row because
15666 they don't fit.
15667 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15668 column is beyond frame width: don't subtract 1 "pixel" when
15669 computing width of the stretch.
15670 (reseat_at_next_visible_line_start): Undo the change made on
15671 2011-09-17 that saved paragraph information and restored it after
15672 the call to `reseat'. (Bug#9545)
15673
15674 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15675
15676 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15677 and turn window cursor on if cleared (Bug#9415).
15678
15679 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
15680
15681 * search.c (boyer_moore): Take unibyte characters from pattern
15682 literally. (Bug#9458)
15683
15684 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15685
15686 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15687
15688 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15689
15690 Fix minor problem found by static checking.
15691 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15692 initialized, to pacify gcc -Wuninitialized.
15693
15694 * fileio.c: Report proper errno when syscall falls.
15695 (Finsert_file_contents): Save and restore errno,
15696 so that report_file_error outputs the correct diagnostic.
15697 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15698
15699 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15700
15701 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15702
15703 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15704
15705 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15706 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15707
15708 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15709
15710 * xdisp.c (reseat_at_next_visible_line_start): Keep information
15711 about the current paragraph and restore it after the call to reseat.
15712
15713 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15714 (bidi_find_paragraph_start): Search back for paragraph beginning
15715 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15716 (bidi_move_to_visually_next): Only trigger paragraph-related
15717 computations when the last character is a newline or at EOB, not
15718 just any NEUTRAL_B. (Bug#9470)
15719
15720 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15721 truncated lines if point is covered by a display string. (Bug#9524)
15722
15723 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15724
15725 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15726 (cons_to_x_long): New function.
15727 (lisp_data_to_selection_data): Use it. Correct the test for
15728 short-versus-long data; it was negated. Break out of vector
15729 loop, for efficiency, when a long datum is discovered.
15730
15731 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15732
15733 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15734
15735 2011-09-16 Eli Zaretskii <eliz@gnu.org>
15736
15737 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15738 GCC PR/17406) by declaring this function with external scope.
15739
15740 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15741
15742 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15743 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15744
15745 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15746
15747 * editfns.c (Fformat): Correctly handle text properties on "%%".
15748
15749 2011-09-15 Eli Zaretskii <eliz@gnu.org>
15750
15751 * xterm.c (x_draw_composite_glyph_string_foreground):
15752 * w32term.c (x_draw_composite_glyph_string_foreground):
15753 * term.c (encode_terminal_code):
15754 * composite.c (composition_update_it, get_composition_id):
15755 * xdisp.c (get_next_display_element)
15756 (fill_composite_glyph_string): Add comments about special meaning
15757 of TAB characters in a composition.
15758
15759 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15760
15761 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15762 This occurs when processing a multibyte format.
15763 Problem reported by Wolfgang Jenker.
15764
15765 2011-09-15 Johan Bockgård <bojohan@gnu.org>
15766
15767 * xdisp.c (try_cursor_movement): Only check for exact match if
15768 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15769
15770 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15771
15772 Remove unused external symbols.
15773 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15774 * xdisp.c (calc_pixel_width_or_height): Now static.
15775 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15776 * indent.c (check_display_width):
15777 * w32term.c: Fix comment to match code.
15778 * xterm.c, xterm.h (x_catching_errors): Remove.
15779
15780 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15781
15782 * xselect.c: Use signed conversions more consistently (Bug#9498).
15783 (selection_data_to_lisp_data): Assume incoming selection data are
15784 signed integers, not unsigned. This is to be consistent with
15785 outgoing selection data, which was modified to use signed integers
15786 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15787 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15788 expects long, not unsigned long.
15789
15790 2011-09-14 Eli Zaretskii <eliz@gnu.org>
15791
15792 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15793 computation of loop end. Reported by Johan Bockgård
15794 <bojohan@gnu.org>.
15795
15796 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
15797
15798 * frame.c (Fother_visible_frames_p): Function deleted.
15799
15800 2011-09-12 Eli Zaretskii <eliz@gnu.org>
15801
15802 * indent.c (compute_motion): Process display vector front to back
15803 rather than the other way around. (Bug#2496)
15804
15805 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15806
15807 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15808
15809 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
15810
15811 * minibuf.c (Fread_from_minibuffer): Doc fix.
15812
15813 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15814
15815 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15816 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15817
15818 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15819
15820 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15821 value for non-existent files.
15822
15823 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15824
15825 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15826 set its "size" to -1. This will set the modtime_size field of
15827 the corresponding buffer to -1, which is what
15828 verify-visited-file-modtime expects for files that do not exist.
15829 (Bug#9139)
15830
15831 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15832
15833 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15834 here ...
15835 * lisp.h: ... from here. push_key_description is no longer
15836 defined in keyboard.c, so its declaration should not be in
15837 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15838 logically belongs with push_key_description.
15839
15840 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15841
15842 * buffer.h: Include <sys/types.h> instead of <time.h>.
15843 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15844 Problem reported by Herbert J. Skuhra.
15845
15846 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15847
15848 * xml.c (parse_region): Make the parsing work for
15849 non-comment-starting XML files again (bug#9144).
15850
15851 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15852
15853 * image.c (gif_load): Fix calculation of bottom and right corner.
15854 (Bug#9468)
15855
15856 2011-09-10 Eli Zaretskii <eliz@gnu.org>
15857
15858 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15859 redisplay in small windows.
15860
15861 2011-09-09 Eli Zaretskii <eliz@gnu.org>
15862
15863 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15864
15865 2011-09-08 Martin Rudalics <rudalics@gmx.at>
15866
15867 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15868 Operate on live windows only.
15869
15870 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
15871
15872 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15873
15874 2011-09-07 Eli Zaretskii <eliz@gnu.org>
15875
15876 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15877 only under bidi iteration.
15878
15879 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15880
15881 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15882
15883 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15884
15885 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15886 Without this fix, the command to link temacs failed due to an
15887 undefined symbol __builtin_isnan. This is because
15888 /usr/include/iso/math_c99.h #defines isnan(x) to
15889 __builtin_isnan(x), but the bundled gcc, which identifies itself
15890 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15891 a __builtin_isnan.
15892 * floatfns.c (isnan): #undef, and then #define to a clone of
15893 what's in data.c.
15894 (Fisnan): Always define, since it's always available now.
15895 (syms_of_floatfns): Always define isnan at the Lisp level.
15896
15897 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15898
15899 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15900
15901 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15902
15903 * fileio.c: Fix bugs with large file offsets (Bug#9428).
15904 The previous code assumed that file offsets (off_t values) fit in
15905 EMACS_INT variables, which is not true on typical 32-bit hosts.
15906 The code messed up by falsely reporting buffer overflow in cases
15907 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15908 when "big" contains more than 2**29 bytes, even though this
15909 inserts just one byte and does not overflow the buffer.
15910 (Finsert_file_contents): Store file offsets as off_t
15911 values, not as EMACS_INT values. Check for overflow when
15912 converting between EMACS_INT and off_t. When checking for
15913 buffer overflow or for overlap, take the offsets into account.
15914 Don't use EMACS_INT for small values where int suffices.
15915 When checking for overlap, fix a typo: ZV was used where
15916 ZV_BYTE was intended.
15917 (Fwrite_region): Don't assume off_t fits into 'long'.
15918 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15919
15920 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
15921
15922 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15923
15924 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15925
15926 sprintf-related integer and memory overflow issues (Bug#9412).
15927
15928 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15929 (esprintf, exprintf, evxprintf): New functions.
15930 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15931 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15932 (modify_event_symbol): Do not assume that the length of
15933 name_alist_or_stem is safe to alloca and fits in int.
15934 (Fexecute_extended_command): Likewise for function name and binding.
15935 (Frecursion_depth): Wrap around reliably on integer overflow.
15936 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15937 since some callers pass EMACS_INT values.
15938 (Fsingle_key_description): Don't crash if symbol name contains more
15939 than MAX_ALLOCA bytes.
15940 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15941 (get_minibuffer): Arg is now EMACS_INT, not int.
15942 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15943 (esprintf, exprintf, evxprintf): New decls.
15944 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15945
15946 * dbusbind.c (signature_cat): New function.
15947 (xd_signature, Fdbus_register_signal):
15948 Do not overrun buffer; instead, report string overflow.
15949
15950 * dispnew.c (add_window_display_history): Don't overrun buffer.
15951 Truncate instead; this is OK since it's just a log.
15952
15953 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15954 even if the time zone offset is outlandishly large.
15955 Don't mishandle offset == INT_MIN.
15956
15957 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15958 when creating daemon; the previous buffer-overflow check was incorrect.
15959
15960 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15961 which has the guts of the old verror function.
15962
15963 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15964 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15965
15966 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15967 (font_unparse_xlfd): Don't blindly alloca long strings.
15968 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15969 fits in int, when using sprintf. Use single snprintf to count
15970 length of string rather than counting it via multiple sprintfs;
15971 that's simpler and more reliable.
15972 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15973 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15974 sprintf, in case result does not fit in int.
15975
15976 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15977 (fontset_from_font): Print it.
15978
15979 * frame.c (tty_frame_count): Now printmax_t, not int.
15980 (make_terminal_frame, set_term_frame_name): Print it.
15981 (x_report_frame_params): In X, window IDs are unsigned long,
15982 not signed long, so print them as unsigned.
15983 (validate_x_resource_name): Check for implausibly long names,
15984 and don't assume name length fits in 'int'.
15985 (x_get_resource_string): Don't blindly alloca invocation name;
15986 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15987 not fit in int.
15988
15989 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15990 (xg_check_special_colors, xg_set_geometry):
15991 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15992
15993 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15994 Use esprintf, not sprintf, in case result does not fit in int.
15995
15996 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15997 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15998 it as a large positive number.
15999 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16000 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16001
16002 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16003 in case result does not fit in int.
16004
16005 * print.c (float_to_string): Detect width overflow more reliably.
16006 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16007 buffer overrun. Don't assume list length fits in 'int'. Treat
16008 print length of 0 as 0, not as infinity; to be consistent with other
16009 uses of print length in this function. Don't overflow print length
16010 index. Don't assume hash table size fits in 'long', or that
16011 vectorlike size fits in 'unsigned long'.
16012
16013 * process.c (make_process): Use printmax_t, not int, to format
16014 process-name gensyms.
16015
16016 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16017
16018 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16019 to avoid potential buffer overrun.
16020
16021 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16022 if X resource line is longer than 512 bytes.
16023
16024 * xfns.c (x_window): Make sprintf buffer a bit bigger
16025 to avoid potential buffer overrun.
16026
16027 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16028
16029 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16030
16031 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16032
16033 Integer overflow fixes for scrolling, etc.
16034 Without these, Emacs silently mishandles large integers sometimes.
16035 For example, "C-u 4294967297 M-x recenter" was treated as if
16036 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16037
16038 * xdisp.c (try_window_id): Check Emacs fixnum range before
16039 converting to 'int'.
16040
16041 * window.c (window_scroll_line_based, Frecenter):
16042 Check that an Emacs fixnum is in range before assigning it to 'int'.
16043 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16044 values converted from Emacs fixnums.
16045 (Frecenter): Don't wrap around a line count if it is out of 'int'
16046 range; instead, treat it as an extreme value.
16047 (Fset_window_configuration, compare_window_configurations):
16048 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16049
16050 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16051 that can exceed INT_MAX. Check that EMACS_INT value is in range
16052 before assigning it to the (possibly-narrower) index.
16053 (match_limit): Don't assume that a fixnum can fit in 'int'.
16054
16055 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16056 exceed INT_MAX.
16057
16058 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16059 (Fvertical_motion): Don't wrap around LINES values that don't fit
16060 in 'int'. Instead, treat them as extreme values. This is good
16061 enough for windows, which can't have more than INT_MAX lines anyway.
16062
16063 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16064
16065 * Require libxml/parser.h to avoid compilation warning.
16066
16067 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16068
16069 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16070 since this reportedly can destroy thread storage.
16071
16072 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16073
16074 * syntax.c (find_defun_start): Update all cache variables if
16075 exiting early (Bug#9401).
16076
16077 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16078
16079 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16080
16081 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16082 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16083 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16084
16085 * term.c (tty_append_glyph): New function.
16086 (produce_stretch_glyph): Static function and its prototype deleted.
16087
16088 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16089 Add prototypes.
16090
16091 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16092
16093 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16094 when checking :margin (Bug#9390).
16095 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16096 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16097 so that the name doesn't mislead. All uses changed.
16098
16099 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16100
16101 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16102 set_tty_hooks.
16103
16104 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16105
16106 * xdisp.c (move_it_to): Don't bail out early when reaching
16107 position beyond to_charpos, if we are scanning backwards.
16108 (move_it_vertically_backward): When DY == 0, make sure we get to
16109 the first character in the line after the newline.
16110
16111 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16112
16113 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16114 (ccl_driver): Do not generate an out-of-range pointer.
16115 (Fccl_execute_on_string): Remove unnecessary check for
16116 integer overflow, noted by Stefan Monnier in
16117 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16118 Remove a FIXME that didn't need fixing.
16119 Simplify the newly-introduced buffer reallocation code.
16120
16121 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16122
16123 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16124
16125 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16126
16127 Integer and memory overflow issues (Bug#9196).
16128
16129 * doc.c (get_doc_string): Rework so that
16130 get_doc_string_buffer_size is the actual buffer size, rather than
16131 being 1 less than the actual buffer size; this makes xpalloc more
16132 convenient.
16133
16134 * image.c (x_allocate_bitmap_record, cache_image):
16135 * xselect.c (Fx_register_dnd_atom):
16136 Simplify previous changes by using xpalloc.
16137
16138 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16139 since either will do and ptrdiff_t is convenient with xpalloc.
16140
16141 * charset.c (charset_table_size)
16142 (struct charset_sort_data.priority): Now ptrdiff_t.
16143 (charset_compare): Don't overflow if priorities differ greatly.
16144 (Fsort_charsets): Don't assume list length fits in int.
16145 Check for size-calculation overflow when allocating sort data.
16146 (syms_of_charset): Allocate an initial charset table that is
16147 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16148
16149 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16150
16151 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16152 The actual value is always <= INT_MAX, and leaving it unsigned made
16153 overflow checking harder.
16154
16155 * dispextern.h (struct glyph_matrix.rows_allocated)
16156 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16157 with xpalloc. The values are still always <= INT_MAX.
16158
16159 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16160
16161 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16162 (SAFE_NALLOCA): New macro.
16163
16164 * region-cache.c (struct boundary.pos, find_cache_boundary)
16165 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16166 (set_cache_region, invalidate_region_cache)
16167 (revalidate_region_cache, know_region_cache, region_cache_forward)
16168 (region_cache_backward, pp_cache):
16169 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16170 so that ptrdiff_t * can be passed to xpalloc.
16171 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16172 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16173 (pp_cache): Don't assume cache_len fits in int.
16174 * region-cache.h: Adjust extern decls to match.
16175
16176 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16177 EMACS_INT, since either will do, for xpalloc.
16178
16179 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16180 (xnmalloc, xnrealloc, xpalloc): New functions.
16181
16182 * bidi.c (bidi_shelve_header_size): New constant.
16183 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16184 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16185
16186 * bidi.c (bidi_cache_shrink):
16187 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16188 (overlay_strings):
16189 Don't update size of array until after memory allocation succeeds,
16190 because xmalloc/xrealloc may not return.
16191 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16192 now that we have proper integer overflow checking.
16193 (record_overlay_string, overlay_strings): Catch overflows when
16194 calculating size of overlay_str_buf.
16195
16196 * callproc.c (Fcall_process): Check for size overflow when
16197 calculating size of args2.
16198 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16199 Normally we prefer signed values, but sticking with ptrdiff_t would
16200 require adding more-complicated checks.
16201
16202 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16203 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16204 Redo buffer-overflow calculations to avoid integer overflow.
16205 Add a FIXME comment where memory seems to be over-allocated.
16206
16207 * character.c (Fstring): Check for size-calculation overflow.
16208
16209 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16210 unnecessary integer overflow. Check for size overflow.
16211 (encode_coding_object): Don't update size until xmalloc succeeds.
16212
16213 * composite.c (get_composition_id): Check for overflow in glyph
16214 length calculations.
16215
16216 Integer and memory overflow fixes for display code.
16217 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16218 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16219 (scrolling_window): Check for overflow in size calculations.
16220 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16221 Don't assume glyph table len fits in int.
16222 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16223 (row_table_size): Now ptrdiff_t, not int.
16224 (scrolling_window): Avoid overflow in size calculations.
16225 Don't update size until allocation succeeds.
16226 * fns.c (concat): Check for overflow in size calculations.
16227 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16228 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16229 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16230
16231 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16232 (get_doc_string): Check for size calculation overflow.
16233 Don't update size until allocation succeeds.
16234 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16235 EMACS_INT, where ptrdiff_t will do.
16236 (Fsubstitute_command_keys): Check for string overflow.
16237
16238 * editfns.c (set_time_zone_rule): Don't assume environment length
16239 fits in int.
16240 (message_length): Now ptrdiff_t, not int.
16241 (Fmessage_box): Don't update size until allocation succeeds.
16242 Don't assume message length fits in int.
16243 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16244
16245 * emacs.c (main): Do not reallocate argv, since there is a null at
16246 the end that can be overwritten, and this way there's no need to
16247 worry about size-calculation overflow.
16248 (sort_args): Check for size-calculation overflow.
16249
16250 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16251 alloc succeeds.
16252 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16253
16254 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16255 (x_set_scroll_bar_width, x_figure_window_size):
16256 Check for integer overflow.
16257 (x_set_alpha): Do not assume XINT fits in int.
16258
16259 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16260 This is for the members text_lines, text_cols, total_lines, total_cols,
16261 where the system imposes an 'int' limit.
16262
16263 * fringe.c (Fdefine_fringe_bitmap):
16264 Don't update size until alloc works.
16265
16266 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16267 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16268
16269 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16270 Check for size-calculation overflow.
16271 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16272 do, as we prefer signed integers.
16273 (id_to_widget.max_size, id_to_widget.used)
16274 (xg_store_widget_in_map, xg_remove_widget_from_map)
16275 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16276 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16277 Use and return ptrdiff_t, not int.
16278 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16279 * gtkutil.h: Change prototypes to match the above.
16280
16281 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16282 are duplicate now that they've been promoted to lisp.h.
16283 (x_allocate_bitmap_record, x_alloc_image_color)
16284 (make_image_cache, cache_image, xpm_load):
16285 Don't update size until alloc is done.
16286 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16287 (x_detect_edges):
16288 Check for size calculation overflow.
16289 (ct_colors_allocated_max): New constant.
16290 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16291 overflow.
16292
16293 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16294 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16295 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16296 Use ptrdiff_t, not int, to count maps.
16297 (read_char_minibuf_menu_prompt): Check for overflow in size
16298 calculations. Don't update size until allocation succeeds.
16299 Redo calculations to avoid overflow.
16300 * keyboard.h: Change prototypes to match the above.
16301
16302 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16303 to count maps.
16304 (current_minor_maps): Check for size calculation overflow.
16305 * keymap.h: Change prototypes to match the above.
16306
16307 * lread.c (read1, init_obarray): Don't update size until alloc done.
16308
16309 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16310 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16311
16312 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16313 Now ptrdiff_t, not int.
16314 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16315 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16316
16317 * process.c (Fnetwork_interface_list): Check for overflow
16318 in size calculation.
16319
16320 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16321
16322 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16323 overflow. Don't bother calling xmalloc when xrealloc will do.
16324
16325 * search.c (Freplace_match): Check for size calculation overflow.
16326 (Fset_match_data): Don't assume list lengths fit in 'int'.
16327
16328 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16329 for command line length. Do not attempt to address one before the
16330 beginning of an array, as that's not portable.
16331
16332 * term.c (max_frame_lines): Remove; unused.
16333 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16334 not int.
16335 (encode_terminal_code, calculate_costs): Check for size
16336 calculation overflow.
16337 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16338 table lengths and related sizes. Don't update size until alloc
16339 done. Redo calculations to avoid overflow.
16340 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16341
16342 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16343 subtracting pointers.
16344 (gobble_line): Check for overflow more carefully. Don't update size
16345 until alloc done.
16346
16347 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16348 Don't update size until alloc done.
16349 Redo size calculations to avoid overflow.
16350 Check for size calculation overflow.
16351 (main) [DEBUG]: Fix typo in invoking tparam1.
16352
16353 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16354 Use ptrdiff_t, not int, for sizes.
16355 (store_mode_line_noprop_char): Don't update size until alloc done.
16356
16357 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16358 Use ptrdiff_t, not int, for sizes.
16359 (Finternal_make_lisp_face, cache_face):
16360 Check for size calculation overflow.
16361 (cache_face): Treat size calculation overflows as if they were
16362 memory exhaustion (the usual treatment), rather than aborting.
16363
16364 * xfns.c (x_encode_text, x_set_name_internal)
16365 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16366 sizes, since they can exceed INT_MAX in size. Check for size
16367 calculation overflow.
16368
16369 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16370 (xg_select): Check for size calculation overflow.
16371 Don't update size until alloc done.
16372
16373 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16374 as sprintf is limited to int lengths.
16375
16376 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16377 (X_LONG_MIN): New macros.
16378 Use them to make the following changes clearer.
16379 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16380 This change doesn't affect the value now, but it may help remind
16381 future maintainers not to raise the value too much later.
16382 (SELECTION_QUANTUM): Remove, replacing with ...
16383 (selection_quantum): ... new function, which avoids overflow.
16384 All uses changed.
16385 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16386 assumption that selection length fits in 'int'.
16387 (x_reply_selection_request, x_handle_selection_request)
16388 (x_get_window_property, receive_incremental_selection)
16389 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16390 (lisp_data_to_selection_data, clean_local_selection_data):
16391 Use ptrdiff_t, not int, to record length of selection.
16392 (x_reply_selection_request, x_get_window_property)
16393 (receive_incremental_selection, x_property_data_to_lisp):
16394 Redo calculations to avoid overflow.
16395 (x_reply_selection_request): When sending hint, ceiling it at
16396 X_LONG_MAX rather than relying on wraparound overflow to send
16397 something.
16398 (x_get_window_property, receive_incremental_selection)
16399 (lisp_data_to_selection_data, x_property_data_to_lisp):
16400 Check for size-calculation overflow.
16401 (x_get_window_property, receive_incremental_selection)
16402 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16403 Don't store size until memory allocation succeeds.
16404 (x_get_window_property): Plug memory leak on memory exhaustion.
16405 Don't double-block input; malloc is safe here. Don't assume 2**34
16406 - 4 fits in unsigned long. Add an xassert to check
16407 XGetWindowProperty overflow. Be more careful about overflow
16408 calculations, and distinguish size from memory overflow better.
16409 (receive_incremental_selection): When tracing, don't assume
16410 unsigned int is less than INT_MAX.
16411 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16412 harmful) conversions of unsigned short to int.
16413 (lisp_data_to_selection_data): Don't assume that integers
16414 in the range -65535 through -1 fit in an X unsigned short.
16415 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16416 result parameters unless successful. Rely on cons_to_unsigned
16417 to report problems with elements; the old code wasn't right anyway.
16418 (x_check_property_data): Check for int overflow; we cannot use
16419 a wider type due to X limits.
16420 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16421
16422 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16423
16424 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16425 (x_term_init): Check for size calculation overflow.
16426 (x_color_cells): Don't store size until memory allocation succeeds.
16427 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16428 Don't assume alloca size is less than MAX_ALLOCA.
16429 (x_term_init): Don't assume length fits in int (sprintf is limited
16430 to int size).
16431
16432 Use ptrdiff_t for composition IDs.
16433 * character.c (lisp_string_width):
16434 * composite.c (composition_table_size, n_compositions)
16435 (get_composition_id, composition_gstring_from_id):
16436 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16437 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16438 * window.c (Frecenter):
16439 Use ptrdiff_t, not int, for composition IDs.
16440 * composite.c (get_composition_id): Check for integer overflow.
16441 * composite.h: Adjust prototypes to match the above changes.
16442
16443 Use ptrdiff_t for hash table indexes.
16444 * category.c (hash_get_category_set):
16445 * ccl.c (ccl_driver):
16446 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16447 * coding.c (coding_system_charset_list, detect_coding_system):
16448 * coding.h (struct coding_system.id):
16449 * composite.c (get_composition_id, gstring_lookup_cache):
16450 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16451 * image.c (xpm_get_color_table_h):
16452 * lisp.h (hash_lookup, hash_put):
16453 * minibuf.c (Ftest_completion):
16454 Use ptrdiff_t for hash table indexes, not int (which is too
16455 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16456 32-bit --with-wide-int hosts).
16457
16458 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16459 Add a FIXME comment about memory leaks.
16460 (syms_of_charset): Don't assume xmalloc returns.
16461
16462 Don't assume that stated character widths fit in int.
16463 * character.c (Fchar_width, c_string_width, lisp_string_width):
16464 * character.h (CHAR_WIDTH):
16465 * indent.c (MULTIBYTE_BYTES_WIDTH):
16466 Use sanitize_char_width to avoid undefined and/or bad behavior
16467 with outlandish widths.
16468 * character.h (sanitize_tab_width): Rename from sanitize_width,
16469 now that we have two such functions. All uses changed.
16470 (sanitize_char_width): New inline function.
16471
16472 Don't assume that tab-width fits in int.
16473 * character.h (sanitize_width): New inline function.
16474 (SANE_TAB_WIDTH): New macro.
16475 (ASCII_CHAR_WIDTH): Use it.
16476 * indent.c (sane_tab_width): Remove. All uses replaced by
16477 SANE_TAB_WIDTH (current_buffer).
16478 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16479
16480 * fileio.c: Integer overflow issues with file modes.
16481 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16482
16483 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16484 Remove unreachable code.
16485 (read_hex, load_charset_map_from_file): Check for integer overflow.
16486
16487 * xterm.c: Don't go over XClientMessageEvent limit.
16488 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16489 (x_send_scroll_bar_event): Likewise. Check that the size does not
16490 exceed limits imposed by XClientMessageEvent, as well as the usual
16491 ptrdiff_t and size_t limits.
16492
16493 * keyboard.c: Overflow, signedness and related fixes.
16494 (make_lispy_movement): Use same integer type in forward decl
16495 that is used in the definition.
16496 (read_key_sequence, keyremap_step):
16497 Change bufsize argument back to int, undoing my 2011-03-30 change.
16498 We prefer signed types, and int is wide enough here.
16499 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16500 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16501 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16502 length, not size_t. Use ptrdiff_t for index, not int.
16503 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16504 possibility of integer overflow.
16505
16506 Overflow, signedness and related fixes for images.
16507
16508 * dispextern.h (struct it.stack[0].u.image.image_id)
16509 (struct_it.image_id, struct image.id, struct image_cache.size)
16510 (struct image_cache.used, struct image_cache.ref_count):
16511 * gtkutil.c (update_frame_tool_bar):
16512 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16513 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16514 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16515 * nsmenu.m (update_frame_tool_bar):
16516 * xdisp.c (calc_pixel_width_or_height):
16517 * xfns.c (image_cache_refcount):
16518 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16519 on typical 64-bit hosts.
16520
16521 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16522 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16523 Omit unnecessary casts to int.
16524 (parse_image_spec): Check that integers fall into 'int' range
16525 when the callers expect that.
16526 (image_ascent): Redo ascent calculation to avoid int overflow.
16527 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16528 (lookup_image): Remove unnecessary tests.
16529 (xbm_image_p): Locals are now of int, not EMACS_INT,
16530 since parse_image_check makes sure they fit into int.
16531 (png_load, gif_load, svg_load_image):
16532 Prefer int to unsigned where either will do.
16533 (tiff_handler): New function, combining the cores of the
16534 old tiff_error_handler and tiff_warning_handler.
16535 This function is rewritten to use vsnprintf and thereby avoid
16536 stack buffer overflows. It uses only the features of vsnprintf
16537 that are common to both POSIX and native Microsoft.
16538 (tiff_error_handler, tiff_warning_handler): Use it.
16539 (tiff_load, gif_load, imagemagick_load_image):
16540 Don't assume :index value fits in 'int'.
16541 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16542 (imagemagick_load_image): Check that crop parameters fit into
16543 the integer types that MagickCropImage accepts. Don't assume
16544 Vimagemagick_render_type has a nonnegative value. Don't assume
16545 size_t fits in 'long'.
16546 (gs_load): Use printmax_t to print the widest integers possible.
16547 Check for integer overflow when computing image height and width.
16548
16549 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16550
16551 * xdisp.c (redisplay_window): Don't force window start if point
16552 will be invisible in the resulting window. (Bug#9324)
16553
16554 2011-08-25 Eli Zaretskii <eliz@gnu.org>
16555
16556 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16557 the display spec is of the form `(space ...)'.
16558 (handle_display_spec): Return the value returned by
16559 handle_single_display_spec, not just 1 or zero.
16560 (handle_single_display_spec): If the display spec is of the form
16561 `(space ...)', and specifies display in the text area, return 2
16562 rather than 1.
16563 (try_cursor_movement): Check for the need to scroll more
16564 accurately, and prefer exact match for point under bidi.
16565 Don't advance `row' beyond the last row of the window.
16566
16567 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16568 into disp_prop; all users changed.
16569
16570 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16571 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16572 for the text covered by the display property.
16573
16574 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
16575
16576 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16577 Change return value to nil.
16578 (Frecord_buffer): Delete unused function.
16579
16580 2011-08-24 Eli Zaretskii <eliz@gnu.org>
16581
16582 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16583 buffers, return left-to-right.
16584 (set_cursor_from_row): Consider candidate row a win if its glyph
16585 represents a newline and point is on that newline. Fixes cursor
16586 positioning on the newline at EOL of R2L text within L2R
16587 paragraph, and vice versa.
16588 (try_cursor_movement): Check continued rows, in addition to
16589 continuation rows. Fixes unwarranted scroll when point enters a
16590 continued line of R2L text within an L2R paragraph, or vice versa.
16591 (cursor_row_p): Consider the case of point being equal to
16592 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16593 from the end of a short line to the beginning of a continued line
16594 of R2L text within L2R paragraph.
16595 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16596 composed characters.
16597
16598 * bidi.c (bidi_check_type): Use xassert.
16599 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16600 members.
16601
16602 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16603
16604 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16605 a character.
16606
16607 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
16608
16609 * nsfont.m (ns_otf_to_script): Fix typo.
16610
16611 2011-08-22 Kenichi Handa <handa@m17n.org>
16612
16613 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16614 extra slot even if the purpose is char-code-property-table.
16615
16616 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16617
16618 * xdisp.c (redisplay_window): When computing centering_position,
16619 account for the height of the header line. (Bug#8874)
16620
16621 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16622 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16623 candidate is selected by the mouse, and that candidate has a
16624 composed character under the mouse.
16625
16626 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16627 coordinates reported by pos-visible-in-window-p for a composed
16628 character in column zero.
16629
16630 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16631
16632 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16633
16634 2011-08-22 Eli Zaretskii <eliz@gnu.org>
16635
16636 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16637 consider it a hit if to_charpos is anywhere in the range of the
16638 composed buffer positions.
16639
16640 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
16641
16642 * image.c (gif_load): Don't assume that each subimage has the same
16643 dimensions as the base image. Handle disposal method that is
16644 "undefined" by the gif spec (Bug#9335).
16645
16646 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
16647
16648 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16649 (Fcondition_case): Document `debug' symbol in error handler.
16650
16651 2011-08-19 Eli Zaretskii <eliz@gnu.org>
16652
16653 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16654 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16655 from an Org mode buffer to a Speedbar frame.
16656
16657 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16658 a composition, take its buffer position from IT->cmp_it.charpos.
16659 Fixes cursor positioning at the beginning of a line that begins
16660 with a composed character.
16661
16662 2011-08-18 Eli Zaretskii <eliz@gnu.org>
16663
16664 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16665 character bidirectional type, use STRONG_L instead. Fixes crashes
16666 in a buffer produced by `describe-categories'.
16667
16668 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16669 members before the level stack, so they would be saved and
16670 restored when copying iterator state. Fixes incorrect reordering
16671 around TABs covered by display properties.
16672
16673 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16674
16675 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16676
16677 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
16678
16679 * eval.c (internal_condition_case, internal_condition_case_1)
16680 (internal_condition_case_2, internal_condition_case_n):
16681 Remove unnecessary aborts (Bug#9081).
16682
16683 2011-08-17 Eli Zaretskii <eliz@gnu.org>
16684
16685 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16686 has no `load' handler, try opening the file locally. (Bug#9311)
16687
16688 2011-08-16 Ken Brown <kbrown@cornell.edu>
16689
16690 * gmalloc.c: Expand comment.
16691
16692 2011-08-16 Eli Zaretskii <eliz@gnu.org>
16693
16694 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16695 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16696
16697 2011-08-16 Ken Brown <kbrown@cornell.edu>
16698
16699 Fix memory allocation problems in Cygwin build (Bug#9273).
16700
16701 * unexcw.c ( __malloc_initialized): Declare external variable.
16702 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16703
16704 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16705 New variables.
16706 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16707 dumped emacs.
16708 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16709 in the static heap.
16710 [CYGWIN] (special_realloc): New function.
16711 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16712 requests to realloc storage in the static heap.
16713
16714 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16715
16716 * bidi.c (bidi_initialize): Remove unused local.
16717
16718 2011-08-15 Eli Zaretskii <eliz@gnu.org>
16719
16720 * bidimirror.h:
16721 * biditype.h: Remove file.
16722 * makefile.w32-in ($(BLD)/bidi.$(O)):
16723 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16724
16725 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16726
16727 * chartab.c: Improve commentary for the uniprop_table API.
16728
16729 * bidi.c (bidi_paragraph_init): Support zero value of
16730 bidi_ignore_explicit_marks_for_paragraph_level.
16731 (bidi_initialize): Use uniprop_table instead of including
16732 biditype.h and bidimirror.h.
16733
16734 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16735 coordinates of the iterator when restoring from ppos_it.
16736 (Bug#9296)
16737
16738 2011-08-14 Kenichi Handa <handa@m17n.org>
16739
16740 * process.c (create_process): Call setup_process_coding_systems
16741 after the pid of the process is set to -1 (Bug#8162).
16742
16743 2011-08-14 Eli Zaretskii <eliz@gnu.org>
16744
16745 * xdisp.c (move_it_in_display_line_to): Don't invoke
16746 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16747 ppos_it. Fixes vertical cursor motion when line beginning is
16748 covered by an image. (Bug#9296)
16749
16750 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16751
16752 * nsterm.h (ns_run_ascript): Declare.
16753 (NSAPP_DATA2_RUNASSCRIPT): Define.
16754
16755 * nsfns.m (as_script, as_result, as_status): New static variables.
16756 (ns_run_ascript): New function.
16757 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
16758 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16759 the event loop. Get status from as_status (Bug#7276).
16760
16761 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16762 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16763 the event loop (Bug#7276).
16764
16765 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16766
16767 * gnutls.c (QCgnutls_bootprop_priority)
16768 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16769 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16770 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16771 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16772 (QCgnutls_bootprop_verify_hostname_error)
16773 (QCgnutls_bootprop_callbacks_verify): Rename from
16774 Qgnutls_bootprop_..., all uses changed.
16775
16776 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16777 uses changed.
16778
16779 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16780
16781 * xfaces.c (Qframe_set_background_mode): Now static.
16782 * dispextern.h (Qframe_set_background_mode): Remove decl.
16783
16784 * process.c (Fnetwork_interface_info): Declare local only if needed.
16785
16786 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16787
16788 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16789 (Fnetwork_interface_list): Allocate in increments of bytes instead
16790 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16791 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16792 sockaddr.
16793 (struct ifflag_def): notrailers is smart on OSX.
16794 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16795 Get hardware address with getifaddrs if available.
16796
16797 2011-08-12 Eli Zaretskii <eliz@gnu.org>
16798
16799 * xdisp.c (iterate_out_of_display_property): xassert that
16800 IT->position is set to within IT->object's boundaries. Break from
16801 the loop as soon as EOB is reached; avoids infloops in redisplay
16802 when IT->position is set up wrongly due to some bug.
16803 Set IT->current to match the bidi iterator unconditionally.
16804 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16805 entry. Force push_it to save on the stack the current
16806 buffer/string position, to be restored by pop_it. Fix flags in
16807 the iterator structure wrt the object coming from a display
16808 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16809 properties. (Bug#9284)
16810
16811 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
16812
16813 * fontset.c (fontset_get_font_group): Add proper type checks.
16814 (Bug#9172)
16815
16816 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16817
16818 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16819 and LC_VERSION_MIN_MACOSX.
16820 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16821 (dump_it) [LC_FUNCTION_STARTS]: Use it.
16822
16823 2011-08-08 Eli Zaretskii <eliz@gnu.org>
16824
16825 * xdisp.c (forward_to_next_line_start): Allow to use the
16826 no-display-properties-and-no-overlays under bidi display.
16827 Set disp_pos in the bidi iterator to avoid searches for display
16828 properties and overlays.
16829
16830 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
16831
16832 * editfns.c (Fset_time_zone_rule): Document relationship with the
16833 setenv function.
16834
16835 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16836 the font entity extracted from the cache (Bug#8109).
16837
16838 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
16839
16840 * composite.c (autocmp_chars): Don't reset point. That is done by
16841 restore_point_unwind (Bug#5984).
16842
16843 2011-08-07 Juri Linkov <juri@jurta.org>
16844
16845 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16846 to show the arg `TIME' instead of `TIMEVAL'.
16847
16848 2011-08-06 Eli Zaretskii <eliz@gnu.org>
16849
16850 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16851 display property strides EOL and includes a newline, as in
16852 longlines-mode. (Bug#9254)
16853 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16854 word-wrap under bidirectional display. (Bug#9224)
16855
16856 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16857 is non-zero, even if the data buffer is NULL. Fixes a crash in
16858 vertical-motion with longlines-mode. (Bug#9254)
16859
16860 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16861
16862 * bidi.c <bidi_cache_total_alloc>: Now static.
16863 (bidi_initialize): Initialize bidi_cache_total_alloc.
16864
16865 * xdisp.c (display_line): Release buffer allocated for shelved bidi
16866 cache. (Bug#9221)
16867
16868 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16869 amount allocated this far in `bidi_cache_total_alloc'.
16870 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16871 non-zero, only free the data buffer without restoring the cache
16872 contents. All callers changed.
16873
16874 * dispextern.h (bidi_unshelve_cache): Update prototype.
16875
16876 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16877 (move_it_in_display_line, move_it_to)
16878 (move_it_vertically_backward, move_it_by_lines): Replace the call
16879 to xfree to an equivalent call to bidi_unshelve_cache.
16880 (move_it_in_display_line_to): Fix logic of returning
16881 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
16882
16883 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16884
16885 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16886 came from a string character with a `cursor' property. (Bug#9229)
16887
16888 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16889
16890 * Makefile.in (LIB_PTHREAD): New variable.
16891 (LIBES): Add LIB_PTHREAD (Bug#9216).
16892
16893 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16894 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16895
16896 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16897
16898 * regex.c (re_iswctype): Remove some redundant boolean conversions.
16899
16900 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16901
16902 * xterm.c (x_find_topmost_parent): New function.
16903 (x_set_frame_alpha): Find topmost parent window with
16904 x_find_topmost_parent and set the property there also (bug#9181).
16905 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16906
16907 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16908
16909 * callproc.c (Fcall_process): Avoid vfork clobbering
16910 the local vars buffer, coding_systems, current_dir.
16911
16912 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16913
16914 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16915
16916 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16917
16918 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16919 so that it is not optimized away.
16920
16921 * xdisp.c (compute_display_string_pos): Remove unused local.
16922
16923 2011-08-02 Eli Zaretskii <eliz@gnu.org>
16924
16925 Fix slow cursor motion and scrolling in large buffers with
16926 selective display, like Org Mode buffers. (Bug#9218)
16927
16928 * dispextern.h (struct bidi_it): New member disp_prop_p.
16929
16930 * xdisp.c: Remove one-slot cache of display string positions.
16931 (compute_display_string_pos): Accept an additional argument
16932 DISP_PROP_P; callers changed. Scan at most 5K characters forward
16933 for a display string or property. If found, set DISP_PROP_P
16934 non-zero.
16935
16936 * bidi.c (bidi_fetch_char): Accept an additional argument
16937 DISP_PROP_P, and pass it to compute_display_string_pos.
16938 Only handle text covered by a display string if DISP_PROP_P is returned
16939 non-zero. All callers of bidi_fetch_char changed.
16940
16941 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16942
16943 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16944
16945 2010-12-03 Don March <don@ohspite.net>
16946
16947 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16948 last character M-[char] is translated to ESC [char] (bug#7541).
16949
16950 2011-08-02 Kenichi Handa <handa@m17n.org>
16951
16952 * lisp.h (uniprop_table): Extern it.
16953
16954 * chartab.c (uniprop_table): Make it non-static.
16955
16956 2011-08-01 Eli Zaretskii <eliz@gnu.org>
16957
16958 * xdisp.c (forward_to_next_line_start): Accept additional argument
16959 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16960 on the newline.
16961 (reseat_at_next_visible_line_start): Use the bidi iterator state
16962 returned by forward_to_next_line_start to restore the state of
16963 it->bidi_it after backing up to previous newline. (Bug#9212)
16964
16965 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16966
16967 * regex.c (re_comp): Protoize.
16968 (re_exec): Fix return type.
16969 (regexec): Fix type of `ret'. (Bug#9203)
16970
16971 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16972
16973 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16974 This is needed if max-image-size is a floating-point number.
16975
16976 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16977
16978 * print.c (print_object): Print empty symbol as ##.
16979
16980 * lread.c (read1): Read ## as empty symbol.
16981
16982 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16983
16984 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16985 setting frame foreground color (Bug#9175).
16986 (x_set_background_color): Likewise.
16987
16988 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16989 contents (Bug#9176).
16990 (EmacsTooltip -init): Remove bezels and add shadows to
16991 tooltip windows.
16992
16993 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16994 or scroll bar (Bug#8470).
16995
16996 * nsfont.m (nsfont_open): Remove assignment to voffset and
16997 unnecessary vars hshink, expand, hd, full_height, min_height.
16998 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16999
17000 * nsterm.h (nsfont_info): Remove voffset field.
17001
17002 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17003
17004 Implement strike-through and overline on NextStep (Bug#8863).
17005
17006 * nsfont.m (nsfont_open): Use underline position provided by font,
17007 instead of hard-coded value of 2.
17008 (nsfont_draw): Call ns_draw_text_decoration instead.
17009
17010 * nsterm.h: Add declaration for ns_draw_text_decoration.
17011
17012 * nsterm.m (ns_draw_text_decoration): New function for drawing
17013 underline, overline, and strike-through.
17014 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17015 ns_draw_text_decoration. Change treatment of cursor drawing to
17016 accommodate underlining, etc.
17017
17018 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17019
17020 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17021 default.
17022
17023 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17024
17025 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17026 Without this fix, if a signal arrives just after memory fills up,
17027 'malloc' might be invoked reentrantly.
17028
17029 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17030 In other words, assume that every image size is allowed, on non-X
17031 hosts. This assumption is probably wrong, but it lets Emacs compile.
17032
17033 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17034
17035 * regex.c (re_iswctype): Convert return values to boolean.
17036
17037 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17038
17039 * xdisp.c (compute_display_string_pos): Don't use cached display
17040 string position if the buffer had its restriction changed.
17041 (Bug#9184)
17042
17043 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17044
17045 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17046
17047 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17048
17049 Integer signedness and overflow and related fixes. (Bug#9079)
17050
17051 * bidi.c: Integer size and overflow fixes.
17052 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17053 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17054 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17055 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17056 (bidi_find_other_level_edge):
17057 Use ptrdiff_t instead of EMACS_INT where either will do.
17058 This works better on 32-bit hosts configured --with-wide-int.
17059 (bidi_cache_ensure_space): Check for size-calculation overflow.
17060 Use % rather than repeated addition, for better worst-case speed.
17061 Don't set bidi_cache_size until after xrealloc returns, because it
17062 might not return.
17063 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17064 (bidi_cache_ensure_space): Also check that the bidi cache size
17065 does not exceed that of the largest Lisp string or buffer. See Eli
17066 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17067
17068 * alloc.c (__malloc_size_t): Remove.
17069 All uses replaced by size_t. See Andreas Schwab's note
17070 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17071
17072 * image.c: Improve checking for integer overflow.
17073 (check_image_size): Assume that f is nonnull, since
17074 it is always nonnull in practice. This is one less thing to
17075 worry about when checking for integer overflow later.
17076 (x_check_image_size): New function, which checks for integer
17077 overflow issues inside X.
17078 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17079 This removes the need for a memory_full check.
17080 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17081 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17082 (xbm_read_bitmap_data): Change locals back to 'int', since
17083 their values must fit in 'int'.
17084 (xpm_load_image, png_load, tiff_load):
17085 Invoke x_create_x_image_and_pixmap earlier,
17086 to avoid much needless work if the image is too large.
17087 (tiff_load): Treat overly large images as if
17088 x_create_x_image_and_pixmap failed, not as malloc failures.
17089 (gs_load): Use x_check_image_size.
17090
17091 * gtkutil.c: Omit integer casts.
17092 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17093 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17094
17095 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17096
17097 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17098 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17099 would wrongly return t on a 64-bit host.
17100
17101 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17102 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17103 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17104 and therefore cause GCC to emit a bogus diagnostic in some cases.
17105
17106 * image.c: Integer signedness and overflow and related fixes.
17107 This is not an exhaustive set of fixes, but it's time to
17108 record what I've got.
17109 (lookup_pixel_color, check_image_size): Remove redundant decls.
17110 (check_image_size): Don't assume that arbitrary EMACS_INT values
17111 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17112 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17113 (tiff_load, imagemagick_load_image):
17114 Check for overflow in size calculations.
17115 (x_create_x_image_and_pixmap): Remove unnecessary test for
17116 xmalloc returning NULL; that can't happen.
17117 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17118 (xpm_color_bucket): Use better integer hashing function.
17119 (xpm_cache_color): Don't possibly over-allocate memory.
17120 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17121 (gif_memory_source):
17122 Use ptrdiff_t, not int or size_t, to record sizes.
17123 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17124 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17125 either works, as we prefer signed integers.
17126 (tiff_read_from_memory, tiff_write_from_memory):
17127 Return tsize_t, not size_t, since that's what the TIFF API wants.
17128 (tiff_read_from_memory): Don't fail simply because the read would
17129 go past EOF; instead, return a short read.
17130 (tiff_load): Omit no-longer-needed casts.
17131 (Fimagemagick_types): Don't assume size fits into 'int'.
17132
17133 Improve hashing quality when configured --with-wide-int.
17134 * fns.c (hash_string): New function, taken from sxhash_string.
17135 Do not discard information about ASCII character case; this
17136 discarding is no longer needed.
17137 (sxhash-string): Use it. Change sig to match it. Caller changed.
17138 * lisp.h: Declare it.
17139 * lread.c (hash_string): Remove, since we now use fns.c's version.
17140 The fns.c version returns a wider integer if --with-wide-int is
17141 specified, so this should help the quality of the hashing a bit.
17142
17143 * emacs.c: Integer overflow minor fix.
17144 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17145 Define only if GNU_LINUX.
17146 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17147
17148 * dispnew.c: Integer signedness and overflow fixes.
17149 Remove unnecessary forward decls, that were a maintenance hassle.
17150 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17151 All uses changed.
17152 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17153 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17154 (prepare_desired_row, line_draw_cost):
17155 Use int, not unsigned, where either works.
17156 (save_current_matrix, restore_current_matrix):
17157 Use ptrdiff_t, not size_t, where either works.
17158 (init_display): Check for overflow more accurately, and without
17159 relying on undefined behavior.
17160
17161 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17162 Remove, replacing with the new symbols in lisp.h. All uses changed.
17163 * fileio.c (make_temp_name):
17164 * filelock.c (lock_file_1, lock_file):
17165 * xdisp.c (message_dolog):
17166 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17167 Use pMd etc. instead.
17168 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17169 replacing the pWIDE etc. symbols removed from editfns.c.
17170
17171 * keyboard.h (num_input_events): Now uintmax_t.
17172 This is (very slightly) less likely to mess up due to wraparound.
17173 All uses changed.
17174
17175 * buffer.c: Integer signedness fixes.
17176 (alloc_buffer_text, enlarge_buffer_text):
17177 Use ptrdiff_t rather than size_t when either will do, as we prefer
17178 signed integers.
17179
17180 * alloc.c: Integer signedness and overflow fixes.
17181 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17182 (__malloc_size_t): Default to size_t, not to int.
17183 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17184 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17185 Prefer ptrdiff_t to size_t when either would do, as we prefer
17186 signed integers.
17187 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17188 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17189 Now const. Initialize with values that are in range even if char
17190 is signed.
17191 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17192 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17193 These functions do the right thing with sizes > 2**32.
17194 (check_depth): Now ptrdiff_t, not int.
17195 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17196 Adjust to new way of storing sizes. Check for size overflow bugs
17197 in rest of code.
17198 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17199 slightly wrong anyway, as it missed one instance of
17200 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17201 (refill_memory_reserve): Omit needless cast to size_t.
17202 (mark_object_loop_halt): Mark as externally visible.
17203
17204 * xselect.c: Integer signedness and overflow fixes.
17205 (Fx_register_dnd_atom, x_handle_dnd_message):
17206 Use ptrdiff_t, not size_t, since we prefer signed.
17207 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17208 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17209 x_dnd_atoms_size and x_dnd_atoms_length.
17210
17211 * doprnt.c: Prefer signed to unsigned when either works.
17212 * eval.c (verror):
17213 * doprnt.c (doprnt):
17214 * lisp.h (doprnt):
17215 * xdisp.c (vmessage):
17216 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17217 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17218 prefer signed arithmetic to avoid comparison confusion.
17219 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17220 but is a bit tricky.
17221
17222 Assume freestanding C89 headers, string.h, stdlib.h.
17223 * data.c, doprnt.c, floatfns.c, print.c:
17224 Include float.h unconditionally.
17225 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17226 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17227 * regex.c: Likewise for stddef.h, string.h.
17228 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17229 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17230 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17231 (STDC_HEADERS): Remove obsolete defines.
17232 * sysdep.c: Include limits.h unconditionally.
17233
17234 Assume support for memcmp, memcpy, memmove, memset.
17235 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17236 * regex.c (memcmp, memcpy):
17237 Remove; we assume C89 now.
17238
17239 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17240 (__malloc_safe_bcopy): Remove; no longer needed.
17241
17242 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17243 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17244 well either way, and we prefer signed to unsigned.
17245
17246 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17247
17248 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17249 closes the connection while we're reading (bug#9182).
17250
17251 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
17252
17253 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17254 are specified (Bug#9168).
17255
17256 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17257
17258 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17259 Found by GCC static checking and --with-wide-int on a 32-bit host.
17260
17261 2011-07-25 Eli Zaretskii <eliz@gnu.org>
17262
17263 * xdisp.c (compute_display_string_pos): Fix logic of caching
17264 previous display string position. Initialize cached_prev_pos to
17265 -1. Fixes slow-down at the beginning of a buffer.
17266
17267 2011-07-24 Eli Zaretskii <eliz@gnu.org>
17268
17269 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17270 for attrs[LFACE_FONTSET_INDEX].
17271
17272 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17273
17274 * xml.c (parse_region): Remove unused local
17275 that was recently introduced.
17276
17277 2011-07-23 Eli Zaretskii <eliz@gnu.org>
17278
17279 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17280 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17281
17282 * xdisp.c (move_it_in_display_line_to): Record the best matching
17283 position for TO_CHARPOS while scanning the line, and restore it on
17284 exit if none of the characters scanned was an exact match.
17285 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17286 when exact match is impossible due to invisible text, and the
17287 lines are truncated.
17288
17289 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17290
17291 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17292 for OSX >= 10.7.
17293
17294 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17295
17296 Fix a significant slow-down of cursor motion with C-n, C-p,
17297 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17298 auto-repeat under bidi redisplay in fontified buffers.
17299 * xdisp.c (compute_stop_pos_backwards): New function.
17300 (next_element_from_buffer): Call compute_stop_pos_backwards to
17301 find a suitable prev_stop when we find ourselves before
17302 base_level_stop.
17303 (reseat): Don't look for prev_stop, as that could mean a very long
17304 run.
17305 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17306 <cached_disp_overlay_modiff>: Cache for last found display string
17307 position.
17308 (compute_display_string_pos): Return the cached position if asked
17309 about the same buffer in the same area of character positions, and
17310 the buffer wasn't changed since the time the display string
17311 position was cached.
17312
17313 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17314
17315 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17316 is an integer, which is important for empty lines. (Bug#9149)
17317
17318 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17319
17320 * frame.c (Fmodify_frame_parameters): In tty case, update the
17321 default face if necessary (Bug#4238).
17322
17323 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17324
17325 * editfns.c (Fstring_to_char): No need to explain what a character
17326 is in the docstring (Bug#6576).
17327
17328 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17329
17330 * xml.c (parse_region): Make sure we always return a tree.
17331
17332 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17333
17334 * xml.c (parse_region): If a document contains only comments,
17335 return that, too.
17336
17337 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17338
17339 * xml.c (make_dom): Return comments, too.
17340
17341 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17342
17343 Port to OpenBSD.
17344 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17345 and the surrounding thread.
17346 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17347 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17348 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17349 timer goes off.
17350 * s/openbsd.h (BROKEN_SIGIO): Define.
17351 * unexelf.c (unexec) [__OpenBSD__]:
17352 Don't update the .mdebug section of the Alpha COFF symbol table.
17353
17354 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17355
17356 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17357 (bug#8460).
17358
17359 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17360
17361 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17362 This fixes some race conditions on the permissions of any newly
17363 created file.
17364
17365 * alloc.c (valid_pointer_p): Use pipe, not open.
17366 This fixes some permissions issues when debugging.
17367
17368 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17369 If fchown fails to set both uid and gid, try to set just gid,
17370 as that is sometimes allowed. Adjust the file's mode to eliminate
17371 setuid or setgid bits that are inappropriate if fchown fails.
17372
17373 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17374
17375 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17376 to compare Lisp_Objects.
17377 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17378 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17379 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17380
17381 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17382
17383 * lread.c (read_integer): Unread even EOF character.
17384 (read1): Likewise. Properly record start position of symbol.
17385
17386 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17387 symbol character follows.
17388
17389 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17390
17391 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17392 This works around a problem with the previous change to Fcopy_file.
17393 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17394 and without this change, GCC might complain about discarding
17395 fchown's return value.
17396
17397 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17398
17399 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17400
17401 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17402
17403 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17404
17405 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17406
17407 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17408 it's used from the C level.
17409
17410 * process.c: Use the same condition for POLL_FOR_INPUT in both
17411 keyboard.c and process.c (bug#1858).
17412
17413 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17414
17415 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17416 (Fgnutls_boot): Use it.
17417
17418 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17419
17420 * doc.c (Fsubstitute_command_keys): Revert last change.
17421
17422 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17423
17424 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17425 quotes the next character, and doesn't affect other longer
17426 sequences (bug#8935).
17427
17428 * lread.c (syms_of_lread): Clarify that is isn't only
17429 `eval-buffer' and `eval-defun' that's affected by
17430 `lexical-binding' (bug#8460).
17431
17432 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17433
17434 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17435 bidi redisplay when a line includes both an image and is truncated.
17436
17437 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17438
17439 Fix minor problems found by static checking.
17440 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17441 (elsz): Now a signed constant, not a size_t var. We prefer signed
17442 types to unsigned, to avoid integer comparison confusion. Without
17443 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17444 "cannot optimize loop, the loop counter may overflow", a symptom
17445 of the confusion.
17446 * indent.c (Fvertical_motion): Mark locals as initialized.
17447 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17448
17449 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17450
17451 * search.c (Fre_search_backward): Mention `case-fold-search' in
17452 all the re_search_* functions (bug#8138).
17453
17454 * keyboard.c (Fopen_dribble_file): Document when the file is
17455 closed (bug#8056).
17456
17457 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17458
17459 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17460 bidi_cache_idx.
17461
17462 Support bidi reordering of display and overlay strings.
17463 * xdisp.c (compute_display_string_pos)
17464 (compute_display_string_end): Accept additional argument STRING.
17465 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17466 (reseat_to_string): Initialize bidi_it->string.s and
17467 bidi_it->string.schars.
17468 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17469 NULL (avoids a crash in bidi_paragraph_init).
17470 Initialize itb.string.lstring.
17471 (init_iterator): Call bidi_init_it only of a valid
17472 buffer position was specified. Initialize paragraph_embedding to
17473 L2R.
17474 (reseat_to_string): Initialize the bidi iterator.
17475 (display_string): If we need to ignore text properties of
17476 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17477 original value of -1 will not work with bidi.)
17478 (compute_display_string_pos): First arg is now struct
17479 `text_pos *'; all callers changed. Support display properties on
17480 Lisp strings.
17481 (compute_display_string_end): Support display properties on Lisp
17482 strings.
17483 (init_iterator, reseat_1, reseat_to_string): Initialize the
17484 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17485 when iterating on a string not from display properties).
17486 (compute_display_string_pos, compute_display_string_end):
17487 Fix calculation of the object to scan. Fixes an error when using
17488 arrow keys.
17489 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17490 base_level_stop; instead, set base_level_stop to BEGV.
17491 Fixes crashes in vertical-motion.
17492 (next_element_from_buffer): Improve commentary for when
17493 the iterator is before prev_stop.
17494 (init_iterator): Initialize bidi_p from the default value of
17495 bidi-display-reordering, not from buffer-local value. Use the
17496 buffer-local value only if initializing for buffer iteration.
17497 (handle_invisible_prop): Support invisible properties on strings
17498 that are being bidi-reordered.
17499 (set_iterator_to_next): Support bidi reordering of C strings and
17500 Lisp strings.
17501 (next_element_from_string): Support bidi reordering of Lisp
17502 strings.
17503 (handle_stop_backwards): Support Lisp strings as well.
17504 (display_string): Support display of R2L glyph rows.
17505 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17506 (init_iterator): Don't initialize it->bidi_p for strings
17507 here.
17508 (reseat_to_string): Initialize it->bidi_p for strings here.
17509 (next_element_from_string, next_element_from_c_string)
17510 (next_element_from_buffer): Add xassert's for correspondence
17511 between IT's object being iterated and it->bidi_it.string
17512 structure.
17513 (face_before_or_after_it_pos): Support bidi iteration.
17514 (next_element_from_c_string): Handle the case of the first string
17515 character that is not the first one in the visual order.
17516 (get_visually_first_element): New function, refactored from common
17517 parts of next_element_from_buffer, next_element_from_string, and
17518 next_element_from_c_string.
17519 (tool_bar_lines_needed, redisplay_tool_bar)
17520 (display_menu_bar): Force left-to-right direction. Add a FIXME
17521 comment for making that be controlled by a user option.
17522 (push_it, pop_it): Save and restore the state of the
17523 bidi iterator. Save and restore the bidi_p flag.
17524 (pop_it): Iterate out of display property for string iteration as
17525 well.
17526 (iterate_out_of_display_property): Support iteration over strings.
17527 (handle_single_display_spec): Set up it->bidi_it for iteration
17528 over a display string, and call bidi_init_it.
17529 (handle_single_display_spec, next_overlay_string)
17530 (get_overlay_strings_1, push_display_prop): Set up the bidi
17531 iterator for displaying display or overlay strings.
17532 (forward_to_next_line_start): Don't use the shortcut if
17533 bidi-iterating.
17534 (back_to_previous_visible_line_start): If handle_display_prop
17535 pushed the iterator stack, restore the internal state of the bidi
17536 iterator by calling bidi_pop_it same number of times.
17537 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17538 and we are bidi-iterating, don't decrement the iterator position;
17539 instead, set the first_elt flag in the bidi iterator, to produce
17540 the same effect.
17541 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17542 (push_display_prop): xassert that we are iterating a buffer.
17543 (push_it, pop_it): Save and restore paragraph_embedding member.
17544 (handle_single_display_spec, next_overlay_string)
17545 (get_overlay_strings_1, reseat_1, reseat_to_string)
17546 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17547 correctly. Don't assume unibyte strings are not bidi-reordered.
17548 (compute_display_string_pos)
17549 (compute_display_string_end): Fix handling the case of C string.
17550 (push_it, pop_it): Save and restore from_disp_prop_p.
17551 (handle_single_display_spec, push_display_prop): Set the
17552 from_disp_prop_p flag.
17553 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17554 (pop_it): Call iterate_out_of_display_property only if we are
17555 popping after iteration over a string that came from a display
17556 property. Fix a typo in popping stretch info. Add an assertion
17557 for verifying that the iterator position is in sync with the bidi
17558 iterator.
17559 (handle_single_display_spec, get_overlay_strings_1)
17560 (push_display_prop): Fix initialization of paragraph direction for
17561 string when that of the parent object is not yet determined.
17562 (reseat_1): Call bidi_init_it to resync the bidi
17563 iterator with IT's position. (Bug#7616)
17564 (find_row_edges): If ROW->start.pos gives position
17565 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17566 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17567 Reset the from_disp_prop_p flag.
17568 (SAVE_IT, RESTORE_IT): New macros.
17569 (pos_visible_p, face_before_or_after_it_pos)
17570 (back_to_previous_visible_line_start)
17571 (move_it_in_display_line_to, move_it_in_display_line)
17572 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17573 (try_scrolling, redisplay_window, display_line): Use them when
17574 saving a temporary copy of the iterator and restoring it back.
17575 (back_to_previous_visible_line_start, reseat_1)
17576 (init_iterator): Empty the bidi cache "stack".
17577 (move_it_in_display_line_to): If iterator ended up at
17578 EOL, but we never saw any buffer positions smaller than
17579 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17580 motion in bidi-reordered lines.
17581 (move_it_in_display_line_to): Record prev_method and prev_pos
17582 immediately before the call to set_iterator_to_next. Fixes cursor
17583 motion in bidi-reordered lines with stretch glyphs and strings
17584 displayed in margins. (Bug#8133) (Bug#8867)
17585 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17586 TO_CHARPOS.
17587 (pos_visible_p): Support positions in bidi-reordered lines.
17588 Save and restore bidi cache.
17589
17590 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17591 (bidi_paragraph_info): Delete unused struct.
17592 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17593 (bidi_cache_start): New variable.
17594 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17595 to zero.
17596 (bidi_cache_fetch_state, bidi_cache_search)
17597 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17598 (bidi_cache_find, bidi_peek_at_next_level)
17599 (bidi_level_of_next_char, bidi_find_other_level_edge)
17600 (bidi_move_to_visually_next): Compare cache index with
17601 bidi_cache_start rather than with zero.
17602 (bidi_fetch_char): Accept new argument STRING; all callers
17603 changed. Support iteration over a string. Support strings with
17604 display properties. Support unibyte strings. Fix the type of
17605 `len' according to what STRING_CHAR_AND_LENGTH expects.
17606 (bidi_paragraph_init, bidi_resolve_explicit_1)
17607 (bidi_resolve_explicit, bidi_resolve_weak)
17608 (bidi_level_of_next_char, bidi_move_to_visually_next):
17609 Support iteration over a string.
17610 (bidi_set_sor_type, bidi_resolve_explicit_1)
17611 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17612 can now be zero (for strings); special values 0 and -1 were
17613 changed to -1 and -2, respectively.
17614 (bidi_char_at_pos): New function.
17615 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17616 Call it instead of FETCH_MULTIBYTE_CHAR.
17617 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17618 initialized to valid values.
17619 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17620 values.
17621 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17622 the test for valid cached positions. Fix the logic for looking up
17623 the sentinel state in the cache. GCPRO the Lisp string we are
17624 iterating.
17625 (bidi_push_it, bidi_pop_it): New functions.
17626 (bidi_initialize): Initialize the bidi cache start stack pointer.
17627 (bidi_cache_ensure_space): New function, refactored from part of
17628 bidi_cache_iterator_state. Don't assume the required size is just
17629 one BIDI_CACHE_CHUNK away.
17630 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17631 (bidi_count_bytes, bidi_char_at_pos): New functions.
17632 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17633 always valid if bidi_cache_idx is valid.
17634 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17635 is valid if it's going to be used.
17636 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17637 (bidi_cache_fetch_state, bidi_cache_search)
17638 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17639 (bidi_cache_iterator_state, bidi_cache_find)
17640 (bidi_find_other_level_edge, bidi_cache_start_stack):
17641 All variables related to cache indices are now EMACS_INT.
17642
17643 * dispextern.h (struct bidi_string_data): New structure.
17644 (struct bidi_it): New member `string'. Make flag members be 1-bit
17645 fields, and put them last in the struct.
17646 (compute_display_string_pos, compute_display_string_end):
17647 Update prototypes.
17648 (bidi_push_it, bidi_pop_it): Add prototypes.
17649 (struct iterator_stack_entry): New members bidi_p,
17650 paragraph_embedding, and from_disp_prop_p.
17651 (struct it): Member bidi_p is now a bit field 1 bit wide.
17652 (bidi_shelve_cache, bidi_unshelve_cache):
17653 Declare prototypes.
17654
17655 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17656 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17657 and vector-like objects.
17658
17659 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17660 cache around display iteration.
17661
17662 * window.c (Fwindow_end, window_scroll_pixel_based)
17663 (displayed_window_lines, Frecenter): Save and restore the bidi
17664 cache around display iteration.
17665
17666 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17667
17668 * editfns.c (Fdelete_region): Clarify the use of the named
17669 parameters (bug#6788).
17670
17671 2011-07-14 Martin Rudalics <rudalics@gmx.at>
17672
17673 * indent.c (Fvertical_motion): Set and restore w->pointm when
17674 saving and restoring the window's buffer (Bug#9006).
17675
17676 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17677
17678 * editfns.c (Fstring_to_char): Clarify just what is returned
17679 (bug#6576). Text by Eli Zaretskii.
17680
17681 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
17682
17683 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17684
17685 2011-07-13 Eli Zaretskii <eliz@gnu.org>
17686
17687 * buffer.c (mmap_find): Fix a typo.
17688
17689 2011-07-13 Johan Bockgård <bojohan@gnu.org>
17690
17691 Fix execution of x selection hooks.
17692 * xselect.c (Qx_lost_selection_functions)
17693 (Qx_sent_selection_functions): New vars.
17694 (syms_of_xselect): DEFSYM them.
17695 (x_handle_selection_request): Pass Qx_sent_selection_functions
17696 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17697 (x_handle_selection_clear,x_clear_frame_selections):
17698 Pass Qx_lost_selection_functions rather than
17699 Vx_lost_selection_functions to Frun_hook_with_args.
17700
17701 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17702
17703 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17704 The old code sometimes used this field without initializing it.
17705
17706 * alloc.c (gc_sweep): Don't read past end of array.
17707 In theory, the old code could also have corrupted Emacs internals,
17708 though it'd be very unlikely.
17709
17710 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17711
17712 * character.c (Fcharacterp): Don't advertise optional ignored
17713 argument. (Bug#4026)
17714
17715 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17716
17717 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17718 key" (bug#4257).
17719
17720 * window.c (Fset_window_start): Doc fix (bug#4199).
17721 (Fset_window_hscroll): Ditto.
17722
17723 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17724
17725 Fix minor new problems caught by GCC 4.6.1.
17726 * term.c (init_tty): Remove unused local.
17727 * xsettings.c (store_monospaced_changed): Define this function only
17728 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17729 not used otherwise.
17730
17731 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
17732
17733 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17734
17735 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17736
17737 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17738 are the mini-buffer and the echo area (bug#3320).
17739
17740 * term.c (init_tty): Remove support for supdup, c10 and perq
17741 terminals, which are no longer supported (bug#1482).
17742
17743 2011-07-10 Johan Bockgård <bojohan@gnu.org>
17744
17745 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17746
17747 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17748
17749 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17750 for non-popups (Bug#3642).
17751
17752 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17753
17754 * alloc.c (reset_malloc_hooks): Protoize.
17755 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17756 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17757 * cm.c (losecursor): Likewise.
17758 * data.c (fmod): Likewise.
17759 * dispnew.c (swap_glyphs_in_rows): Likewise.
17760 * emacs.c (memory_warning_signal): Likewise.
17761 * floatfns.c (float_error): Likewise.
17762 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17763 (otf_open, font_otf_capability, generate_otf_features)
17764 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17765 Likewise.
17766 * image.c (pbm_read_file): Likewise.
17767 * indent.c (string_display_width): Likewise.
17768 * intervals.c (check_for_interval, search_for_interval)
17769 (inc_interval_count, count_intervals, root_interval)
17770 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17771 * lread.c (defalias): Likewise.
17772 * ralloc.c (r_alloc_check): Likewise.
17773 * regex.c (set_image_of_range_1, set_image_of_range)
17774 (regex_grow_registers): Likewise.
17775 * sysdep.c (strerror): Likewise.
17776 * termcap.c (valid_filename_p, tprint, main): Likewise.
17777 * tparam.c (main): Likewise.
17778 * unexhp9k800.c (run_time_remap, save_data_space)
17779 (update_file_ptrs, read_header, write_header, calculate_checksum)
17780 (copy_file, copy_rest, display_header): Likewise.
17781 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17782 Likewise.
17783 * xdisp.c (check_it): Likewise.
17784 * xfaces.c (register_color, unregister_color, unregister_colors):
17785 Likewise.
17786 * xfns.c (print_fontset_result): Likewise.
17787 * xrdb.c (member, fatal, main): Likewise.
17788
17789 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17790
17791 Fix minor problems found by static checking (Bug#9031).
17792 * chartab.c (char_table_set_range, map_sub_char_table):
17793 Remove unused locals.
17794 (uniprop_table): Now static.
17795 * composite.c (_work_char): Remove unused static var.
17796
17797 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
17798
17799 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17800
17801 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17802
17803 * gtkutil.c (qttip_cb): Remove code without function.
17804
17805 2011-07-09 Eli Zaretskii <eliz@gnu.org>
17806
17807 * w32.c (pthread_sigmask): New stub.
17808
17809 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
17810
17811 Use pthread_sigmask, not sigprocmask (Bug#9010).
17812 sigprocmask is portable only for single-threaded applications, and
17813 Emacs can be multi-threaded when it uses GTK.
17814 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17815 (LIBES): Use it.
17816 * callproc.c (Fcall_process):
17817 * process.c (create_process):
17818 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17819 Use pthread_sigmask, not sigprocmask.
17820
17821 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17822
17823 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17824 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17825 wrong (Bug#8591).
17826
17827 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17828
17829 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17830 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17831 (xg_hide_tooltip): Fix comment.
17832
17833 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17834 in registerServicesMenuSendTypes.
17835 (validRequestorForSendType): Don't check ns_return_types.
17836
17837 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17838 ns_return_type.
17839
17840 2011-07-08 Jason Rumney <jasonr@gnu.org>
17841
17842 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17843 SH_SHOW for hidden windows (Bug#5482).
17844
17845 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17846 frame struct members of non-existent frames (Bug#6284).
17847
17848 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17849
17850 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17851 variable firstTime not needed on OSX >= 10.6.
17852 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17853 >= 10.5. Use setKnobProportion, setDoubleValue.
17854
17855 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17856 (MAC_OS_X_VERSION_10_5): Define if not defined.
17857 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17858 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17859 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17860
17861 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17862 cString and lossyCString on OSX >= 10.4.
17863
17864 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17865 sizeToFit on OSX >= 10.2.
17866
17867 * nsimage.m (allocInitFromFile): Don't use deprecated method
17868 bestRepresentationForDevice on OSX >= 10.6.
17869
17870 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17871 to avoid warning.
17872
17873 * emacs.c: Declare unexec_init_emacs_zone.
17874
17875 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17876
17877 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17878
17879 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17880 on svcsMenu (Bug#8842).
17881
17882 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17883 ns_return_types.
17884 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17885
17886 * nsterm.m (QUTF8_STRING): Declare.
17887 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17888 (validRequestorForSendType): Return type is (id).
17889 Change indexOfObjectIdenticalTo to indexOfObject.
17890 Check if we have local selection before returning self (Bug#8842).
17891 (writeSelectionToPasteboard): Put local selection into paste board
17892 if we have a local selection (Bug#8842).
17893 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17894
17895 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17896 (ns_get_local_selection): Declare.
17897
17898 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17899
17900 * keymap.c (describe_map_tree): Don't insert a double newline at
17901 the end of the buffer (bug#1169) and return whether we inserted
17902 something.
17903
17904 * callint.c (Fcall_interactively): Change "reading args" to
17905 "providing args" to try to clarify what it does (bug#1010).
17906
17907 2011-07-07 Kenichi Handa <handa@m17n.org>
17908
17909 * composite.c (composition_compute_stop_pos): Ignore a static
17910 composition starting before CHARPOS (Bug#8915).
17911
17912 * xdisp.c (handle_composition_prop): Likewise.
17913
17914 2011-07-07 Eli Zaretskii <eliz@gnu.org>
17915
17916 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17917 (Bug#9015)
17918
17919 2011-07-07 Kenichi Handa <handa@m17n.org>
17920
17921 * character.h (unicode_category_t): New enum type.
17922
17923 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17924 (Qchar_code_property_table): New variable.
17925 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17926 (UNIPROP_COMPRESSED_FORM_P): New macros.
17927 (char_table_ascii): Uncompress the compressed values.
17928 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17929 Uncompress the compressed values.
17930 (sub_char_table_ref_and_range): Likewise.
17931 (char_table_ref_and_range): Uncompress the compressed values.
17932 (sub_char_table_set): New arg is_uniprop. Callers changed.
17933 Uncompress the compressed values.
17934 (sub_char_table_set_range): Args changed. Callers changed.
17935 (char_table_set_range): Adjuted for the above change.
17936 (map_sub_char_table): Delete args default_val and parent. Add arg
17937 top. Give decoded values to a Lisp function.
17938 (map_char_table): Adjust for the above change. Give decoded
17939 values to a Lisp function. Gcpro more variables.
17940 (uniprop_table_uncompress)
17941 (uniprop_decode_value_run_length): New functions.
17942 (uniprop_decoder, uniprop_decoder_count): New variables.
17943 (uniprop_get_decoder, uniprop_encode_value_character)
17944 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17945 New functions.
17946 (uniprop_encoder, uniprop_encoder_count): New variables.
17947 (uniprop_get_encoder, uniprop_table)
17948 (Funicode_property_table_internal, Fget_unicode_property_internal)
17949 (Fput_unicode_property_internal): New functions.
17950 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17951 Sunicode_property_table_internal, Sget_unicode_property_internal,
17952 and Sput_unicode_property_internal. Defvar_lisp
17953 char-code-property-alist.
17954
17955 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17956 Vunicode_category_table.
17957
17958 * font.c (font_range): Adjust for the change of
17959 Vunicode_category_table.
17960
17961 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17962
17963 * m/iris4d.h: Remove file, move contents ...
17964 * s/irix6-5.h: ... here.
17965
17966 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17967
17968 Remove unportable assumption about struct layout (Bug#8884).
17969 * alloc.c (mark_buffer):
17970 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17971 (clone_per_buffer_values): Don't assume that
17972 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17973 This isn't true in general, and it's particularly not true
17974 if Emacs is configured with --with-wide-int.
17975 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17976 New macros, used in the buffer.c change.
17977
17978 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17979
17980 * xsettings.c: Use both GConf and GSettings if both are available.
17981 (store_config_changed_event): Add comment.
17982 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17983 (store_tool_bar_style_changed): New functions.
17984 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
17985 (struct xsettings): Move font inside HAVE_XFT.
17986 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17987 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17988 Move inside HAVE_XFT.
17989 (something_changed_gsettingsCB): Rename from something_changedCB.
17990 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17991 also.
17992 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17993 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
17994 (something_changed_gconfCB): Rename from something_changedCB.
17995 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17996 (parse_settings): Move check for font inside HAVE_XFT.
17997 (read_settings, apply_xft_settings): Add comment.
17998 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17999 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18000 call store_font_name_changed.
18001 (xft_settings_event): Add comment.
18002 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18003 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18004 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18005 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18006 (xsettings_initialize): Call init_gsettings last.
18007 (xsettings_get_system_font, xsettings_get_system_normal_font):
18008 Add comment.
18009
18010 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18011
18012 Random fixes. E.g., (random) never returned negative values.
18013 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18014 subseconds part to the entropy, as that's a bit more random.
18015 Prefer signed to unsigned, since the signedness doesn't matter and
18016 in general we prefer signed. When given a limit, use a
18017 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18018 latter isn't right if USE_2_TAGS_FOR_INTS.
18019 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18020 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18021
18022 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18023
18024 * textprop.c (text_property_stickiness):
18025 Obey Vtext_property_default_nonsticky.
18026 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18027 * w32fns.c (syms_of_w32fns):
18028 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18029
18030 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18031
18032 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18033 This is more efficient than Ffile_directory_p and avoids a minor race.
18034
18035 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18036
18037 * buffer.c (Foverlay_put): Say what the return value is
18038 (bug#7835).
18039
18040 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18041 is a directory before asking whether to use the file name
18042 (bug#7564).
18043 (barf_or_query_if_file_exists): Make the "File is a directory"
18044 error be more correct.
18045
18046 * fns.c (Frequire): Remove the mention of the .gz files, since
18047 that's installation-specific, but keep the mention of
18048 `get-load-suffixes'.
18049
18050 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18051
18052 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18053 Report string overflow if the output is too long.
18054
18055 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18056
18057 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18058 (syms_of_gnutls): Remove duplicate DEFSYM for
18059 Qgnutls_bootprop_verify_hostname_error, an error for
18060 Qgnutls_bootprop_verify_error (which is no longer used).
18061
18062 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18063 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18064 Also (re)move comments that are misplaced or no longer relevant.
18065
18066 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18067
18068 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18069
18070 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18071
18072 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18073 and background color parameters if they have been changed.
18074
18075 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18076
18077 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18078
18079 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18080
18081 * xsettings.c (SYSTEM_FONT): Define only when used.
18082 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18083
18084 * keymap.c (access_keymap_1): Now static.
18085
18086 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18087
18088 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18089 leave any prefix arg for the up event (Bug#1586).
18090
18091 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18092
18093 * lread.c (syms_of_lread): Mention single symbols defined by
18094 `defvar' or `defconst' (bug#7154).
18095
18096 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18097 (Frequire): Mention get-load-suffixes.
18098
18099 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18100
18101 * window.h (window): Remove clone_number slot.
18102 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18103 Remove.
18104 (make_parent_window, make_window, saved_window)
18105 (Fset_window_configuration, save_window_save): Don't deal with
18106 clone numbers.
18107 * buffer.c (Qclone_number): Remove declaration.
18108 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18109
18110 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18111
18112 Add multiple inheritance to keymaps.
18113 * keymap.c (Fmake_composed_keymap): New function.
18114 (Fset_keymap_parent): Simplify.
18115 (fix_submap_inheritance): Remove.
18116 (access_keymap_1): New function extracted from access_keymap to handle
18117 embedded parents and handle lists of maps.
18118 (access_keymap): Use it.
18119 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18120 (Fcopy_keymap): Handle embedded parents.
18121 (Fcommand_remapping, define_as_prefix): Simplify.
18122 (Fkey_binding): Simplify.
18123 (syms_of_keymap): Move minibuffer-local-completion-map,
18124 minibuffer-local-filename-completion-map,
18125 minibuffer-local-must-match-map, and
18126 minibuffer-local-filename-must-match-map to Elisp.
18127 (syms_of_keymap): Defsubr make-composed-keymap.
18128 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18129 (parse_menu_item): Trivial simplification.
18130
18131 2011-07-01 Glenn Morris <rgm@gnu.org>
18132
18133 * Makefile.in (SETTINGS_LIBS): Fix typo.
18134
18135 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18136
18137 * coding.c (Fencode_coding_string): Record the last coding system
18138 used, as the function doc string says (bug#8738).
18139
18140 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18141
18142 * xsettings.c (store_monospaced_changed): Take new font as arg and
18143 check for change against current_mono_font.
18144 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18145 (emacs_settings_constructor, emacs_settings_get_property)
18146 (emacs_settings_set_property, emacs_settings_class_init)
18147 (emacs_settings_init, gsettings_obj): Remove.
18148 (something_changedCB): New function for HAVE_GSETTINGS.
18149 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18150 with value as argument.
18151 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18152 g_settings_new (Bug#8967). Do not create gsettings_obj.
18153 Remove calls to g_settings_bind. Connect something_changedCB to
18154 "changed".
18155
18156 * xgselect.c: Add defined (HAVE_GSETTINGS).
18157 (xgselect_initialize): Ditto.
18158
18159 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18160 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18161 xg_select.
18162
18163 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18164
18165 * eval.c (struct backtrace): Simplify and port the data structure.
18166 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18167 signed bit field, as this assumption is not portable and it makes
18168 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18169 "char debug_on_exit : 1" as this is not portable either; instead,
18170 use the portable "unsigned int debug_on_exit : 1". Remove unused
18171 member evalargs. Remove obsolete comments about cc bombing out.
18172
18173 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18174
18175 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18176 Let HAVE_GSETTINGS override HAVE_GCONF.
18177 (store_monospaced_changed): New function.
18178 (EMACS_SETTINGS): A new type derived from GObject to handle
18179 GSettings notifications.
18180 (emacs_settings_constructor, emacs_settings_get_property)
18181 (emacs_settings_set_property, emacs_settings_class_init):
18182 New functions.
18183 (gsettings_client, gsettings_obj): New variables.
18184 (GSETTINGS_SCHEMA): New define.
18185 (something_changedCB): Call store_monospaced_changed.
18186 (init_gsettings): New function.
18187 (xsettings_initialize): Call init_gsettings.
18188 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18189 to NULL.
18190
18191 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18192 GCONF_CFLAGS/LIBS.
18193
18194 2011-06-29 Martin Rudalics <rudalics@gmx.at>
18195
18196 * window.c (resize_root_window, grow_mini_window)
18197 (shrink_mini_window): Rename Qresize_root_window to
18198 Qwindow_resize_root_window and Qresize_root_window_vertically to
18199 Qwindow_resize_root_window_vertically.
18200
18201 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18202
18203 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18204
18205 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
18206
18207 * makefile.w32-in: Redesign dependencies so they reflect more
18208 clearly which files are directly included by each source file,
18209 and not through other includes.
18210
18211 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18212
18213 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18214 (sort_overlays, overlay_strings): When an overlay's clone number
18215 matches the window's clone number process the overlay even if
18216 the overlay's window property doesn't match the current window.
18217
18218 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18219 (Fwindow_hchild): Rename to Fwindow_left_child.
18220 (Fwindow_next): Rename to Fwindow_next_sibling.
18221 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18222 (resize_window_check): Rename to window_resize_check.
18223 (resize_window_apply): Rename to window_resize_apply.
18224 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18225 (Fdelete_other_windows_internal, resize_frame_windows)
18226 (Fsplit_window_internal, Fdelete_window_internal)
18227 (grow_mini_window, shrink_mini_window)
18228 (Fresize_mini_window_internal): Fix callers accordingly.
18229
18230 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18231
18232 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18233 (emacs_fixed_set_min_size): Remove.
18234 (emacs_fixed_new): Take frame as argument.
18235
18236 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18237 (_EmacsFixedPrivate): Remove minwidth/height.
18238 Add struct frame *f.
18239 (emacs_fixed_init): Initialize priv->f.
18240 (get_parent_class, emacs_fixed_set_min_size): Remove.
18241 (emacs_fixed_new): Set priv->f to argument.
18242 (emacs_fixed_get_preferred_width)
18243 (emacs_fixed_get_preferred_height): Use min_width/height from
18244 frames size_hint to set minimum and natural (Bug#8919).
18245 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18246 and use min_width/height from frames size_hint to set
18247 min_width/height (Bug#8919).
18248
18249 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18250 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18251 Fix indentation.
18252
18253 2011-06-26 Eli Zaretskii <eliz@gnu.org>
18254
18255 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18256 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18257 called at ZV.
18258
18259 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
18260
18261 * process.c (wait_reading_process_output): Bypass select if
18262 waiting for a cell while ignoring keyboard input, and input is
18263 pending. Suggested by Jan Djärv (Bug#8869).
18264
18265 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18266
18267 Use gnulib's dup2 module instead of rolling our own.
18268 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18269
18270 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18271
18272 * dispnew.c (scrolling_window): Before scrolling, turn off a
18273 mouse-highlight in the window being scrolled.
18274
18275 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
18276
18277 Move DEFSYM to lisp.h and use everywhere.
18278
18279 * character.h (DEFSYM): Move declaration...
18280 * lisp.h (DEFSYM): ...here.
18281
18282 * gnutls.c:
18283 * minibuf.c:
18284 * w32menu.c:
18285 * w32proc.c:
18286 * w32select.c: Don't include character.h.
18287
18288 * alloc.c (syms_of_alloc):
18289 * buffer.c (syms_of_buffer):
18290 * bytecode.c (syms_of_bytecode):
18291 * callint.c (syms_of_callint):
18292 * casefiddle.c (syms_of_casefiddle):
18293 * casetab.c (init_casetab_once):
18294 * category.c (init_category_once, syms_of_category):
18295 * ccl.c (syms_of_ccl):
18296 * cmds.c (syms_of_cmds):
18297 * composite.c (syms_of_composite):
18298 * dbusbind.c (syms_of_dbusbind):
18299 * dired.c (syms_of_dired):
18300 * dispnew.c (syms_of_display):
18301 * doc.c (syms_of_doc):
18302 * editfns.c (syms_of_editfns):
18303 * emacs.c (syms_of_emacs):
18304 * eval.c (syms_of_eval):
18305 * fileio.c (syms_of_fileio):
18306 * fns.c (syms_of_fns):
18307 * frame.c (syms_of_frame):
18308 * fringe.c (syms_of_fringe):
18309 * insdel.c (syms_of_insdel):
18310 * keymap.c (syms_of_keymap):
18311 * lread.c (init_obarray, syms_of_lread):
18312 * macros.c (syms_of_macros):
18313 * msdos.c (syms_of_msdos):
18314 * print.c (syms_of_print):
18315 * process.c (syms_of_process):
18316 * search.c (syms_of_search):
18317 * sound.c (syms_of_sound):
18318 * syntax.c (init_syntax_once, syms_of_syntax):
18319 * terminal.c (syms_of_terminal):
18320 * textprop.c (syms_of_textprop):
18321 * undo.c (syms_of_undo):
18322 * w32.c (globals_of_w32):
18323 * window.c (syms_of_window):
18324 * xdisp.c (syms_of_xdisp):
18325 * xfaces.c (syms_of_xfaces):
18326 * xfns.c (syms_of_xfns):
18327 * xmenu.c (syms_of_xmenu):
18328 * xsettings.c (syms_of_xsettings):
18329 * xterm.c (syms_of_xterm): Use DEFSYM.
18330
18331 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18332
18333 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18334
18335 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18336
18337 Integer and buffer overflow fixes (Bug#8873).
18338
18339 * print.c (printchar, strout): Check for string overflow.
18340 (PRINTPREPARE, printchar, strout):
18341 Don't set size unless allocation succeeds.
18342
18343 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18344 for sizes. Check for string overflow more accurately.
18345 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18346
18347 * macros.c: Integer and buffer overflow fixes.
18348 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18349 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18350 Use ptrdiff_t, not int, for sizes.
18351 Don't increment bufsize until after realloc succeeds.
18352 Check for size-calculation overflow.
18353 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18354
18355 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18356
18357 * lread.c: Integer overflow fixes.
18358 (read_integer): Radix is now EMACS_INT, not int,
18359 to improve quality of diagnostics for out-of-range radices.
18360 Calculate buffer size correctly for out-of-range radices.
18361 (read1): Check for integer overflow in radices, and in
18362 read-circle numbers.
18363 (read_escape): Avoid int overflow.
18364 (Fload, openp, read_buffer_size, read1)
18365 (substitute_object_recurse, read_vector, read_list, map_obarray):
18366 Use ptrdiff_t, not int, for sizes.
18367 (read1): Use EMACS_INT, not int, for sizes.
18368 Check for size overflow.
18369
18370 * image.c (cache_image): Check for size arithmetic overflow.
18371
18372 * lread.c: Integer overflow issues.
18373 (saved_doc_string_size, saved_doc_string_length)
18374 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18375 Now ptrdiff_t, not int.
18376 (read1): Don't assume doc string length fits in int. Check for
18377 out-of-range doc string lengths.
18378 (read_list): Don't assume file position fits in int.
18379 (read_escape): Check for hex character overflow.
18380
18381 2011-06-22 Leo Liu <sdl.web@gmail.com>
18382
18383 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18384 Move to minibuffer.el.
18385
18386 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18387
18388 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18389 The following patches are for when GLYPH_DEBUG && !XASSERT.
18390 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18391 * dispnew.c (flush_stdout):
18392 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18393 Mark as externally visible.
18394 * dispnew.c (check_window_matrix_pointers): Now static.
18395 * dispnew.c (window_to_frame_vpos):
18396 * xfns.c (unwind_create_frame):
18397 * xterm.c (x_check_font): Remove unused local.
18398 * scroll.c (CHECK_BOUNDS):
18399 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18400 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18401 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18402 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18403 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18404 Now static.
18405 (debug_method_add): Use va_list and vsprintf rather than relying
18406 on undefined behavior with wrong number of arguments.
18407 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18408 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18409 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18410 since we're not interested in debugging glyphs with old libraries.
18411 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18412 GCC 4.6.0's static checking.
18413
18414 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18415
18416 Integer overflow and signedness fixes (Bug#8873).
18417 A few related buffer overrun fixes, too.
18418
18419 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18420
18421 * dispextern.h (struct face.stipple):
18422 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18423 (x_bitmap_mask, x_allocate_bitmap_record)
18424 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18425 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18426 (x_create_bitmap_from_xpm_data):
18427 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18428 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18429 (.bitmaps_last):
18430 * xfaces.c (load_pixmap):
18431 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18432 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18433 (.bitmaps_last, struct x_output.icon_bitmap):
18434 Use ptrdiff_t, not int, for bitmap indexes.
18435 (x_allocate_bitmap_record): Check for size overflow.
18436 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18437
18438 Use ptrdiff_t, not int, for overlay counts.
18439 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18440 * editfns.c (overlays_around, get_pos_property):
18441 * textprop.c (get_char_property_and_overlay):
18442 * xdisp.c (next_overlay_change, note_mouse_highlight):
18443 * xfaces.c (face_at_buffer_position):
18444 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18445 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18446 (Fnext_overlay_change, Fprevious_overlay_change)
18447 (mouse_face_overlay_overlaps, Foverlays_in):
18448 Use ptrdiff_t, not int, for sizes.
18449 (overlays_at, overlays_in): Check for size-calculation overflow.
18450
18451 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18452
18453 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18454 (x_session_initialize): Do not assume string length fits in int.
18455
18456 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18457 This is unlikely, but can occur if DPI is outlandish.
18458
18459 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18460 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18461
18462 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18463 * xrdb.c (magic_file_p, search_magic_path):
18464 Omit last arg SUFFIX; it was always 0. All callers changed.
18465 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18466
18467 * xfont.c (xfont_match): Avoid need for strlen.
18468
18469 * xfns.c: Don't assume strlen fits in int.
18470 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18471
18472 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18473 not unsigned long, as we prefer signed integers. All callers changed.
18474 Detect integer overflow in repeat count.
18475 (message_dolog): Don't assume print length fits in 39 bytes.
18476 (display_mode_element): Don't assume strlen fits in int.
18477
18478 * termcap.c: Don't assume sizes fit in int and never overflow.
18479 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18480 (gobble_line): Check for size-calculation overflow.
18481
18482 * minibuf.c (Fread_buffer):
18483 * lread.c (intern, intern_c_string):
18484 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18485 Don't assume string length fits in int.
18486
18487 * keyboard.c (parse_tool_bar_item):
18488 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18489
18490 * font.c: Don't assume string length fits in int.
18491 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18492 Use ptrdiff_t, not int.
18493 (font_intern_prop): Don't assume string length fits in int.
18494 Don't assume integer property fits in fixnum.
18495 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18496
18497 * filelock.c: Fix some buffer overrun and integer overflow issues.
18498 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18499 Reformulate so as not to need the command string.
18500 Invoke gzip -cd rather than gunzip, as it's more portable.
18501 (lock_info_type, lock_file_1, lock_file):
18502 Don't assume pid_t and time_t fit in unsigned long.
18503 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18504 (current_lock_owner): Prefer signed type for sizes.
18505 Use memcpy, not strncpy, where memcpy is what is really wanted.
18506 Don't assume (via atoi) that time_t and pid_t fit in int.
18507 Check for time_t and/or pid_t out of range, e.g., via a network share.
18508 Don't alloca where an auto var works fine.
18509
18510 * fileio.c: Fix some integer overflow issues.
18511 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18512 Don't assume string length fits in int.
18513 (directory_file_name): Don't assume string length fits in long.
18514 (make_temp_name): Don't assume pid fits in int, or that its print
18515 length is less than 20.
18516
18517 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18518
18519 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18520
18521 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18522
18523 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18524 We prefer signed integers, even for size calculations.
18525
18526 * emacs.c: Don't assume string length fits in 'int'.
18527 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18528 (main): Don't invoke strlen when not needed.
18529
18530 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18531 (XD_DEBUG_MESSAGE): Don't waste a byte.
18532
18533 * callproc.c (getenv_internal_1, getenv_internal)
18534 (Fgetenv_internal):
18535 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18536
18537 * lread.c (invalid_syntax): Omit length argument.
18538 All uses changed. This doesn't fix a bug, but it simplifies the
18539 code away from its former Hollerith-constant appearance, and it's
18540 one less 'int' to worry about when looking at integer-overflow issues.
18541 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18542
18543 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18544 This didn't break anything, but it didn't help either.
18545 It's confusing to put a bogus integer in a place where the actual
18546 value does not matter.
18547 (LIST_END_P): Remove unused macro and its bogus comment.
18548 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18549
18550 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18551 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18552 implementation.
18553 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18554 We prefer signed types, and the value cannot exceed the EMACS_INT
18555 range anyway (because otherwise the length would not be representable).
18556 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18557 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18558 This avoids a GCC warning when WIDE_EMACS_INT.
18559
18560 * indent.c (sane_tab_width): New function.
18561 (current_column, scan_for_column, Findent_to, position_indentation)
18562 (compute_motion): Use it. This is just for clarity.
18563 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18564
18565 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18566
18567 * lisp.h (lint_assume): New macro.
18568 * composite.c (composition_gstring_put_cache):
18569 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18570
18571 * editfns.c, insdel.c:
18572 Omit unnecessary forward decls, to simplify future changes.
18573
18574 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18575
18576 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18577
18578 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18579 Use much-faster test for byte-length change.
18580 Don't assume string byte-length fits in 'int'.
18581 Check that character arg fits in 'int'.
18582 (mapcar1): Declare byte as byte, for clarity.
18583
18584 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18585
18586 * fns.c (concat): Catch string overflow earlier.
18587 Do not rely on integer wraparound.
18588
18589 * dispextern.h (struct it.overlay_strings_charpos)
18590 (struct it.selective): Now EMACS_INT, not int.
18591 * xdisp.c (forward_to_next_line_start)
18592 (back_to_previous_visible_line_start)
18593 (reseat_at_next_visible_line_start, next_element_from_buffer):
18594 Don't arbitrarily truncate the value of 'selective' to int.
18595
18596 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18597
18598 * composite.c: Don't truncate sizes to 'int'.
18599 (composition_gstring_p, composition_reseat_it)
18600 (composition_adjust_point): Use EMACS_INT, not int.
18601 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18602 not EMACS_UINT, for indexes.
18603
18604 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18605
18606 * buffer.c: Include <verify.h>.
18607 (struct sortvec.priority, struct sortstr.priority):
18608 Now EMACS_INT, not int.
18609 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18610 (struct sortstr.size, record_overlay_string)
18611 (struct sortstrlist.size, struct sortlist.used):
18612 Don't truncate size to int.
18613 (record_overlay_string): Check for size-calculation overflow.
18614 (init_buffer_once): Check at compile-time, not run-time.
18615
18616 2011-06-22 Jim Meyering <meyering@redhat.com>
18617
18618 Don't leak an XBM-image-sized buffer
18619 * image.c (xbm_load): Free the image buffer after using it.
18620
18621 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18622
18623 Port to Sun C.
18624 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18625 that Sun C diagnosed.
18626 * fns.c (secure_hash): Fix pointer signedness issue.
18627 * intervals.c (static_offset_intervals): New function.
18628 (offset_intervals): Use it.
18629
18630 2011-06-21 Leo Liu <sdl.web@gmail.com>
18631
18632 * deps.mk (fns.o):
18633 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18634 sha512.h.
18635
18636 * fns.c (secure_hash): Rename from crypto_hash_function and change
18637 the first arg to accept symbols.
18638 (Fsecure_hash): New primitive.
18639 (syms_of_fns): New symbols.
18640
18641 2011-06-20 Deniz Dogan <deniz@dogan.se>
18642
18643 * process.c (Fset_process_buffer): Clarify return value in
18644 docstring.
18645
18646 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
18647
18648 * dispnew.c (add_window_display_history): Use BVAR.
18649
18650 * xdisp.c (debug_method_add): Use BVAR.
18651 (check_window_end, dump_glyph_matrix, dump_glyph)
18652 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18653
18654 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18655 Likewise.
18656
18657 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18658 check till after the cache is created in init_frame_faces.
18659
18660 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18661
18662 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18663
18664 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18665
18666 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18667 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18668 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18669
18670 Improve buffer-overflow checking (Bug#8873).
18671 * fileio.c (Finsert_file_contents):
18672 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18673 Remove the old (too-loose) buffer overflow checks.
18674 They weren't needed, since make_gap checks for buffer overflow.
18675 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18676 The old code merely checked for Emacs fixnum overflow, and relied
18677 on undefined (wraparound) behavior. The new code avoids undefined
18678 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18679
18680 * editfns.c (Finsert_char): Don't dump core with very negative counts.
18681 Tune. Don't use wider integers than needed. Don't use alloca.
18682 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
18683
18684 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18685
18686 * insdel.c, lisp.h (buffer_overflow): New function.
18687 (insert_from_buffer_1, replace_range, replace_range_2):
18688 * insdel.c (make_gap_larger):
18689 * editfns.c (Finsert_char):
18690 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18691
18692 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18693
18694 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18695
18696 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18697
18698 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18699 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18700
18701 * fileio.c: Don't assume EMACS_INT fits in off_t.
18702 (emacs_lseek): New static function.
18703 (Finsert_file_contents, Fwrite_region): Use it.
18704 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18705
18706 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18707
18708 * fns.c: Don't overflow int when computing a list length.
18709 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18710 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18711 truncation on 64-bit hosts. Check for QUIT every
18712 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18713 faster and is responsive enough.
18714 (Flength): Report an error instead of overflowing an integer.
18715 (Fsafe_length): Return a float if the value is not representable
18716 as a fixnum. This shouldn't happen except in contrived situations.
18717 (Fnthcdr, Fsort): Don't assume list length fits in int.
18718 (Fcopy_sequence): Don't assume vector length fits in int.
18719
18720 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18721 (header_size, word_size): New constants.
18722 (allocate_vectorlike): Don't check size overflow here.
18723 (allocate_vector): Check it here instead, since this is the only
18724 caller of allocate_vectorlike that could cause overflow.
18725 Check that the new vector's length is representable as a fixnum.
18726
18727 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18728 The previous code was bogus. For example, next_almost_prime (32)
18729 returned 39, which is undesirable as it is a multiple of 3; and
18730 next_almost_prime (24) returned 25, which is a multiple of 5 so
18731 why was the code bothering to check for multiples of 7?
18732
18733 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18734
18735 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18736
18737 Variadic C functions now count arguments with ptrdiff_t.
18738 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18739 Back then I didn't know that the Emacs coding style prefers signed int.
18740 Also, in the meantime I found a few more instances where arguments
18741 were being counted with int, which may truncate counts on 64-bit
18742 machines, or EMACS_INT, which may be unnecessarily wide.
18743 * lisp.h (struct Lisp_Subr.function.aMANY)
18744 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18745 Arg counts are now ptrdiff_t, not size_t.
18746 All variadic functions and their callers changed accordingly.
18747 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18748 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18749 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18750 * callint.c (Fcall_interactively): Check arg count for overflow,
18751 to avoid potential buffer overrun. Use signed char, not 'int',
18752 for 'varies' array, so that we needn't bother to check its size
18753 calculation for overflow.
18754 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18755 * eval.c (apply_lambda):
18756 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18757 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18758 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18759
18760 * callint.c (Fcall_interactively): Don't use index var as event count.
18761
18762 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18763 * mem-limits.h (SIZE): Remove; no longer used.
18764
18765 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18766
18767 Remove unnecessary casts.
18768 * xterm.c (x_term_init):
18769 * xfns.c (x_set_border_pixel):
18770 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18771 These aren't needed now that we assume ANSI C.
18772
18773 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18774 It's more likely to cause problems (due to unsigned overflow)
18775 than to cure them.
18776
18777 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18778
18779 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18780
18781 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18782
18783 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18784
18785 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18786
18787 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18788
18789 GLYPH_CODE_FACE returns EMACS_INT, not int.
18790 * dispextern.h (merge_faces):
18791 * xfaces.c (merge_faces):
18792 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18793 Don't assume EMACS_INT fits in int.
18794
18795 * character.h (CHAR_VALID_P): Remove unused parameter.
18796 * fontset.c, lisp.h, xdisp.c: All uses changed.
18797
18798 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18799
18800 * fns.c (concat): Minor tuning based on overflow analysis.
18801 This doesn't fix any bugs. Use int to hold character, instead
18802 of constantly refetching from Emacs object. Use XFASTINT, not
18803 XINT, for value known to be a character. Don't bother comparing
18804 a single byte to 0400, as it's always less.
18805
18806 * floatfns.c (Fexpt):
18807 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18808
18809 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18810 for characters.
18811
18812 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18813
18814 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18815 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18816 incorrectly succeed when S was a string, because 4294967386 was
18817 truncated before it was used.
18818
18819 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18820 Otherwise, an out-of-range integer could cause undefined behavior
18821 on a 64-bit host.
18822
18823 * composite.c: Use int, not EMACS_INT, for characters.
18824 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18825 EMACS_INT, for values that are known to be in character range.
18826 This doesn't fix any bugs but is the usual style inside Emacs and
18827 may generate better code on 32-bit machines.
18828
18829 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18830 This is for reasons similar to the recent CHAR_STRING fix.
18831 * charset.c (Fencode_char): Check that character arg is actually
18832 a character. Pass an int to ENCODE_CHAR.
18833 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18834 wider than 'int', as a compile-time check to prevent future regressions
18835 in this area.
18836
18837 * character.c (char_string): Remove unnecessary casts.
18838
18839 Make sure a 64-bit char is never passed to CHAR_STRING.
18840 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18841 by silently ignoring the top 32 bits, allowing some values
18842 that were far too large to be valid characters.
18843 * character.h: Include <verify.h>.
18844 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18845 arguments are no wider than unsigned, as a compile-time check
18846 to prevent future regressions in this area.
18847 * data.c (Faset):
18848 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18849 (Fsubst_char_in_region):
18850 * fns.c (concat):
18851 * xdisp.c (decode_mode_spec_coding):
18852 Adjust to CHAR_STRING's new requirement.
18853 * editfns.c (Finsert_char, Fsubst_char_in_region):
18854 * fns.c (concat): Check that character args are actually
18855 characters. Without this test, these functions did the wrong
18856 thing with wildly out-of-range values on 64-bit hosts.
18857
18858 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18859 These casts should not be needed on 32-bit hosts, either.
18860 * keyboard.c (read_char):
18861 * lread.c (Fload): Remove casts to unsigned.
18862
18863 * lisp.h (UNSIGNED_CMP): New macro.
18864 This fixes comparison bugs on 64-bit hosts.
18865 (ASCII_CHAR_P): Use it.
18866 * casefiddle.c (casify_object):
18867 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18868 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18869 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18870 * dispextern.h (FACE_FROM_ID):
18871 * keyboard.c (read_char): Use UNSIGNED_CMP.
18872
18873 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18874 not to EMACS_INT, to avoid GCC warning.
18875
18876 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18877
18878 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18879 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18880 isn't needed on 32-bit machines.
18881
18882 * buffer.c (Fgenerate_new_buffer_name):
18883 Use EMACS_INT for count, not int.
18884 (advance_to_char_boundary): Return EMACS_INT, not int.
18885
18886 * data.c (Qcompiled_function): Now static.
18887
18888 * window.c (window_body_lines): Now static.
18889
18890 * image.c (gif_load): Rename local to avoid shadowing.
18891
18892 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18893 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18894 * alloc.c (make_save_value): Integer argument is now of type
18895 ptrdiff_t, not int.
18896 (mark_object): Use ptrdiff_t, not int.
18897 * lisp.h (pD): New macro.
18898 * print.c (print_object): Use it.
18899
18900 * alloc.c: Use EMACS_INT, not int, to count objects.
18901 (total_conses, total_markers, total_symbols, total_vector_size)
18902 (total_free_conses, total_free_markers, total_free_symbols)
18903 (total_free_floats, total_floats, total_free_intervals)
18904 (total_intervals, total_strings, total_free_strings):
18905 Now EMACS_INT, not int. All uses changed.
18906 (Fgarbage_collect): Compute overall total using a double, so that
18907 integer overflow is less likely to be a problem. Check for overflow
18908 when converting back to an integer.
18909 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18910 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18911 These were 'int' variables that could overflow on 64-bit hosts;
18912 they were never used, so remove them instead of repairing them.
18913 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18914 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18915 Previously, this ceilinged at INT_MAX, but that doesn't work on
18916 64-bit machines.
18917 (allocate_pseudovector): Don't use EMACS_INT when int would do.
18918
18919 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18920 (allocate_vectorlike): Check for ptrdiff_t overflow.
18921 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18922 when a (possibly-narrower) signed value would do just as well.
18923 We prefer using signed arithmetic, to avoid comparison confusion.
18924
18925 * alloc.c: Catch some string size overflows that we were missing.
18926 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18927 for convenience in STRING_BYTES_MAX.
18928 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18929 The definition here is exact; the one in lisp.h was approximate.
18930 (allocate_string_data): Check for string overflow. This catches
18931 some instances we weren't catching before. Also, it catches
18932 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18933 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18934 and ptrdiff_t and EMACS_INT are both 64 bits.
18935
18936 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18937 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18938 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18939
18940 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18941
18942 * alloc.c (Fmake_string): Check for out-of-range init.
18943
18944 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18945
18946 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18947
18948 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18949
18950 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18951 xg_get_default_scrollbar_width.
18952
18953 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18954 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18955 (style_changed_cb): Call update_theme_scrollbar_width and call
18956 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18957 all frames (Bug#8505).
18958 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18959 Call gtk_window_set_resizable if HAVE_GTK3.
18960 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18961 and height if HAVE_GTK3 (Bug#8505).
18962 (scroll_bar_width_for_theme): New variable.
18963 (update_theme_scrollbar_width): New function.
18964 (xg_get_default_scrollbar_width): Move code to
18965 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18966 (xg_initialize): Call update_theme_scrollbar_width.
18967
18968 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18969
18970 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18971
18972 2011-06-12 Martin Rudalics <rudalics@gmx.at>
18973
18974 * frame.c (make_frame): Call other_buffer_safely instead of
18975 other_buffer.
18976
18977 * window.c (temp_output_buffer_show): Call display_buffer with
18978 second argument Vtemp_buffer_show_specifiers and reset latter
18979 immediately after the call.
18980 (Vtemp_buffer_show_specifiers): New variable.
18981 (auto_window_vscroll_p, next_screen_context_lines)
18982 (Vscroll_preserve_screen_position): Remove leading asterisks from
18983 doc-strings.
18984
18985 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
18986
18987 Fix minor problems found by GCC 4.6.0 static checking.
18988 * buffer.c (Qclone_number): Remove for now, as it's unused.
18989 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18990 (record_buffer): Remove unused local.
18991 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18992 (set_frame_buffer_list): Remove; unused.
18993 * frame.h (other_visible_frames): Remove decl.
18994 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18995 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18996 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18997 if HAVE_GPM.
18998 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18999 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19000 Define only if HAVE_GPM.
19001 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19002 (update_hints_inhibit): Remove; never set. All uses removed.
19003 * widgetprv.h (emacsFrameClassRec): Remove decl.
19004 * window.c (delete_deletable_window): Now returns void, since it
19005 wasn't returning anything.
19006 (compare_window_configurations): Remove unused locals.
19007 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19008 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19009 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19010 the same widths as pointers. This follows up on the 2011-05-06 patch.
19011 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19012 * xterm.h: Likewise.
19013 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19014
19015 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19016
19017 * makefile.w32-in: Update dependencies.
19018 (LISP_H): Add lib/intprops.h.
19019
19020 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19021
19022 * image.c (gif_load): Add animation frame delay to the metadata.
19023 (syms_of_image): Use DEFSYM. New symbol `delay'.
19024
19025 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19026
19027 * window.c (delete_deletable_window): Re-add.
19028 (Fset_window_configuration): Rewrite to handle dead buffers and
19029 consequently deletable windows.
19030 (window_tree, Fwindow_tree): Remove. Supply functionality in
19031 window.el.
19032 (compare_window_configurations): Simplify code.
19033
19034 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19035
19036 * image.c (imagemagick_load_image): Fix type mismatch.
19037 (Fimagemagick_types): Likewise.
19038
19039 * window.h (replace_buffer_in_windows): Declare.
19040
19041 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19042
19043 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19044 Qclone_number. Remove external declaration of Qdelete_window.
19045 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19046 code.
19047 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19048 Run Qbuffer_list_update_hook if allowed.
19049 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19050 buffer list implementation.
19051 (other_buffer_safely): New function.
19052 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19053 calls to replace_buffer_in_windows and
19054 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19055 if allowed.
19056 (record_buffer): Inhibit quitting and rewrite using quittable
19057 functions. Run Qbuffer_list_update_hook if allowed.
19058 (Frecord_buffer, Funrecord_buffer): New functions.
19059 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19060 Move switch-to-buffer to window.el.
19061 (bury-buffer): Move to window.el.
19062 (Vbuffer_list_update_hook): New variable.
19063
19064 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19065 section.
19066
19067 * window.h (resize_frame_windows): Move up in code.
19068 (Fwindow_frame): Remove EXFUN.
19069 (replace_buffer_in_all_windows): Remove prototype.
19070 (replace_buffer_in_windows_safely): Add prototype.
19071
19072 * window.c: Declare Qdelete_window static again. Move down
19073 declaration of select_count.
19074 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19075 (Fother_window): Move to window.el.
19076 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19077 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19078 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19079 window.el.
19080 (replace_buffer_in_windows): Implement by calling
19081 Qreplace_buffer_in_windows.
19082 (replace_buffer_in_all_windows): Remove with some functionality
19083 moved into replace_buffer_in_windows_safely.
19084 (replace_buffer_in_windows_safely): New function.
19085 (select_window_norecord, select_frame_norecord): Move in front
19086 of run_window_configuration_change_hook. Remove now obsolete
19087 declarations.
19088 (Fset_window_buffer): Rewrite doc-string.
19089 Call Qrecord_window_buffer.
19090 (keys_of_window): Move binding for other-window to window.el.
19091
19092 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19093
19094 * dispextern.h (struct image): Replace data member, whose int_val
19095 and ptr_val fields were not used by anything, with a single
19096 lisp_val object.
19097
19098 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19099 (gif_clear_image, gif_load, imagemagick_load_image)
19100 (gs_clear_image, gs_load): Callers changed.
19101
19102 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19103
19104 * buffer.h: Include <time.h>, for time_t.
19105 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19106
19107 Fix minor problems found by static checking.
19108
19109 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19110
19111 Make identifiers static if they are not used in other modules.
19112 * data.c (Qcompiled_function, Qframe, Qvector):
19113 * image.c (QimageMagick, Qsvg):
19114 * minibuf.c (Qmetadata):
19115 * window.c (resize_window_check, resize_root_window): Now static.
19116 * window.h (resize_window_check, resize_root_window): Remove decls.
19117
19118 * window.c (window_deletion_count, delete_deletable_window):
19119 Remove; unused.
19120 (window_body_lines): Now static.
19121 (Fdelete_other_windows_internal): Mark vars as initialized.
19122 Make sure 'resize_failed' is initialized.
19123 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19124 (resize_window_apply): Remove unused local.
19125 * window.h (delete_deletable_window): Remove decl.
19126
19127 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19128 (imagemagick_load_image): Fix pointer signedness problem by changing
19129 last arg from unsigned char * to char *. All uses changed.
19130 Also, fix a local for similar reasons.
19131 Remove unused locals. Remove locals to avoid shadowing.
19132 (fn_rsvg_handle_free): Remove; unused.
19133 (svg_load, svg_load_image): Fix pointer signedness problem.
19134 (imagemagick_load_image): Don't use garbage pointer image_wand.
19135
19136 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19137
19138 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19139
19140 * image.c (gif_load): Fix omitted cast error introduced by
19141 2011-06-06 change.
19142
19143 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19144
19145 * window.h (resize_proportionally, orig_total_lines)
19146 (orig_top_line): Remove from window structure.
19147 (set_window_height, set_window_width, change_window_heights)
19148 (Fdelete_window): Remove prototypes.
19149 (resize_frame_windows): Remove duplicate declaration.
19150
19151 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19152
19153 * window.h (resize_frame_windows, resize_window_check)
19154 (delete_deletable_window, resize_root_window)
19155 (resize_frame_windows): Declare prototypes.
19156
19157 * window.c (resize_window_apply): Make definition be "static" to
19158 match the prototype.
19159
19160 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19161
19162 * window.c: Remove declarations of Qwindow_size_fixed,
19163 window_min_size_1, window_min_size_2, window_min_size,
19164 size_window, window_fixed_size_p, enlarge_window, delete_window.
19165 Remove static from declaration of Qdelete_window, it's
19166 temporarily needed by Fbury_buffer.
19167 (replace_window): Don't assign orig_top_line and
19168 orig_total_lines.
19169 (Fdelete_window, delete_window): Remove. Window deletion is
19170 handled by window.el.
19171 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19172 Replace Fdelete_window calls with calls to Qdelete_window.
19173 (Fdelete_other_windows): Remove. Deleting other windows is
19174 handled by window.el.
19175 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19176 handled in window.el.
19177 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19178 Window minimum sizes are handled in window.el.
19179 (shrink_windows, size_window, set_window_height)
19180 (set_window_width, change_window_heights, window_height)
19181 (window_width, CURBEG, CURSIZE, enlarge_window)
19182 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19183 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19184 handled in window.el.
19185 (make_dummy_parent): Rename to make_parent_window and give it a
19186 second argument horflag.
19187 (make_window): Don't set resize_proportionally any more.
19188 (Fsplit_window): Remove. Windows are split in window.el.
19189 (save_restore_action, save_restore_orig_size)
19190 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19191 Resize mini windows in window.el.
19192 (grow_mini_window, shrink_mini_window): Implement by calling
19193 Qresize_root_window_vertically, resize_window_check and
19194 resize_window_apply.
19195 (saved_window, Fset_window_configuration, save_window_save):
19196 Do not handle orig_top_line, orig_total_lines, and
19197 resize_proportionally.
19198 (window_min_height, window_min_width): Move to window.el.
19199 (keys_of_window): Move bindings for delete-other-windows,
19200 split-window, delete-window and enlarge-window to window.el.
19201
19202 * buffer.c: Temporarily extern Qdelete_window.
19203 (Fbury_buffer): Temporarily call Qdelete_window instead of
19204 Fdelete_window (Fbury_buffer will move to window.el soon).
19205
19206 * frame.c (set_menu_bar_lines_1): Remove code handling
19207 orig_top_line and orig_total_lines.
19208
19209 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19210 set_window_height but set heights directly.
19211 (change_frame_size_1): Use resize_frame_windows.
19212
19213 * xdisp.c (init_xdisp): Don't use set_window_height but set
19214 heights directly.
19215
19216 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19217 Use resize_frame_windows instead of change_window_heights and run
19218 run_window_configuration_change_hook.
19219
19220 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19221 instead of change_window_heights and run
19222 run_window_configuration_change_hook.
19223
19224 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19225
19226 * window.c (replace_window): Rename second argument REPLACEMENT to
19227 NEW. New third argument SETFLAG. Rewrite.
19228 (delete_window, make_dummy_parent): Call replace_window with
19229 third argument 1.
19230 (window_list_1): Move down in code.
19231 (run_window_configuration_change_hook): Move set_buffer part
19232 before select_frame_norecord part in order to unwind correctly.
19233 Rename count1 to count.
19234 (recombine_windows, delete_deletable_window, resize_root_window)
19235 (Fdelete_other_windows_internal)
19236 (Frun_window_configuration_change_hook, make_parent_window)
19237 (resize_window_check, resize_window_apply, Fresize_window_apply)
19238 (resize_frame_windows, Fsplit_window_internal)
19239 (Fdelete_window_internal, Fresize_mini_window_internal):
19240 New functions.
19241 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19242
19243 2011-06-08 Martin Rudalics <rudalics@gmx.at>
19244
19245 * window.h (window): Add some new members to window structure -
19246 normal_lines, normal_cols, new_total, new_normal, clone_number,
19247 splits, nest, prev_buffers, next_buffers.
19248 (WINDOW_TOTAL_SIZE): Move here from window.c.
19249 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19250
19251 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19252 Remove.
19253 (make_dummy_parent): Set new members of windows structure.
19254 (make_window): Move down in code. Handle new members of window
19255 structure.
19256 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19257 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19258 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19259 (Fset_window_prev_buffers, Fwindow_next_buffers)
19260 (Fset_window_next_buffers, Fset_window_clone_number):
19261 New functions.
19262 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19263 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19264 Doc-string fixes.
19265 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19266 Argument WINDOW can be now internal window too.
19267 (Fwindow_use_time): Move up in code.
19268 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19269 Rewrite doc-string.
19270 (Fset_window_configuration, saved_window)
19271 (Fcurrent_window_configuration, save_window_save): Handle new
19272 members of window structure.
19273 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19274 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19275 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19276 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19277 Qget_mru_window, Qresize_root_window,
19278 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19279 Qauto_buffer_name; staticpro them.
19280
19281 2011-06-07 Martin Rudalics <rudalics@gmx.at>
19282
19283 * window.c (Fwindow_total_size, Fwindow_left_column)
19284 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19285 (Fwindow_list_1): New functions.
19286 (window_box_text_cols): Replace with window_body_cols.
19287 (Fwindow_width, Fscroll_left, Fscroll_right):
19288 Use window_body_cols instead of window_box_text_cols.
19289 (delete_window, Fset_window_configuration):
19290 Call delete_all_subwindows with window as argument.
19291 (delete_all_subwindows): Take a window as argument and not a
19292 structure. Rewrite.
19293 (window_loop): Remove handling of GET_LRU_WINDOW and
19294 GET_LARGEST_WINDOW.
19295 (Fget_lru_window, Fget_largest_window): Move to window.el.
19296
19297 * window.h: Extern window_body_cols instead of
19298 window_box_text_cols. delete_all_subwindows now takes a
19299 Lisp_Object as argument.
19300
19301 * indent.c (compute_motion, Fcompute_motion):
19302 Use window_body_cols instead of window_box_text_cols.
19303
19304 * frame.c (delete_frame): Call delete_all_subwindows with root
19305 window as argument.
19306
19307 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19308
19309 * fns.c (Fputhash): Document return value.
19310
19311 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19312
19313 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19314
19315 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19316
19317 Cons<->int and similar integer overflow fixes (Bug#8794).
19318
19319 Check for overflow when converting integer to cons and back.
19320 * charset.c (Fdefine_charset_internal, Fdecode_char):
19321 Use cons_to_unsigned to catch overflow.
19322 (Fencode_char): Use INTEGER_TO_CONS.
19323 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19324 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19325 * data.c (long_to_cons, cons_to_long): Remove.
19326 (cons_to_unsigned, cons_to_signed): New functions.
19327 These signal an error for invalid or out-of-range values.
19328 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19329 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19330 * font.c (Ffont_variation_glyphs):
19331 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19332 * lisp.h: Include <intprops.h>.
19333 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19334 (cons_to_signed, cons_to_unsigned): New decls.
19335 (long_to_cons, cons_to_long): Remove decls.
19336 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19337 (Fprimitive_undo): Use CONS_TO_INTEGER.
19338 * xfns.c (Fx_window_property): Likewise.
19339 * xselect.c: Include <limits.h>.
19340 (x_own_selection, selection_data_to_lisp_data):
19341 Use INTEGER_TO_CONS.
19342 (x_handle_selection_request, x_handle_selection_clear)
19343 (x_get_foreign_selection, Fx_disown_selection_internal)
19344 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19345 (lisp_data_to_selection_data): Use cons_to_unsigned.
19346 (x_fill_property_data): Use cons_to_signed.
19347 Report values out of range.
19348
19349 Check for buffer and string overflow more precisely.
19350 * buffer.h (BUF_BYTES_MAX): New macro.
19351 * lisp.h (STRING_BYTES_MAX): New macro.
19352 * alloc.c (Fmake_string):
19353 * character.c (string_escape_byte8):
19354 * coding.c (coding_alloc_by_realloc):
19355 * doprnt.c (doprnt):
19356 * editfns.c (Fformat):
19357 * eval.c (verror):
19358 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19359 since they may not be the same number.
19360 * editfns.c (Finsert_char):
19361 * fileio.c (Finsert_file_contents):
19362 Likewise for BUF_BYTES_MAX.
19363
19364 * image.c: Use ptrdiff_t, not int, for sizes.
19365 (slurp_file): Switch from int to ptrdiff_t.
19366 All uses changed.
19367 (slurp_file): Check that file size fits in both size_t (for
19368 malloc) and ptrdiff_t (for sanity and safety).
19369
19370 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19371 if b->modtime has its maximal value.
19372
19373 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19374
19375 Don't assume time_t can fit into int.
19376 * buffer.h (struct buffer.modtime): Now time_t, not int.
19377 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19378 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19379
19380 Minor fixes for signed vs unsigned integers.
19381 * character.h (MAYBE_UNIFY_CHAR):
19382 * charset.c (maybe_unify_char):
19383 * keyboard.c (read_char, reorder_modifiers):
19384 XINT -> XFASTINT, since the integer must be nonnegative.
19385 * ftfont.c (ftfont_spec_pattern):
19386 * keymap.c (access_keymap, silly_event_symbol_error):
19387 XUINT -> XFASTINT, since the integer must be nonnegative.
19388 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19389 since it makes no difference and we prefer signed.
19390 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19391 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19392 nonnegative.
19393
19394 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19395
19396 * window.h (Fwindow_frame): Declare.
19397
19398 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19399
19400 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19401 (SPARE_MEMORY): Always define.
19402 (LARGE_REQUEST): Remove.
19403 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19404
19405 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19406
19407 * lisp.h: Move EXFUNS for Fframe_root_window,
19408 Fframe_first_window and Fset_frame_selected_window to window.h.
19409
19410 * window.h: Move EXFUNS for Fframe_root_window,
19411 Fframe_first_window and Fset_frame_selected_window here from
19412 lisp.h.
19413
19414 * frame.c (Fwindow_frame, Fframe_first_window)
19415 (Fframe_root_window, Fframe_selected_window)
19416 (Fset_frame_selected_window): Move to window.c.
19417 (Factive_minibuffer_window): Move to minibuf.c.
19418 (Fother_visible_frames_p): New function.
19419
19420 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19421
19422 * window.c (decode_window, decode_any_window): Move up in code.
19423 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19424 (inhibit_frame_unsplittable): Remove unused variable.
19425 (Fwindow_buffer): Move up and rewrite doc-string.
19426 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19427 (Fwindow_prev): New functions.
19428 (Fwindow_frame): Move here from frame.c. Accept any window as
19429 argument.
19430 (Fframe_root_window, Fframe_first_window)
19431 (Fframe_selected_window): Move here from frame.c. Accept frame
19432 or arbitrary window as argument. Update doc-strings.
19433 (Fminibuffer_window): Move up in code.
19434 (Fwindow_minibuffer_p): Move up in code and simplify.
19435 (Fset_frame_selected_window): Move here from frame.c.
19436 Marginal rewrite.
19437 (Fselected_window, select_window, Fselect_window): Move up in
19438 code. Minor doc-string fixes.
19439
19440 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19441
19442 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19443 Do not assume that spare memory exists; that assumption is valid
19444 only if SYSTEM_MALLOC.
19445 (LARGE_REQUEST): New macro, so that the issue of large requests
19446 is separated from the issue of spare memory.
19447
19448 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19449
19450 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19451 format. (Bug#8806)
19452
19453 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19454
19455 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19456 before statements.
19457
19458 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19459
19460 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19461
19462 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19463
19464 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19465 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19466
19467 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
19468
19469 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19470
19471 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
19472
19473 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19474 (x_clipboard_manager_save): Add return value.
19475 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19476 New error handlers.
19477 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19478 Obey Vx_select_enable_clipboard_manager. Catch errors in
19479 x_clipboard_manager_save (Bug#8779).
19480 (Vx_select_enable_clipboard_manager): New variable.
19481 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19482
19483 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19484
19485 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19486
19487 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19488
19489 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19490 in the current matrix if keep_current_p is non-zero.
19491
19492 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19493
19494 * bidi.c (bidi_level_of_next_char): Fix last change.
19495
19496 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19497
19498 Support bidi reordering of text covered by display properties.
19499
19500 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19501 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19502 (bidi_cache_search, bidi_cache_iterator_state)
19503 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19504 (bidi_level_of_next_char, bidi_move_to_visually_next):
19505 Support character positions inside a run of characters covered by a
19506 display string.
19507 (bidi_paragraph_init, bidi_resolve_explicit_1)
19508 (bidi_level_of_next_char): Call bidi_fetch_char and
19509 bidi_fetch_char_advance instead of FETCH_CHAR and
19510 FETCH_CHAR_ADVANCE.
19511 (bidi_init_it): Initialize new members.
19512 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19513 definitions.
19514 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19515 instead of using explicit *_CHAR codes.
19516 (bidi_resolve_explicit, bidi_resolve_weak):
19517 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19518 bidirectional text is supported only in multibyte buffers.
19519 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19520 it to initialize the frame_window_p member of struct bidi_it.
19521 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19522 (bidi_resolve_explicit, bidi_resolve_weak)
19523 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19524 bidi_it->nchars is non-positive.
19525 (bidi_level_of_next_char): Don't try to lookup the cache for the
19526 next/previous character if nothing is cached there yet, or if we
19527 were just reseat()'ed to a new position.
19528
19529 * xdisp.c (set_cursor_from_row): Set start and stop points
19530 according to the row's direction when priming the loop that looks
19531 for the glyph on which to display cursor.
19532 (single_display_spec_intangible_p): Function deleted.
19533 (display_prop_intangible_p): Reimplement to call
19534 handle_display_spec instead of single_display_spec_intangible_p.
19535 Accept 3 additional arguments needed by handle_display_spec.
19536 This fixes incorrect cursor motion across display property with complex
19537 values: lists, `(when COND...)' forms, etc.
19538 (single_display_spec_string_p): Support property values that are
19539 lists with the argument STRING its top-level element.
19540 (display_prop_string_p): Fix the condition for processing a
19541 property that is a list to be consistent with handle_display_spec.
19542 (handle_display_spec): New function, refactored from the
19543 last portion of handle_display_prop.
19544 (compute_display_string_pos): Accept additional argument
19545 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19546 value of a `display' property is a "replacing spec".
19547 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19548 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19549 the display property, but just return a value indicating whether
19550 the display property will replace the characters it covers.
19551 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19552 frame_window_p members of struct bidi_it.
19553 (compute_display_string_pos, compute_display_string_end):
19554 New functions.
19555 (push_it): Accept second argument POSITION, where pop_it should
19556 jump to continue iteration.
19557 (reseat_1): Initialize bidi_it.disp_pos.
19558
19559 * keyboard.c (adjust_point_for_property): Adjust the call to
19560 display_prop_intangible_p to its new signature.
19561
19562 * dispextern.h (struct bidi_it): New member frame_window_p.
19563 (bidi_init_it): Update prototypes.
19564 (display_prop_intangible_p): Update prototype.
19565 (compute_display_string_pos, compute_display_string_end):
19566 Declare prototypes.
19567 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19568 EMACS_INT.
19569
19570 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
19571
19572 Malloc failure behavior now depends on size of allocation.
19573 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19574 * lisp.h: Change signatures accordingly.
19575 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19576 All callers changed. (Bug#8762)
19577
19578 * gnutls.c: Use Emacs's memory allocators.
19579 Without this change, the gnutls library would invoke malloc etc.
19580 directly, which causes problems on non-SYNC_INPUT hosts, and which
19581 runs afoul of improving memory_full behavior. (Bug#8761)
19582 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19583 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19584 xfree instead of the default malloc, realloc, free.
19585 (Fgnutls_boot): No need to check for memory allocation failure,
19586 since xmalloc does that for us.
19587
19588 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
19589 * category.c (hash_get_category_set):
19590 * ccl.c (ccl_driver):
19591 * charset.c (Fdefine_charset_internal):
19592 * charset.h (struct charset.hash_index):
19593 * composite.c (get_composition_id, gstring_lookup_cache)
19594 (composition_gstring_put_cache):
19595 * composite.h (struct composition.hash_index):
19596 * dispextern.h (struct image.hash):
19597 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19598 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19599 (hashfn_equal, hashfn_user_defined, make_hash_table)
19600 (maybe_resize_hash_table, hash_lookup, hash_put)
19601 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19602 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19603 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19604 * image.c (make_image, search_image_cache, lookup_image)
19605 (xpm_put_color_table_h):
19606 * lisp.h (struct Lisp_Hash_Table):
19607 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19608 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19609 for hashes and hash indexes, instead of 'unsigned' and 'int'.
19610 * alloc.c (allocate_vectorlike):
19611 Check for overflow in vector size calculations.
19612 * ccl.c (ccl_driver):
19613 Check for overflow when converting EMACS_INT to int.
19614 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19615 need to be updated by these changes.
19616 * fns.c (make_hash_table, maybe_resize_hash_table):
19617 Check for integer overflow with large hash tables.
19618 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19619 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19620 (SXHASH_REDUCE): New macro.
19621 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19622 Use it instead of discarding useful hash info with large hash values.
19623 (sxhash_float): New function.
19624 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19625 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19626 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19627 Rewrite to use FIXNUM_BITS, as this simplifies things.
19628 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19629 Adjust signatures to match updated version of code.
19630 (consing_since_gc): Now EMACS_INT, since a single hash table can
19631 use more than INT_MAX bytes.
19632
19633 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19634
19635 Make it possible to build with GCC-4.6+ -O2 -flto.
19636
19637 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19638
19639 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19640
19641 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19642 Call minibuffer-inactive-mode.
19643
19644 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
19645
19646 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19647 Update dependencies.
19648
19649 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19650
19651 * data.c (init_data): Remove code for UTS, this system is not
19652 supported anymore.
19653
19654 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19655
19656 Don't force ./temacs to start in terminal mode.
19657
19658 * frame.c (make_initial_frame): Initialize faces in all cases, not
19659 only when CANNOT_DUMP is defined.
19660 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19661
19662 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19663
19664 * dispnew.c (add_window_display_history): Use const for the string
19665 pointer. Remove declaration, not needed.
19666
19667 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19668
19669 Use 'inline', not 'INLINE'.
19670 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19671 * alloc.c, fontset.c (INLINE): Remove.
19672 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19673 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19674 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19675 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19676 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19677
19678 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19679
19680 Make it possible to run ./temacs.
19681
19682 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19683 syms_of_callproc does the same thing. Remove test for
19684 "initialized", do it in the caller.
19685 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19686
19687 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19688
19689 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19690 (read_minibuf): Use get_minibuffer.
19691 (syms_of_minibuf): Use DEFSYM.
19692 (Qmetadata): New var.
19693 * data.c (Qbuffer): Don't make it static.
19694 (syms_of_data): Use DEFSYM.
19695
19696 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19697
19698 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19699 (CCL_CODE_MIN): New macro.
19700
19701 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19702
19703 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19704
19705 * eval.c (Qdebug): Now static.
19706 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19707 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19708 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19709
19710 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19711
19712 * image.c: Various fixes to ImageMagick code comments.
19713 (Fimagemagick_types): Doc fix.
19714
19715 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19716
19717 Minor fixes prompted by GCC 4.6.0 warnings.
19718
19719 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19720
19721 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19722 (x_clipboard_manager_save_all): Move extern decl to ...
19723 * xterm.h: ... here, so that it can be checked for consistency.
19724
19725 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19726
19727 * xselect.c (x_clipboard_manager_save_frame)
19728 (x_clipboard_manager_save_all): New functions.
19729 (Fx_clipboard_manager_save): Lisp function deleted.
19730
19731 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19732 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19733
19734 * xterm.h: Update prototype.
19735
19736 2011-05-28 William Xu <william.xwl@gmail.com>
19737
19738 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19739 exiting (Bug#8239).
19740
19741 2011-05-28 Jim Meyering <meyering@redhat.com>
19742
19743 Avoid a sign-extension bug in crypto_hash_function.
19744 * fns.c (to_uchar): Define.
19745 (crypto_hash_function): Use it to convert some newly-signed
19746 variables to unsigned, to avoid sign-extension bugs. For example,
19747 without this change, (md5 "truc") would evaluate to
19748 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19749 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
19750 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19751
19752 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19753
19754 Integer overflow fixes.
19755
19756 * dbusbind.c: Serial number integer overflow fixes.
19757 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19758 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19759 to hold a serial number that is too large for a fixnum.
19760 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19761 Check for serial numbers out of range. Decode any serial number
19762 that was so large that it became a float. (Bug#8722)
19763
19764 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19765 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19766 Use XFASTINT rather than XUINT when numbers are nonnegative.
19767 (xd_append_arg, Fdbus_method_return_internal):
19768 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19769 arguments, check that Lisp number is nonnegative, rather than
19770 silently wrapping negative numbers around. (Bug#8722)
19771 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19772 (Bug#8722)
19773
19774 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19775
19776 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19777
19778 ccl: Add integer overflow checks.
19779 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19780 (IN_INT_RANGE): New macros.
19781 (ccl_driver): Use them to check for integer overflow when
19782 decoding a CCL program. Many of the new checks are whether XINT (x)
19783 fits in int; it doesn't always, on 64-bit hosts. The new version
19784 doesn't catch all possible integer overflows, but it's an
19785 improvement. (Bug#8719)
19786
19787 * alloc.c (make_event_array): Use XINT, not XUINT.
19788 There's no need for unsigned here.
19789
19790 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19791 This follows up to the 2011-05-06 change that substituted uintptr_t
19792 for EMACS_INT. This case wasn't caught back then.
19793
19794 Rework Fformat to avoid integer overflow issues.
19795 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19796 now (part of C89). Include <verify.h>.
19797 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19798 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19799 (Fformat): Avoid the prepass trying to compute sizes; it was only
19800 approximate and thus did not catch overflow reliably. Instead, walk
19801 through the format just once, formatting and computing sizes as we go,
19802 checking for integer overflow at every step, and allocating a larger
19803 buffer as needed. Keep track separately whether the format is
19804 multibyte. Keep only the most-recently calculated precision, rather
19805 than them all. Record whether each argument has been converted to
19806 string. Use EMACS_INT, not int, for byte and char and arg counts.
19807 Support field widths and precisions larger than INT_MAX. Avoid
19808 sprintf's undefined behavior with conversion specifications such as %#d
19809 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19810 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19811 formatting out-of-range floating point numbers with int
19812 formats. (Bug#8668)
19813
19814 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19815
19816 * data.c: Avoid integer truncation in expressions involving floats.
19817 * data.c: Include <intprops.h>.
19818 (arith_driver): When there's an integer overflow in an expression
19819 involving floating point, convert the integers to floating point
19820 so that the resulting value does not suffer from catastrophic
19821 integer truncation. For example, on a 64-bit host (* 4
19822 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19823 Do not rely on undefined behavior after integer overflow.
19824
19825 merge count_size_as_multibyte, parse_str_to_multibyte
19826 * character.c, character.h (count_size_as_multibyte):
19827 Rename from parse_str_to_multibyte; all uses changed.
19828 Check for integer overflow.
19829 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19830 since it's now a duplicate of the other. This is more of
19831 a character than a buffer op, so better that it's in character.c.
19832 * fns.c, print.c: Adjust to above changes.
19833
19834 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19835
19836 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19837
19838 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19839
19840 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19841 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19842 (x_clipboard_manager_save): Now static.
19843 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19844
19845 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19846 (crypto_hash_function): Now static.
19847 Fix pointer signedness problems. Avoid unnecessary initializations.
19848
19849 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
19850
19851 * termhooks.h (Vselection_alist): Make it terminal-local.
19852
19853 * terminal.c (create_terminal): Initialize it.
19854
19855 * xselect.c: Support for clipboard managers.
19856 (Vselection_alist): Move to termhooks.h as terminal-local var.
19857 (LOCAL_SELECTION): New macro.
19858 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19859 (symbol_to_x_atom): Remove gratuitous arg.
19860 (x_handle_selection_request, lisp_data_to_selection_data)
19861 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19862 (x_own_selection, x_get_local_selection, x_convert_selection):
19863 New arg, specifying work frame. Use terminal-local Vselection_alist.
19864 (some_frame_on_display): Delete unused function.
19865 (Fx_own_selection_internal, Fx_get_selection_internal)
19866 (Fx_disown_selection_internal, Fx_selection_owner_p)
19867 (Fx_selection_exists_p): New optional frame arg.
19868 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19869 (x_handle_selection_clear): Don't treat other terminals with the
19870 same keyboard specially. Use the terminal-local Vselection_alist.
19871 (x_clear_frame_selections): Use Frun_hook_with_args.
19872
19873 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19874
19875 * xterm.h: Add support for those atoms.
19876
19877 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
19878
19879 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19880 (converted_selections, conversion_fail_tag): New global variables.
19881 (x_selection_request_lisp_error): Free the above.
19882 (x_get_local_selection): Remove unnecessary code.
19883 (x_reply_selection_request): Args changed; handle arbitrary array
19884 of converted selections stored in converted_selections.
19885 Separate the XChangeProperty and SelectionNotify steps.
19886 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19887 (x_convert_selection): New function.
19888 (x_handle_selection_event): Simplify.
19889 (x_get_foreign_selection): Don't ignore incoming requests while
19890 waiting for an answer; this will fail when we implement
19891 SAVE_TARGETS, and seems unnecessary anyway.
19892 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19893 (Vx_sent_selection_functions): Doc fix.
19894
19895 2011-05-26 Leo Liu <sdl.web@gmail.com>
19896
19897 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19898
19899 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19900
19901 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19902
19903 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19904 for fringe update if it has periodic bitmap.
19905 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19906 and fringe_bitmap_periodic_p.
19907
19908 * fringe.c (get_fringe_bitmap_data): New function.
19909 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19910 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19911 row. Mark glyph row for fringe update if periodicity changed.
19912
19913 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19914 for fringe update unless it has periodic bitmap.
19915
19916 2011-05-25 Kenichi Handa <handa@m17n.org>
19917
19918 * xdisp.c (get_next_display_element): Set correct it->face_id for
19919 a static composition.
19920
19921 2011-05-24 Leo Liu <sdl.web@gmail.com>
19922
19923 * deps.mk (fns.o):
19924 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19925
19926 * fns.c (crypto_hash_function, Fsha1): New function.
19927 (Fmd5): Use crypto_hash_function.
19928 (syms_of_fns): Add Ssha1.
19929
19930 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19931
19932 * gnutls.c: Remove unused macros.
19933 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19934 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19935 Remove macros that are defined and never used.
19936 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19937
19938 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19939
19940 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19941 (Fx_get_selection_internal): Minor cleanup.
19942 (Fx_own_selection_internal): Rename arguments for consistency with
19943 select.el.
19944
19945 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19946
19947 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19948
19949 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19950
19951 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19952
19953 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19954
19955 * dispnew.c (scrolling_window): Don't exclude the case that the
19956 last enabled row in the desired matrix touches the bottom boundary.
19957
19958 2011-05-21 Glenn Morris <rgm@gnu.org>
19959
19960 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19961 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19962 and add some more files.
19963
19964 2011-05-20 Eli Zaretskii <eliz@gnu.org>
19965
19966 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19967 report_file_error introduced by the change from 2011-05-07.
19968
19969 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19970
19971 * systime.h (Time): Define only if emacs is defined.
19972 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19973 where the include path doesn't have X11/X.h by default. See
19974 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19975
19976 2011-05-20 Kenichi Handa <handa@m17n.org>
19977
19978 * composite.c (find_automatic_composition): Fix previous change.
19979
19980 2011-05-20 Glenn Morris <rgm@gnu.org>
19981
19982 * lisp.mk: New file, split from Makefile.in.
19983 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19984 (shortlisp): Remove.
19985 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19986
19987 2011-05-19 Glenn Morris <rgm@gnu.org>
19988
19989 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19990 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19991 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19992 (lisp): Set the order to that of loadup.el.
19993 (shortlisp): Make it a copy of $lisp.
19994 (SOME_MACHINE_LISP): Remove.
19995 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19996 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19997
19998 2011-05-18 Kenichi Handa <handa@m17n.org>
19999
20000 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20001 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20002 (find_automatic_composition): Mostly rewrite for efficiency.
20003
20004 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20005
20006 * makefile.w32-in: Update dependencies.
20007
20008 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20009
20010 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20011 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20012
20013 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20014
20015 Fix some integer overflow issues, such as string length overflow.
20016
20017 * insdel.c (count_size_as_multibyte): Check for string overflow.
20018
20019 * character.c (lisp_string_width): Check for string overflow.
20020 Use EMACS_INT, not int, for string indexes and lengths; in
20021 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20022 the resulting string length overflows an EMACS_INT; instead,
20023 report a string overflow if no precision given. When checking for
20024 precision exhaustion, use a check that cannot possibly have
20025 integer overflow. (Bug#8675)
20026 * character.h (lisp_string_width): Adjust to new signature.
20027
20028 * alloc.c (string_overflow): New function.
20029 (Fmake_string): Use it. This doesn't change behavior, but saves
20030 a few bytes and will simplify future changes.
20031 * character.c (string_escape_byte8): Likewise.
20032 * lisp.h (string_overflow): New decl.
20033
20034 Fixups, following up to the user-interface timestamp change.
20035 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20036 for UI timestamps, instead of unsigned long.
20037 * msdos.c (mouse_get_pos): Likewise.
20038 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20039 * w32gui.h (Time): Define by including "systime.h" rather than by
20040 declaring it ourselves. (Bug#8664)
20041
20042 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20043 * image.c (clear_image_cache): Likewise.
20044
20045 * term.c (term_mouse_position): Don't assume time_t wraparound.
20046
20047 Be more systematic about user-interface timestamps.
20048 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20049 and sometimes 'EMACS_UINT', to represent these timestamps.
20050 This change causes it to use 'Time' uniformly, as that's what X uses.
20051 This makes the code easier to follow, and makes it easier to catch
20052 integer overflow bugs such as Bug#8664.
20053 * frame.c (Fmouse_position, Fmouse_pixel_position):
20054 Use Time, not unsigned long, for user-interface timestamps.
20055 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20056 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20057 * keyboard.h (last_event_timestamp): Likewise.
20058 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20059 * menu.h (xmenu_show): Likewise.
20060 * term.c (term_mouse_position): Likewise.
20061 * termhooks.h (struct input_event.timestamp): Likewise.
20062 (struct terminal.mouse_position_hook): Likewise.
20063 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20064 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20065 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20066 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20067 what it was before.
20068 * menu.h, termhooks.h: Include "systime.h", for Time.
20069
20070 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20071 Don't assume that the difference between two unsigned long values
20072 can fit into an integer. At this point, we know button_down_time
20073 <= event->timestamp, so the difference must be nonnegative, so
20074 there's no need to cast the result if double-click-time is
20075 nonnegative, as it should be; check that it's nonnegative, just in
20076 case. This bug is triggered when events are more than 2**31 ms
20077 apart (about 25 days). (Bug#8664)
20078
20079 * xselect.c (last_event_timestamp): Remove duplicate decl.
20080 (x_own_selection): Remove needless cast to unsigned long.
20081
20082 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20083 that always fit in int. Use a sentinel instead of a counter, to
20084 avoid a temp and to allay GCC's concerns about possible int overflow.
20085 * frame.h (struct frame): Use int for menu_bar_items_used
20086 instead of EMACS_INT, since it always fits in int.
20087
20088 * menu.c (grow_menu_items): Check for int overflow.
20089
20090 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20091
20092 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20093 Before, the code was not consistent. These values cannot exceed
20094 2**31 - 1 so there's no need to make them unsigned.
20095 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20096 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20097 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20098 as modifiers.
20099 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20100
20101 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20102 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20103 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20104 presumably because the widths might not match.
20105
20106 * window.c (size_window): Avoid needless test at loop start.
20107
20108 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20109
20110 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20111
20112 2011-05-12 Drew Adams <drew.adams@oracle.com>
20113
20114 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20115
20116 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20117
20118 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20119 `width' to `bar_area_x' and `bar_area_width', respectively.
20120 (x_scroll_run): Take account of fringe background extension.
20121
20122 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20123 Rename local vars `left' and `width' to `bar_area_x' and
20124 `bar_area_width', respectively.
20125 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20126 background extension.
20127
20128 2011-05-10 Jim Meyering <meyering@redhat.com>
20129
20130 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20131
20132 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20133
20134 * image.c (Finit_image_library): Return t for built-in image types,
20135 like pbm and xbm. (Bug#8640)
20136
20137 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20138
20139 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20140
20141 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20142
20143 * w32console.c (Fset_screen_color): Doc fix.
20144 (Fget_screen_color): New function.
20145 (syms_of_ntterm): Defsubr it.
20146
20147 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20148 unlink the temporary file if Fcall_process didn't create it in the
20149 first place.
20150 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20151 child process will be redirected to a file specified with `:file'.
20152 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20153 cue to call_process_cleanup not to close that handle.
20154
20155 2011-05-07 Ben Key <bkey76@gmail.com>
20156
20157 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20158 one of two shell specific rules, either bootstrap-temacs-CMD or
20159 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20160 to the previous implementation of the bootstrap-temacs rule.
20161 The bootstrap-temacs-CMD rule is similar to the previous
20162 implementation of the bootstrap-temacs rule except that it
20163 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20164 variable.
20165
20166 These changes, along with some changes to nt/configure.bat,
20167 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20168 earlier fix to add support for --cflags and --ldflags options
20169 that include quotes so that it works whether make uses cmd or
20170 sh as the shell.
20171
20172 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20173
20174 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20175 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20176 is a constant.
20177 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20178 a string. Handle both cases.
20179 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20180 (Fdbus_register_method): Use Qinvalid_function.
20181
20182 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20183
20184 * makefile.w32-in: Update dependencies.
20185 (LISP_H): Add inttypes.h and stdin.h.
20186 (PROCESS_H): Add unistd.h.
20187
20188 2011-05-06 Eli Zaretskii <eliz@gnu.org>
20189
20190 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20191 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20192
20193 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
20194
20195 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20196
20197 * term.c (vfatal): Remove stray call to va_end.
20198 It's not needed and the C Standard doesn't allow it here anyway.
20199
20200 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20201 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20202
20203 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20204 bytes.
20205
20206 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20207
20208 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20209
20210 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20211
20212 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20213
20214 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20215
20216 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20217 * charset.c (Fdefine_charset_internal): Don't initialize
20218 charset.code_space[15]. The value was garbage, on hosts with
20219 32-bit int (Bug#8600).
20220
20221 * lread.c (read_integer): Be more consistent with string-to-number.
20222 Use string_to_number to do the actual conversion; this avoids
20223 rounding errors and fixes some other screwups. Without this fix,
20224 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20225 (digit_to_number): Move earlier, for benefit of read_integer.
20226 Return -1 if the digit is out of range for the base, -2 if it is
20227 not a digit in any supported base. (Bug#8602)
20228
20229 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20230
20231 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20232 to match comment at start of function. This also removes a
20233 GCC warning about overflow in a 32+64-bit port.
20234
20235 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20236
20237 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20238 Reported by Stefan Monnier in
20239 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20240 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20241 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20242
20243 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20244 (EMACS_UINTPTR): Likewise, with uintptr_t.
20245
20246 * lisp.h: Prefer 64-bit EMACS_INT if available.
20247 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20248 on 32-bit hosts that have 64-bit int, so that they can access
20249 large files.
20250 However, temporarily disable this change unless the temporary
20251 symbol WIDE_EMACS_INT is defined.
20252
20253 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20254
20255 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20256 This removes an assumption that EMACS_INT and long are the same
20257 width as pointers. The assumption is true for Emacs porting targets
20258 now, but we want to make other targets possible.
20259 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20260 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20261 In the rest of the code, change types of integers that hold casted
20262 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20263 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20264 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20265 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20266 No need to cast type when ORing.
20267 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20268 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20269 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20270 assume EMACS_INT is the same width as char *.
20271 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20272 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20273 Remove no-longer-needed casts.
20274 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20275 (xg_tool_bar_help_callback, xg_make_tool_item):
20276 Use EMACS_INTPTR to hold an integer
20277 that will be cast to void *; this can avoid a GCC warning
20278 if EMACS_INT is not the same width as void *.
20279 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20280 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20281 (current_message_1, set_message_1):
20282 Use a local to convert to proper width without a cast.
20283 * xmenu.c (dialog_selection_callback): Likewise.
20284
20285 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20286 Also, don't assume VALBITS / RAND_BITS is less than 5,
20287 and don't rely on undefined behavior when shifting a 1 left into
20288 the sign bit.
20289 * lisp.h (get_random): Change signature to match.
20290
20291 * lread.c (hash_string): Use size_t, not int, for hash computation.
20292 Normally we prefer signed values; but hashing is special, because
20293 it's better to use unsigned division on hash table sizes so that
20294 the remainder is nonnegative. Also, size_t is the natural width
20295 for hashing into memory. The previous code used 'int', which doesn't
20296 retain enough info to hash well into very large tables.
20297 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20298
20299 * dbusbind.c: Don't possibly lose pointer info when converting.
20300 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20301 Use XPNTR rather than XHASH, so that the high-order bits of
20302 the pointer aren't lost when converting through void *.
20303
20304 * eval.c (Fautoload): Don't double-shift a pointer.
20305
20306 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20307
20308 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20309
20310 * gnutls.c (DEF_GNUTLS_FN):
20311 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20312
20313 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20314
20315 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20316 marker. (Bug#8610)
20317
20318 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20319
20320 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20321 New version that can reserve upto 2GB of heap space.
20322
20323 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20324
20325 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20326
20327 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20328
20329 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20330 `gnutls_certificate_set_x509_key_file'.
20331
20332 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20333
20334 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20335 Update dependencies.
20336
20337 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20338
20339 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20340 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20341 Remove unused parameter `fildes'.
20342 * process.c (read_process_output, send_process): Don't pass it.
20343
20344 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20345
20346 Fix previous change: the library cache is defined in w32.c.
20347 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20348 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20349
20350 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20351
20352 Implement dynamic loading of GnuTLS on Windows.
20353
20354 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20355 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20356 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20357 Declare.
20358
20359 * gnutls.c (Qgnutls_dll): Define.
20360 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20361 (gnutls_*): Declare function pointers.
20362 (init_gnutls_functions): New function to initialize function pointers.
20363 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20364 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20365 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20366 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20367 (emacs_gnutls_write, emacs_gnutls_read)
20368 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20369 (Fgnutls_available_p): New function.
20370 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20371 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20372 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20373
20374 * image.c: Include w32.h.
20375 (Vimage_type_cache): Delete.
20376 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20377 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20378 (w32_delayed_load): Move to w32.c.
20379
20380 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20381
20382 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20383 (w32_delayed_load): Move from image.c. When loading a library, record
20384 its filename in the :loaded-from property of the library id.
20385 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20386 Initialize and staticpro them.
20387 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20388
20389 * process.c: Include lisp.h before w32.h, not after.
20390 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20391 instead of gnutls_record_check_pending.
20392
20393 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20394
20395 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20396
20397 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20398 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20399 as passed in.
20400
20401 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20402
20403 * xterm.c (x_set_frame_alpha): Do not set property on anything
20404 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20405
20406 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20407
20408 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20409
20410 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20411
20412 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20413 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20414 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20415 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20416 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20417 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20418 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20419 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20420 (Qgnutls_bootprop_callbacks_verify): Make static.
20421
20422 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20423
20424 * callproc.c: Indentation fixup.
20425
20426 * sysdep.c (wait_for_termination_1): Make static.
20427 (wait_for_termination, interruptible_wait_for_termination):
20428 Move after wait_for_termination_1.
20429
20430 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20431
20432 * sysdep.c (interruptible_wait_for_termination): New function
20433 which is like wait_for_termination, but allows keyboard
20434 interruptions.
20435
20436 * callproc.c (Fcall_process): Add (:file "file") as an option for
20437 the STDOUT buffer.
20438 (Fcall_process_region): Ditto.
20439
20440 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20441
20442 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20443 rather than `XVECTOR (FOO)->size'.
20444
20445 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20446 inttypes.h, as a gnulib replacement is used if it not available in
20447 system headers.
20448
20449 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20450
20451 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20452 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20453 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20454
20455 * coding.c (coding_alloc_by_realloc): Error out if destination
20456 will grow beyond MOST_POSITIVE_FIXNUM.
20457 (decode_coding_emacs_mule): Abort if there isn't enough place in
20458 charbuf for the composition carryover bytes. Reserve an extra
20459 space for up to 2 characters produced in a loop.
20460 (decode_coding_iso_2022): Abort if there isn't enough place in
20461 charbuf for the composition carryover bytes.
20462
20463 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20464
20465 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20466 aborting when %lld or %lll format is passed.
20467 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20468 %llo or %llx format is passed. (Bug#8545)
20469
20470 * window.c (window_scroll_line_based): Use a marker instead of
20471 simple variables to record original value of point. (Bug#7952)
20472
20473 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20474 produced by %s or %c overflows available buffer space. (Bug#8545)
20475
20476 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20477
20478 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20479 (SIZE_MAX): Move defn after all includes, as they might #define it.
20480
20481 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20482
20483 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20484
20485 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20486
20487 * keyboard.c (Qdelayed_warnings_hook): Define.
20488 (command_loop_1): Run `delayed-warnings-hook'
20489 if Vdelayed_warnings_list is non-nil.
20490 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20491 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20492
20493 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20494
20495 * doprnt.c (doprnt): Don't return value smaller than the buffer
20496 size if the message was truncated. (Bug#8545).
20497
20498 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20499
20500 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20501 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20502
20503 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20504
20505 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20506
20507 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20508
20509 * makefile.w32-in: Update dependencies.
20510
20511 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20512
20513 Improve `doprnt' and its usage. (Bug#8545)
20514 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20515 `format_end'. Remove support for %l as a conversion specifier.
20516 Don't use xrealloc. Improve diagnostics when the %l size modifier
20517 is used. Update the commentary.
20518
20519 * eval.c (verror): Simplify calculation of size_t.
20520
20521 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20522 messages.
20523
20524 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20525
20526 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20527 change.
20528
20529 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20530
20531 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20532 This makes this file independent of the recent pseudovector change.
20533
20534 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20535
20536 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20537
20538 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20539 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20540 Remove unused local.
20541 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20542
20543 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20544 GCC 4.6.0 optimizes based on type-based alias analysis.
20545 For example, if b is of type struct buffer * and v of type struct
20546 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20547 != &v->size, and therefore "v->size = 1; b->size = 2; return
20548 v->size;" must therefore return 1. This assumption is incorrect
20549 for Emacs, since it type-puns struct Lisp_Vector * with many other
20550 types. To fix this problem, this patch adds a new type struct
20551 vectorlike_header that documents the constraints on layout of vectors
20552 and pseudovectors, and helps optimizing compilers not get fooled
20553 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20554 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20555 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20556 the size member.
20557 (XSETPVECTYPE): Rewrite in terms of new macro.
20558 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20559 This is a bit clearer, and further avoids the possibility of
20560 undesirable aliasing.
20561 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20562 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20563 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20564 since Lisp_Subr is a special case (no "next" field).
20565 (ASIZE): Now uses header.size rather than size.
20566 All previous uses of XVECTOR (foo)->size replaced to use this macro,
20567 to avoid the hassle of writing XVECTOR (foo)->header.size.
20568 (struct vectorlike_header): New type.
20569 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20570 object, to help avoid aliasing.
20571 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20572 (SUBRP): Likewise, since Lisp_Subr is a special case.
20573 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20574 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20575 (struct Lisp_Hash_Table): Combine first two members into a single
20576 struct vectorlike_header member. All uses of "size" and "next" members
20577 changed to be "header.size" and "header.next".
20578 * buffer.h (struct buffer): Likewise.
20579 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20580 * frame.h (struct frame): Likewise.
20581 * process.h (struct Lisp_Process): Likewise.
20582 * termhooks.h (struct terminal): Likewise.
20583 * window.c (struct save_window_data, struct saved_window): Likewise.
20584 * window.h (struct window): Likewise.
20585 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20586 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20587 * buffer.c (init_buffer_once): Likewise.
20588 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20589 special case.
20590 * process.c (Fformat_network_address): Use local var for size,
20591 for brevity.
20592
20593 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20594
20595 Make the Lisp reader and string-to-float more consistent (Bug#8525)
20596 * data.c (atof): Remove decl; no longer used or needed.
20597 (digit_to_number): Move to lread.c.
20598 (Fstring_to_number): Use new string_to_number function, to be
20599 consistent with how the Lisp reader treats infinities and NaNs.
20600 Do not assume that floating-point numbers represent EMACS_INT
20601 without losing information; this is not true on most 64-bit hosts.
20602 Avoid double-rounding errors, by insisting on integers when
20603 parsing non-base-10 numbers, as the documentation specifies.
20604 * lisp.h (string_to_number): New decl, replacing ...
20605 (isfloat_string): Remove.
20606 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20607 (read1): Do not accept +. and -. as integers; this
20608 appears to have been a coding error. Similarly, do not accept
20609 strings like +-1e0 as floating point numbers. Do not report
20610 overflow for integer overflows unless the base is not 10 which
20611 means we have no simple and reliable way to continue.
20612 Break out the floating-point parsing into a new
20613 function string_to_number, so that Fstring_to_number parses
20614 floating point numbers consistently with the Lisp reader.
20615 (digit_to_number): Move here from data.c. Make it static inline.
20616 (E_CHAR, EXP_INT): Remove, replacing with ...
20617 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20618 (string_to_number): New function, replacing isfloat_string.
20619 This function checks for valid syntax and produces the resulting
20620 Lisp float number too. Rework it so that string-to-number
20621 no longer mishandles examples like "1.0e+". Use strtoumax,
20622 so that overflow for non-base-10 numbers is reported only when
20623 there's no portable and simple way to convert to floating point.
20624
20625 * textprop.c (set_text_properties_1): Rewrite for clarity,
20626 and to avoid GCC warning about integer overflow.
20627
20628 * intervals.h (struct interval): Use EMACS_INT for members
20629 where EMACS_UINT might cause problems. See
20630 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20631 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20632 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20633 All uses changed.
20634 (offset_intervals): Tell GCC not to worry about length overflow
20635 when negating a negative length.
20636
20637 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20638 (overrun_check_free): Likewise.
20639
20640 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20641 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20642 word size.
20643
20644 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20645 (gnutls_make_error): Rename local to avoid shadowing.
20646 (gnutls_emacs_global_deinit): ifdef out; not used.
20647 (Fgnutls_boot): Use const for pointer to readonly storage.
20648 Comment out unused local. Fix pointer signedness problems.
20649
20650 * lread.c (openp): Don't stuff size_t into an 'int'.
20651 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20652 about possible signed overflow.
20653
20654 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20655 (GDK_KEY_g): Don't define if already defined.
20656 (xg_prepare_tooltip): Avoid pointer signedness problem.
20657 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20658
20659 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20660 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20661
20662 * xfns.c (Fx_window_property): Simplify a bit,
20663 to make a bit faster and to avoid GCC 4.6.0 warning.
20664 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20665
20666 * fns.c (internal_equal): Don't assume size_t fits in int.
20667
20668 * alloc.c (compact_small_strings): Tighten assertion a little.
20669
20670 Replace pEd with more-general pI, and fix some printf arg casts.
20671 * lisp.h (pI): New macro, generalizing old pEd macro to other
20672 conversion specifiers. For example, use "...%"pI"d..." rather
20673 than "...%"pEd"...".
20674 (pEd): Remove. All uses replaced with similar uses of pI.
20675 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20676 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20677 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20678 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20679 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20680 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20681 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20682 64-bit hosts.
20683 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20684 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20685 * print.c (safe_debug_print, print_object): Likewise.
20686 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20687 to int.
20688 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20689 avoiding the 0 flag, which is not portable.
20690 * process.c (Fmake_network_process): Use pI to avoid cast.
20691 * region-cache.c (pp_cache): Likewise.
20692 * xdisp.c (decode_mode_spec): Likewise.
20693 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20694 behavior on 64-bit hosts with printf arg.
20695 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20696 (x_stop_queuing_selection_requests): Likewise.
20697 (x_get_window_property): Don't truncate byte count to an 'int'
20698 when tracing.
20699
20700 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20701 here, since it parses constructs like leading '-' and spaces,
20702 which are not wanted; and it overflows with large numbers.
20703 Instead, simply match F[0-9]+, which is what is wanted anyway.
20704
20705 * alloc.c: Remove unportable assumptions about struct layout.
20706 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20707 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20708 (allocate_vectorlike, make_pure_vector): Use the new macros,
20709 plus offsetof, to remove unportable assumptions about struct layout.
20710 These assumptions hold on all porting targets that I know of, but
20711 they are not guaranteed, they're easy to remove, and removing them
20712 makes further changes easier.
20713
20714 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20715 This doesn't fix a bug but makes the code clearer.
20716 (string_overrun_cookie): Now const. Use initializers that
20717 don't formally overflow signed char, to avoid warnings.
20718 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20719 can cause Emacs to crash when string overrun checking is enabled.
20720 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20721 multiple of sizeof (EMACS_INT); it need not be, if
20722 alignof(EMACS_INT) < sizeof (EMACS_INT).
20723 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20724
20725 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
20726
20727 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20728
20729 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20730
20731 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20732 supposed to be handshaking. (Bug#8556)
20733 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20734
20735 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
20736
20737 * lisp.h (Qdebug): List symbol.
20738 * eval.c (Qdebug): Restore global linkage.
20739 * keyboard.c (debug-on-event): New variable.
20740 (handle_user_signal): Break into debugger when debug-on-event
20741 matches the current signal symbol.
20742
20743 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20744
20745 * alloc.c (check_sblock, check_string_bytes)
20746 (check_string_free_list): Convert to standard C.
20747
20748 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20749
20750 * w32.c (emacs_gnutls_push): Fix typo.
20751
20752 2011-04-25 Eli Zaretskii <eliz@gnu.org>
20753
20754 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20755 "cast to pointer from integer of different size".
20756
20757 Improve doprnt and its use in verror. (Bug#8545)
20758 * doprnt.c (doprnt): Document the set of format control sequences
20759 supported by the function. Use SAFE_ALLOCA instead of always
20760 using `alloca'.
20761
20762 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20763 is one byte too soon. Don't use xrealloc; instead xfree and
20764 xmalloc anew.
20765
20766 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20767
20768 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20769 callbacks stage.
20770
20771 * gnutls.c: Renamed global_initialized to
20772 gnutls_global_initialized. Added internals for the
20773 :verify-hostname-error, :verify-error, and :verify-flags
20774 parameters of `gnutls-boot' and documented those parameters in the
20775 docstring. Start callback support.
20776 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20777 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20778 on error. Return error code.
20779 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20780 (emacs_gnutls_read): Likewise.
20781 (Fgnutls_boot): Return handshake error code.
20782 (emacs_gnutls_handle_error): New function.
20783 (wsaerror_to_errno): Likewise.
20784
20785 * w32.h (emacs_gnutls_pull): Add prototype.
20786 (emacs_gnutls_push): Likewise.
20787
20788 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20789 (emacs_gnutls_push): Likewise.
20790
20791 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20792
20793 * process.c (wait_reading_process_output): Check if GnuTLS
20794 buffered some data internally if no FDs are set for TLS
20795 connections.
20796
20797 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20798 (LIBS): Link to USER_LIBS.
20799 ($(BLD)/gnutls.$(0)): New target.
20800
20801 2011-04-24 Eli Zaretskii <eliz@gnu.org>
20802
20803 * xdisp.c (handle_single_display_spec): Rename the
20804 display_replaced_before_p argument into display_replaced_p, to
20805 make it consistent with the commentary. Fix typos in the
20806 commentary.
20807
20808 * textprop.c (syms_of_textprop): Remove dead code.
20809 (copy_text_properties): Delete obsolete commentary about an
20810 interface that was deleted long ago. Fix typos in the description
20811 of arguments.
20812
20813 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20814 to changes in oldXMenu/XMenu.h from 2011-04-16.
20815 <menu_help_message, prev_menu_help_message>: Constify.
20816 (IT_menu_make_room): menu->help_text is now `const char **';
20817 adjust.
20818
20819 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20820 to changes in oldXMenu/XMenu.h from 2011-04-16.
20821 (struct XMenu): Declare `help_text' `const char **'.
20822
20823 * xfaces.c <Qunspecified>: Make extern again.
20824
20825 * syntax.c: Include sys/types.h before including regex.h, as
20826 required by POSIX.
20827
20828 * doc.c (get_doc_string): Improve the format passed to `error'.
20829
20830 * doprnt.c (doprnt): Improve commentary.
20831
20832 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20833
20834 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20835 them with etags.
20836
20837 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20838 changes in globals.h immediately force recompilation.
20839 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20840 $(CURDIR)/s/ms-w32.h.
20841 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20842
20843 * character.c (Fchar_direction): Function deleted.
20844 (syms_of_character): Don't defsubr it.
20845 <char-direction-table>: Deleted.
20846
20847 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20848
20849 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20850 * doprnt.c: Include limits.h.
20851 (SIZE_MAX): New macro.
20852 (doprnt): Return a size_t value. 2nd arg is now size_t.
20853 Many local variables are now size_t instead of int or unsigned.
20854 Improve overflow protection. Support `l' modifier for integer
20855 conversions. Support %l conversion. Don't assume an EMACS_INT
20856 argument for integer conversions and for %c.
20857
20858 * lisp.h (doprnt): Restore prototype.
20859
20860 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20861 $(SRC)/character.h.
20862
20863 * Makefile.in (base_obj): Add back doprnt.o.
20864
20865 * deps.mk (doprnt.o): Add back prerequisites.
20866 (callint.o): Depend on character.h.
20867
20868 * eval.c (internal_lisp_condition_case): Include the handler
20869 representation in the error message.
20870 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20871 when breaking from the loop.
20872
20873 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20874
20875 * callint.c (Fcall_interactively): When displaying error message
20876 about invalid control letter, pass the character's codepoint, not
20877 a pointer to its multibyte form. Improve display of the character
20878 in octal and display also its hex code.
20879
20880 * character.c (char_string): Use %x to display the (unsigned)
20881 codepoint of an invalid character, to avoid displaying a bogus
20882 negative value.
20883
20884 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20885 `error', not SYMBOL_NAME itself.
20886
20887 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20888 character arguments to `error'.
20889
20890 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20891 to `error' in error message about FINAL_CHAR argument. Make sure
20892 FINAL_CHAR is a character, and use %c when it is passed as
20893 argument to `error'.
20894
20895 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20896
20897 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20898
20899 * w32.c: Include <time.h>.
20900 (sys_localtime): New function.
20901
20902 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
20903
20904 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20905
20906 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20907
20908 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
20909
20910 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20911 zombies (Bug#8467).
20912
20913 2011-04-19 Eli Zaretskii <eliz@gnu.org>
20914
20915 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20916 gl_state.e_property when gl_state.object is Qt.
20917
20918 * insdel.c (make_gap_larger): Remove limitation of buffer size
20919 to <= INT_MAX.
20920
20921 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
20922
20923 * xdisp.c (lookup_glyphless_char_display)
20924 (produce_glyphless_glyph): Handle cons cell entry in
20925 glyphless-char-display.
20926 (Vglyphless_char_display): Document it.
20927
20928 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20929 glyphless-char-display.
20930
20931 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
20932
20933 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20934
20935 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20936
20937 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20938 definition for no-X builds.
20939
20940 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
20941
20942 Static checks with GCC 4.6.0 and non-default toolkits.
20943
20944 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20945
20946 * process.c (keyboard_bit_set): Define only if SIGIO.
20947 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20948 (send_process): Repair possible setjmp clobbering.
20949
20950 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20951
20952 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20953
20954 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20955
20956 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20957 Define only if needed.
20958
20959 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20960 by pacifying GCC about it. Maybe it's time to retire it?
20961 * xfaces.c (USG, __TIMEVAL__): Likewise.
20962
20963 * dispextern.h (struct redisplay_interface): Rename param
20964 to avoid shadowing.
20965 * termhooks.h (struct terminal): Likewise.
20966 * xterm.c (xembed_send_message): Likewise.
20967
20968 * insdel.c (make_gap_smaller): Define only if
20969 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20970
20971 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20972 it.
20973
20974 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20975 so that we aren't warned about unused symbols.
20976
20977 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20978
20979 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20980
20981 * xfns.c (x_real_positions): Mark locals as initialized.
20982
20983 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20984
20985 * xterm.c: Fix problems found by static analysis with other toolkits.
20986 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20987 (x_dispatch_event): Declare static if USE_GTK, and
20988 define if USE_GTK || USE_X_TOOLKIT.
20989 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20990 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20991 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20992 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20993
20994 * xmenu.c (menu_help_callback): Pointer type fixes.
20995 Use const pointers when pointing at readonly data. Avoid pointer
20996 signedness clashes.
20997 (FALSE): Remove unused macro.
20998 (update_frame_menubar): Remove unused decl.
20999
21000 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21001
21002 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21003 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21004 (single_menu_item): Rename local to avoid shadowing.
21005
21006 * keyboard.c (make_lispy_event): Remove unused local var.
21007
21008 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21009 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21010
21011 * bitmaps: Change bitmaps from unsigned char back to the X11
21012 compatible char. Avoid the old compiler warnings about
21013 out-of-range initializers by using, for example, '\xab' rather
21014 than 0xab.
21015
21016 * xgselect.c (xgselect_initialize): Check vs interface
21017 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21018
21019 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21020
21021 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21022 to read-only memory.
21023
21024 * fns.c (vector): Remove; this old hack is no longer needed.
21025
21026 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21027 Remove unused var.
21028 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21029
21030 * xrdb.c (x_load_resources): Omit unused local.
21031
21032 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21033 (x_window): Rename locals to avoid shadowing.
21034 (USG): Use the kludged USG macro, to pacify gcc.
21035
21036 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21037 (x_term_init): Remove local to avoid shadowing.
21038
21039 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21040
21041 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21042 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21043
21044 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21045
21046 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21047
21048 Fix regex.c, syntax.c and friends for buffers > 2GB.
21049 * syntax.h (struct gl_state_s): Declare character position members
21050 EMACS_INT.
21051
21052 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21053
21054 * textprop.c (verify_interval_modification, interval_of):
21055 Declare arguments EMACS_INT.
21056
21057 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21058 EMACS_INT.
21059
21060 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21061
21062 * indent.c (Fvertical_motion): Local variable it_start is now
21063 EMACS_INT.
21064
21065 * regex.c (re_match, re_match_2, re_match_2_internal)
21066 (bcmp_translate, regcomp, regexec, print_double_string)
21067 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21068 (re_compile_pattern, re_exec): Declare arguments and local
21069 variables `size_t' and `ssize_t' and return values `regoff_t', as
21070 appropriate.
21071 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21072 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21073 <compile_stack_type>: `size' and `avail' are now `size_t'.
21074
21075 * regex.h <regoff_t>: Use ssize_t, not int.
21076 (re_search, re_search_2, re_match, re_match_2): Arguments that
21077 specify buffer/string position and length are now ssize_t and
21078 size_t. Return type is regoff_t.
21079
21080 2011-04-16 Ben Key <bkey76@gmail.com>
21081
21082 * nsfont.m: Fixed bugs in ns_get_family and
21083 ns_descriptor_to_entity that were caused by using free to
21084 deallocate memory blocks that were allocated by xmalloc (via
21085 xstrdup). This caused Emacs to crash when compiled with
21086 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21087 --enable-checking=xmallocoverrun). xfree is now used to
21088 deallocate these memory blocks.
21089
21090 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21091
21092 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21093
21094 emacs_write: Accept and return EMACS_INT for sizes.
21095 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21096 et seq.
21097 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21098 Accept and return EMACS_INT.
21099 (emacs_gnutls_write): Return the number of bytes written on
21100 partial writes.
21101 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21102 (emacs_read, emacs_write): Remove check for negative size, as the
21103 Emacs source code has been audited now.
21104 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21105 (emacs_read, emacs_write): Use it.
21106 * process.c (send_process): Adjust to the new signatures of
21107 emacs_write and emacs_gnutls_write. Do not attempt to store
21108 a byte offset into an 'int'; it might overflow.
21109 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21110
21111 * sound.c: Don't assume sizes fit in 'int'.
21112 (struct sound_device.period_size, alsa_period_size):
21113 Return EMACS_INT, not int.
21114 (struct sound_device.write, vox_write, alsa_write):
21115 Accept EMACS_INT, not int.
21116 (wav_play, au_play): Use EMACS_INT to store sizes and to
21117 record read return values.
21118
21119 2011-04-15 Ben Key <bkey76@gmail.com>
21120
21121 * keyboard.c (Qundefined): Don't declare static since it is used
21122 in nsfns.m.
21123 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21124 static since they are used in nsfont.m.
21125
21126 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21127
21128 * process.c (Qprocessp): Don't declare static.
21129 * lisp.h (Qprocessp): Declare again.
21130
21131 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21132
21133 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21134
21135 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21136
21137 Improve C-level modularity by making more things 'static'.
21138
21139 Don't publish debugger-only interfaces to other modules.
21140 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21141 (verify_bytepos, count_markers): Move decls to the only modules
21142 that need them.
21143 * region-cache.h (pp_cache): Likewise.
21144 * window.h (check_all_windows): Likewise.
21145 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21146
21147 * sysdep.c (croak): Now static, if
21148 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21149 * syssignal.h (croak): Declare only if not static.
21150
21151 * alloc.c (refill_memory_reserve): Now static if
21152 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21153 * lisp.h (refill_memory_reserve): Declare only if not static.
21154
21155 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21156 Define only if USE_LUCID.
21157
21158 * xrdb.c (x_customization_string, x_rm_string): Now static.
21159
21160 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21161 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21162
21163 * xdisp.c (draw_row_with_mouse_face): Now static.
21164 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21165
21166 * window.h (check_all_windows): Mark externally visible.
21167
21168 * window.c (window_deletion_count): Now static.
21169
21170 * undo.c: Make symbols static if they're not exported.
21171 (last_undo_buffer, last_boundary_position, pending_boundary):
21172 Now static.
21173
21174 * textprop.c (interval_insert_behind_hooks): Now static.
21175 (interval_insert_in_front_hooks): Likewise.
21176
21177 * term.c: Make symbols static if they're not exported.
21178 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21179 (max_frame_lines, tty_set_terminal_modes):
21180 (tty_reset_terminal_modes, tty_turn_off_highlight):
21181 (get_tty_terminal): Now static.
21182 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21183 * termhooks.h (term_mouse_moveto): Do not declare if
21184 HAVE_WINDOW_SYSTEM.
21185 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21186 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21187
21188 * sysdep.c: Make symbols static if they're not exported.
21189 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21190 Now static.
21191 (sigprocmask_set, full_mask): Remove; unused.
21192 (wait_debugging): Mark as visible.
21193 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21194 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21195
21196 * syntax.c (syntax_temp): Define only if !__GNUC__.
21197
21198 * sound.c (current_sound_device, current_sound): Now static.
21199
21200 * search.c (searchbufs, searchbuf_head): Now static.
21201
21202 * scroll.c (scroll_cost): Remove; unused.
21203 * dispextern.h (scroll_cost): Remove decl.
21204
21205 * region-cache.h (pp_cache): Mark as externally visible.
21206
21207 * process.c: Make symbols static if they're not exported.
21208 (process_tick, update_tick, create_process, chan_process):
21209 (Vprocess_alist, proc_buffered_char, datagram_access):
21210 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21211 (deactivate_process): Mark defn as static, as well as decl.
21212 * lisp.h (create_process): Remove decl.
21213 * process.h (chan_process, Vprocess_alist): Remove decls.
21214
21215 * print.c: Make symbols static if they're not exported.
21216 (print_depth, new_backquote_output, being_printed, print_buffer):
21217 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21218 (print_interval, print_number_index, initial_stderr_stream):
21219 Now static.
21220 * lisp.h (Fprinc): Remove decl.
21221 (debug_output_compilation_hack): Mark as externally visible.
21222
21223 * sysdep.c (croak): Move decl from here to syssignal.h.
21224 * syssignal.h (croak): Put it here, so the API can be checked when
21225 'croak' is called from dissociate_if_controlling_tty.
21226
21227 * minibuf.c: Make symbols static if they're not exported.
21228 (minibuf_save_list, choose_minibuf_frame): Now static.
21229 * lisp.h (choose_minibuf_frame): Remove decl.
21230
21231 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21232
21233 * lread.c: Make symbols static if they're not exported.
21234 (read_objects, initial_obarray, oblookup_last_bucket_number):
21235 Now static.
21236 (make_symbol): Remove; unused.
21237 * lisp.h (initial_obarray, make_symbol): Remove decls.
21238
21239 * keyboard.c: Make symbols static if they're not exported.
21240 (single_kboard, recent_keys_index, total_keys, recent_keys):
21241 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21242 (this_single_command_key_start, echoing, last_auto_save):
21243 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21244 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21245 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21246 (Vlispy_mouse_stem, double_click_count):
21247 Now static.
21248 (force_auto_save_soon): Define only if SIGDANGER.
21249 (ignore_mouse_drag_p): Now static if
21250 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21251 (print_help): Remove; unused.
21252 (stop_character, last_timer_event): Mark as externally visible.
21253 * keyboard.h (ignore_mouse_drag_p): Declare only if
21254 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21255 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21256 * lisp.h (echoing): Remove decl.
21257 (force_auto_save_soon): Declare only if SIGDANGER.
21258 * xdisp.c (redisplay_window): Simplify code, to make it more
21259 obvious that ignore_mouse_drag_p is not accessed if !defined
21260 USE_GTK && !defined HAVE_NS.
21261
21262 * intervals.c: Make symbols static if they're not exported.
21263 (merge_properties_sticky, merge_interval_right, delete_interval):
21264 Now static.
21265 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21266
21267 * insdel.c: Make symbols static if they're not exported.
21268 However, leave prepare_to_modify_buffer alone. It's never
21269 called from outside this function, but that appears to be a bug.
21270 (combine_after_change_list, combine_after_change_buffer):
21271 (adjust_after_replace, signal_before_change): Now static.
21272 (adjust_after_replace_noundo): Remove; unused.
21273 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21274 (signal_before_change): Remove decls.
21275
21276 * indent.c (val_compute_motion, val_vmotion): Now static.
21277
21278 * image.c: Make symbols static if they're not exported.
21279 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21280 if USE_GTK.
21281 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21282 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21283
21284 * fringe.c (standard_bitmaps): Now static.
21285 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21286
21287 * frame.c: Make symbols static if they're not exported.
21288 (x_report_frame_params, make_terminal_frame): Now static.
21289 (get_frame_param): Now static, unless HAVE_NS.
21290 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21291 (x_get_resource_string): Remove; not used.
21292 * frame.h (make_terminal_frame, x_report_frame_params):
21293 (x_get_resource_string); Remove decls.
21294 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21295 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21296
21297 * font.c, fontset.c: Make symbols static if they're not exported.
21298 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21299 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21300 * font.c (font_close_object): Now static.
21301 * font.h (font_close_object): Remove.
21302 * fontset.c (FONTSET_OBJLIST): Remove.
21303 (free_realized_fontset) #if-0 the body, which does nothing.
21304 (face_suitable_for_char_p): #if-0, as it's never called.
21305 * fontset.h (face_suitable_for_char_p): Remove decl.
21306 * xfaces.c (face_at_string_position):
21307 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21308 since 0 is always ASCII.
21309
21310 * fns.c (weak_hash_tables): Now static.
21311
21312 * fileio.c: Make symbols static if they're not exported.
21313 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21314 (Vwrite_region_annotation_buffers): Now static.
21315
21316 * eval.c: Make symbols static if they're not exported.
21317 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21318 * lisp.h (backtrace_list): Remove decl.
21319
21320 * emacs.c: Make symbols static if they're not exported.
21321 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21322 (fatal_error_code, fatal_error_signal_hook, standard_args):
21323 Now static.
21324 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21325 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21326 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21327 * lisp.h (fatal_error_signal_hook): Remove decl.
21328 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21329
21330 * editfns.c: Move a (normally-unused) function to its only use.
21331 * editfns.c, lisp.h (get_operating_system_release): Remove.
21332 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21333 worth the hassle of breaking this out.
21334
21335 * xterm.c: Make symbols static if they're not exported.
21336 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21337 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21338 (x_destroy_window, x_delete_display):
21339 Now static.
21340 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21341 (x_mouse_leave): Remove; unused.
21342 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21343 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21344 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21345 Remove decls.
21346 (x_mouse_leave): Declare only if WINDOWSNT.
21347 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21348 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21349 USE_X_TOOLKIT.
21350
21351 * ftxfont.c: Make symbols static if they're not exported.
21352 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21353 HAVE_FREETYPE.
21354 * font.h (ftxfont_driver): Likewise.
21355
21356 * xfns.c: Make symbols static if they're not exported.
21357 (x_last_font_name, x_display_info_for_name):
21358 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21359 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21360 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21361 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21362 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21363 (last_show_tip_args): Now static.
21364 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21365 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21366 (x_screen_planes): Remove; unused.
21367 * dispextern.h (x_screen_planes): Remove decl.
21368
21369 * dispnew.c: Make symbols static if they're not exported.
21370 * dispextern.h (redraw_garbaged_frames, scrolling):
21371 (increment_row_positions): Remove.
21372 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21373 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21374 Now static.
21375 (redraw_garbaged_frames): Remove; unused.
21376
21377 * xfaces.c: Make symbols static if they're not exported.
21378 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21379 Remove decls.
21380 * xterm.h (defined_color): Remove decls.
21381 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21382 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21383 (menu_face_changed_default, defined_color, free_realized_face):
21384 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21385 (ascii_face_of_lisp_face): Remove; unused.
21386
21387 * xdisp.c: Make symbols static if they're not exported.
21388 * dispextern.h (scratch_glyph_row, window_box_edges):
21389 (glyph_to_pixel_coords, set_cursor_from_row):
21390 (get_next_display_element, set_iterator_to_next):
21391 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21392 (show_mouse_face): Remove decls
21393 * frame.h (message_buf_print): Likewise.
21394 * lisp.h (pop_message, set_message, check_point_in_composition):
21395 Likewise.
21396 * xterm.h (set_vertical_scroll_bar): Likewise.
21397 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21398 (message_buf_print, scratch_glyph_row, displayed_buffer):
21399 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21400 (get_next_display_element, show_mouse_face, window_box_edges):
21401 (frame_to_window_pixel_xy, check_point_in_composition):
21402 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21403 (glyph_to_pixel_coords): Remove; unused.
21404
21405 * dired.c (file_name_completion): Now static.
21406
21407 * dbusbind.c (xd_in_read_queued_messages): Now static.
21408
21409 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21410 * data.c (circular_list_error): Remove.
21411
21412 * commands.h (last_point_position, last_point_position_buffer):
21413 (last_point_position_window): Remove decls.
21414 * keyboard.c: Make these variables static.
21415
21416 * coding.h (coding, code_convert_region, encode_coding_gap):
21417 Remove decls.
21418 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21419 (iso_code_class, detect_coding, code_convert_region): Now static.
21420 (encode_coding_gap): Remove; unused.
21421
21422 * chartab.c (chartab_chars, chartab_bits): Now static.
21423
21424 * charset.h (charset_iso_8859_1): Remove decl.
21425 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21426 Now static.
21427
21428 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21429 * ccl.c (Vccl_program_table): Now static.
21430 (check_ccl_update): Remove; unused.
21431
21432 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21433 * category.h: ... from here.
21434 * category.c (check_category_table, set_category_set): Now static.
21435
21436 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21437 * lisp.h: Remove these decls.
21438
21439 * buffer.c (buffer_count): Remove unused var.
21440
21441 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21442 so that it's not optimized away.
21443 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21444 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21445 exported only to the debugger.
21446
21447 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21448 * atimer.h (run_all_atimers): Remove; not exported.
21449
21450 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21451 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21452 was inaccessible from Lisp.
21453 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21454 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21455
21456 alloc.c: Import and export fewer symbols, and remove unused items.
21457 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21458 is defined.
21459 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21460 it's not optimized away by whole-program optimization.
21461 (message_enable_multibyte, free_misc): Remove.
21462 (catchlist, handlerlist, mark_backtrace):
21463 Declare only if BYTE_MARK_STACK.
21464 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21465 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21466 (message_enable_multibyte): Remove decl.
21467 (free_misc, interval_free_list, float_block, float_block_index):
21468 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21469 (cons_free_list, last_marked_index):
21470 Now static.
21471 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21472 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21473 (mark_backtrace): Define only if BYTE_MARK_STACK.
21474 * xdisp.c (message_enable_multibyte): Now static.
21475
21476 Declare Lisp_Object Q* variables to be 'static' if not exported.
21477 This makes it easier for human readers (and static analyzers)
21478 to see whether these variables are used from other modules.
21479 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21480 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21481 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21482 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21483 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21484 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21485 * xmenu.c, xselect.c:
21486 Declare Q* vars static if they are not used in other modules.
21487 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21488 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21489 Remove decls of unexported vars.
21490 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21491
21492 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21493
21494 Make Emacs functions such as Fatom 'static' by default.
21495 This makes it easier for human readers (and static analyzers)
21496 to see whether these functions can be called from other modules.
21497 DEFUN now defines a static function. To make the function external
21498 so that it can be used in other C modules, use the new macro DEFUE.
21499 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21500 (Finit_image_library):
21501 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21502 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21503 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21504 Remove decls, since these functions are now static.
21505 (Funintern, Fget_internal_run_time): New decls, since these functions
21506 were already external.
21507
21508 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21509 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21510 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21511 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21512 * keyboard.c, keymap.c, lread.c:
21513 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21514 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21515 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21516 Mark functions with DEFUE instead of DEFUN,
21517 if they are used in other modules.
21518 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21519 decls for now-static functions.
21520 * buffer.h (Fdelete_overlay): Remove decl.
21521 * callproc.c (Fgetenv_internal): Mark as internal.
21522 * composite.c (Fremove_list_of_text_properties): Remove decl.
21523 (Fcomposition_get_gstring): New forward static decl.
21524 * composite.h (Fcomposite_get_gstring): Remove decl.
21525 * dired.c (Ffile_attributes): New forward static decl.
21526 * doc.c (Fdocumntation_property): New forward static decl.
21527 * eval.c (Ffetch_bytecode): New forward static decl.
21528 (Funintern): Remove extern decl; now in .h file where it belongs.
21529 * fileio.c (Fmake_symbolic_link): New forward static decl.
21530 * image.c (Finit_image_library): New forward static decl.
21531 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21532 * intervals.h (Fprevious_property_change):
21533 (Fremove_list_of_text_properties): Remove decls.
21534 * keyboard.c (Fthis_command_keys): Remove decl.
21535 (Fcommand_execute): New forward static decl.
21536 * keymap.c (Flookup_key): New forward static decl.
21537 (Fcopy_keymap): Now static.
21538 * keymap.h (Flookup_key): Remove decl.
21539 * process.c (Fget_process): New forward static decl.
21540 (Fprocess_datagram_address): Mark as internal.
21541 * syntax.c (Fsyntax_table_p): New forward static decl.
21542 (skip_chars): Remove duplicate decl.
21543 * textprop.c (Fprevious_property_change): New forward static decl.
21544 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21545 Now internal.
21546 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21547 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21548
21549 * editfns.c (Fformat): Remove unreachable code.
21550
21551 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21552
21553 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21554 change. (Bug#8496)
21555
21556 2011-04-13 Eli Zaretskii <eliz@gnu.org>
21557
21558 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21559 when at ZV. (Bug#8487)
21560
21561 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21562
21563 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21564 (Bug#8437)
21565 * keyboard.c (parse_tool_bar_item): Likewise.
21566 * sound.c (sound_cleanup, alsa_close): Likewise.
21567 * termcap.c (tgetent): Likewise.
21568 * xfns.c (x_default_font_parameter): Likewise.
21569 * xsettings.c (read_and_apply_settings): Likewise.
21570
21571 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21572 (overrun_check_free): Protoize.
21573
21574 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21575
21576 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21577 since callers should never pass a negative size.
21578 Change the signature to match that of plain 'read' and 'write'; see
21579 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21580 * lisp.h: Update prototypes of emacs_write and emacs_read.
21581
21582 2011-04-11 Eli Zaretskii <eliz@gnu.org>
21583
21584 * xdisp.c (redisplay_window): Don't try to determine the character
21585 position of the scroll margin if the window start point w->startp
21586 is outside the buffer's accessible region. (Bug#8468)
21587
21588 2011-04-10 Eli Zaretskii <eliz@gnu.org>
21589
21590 Fix write-region and its subroutines for buffers > 2GB.
21591 * fileio.c (a_write, e_write): Modify declaration of arguments and
21592 local variables to support buffers larger than 2GB.
21593 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21594
21595 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21596 argument, local variables, and return value.
21597
21598 * lisp.h: Update prototypes of emacs_write and emacs_read.
21599
21600 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21601
21602 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
21603
21604 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21605
21606 Fix more problems found by GCC 4.6.0's static checks.
21607
21608 * xdisp.c (vmessage): Use a better test for character truncation.
21609
21610 * charset.c (load_charset_map): <, not <=, for optimization,
21611 and to avoid potential problems with integer overflow.
21612 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21613 * casetab.c (set_identity, shuffle): Likewise.
21614 * editfns.c (Fformat): Likewise.
21615 * syntax.c (skip_chars): Likewise.
21616
21617 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21618 This also lets GCC 4.6.0 generate slightly better loop code.
21619
21620 * callint.c (Fcall_interactively): <, not <=, for optimization.
21621 (Fcall_interactively): Count the number of arguments produced,
21622 not the number of arguments given. This is simpler and lets GCC
21623 4.6.0 generate slightly better code.
21624
21625 * ftfont.c: Distingish more carefully between FcChar8 and char.
21626 The previous code passed unsigned char * to a functions like
21627 strlen and xstrcasecmp that expect char *, which does not
21628 conform to the C standard.
21629 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21630 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21631 char * when the C standard requires it.
21632
21633 * keyboard.c (read_char): Remove unused var.
21634
21635 * eval.c: Port to Windows vsnprintf (Bug#8435).
21636 Include <limits.h>.
21637 (SIZE_MAX): Define if the headers do not.
21638 (verror): Do not give up if vsnprintf returns a negative count.
21639 Instead, grow the buffer. This ports to Windows vsnprintf, which
21640 does not conform to C99. Problem reported by Eli Zaretskii.
21641 Also, simplify the allocation scheme, by avoiding the need for
21642 calling realloc, and removing the ALLOCATED variable.
21643
21644 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21645
21646 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21647 But keep the doprint source code for now, as we might revamp it
21648 and use it again (Bug#8435).
21649 * lisp.h (doprnt): Remove.
21650 * Makefile.in (base_obj): Remove doprnt.o.
21651 * deps.mk (doprnt.o): Remove.
21652
21653 error: Print 32- and 64-bit integers portably (Bug#8435).
21654 Without this change, on typical 64-bit hosts error ("...%d...", N)
21655 was used to print both 32- and 64-bit integers N, which relied on
21656 undefined behavior.
21657 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21658 * lisp.h (error, verror): Mark as printf-like functions.
21659 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21660 Report overflow in size calculations when allocating printf buffer.
21661 Do not truncate output string at its first null byte.
21662 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21663 Truncate the output at a character boundary, since vsnprintf does not
21664 do that.
21665 * charset.c (check_iso_charset_parameter): Convert internal
21666 character to string before calling 'error', since %c now has the
21667 printf meaning.
21668 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21669 overflow when computing char to be passed to 'error'. Do not
21670 pass Lisp_Object to 'error'; pass the integer instead.
21671 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21672 formatted with plain %d.
21673
21674 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21675
21676 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21677
21678 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21679
21680 * xterm.c (x_catch_errors): Remove duplicate declaration.
21681
21682 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21683
21684 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21685
21686 2011-04-10 Jim Meyering <meyering@redhat.com>
21687
21688 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21689 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21690 return ssize_t not "int", and use size_t as the buffer length.
21691 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21692 * gnutls.h: Update declarations.
21693 * process.c (read_process_output): Use ssize_t, to match.
21694 (send_process): Likewise.
21695
21696 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21697
21698 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21699
21700 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21701
21702 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21703 Use unsigned char, to match FcChar8 type definition.
21704
21705 * xterm.c (handle_one_xevent):
21706 * xmenu.c (create_and_show_popup_menu):
21707 * xselect.c (x_decline_selection_request)
21708 (x_reply_selection_request): Avoid type-punned deref of X events.
21709
21710 2011-04-09 Eli Zaretskii <eliz@gnu.org>
21711
21712 Fix some uses of `int' instead of EMACS_INT.
21713 * search.c (string_match_1, fast_string_match)
21714 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21715 (scan_buffer, find_next_newline_no_quit)
21716 (find_before_next_newline, search_command, Freplace_match)
21717 (Fmatch_data): Make some `int' variables be EMACS_INT.
21718
21719 * xdisp.c (display_count_lines): 3rd argument and return value now
21720 EMACS_INT. All callers changed.
21721 (pint2hrstr): Last argument is now EMACS_INT.
21722
21723 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21724 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21725 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21726 (decode_coding_utf_16, decode_coding_emacs_mule)
21727 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21728 (decode_coding_ccl, decode_coding_charset)
21729 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21730 (decode_coding_iso_2022, decode_coding_emacs_mule)
21731 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21732 <char_offset, last_offset>: Declare EMACS_INT.
21733 (encode_coding_utf_8, encode_coding_utf_16)
21734 (encode_coding_emacs_mule, encode_invocation_designation)
21735 (encode_designation_at_bol, encode_coding_iso_2022)
21736 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21737 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21738 Declare EMACS_INT.
21739 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21740 (encode_invocation_designation): Last argument P_NCHARS is now
21741 EMACS_INT.
21742 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21743 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21744
21745 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21746 All users changed.
21747
21748 * ccl.c (Fccl_execute_on_string): Declare some variables
21749 EMACS_INT.
21750
21751 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
21752
21753 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21754
21755 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21756
21757 * process.c (Fformat_network_address): Doc fix.
21758
21759 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21760
21761 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21762
21763 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
21764
21765 * keyboard.c (read_char): Call Lisp function help-form-show,
21766 instead of using internal_with_output_to_temp_buffer.
21767 (Qhelp_form_show): New var.
21768 (syms_of_keyboard): Use DEFSYM macro.
21769
21770 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21771
21772 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21773
21774 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
21775
21776 * process.c (Flist_processes): Remove to Lisp.
21777 (list_processes_1): Delete.
21778
21779 2011-04-06 Eli Zaretskii <eliz@gnu.org>
21780
21781 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21782
21783 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21784
21785 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
21786
21787 Fix more problems found by GCC 4.6.0's static checks.
21788
21789 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21790
21791 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21792
21793 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21794
21795 * xdisp.c (vmessage): Mark as a printf-like function.
21796
21797 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21798
21799 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21800
21801 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21802 printf-like functions.
21803 (tiff_load): Add casts to remove these marks before passing them
21804 to system-supplied API.
21805
21806 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21807
21808 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21809 This avoids several warnings with gcc -Wstrict-overflow.
21810 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21811 directly, rather than having caller test rule sign. This avoids
21812 some unnecessary tests.
21813 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21814 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21815 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21816
21817 * xfont.c (xfont_text_extents): Remove var that was set but not used.
21818 (xfont_open): Avoid unnecessary tests.
21819
21820 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21821
21822 * composite.h, composite.c (composition_gstring_put_cache):
21823 Use EMACS_INT, not int, for length.
21824
21825 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21826 breaking out part of COMPOSITION_DECODE_RULE.
21827 (COMPOSITION_DECODE_RULE): Use it.
21828 * composite.c (get_composition_id): Remove unused local vars,
21829 by using the new macro.
21830
21831 * textprop.c (set_text_properties_1): Change while to do-while,
21832 since the condition is always true at first.
21833
21834 * intervals.c (graft_intervals_into_buffer): Mark var as used.
21835 (interval_deletion_adjustment): Return unsigned value.
21836 All uses changed.
21837
21838 * process.c (list_processes_1, create_pty, read_process_output):
21839 (exec_sentinel): Remove vars that were set but not used.
21840 (create_pty): Remove unnecessary "volatile"s.
21841 (Fnetwork_interface_info): Avoid possibility of int overflow.
21842 (read_process_output): Do adaptive read buffering even if carryover.
21843 (read_process_output): Simplify nbytes computation if buffered.
21844
21845 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21846
21847 * syntax.c (scan_words): Remove var that was set but not used.
21848 (update_syntax_table): Use unsigned instead of int.
21849
21850 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21851 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21852 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21853
21854 * print.c (print_error_message): Avoid int overflow.
21855
21856 * font.c (font_list_entities): Redo for clarity,
21857 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21858
21859 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21860 (font_score): Avoid potential overflow in diff calculation.
21861
21862 * fns.c (substring_both): Remove var that is set but not used.
21863 (sxhash): Redo loop for clarity and to avoid wraparound warning.
21864
21865 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21866
21867 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21868 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21869 can always succeed if overflow has undefined behavior.
21870
21871 * search.c (boyer_moore, wordify): Remove vars set but not used.
21872 (wordify): Omit three unnecessary tests.
21873
21874 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21875 All callers changed. This avoids the need for an unused var.
21876
21877 * casefiddle.c (casify_region): Remove var that is set but not used.
21878
21879 * dired.c (file_name_completion): Remove var that is set but not used.
21880
21881 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21882
21883 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21884 (Finsert_file_contents): Remove unnecessary code checking fd.
21885
21886 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21887 Check for integer overflow on size calculations.
21888
21889 * buffer.c (Fprevious_overlay_change): Remove var that is set
21890 but not used.
21891
21892 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21893 Remove vars that are set but not used.
21894 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21895 (timer_check_2): Mark vars as initialized.
21896
21897 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21898
21899 * image.c (lookup_image): Remove var that is set but not used.
21900 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21901
21902 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21903 that are set but not used.
21904
21905 * xfns.c (make_invisible_cursor): Don't return garbage
21906 if XCreateBitmapFromData fails (Bug#8410).
21907
21908 * xselect.c (x_get_local_selection, x_handle_property_notify):
21909 Remove vars that are set but not used.
21910
21911 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21912 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21913
21914 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21915 Remove var that is set but not used.
21916 (scroll_bar_windows_size): Now size_t, not int.
21917 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21918 Check for overflow.
21919
21920 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21921 (map_tty_color) [!defined MSDOS]: Likewise.
21922
21923 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21924
21925 * coding.c: Remove vars that are set but not used.
21926 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21927 All callers changed.
21928 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21929 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21930 (decode_coding_charset): Remove vars that are set but not used.
21931
21932 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21933 that is set but not used.
21934
21935 * print.c (print_object): Remove var that is set but not used.
21936
21937 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21938 The gnulib version avoids calling malloc in the usual case,
21939 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21940 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21941 * filelock.c (current_lock_owner): Likewise.
21942 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21943 * sysdep.c: Include allocator.h, careadlinkat.h.
21944 (emacs_no_realloc_allocator): New static constant.
21945 (emacs_readlink): New function.
21946 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21947 ../lib/careadlinkat.h.
21948
21949 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21950
21951 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21952 first non-nil return value).
21953
21954 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21955
21956 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21957 if not defined (Bug#8403).
21958
21959 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21960
21961 * xdisp.c (display_count_lines): Remove parameter `start',
21962 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21963 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21964 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21965 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21966 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21967 and thereabouts. All callers changed.
21968 (get_per_char_metric): Remove parameter `f', unused since
21969 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21970
21971 2011-04-02 Jim Meyering <meyering@redhat.com>
21972
21973 do not dereference NULL upon failed strdup
21974 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21975 (ns_get_family): Likewise.
21976
21977 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21978
21979 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21980
21981 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21982
21983 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21984 later (Bug#8403).
21985
21986 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21987
21988 Add lexical binding.
21989
21990 * window.c (Ftemp_output_buffer_show): New fun.
21991 (Fsave_window_excursion):
21992 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21993
21994 * lread.c (lisp_file_lexically_bound_p): New function.
21995 (Fload): Bind Qlexical_binding.
21996 (readevalloop): Remove `evalfun' arg.
21997 Bind Qinternal_interpreter_environment.
21998 (Feval_buffer): Bind Qlexical_binding.
21999 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22000 Mark as dynamic.
22001 (syms_of_lread): Declare `lexical-binding'.
22002
22003 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22004
22005 * keyboard.c (eval_dyn): New fun.
22006 (menu_item_eval_property): Use it.
22007
22008 * image.c (parse_image_spec): Use Ffunctionp.
22009
22010 * fns.c (concat, mapcar1): Accept byte-code-functions.
22011
22012 * eval.c (Fsetq): Handle lexical vars.
22013 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22014 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22015 (FletX, Flet): Obey lexical binding.
22016 (Fcommandp): Handle closures.
22017 (Feval): New `lexical' arg.
22018 (eval_sub): New function extracted from Feval. Use it almost
22019 everywhere where Feval was used. Look up vars in lexical env.
22020 Handle closures.
22021 (Ffunctionp): Move from subr.el.
22022 (Ffuncall): Handle closures.
22023 (apply_lambda): Remove `eval_flags'.
22024 (funcall_lambda): Handle closures and new byte-code-functions.
22025 (Fspecial_variable_p): New function.
22026 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22027 but without exporting it to Lisp.
22028
22029 * doc.c (Fdocumentation, store_function_docstring):
22030 * data.c (Finteractive_form): Handle closures.
22031
22032 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22033 interactive spec.
22034
22035 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22036 New byte-codes.
22037 (exec_byte_code): New function extracted from Fbyte_code to handle new
22038 calling convention for byte-code-functions. Add new byte-codes.
22039
22040 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22041
22042 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22043
22044 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22045
22046 * xdisp.c (redisplay_internal): Fix prototype.
22047
22048 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22049
22050 * xdisp.c (SCROLL_LIMIT): New macro.
22051 (try_scrolling): Use it when setting scroll_limit.
22052 Limit scrolling to 100 screen lines.
22053 (redisplay_window): Even when falling back on "recentering",
22054 position point in the window according to scroll-conservatively,
22055 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22056
22057 (try_scrolling): When point is above the window, allow searching
22058 as far as scroll_max, or one screenful, to compute vertical
22059 distance from PT to the scroll margin position. This prevents
22060 try_scrolling from unnecessarily failing when
22061 scroll-conservatively is set to a value slightly larger than the
22062 window height. Clean up the case of PT below the margin at bottom
22063 of window: scroll_max can no longer be INT_MAX. When aggressive
22064 scrolling is in use, don't let point enter the opposite scroll
22065 margin as result of the scroll.
22066 (syms_of_xdisp) <scroll-conservatively>: Document the
22067 threshold of 100 lines for never-recentering scrolling.
22068
22069 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22070
22071 * dispextern.h (move_it_by_lines):
22072 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22073 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22074 (message_log_check_duplicate): Remove parameters `prev_bol' and
22075 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22076 (redisplay_internal): Remove parameter `preserve_echo_area',
22077 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22078
22079 * indent.c (Fvertical_motion):
22080 * window.c (window_scroll_pixel_based, Frecenter):
22081 Don't pass `need_y_p' to `move_it_by_lines'.
22082
22083 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22084
22085 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22086 steal a few bits to be more compact.
22087 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22088 Remove unneeded casts.
22089
22090 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22091
22092 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22093
22094 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22095 binding" message (bug#7967).
22096
22097 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22098
22099 Fix more problems found by GCC 4.6.0's static checks.
22100
22101 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22102 Remove unused local var.
22103
22104 * editfns.c (Fmessage_box): Remove unused local var.
22105
22106 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22107 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22108 Omit unused local vars.
22109 * window.c (shrink_windows): Omit unused local var.
22110 * menu.c (digest_single_submenu): Omit unused local var.
22111 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22112 Omit unused local var.
22113
22114 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22115 Don't assume string length fits in int.
22116 (keyremap_step, read_key_sequence): Use size_t for sizes.
22117 (read_key_sequence): Don't check last_real_key_start redundantly.
22118
22119 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22120 instead of alloca (Bug#8344).
22121
22122 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22123 (Fbacktrace_frame): Don't assume nframes fits in int.
22124
22125 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22126
22127 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22128 concerns.
22129
22130 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22131
22132 * cm.c (calccost): Turn while-do into do-while, for clarity.
22133
22134 * keyboard.c (syms_of_keyboard): Use the same style as later
22135 in this function when indexing through an array. This also
22136 works around GCC bug 48267.
22137
22138 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22139
22140 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22141
22142 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22143 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22144
22145 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22146 This avoids undefined behavior on integer overflow, and is a bit
22147 more convenient anyway since it is compared to a size_t variable.
22148
22149 Variadic C functions now count arguments with size_t, not int.
22150 This avoids an unnecessary limitation on 64-bit machines, which
22151 caused (substring ...) to crash on large vectors (Bug#8344).
22152 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22153 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22154 All variadic functions and their callers changed accordingly.
22155 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22156 * data.c (arith_driver, float_arith_driver): Likewise.
22157 * editfns.c (general_insert_function): Likewise.
22158 * eval.c (struct backtrace.nargs, interactive_p)
22159 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22160 (funcall_lambda, mark_backtrace): Likewise.
22161 * fns.c (concat): Likewise.
22162 * frame.c (x_set_frame_parameters): Likewise.
22163 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22164 0 if not found, not -1. All callers changed.
22165
22166 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22167 (stack_copy_size): Now size_t, not int.
22168 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22169
22170 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22171
22172 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22173 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22174 All callers changed.
22175
22176 * lisp.h (multibyte_char_to_unibyte):
22177 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22178 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22179 * character.h (CHAR_TO_BYTE8):
22180 * cmds.c (internal_self_insert):
22181 * editfns.c (general_insert_function):
22182 * keymap.c (push_key_description):
22183 * search.c (Freplace_match):
22184 * xdisp.c (message_dolog, set_message_1): All callers changed.
22185
22186 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22187
22188 * keyboard.c (safe_run_hook_funcall): New function.
22189 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22190 don't set the hook to nil, but remove the offending function instead.
22191 (Qcommand_hook_internal): Remove, unused.
22192 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22193 Vcommand_hook_internal.
22194
22195 * eval.c (enum run_hooks_condition): Remove.
22196 (funcall_nil, funcall_not): New functions.
22197 (run_hook_with_args): Call each function through a `funcall' argument.
22198 Remove `cond' argument, now redundant.
22199 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22200 (Frun_hook_with_args_until_failure): Adjust accordingly.
22201 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22202
22203 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22204
22205 * dispextern.h (string_buffer_position): Remove declaration.
22206
22207 * print.c (strout): Remove parameter `multibyte', unused since
22208 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22209
22210 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22211 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22212 All callers changed.
22213
22214 * w32.c (_wsa_errlist): Use braces for struct initializers.
22215
22216 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22217 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22218 All callers changed.
22219 (string_buffer_position): Likewise. Also, make static (it's never
22220 used outside xdisp.c).
22221 (cursor_row_p): Remove parameter `w', unused since
22222 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22223 (decode_mode_spec): Remove parameter `precision', introduced during
22224 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22225 All callers changed.
22226
22227 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22228
22229 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22230
22231 2011-03-27 Anders Lindgren <andlind@gmail.com>
22232
22233 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22234 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22235 (ns_update_auto_hide_menu_bar): New functions.
22236 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22237 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22238 ns_constrain_all_frames.
22239 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22240 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22241
22242 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22243
22244 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22245
22246 2011-03-27 Glenn Morris <rgm@gnu.org>
22247
22248 * syssignal.h: Replace RETSIGTYPE with void.
22249 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22250 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22251 Replace SIGTYPE with void everywhere.
22252 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22253 * s/template.h (SIGTYPE): Remove commented out definition.
22254
22255 2011-03-26 Eli Zaretskii <eliz@gnu.org>
22256
22257 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22258 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22259
22260 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
22261
22262 * w32.c (read_unc_volume): Use parameter `henum', instead of
22263 global variable `wget_enum_handle'.
22264
22265 * keymap.c (describe_vector): Remove parameters `indices' and
22266 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22267 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22268
22269 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22270
22271 * keyboard.c (timer_check): Remove parameter `do_it_now',
22272 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22273 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22274 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22275
22276 * keyboard.c (read_char):
22277 * w32menu.c (w32_menu_display_help):
22278 * xmenu.c (show_help_event, menu_help_callback):
22279 Adjust calls to `show_help_echo'.
22280
22281 * gtkutil.c (xg_maybe_add_timer):
22282 * keyboard.c (readable_events):
22283 * process.c (wait_reading_process_output):
22284 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22285
22286 * insdel.c (adjust_markers_gap_motion):
22287 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22288 (gap_left, gap_right): Don't call it.
22289
22290 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22291
22292 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22293 incurred during fontification.
22294
22295 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22296
22297 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22298 (DEFVAR_PER_BUFFER): Don't pass it.
22299
22300 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22301 (scrolling_window): Don't pass it.
22302
22303 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22304
22305 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22306
22307 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22308 and `suffix'.
22309 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22310 of variables specific to SELinux and computation of `encoded_absname'.
22311
22312 * image.c (XPutPixel): Remove unused variable `height'.
22313
22314 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22315
22316 * unexw32.c (get_section_info): Remove unused variable `section'.
22317
22318 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22319 (system_process_attributes): Remove unused variable `sess'.
22320 (sys_read): Remove unused variable `err'.
22321
22322 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22323 (w32_wnd_proc): Remove unused variable `isdead'.
22324 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22325 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22326 (x_create_tip_frame): Remove unused variable `tem'.
22327
22328 * w32inevt.c (w32_console_read_socket):
22329 Remove unused variable `no_events'.
22330
22331 * w32term.c (x_draw_composite_glyph_string_foreground):
22332 Remove unused variable `width'.
22333
22334 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22335
22336 * w32term.c (x_set_glyph_string_clipping):
22337 Don't pass uninitialized region to CombineRgn.
22338
22339 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22340
22341 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22342 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22343 (Fx_close_connection): Remove unused variable `i'.
22344
22345 * w32font.c (w32font_draw): Return number of glyphs.
22346 (w32font_open_internal): Remove unused variable `i'.
22347 (w32font_driver): Add missing initializer.
22348
22349 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22350 (fill_in_menu): Remove unused variable `items_added'.
22351
22352 * w32term.c (last_mouse_press_frame): Remove static global variable.
22353 (w32_clip_to_row): Remove unused variable `f'.
22354 (x_delete_terminal): Remove unused variable `i'.
22355
22356 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22357 (NOTHING): Remove unused static global variable.
22358 (uniscribe_check_otf): Remove unused variable `table'.
22359 (uniscribe_font_driver): Add missing initializers.
22360
22361 2011-03-23 Julien Danjou <julien@danjou.info>
22362
22363 * term.c (Fsuspend_tty, Fresume_tty):
22364 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22365 * window.c (temp_output_buffer_show):
22366 * insdel.c (signal_before_change):
22367 * frame.c (Fhandle_switch_frame):
22368 * fileio.c (Fdo_auto_save):
22369 * emacs.c (Fkill_emacs):
22370 * editfns.c (save_excursion_restore):
22371 * cmds.c (internal_self_insert):
22372 * callint.c (Fcall_interactively):
22373 * buffer.c (Fkill_all_local_variables):
22374 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22375 Use Frun_hooks.
22376 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22377 unconditionally since it does the check itself.
22378
22379 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22380
22381 Fix more problems found by GCC 4.5.2's static checks.
22382
22383 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22384 the first time through the loop, since we know p0 < p1 then.
22385 This also avoids a gcc -Wstrict-overflow warning.
22386
22387 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22388 leading to a memory leak, possible in functions like
22389 load_charset_map_from_file that can allocate an unbounded number
22390 of objects (Bug#8318).
22391
22392 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22393 that could (at least in theory) be that large.
22394
22395 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22396 This is less likely to overflow, and avoids undefined behavior if
22397 overflow does occur. All callers changed. Use strtoul to scan
22398 for the unsigned long integer.
22399 (pint2hrstr): Simplify and tune code slightly.
22400 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22401
22402 * scroll.c (do_scrolling): Work around GCC bug 48228.
22403 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22404
22405 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22406 This also avoids a warning with gcc -Wstrict-overflow.
22407 (validate_x_resource_name): Simplify count usage.
22408 This also avoids a warning with gcc -Wstrict-overflow.
22409
22410 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22411 fail (Bug#8306).
22412
22413 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22414
22415 * process.c (Fmake_network_process): Use socklen_t, not int,
22416 where POSIX says socklen_t is required in portable programs.
22417 This fixes a porting bug on hosts like 64-bit HP-UX, where
22418 socklen_t is wider than int (Bug#8277).
22419 (Fmake_network_process, server_accept_connection):
22420 (wait_reading_process_output, read_process_output):
22421 Likewise.
22422
22423 * process.c: Rename or move locals to avoid shadowing.
22424 (list_processes_1, Fmake_network_process):
22425 (read_process_output_error_handler, exec_sentinel_error_handler):
22426 Rename or move locals.
22427 (Fmake_network_process): Define label "retry_connect" only if needed.
22428 (Fnetwork_interface_info): Fix pointer signedness.
22429 (process_send_signal): Add cast to avoid pointer signedness problem.
22430 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22431 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22432
22433 Make tparam.h and terminfo.c consistent.
22434 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22435 Include tparam.h instead, since it declares them.
22436 * cm.h (PC): Remove extern decl; tparam.h now does this.
22437 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22438 * terminfo.c: Include tparam.h, to check interfaces.
22439 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22440 (tparam): Adjust signature to match interface in tparam.h;
22441 this removes some undefined behavior. Check that outstring and len
22442 are zero, which they always are with Emacs.
22443 * tparam.h (PC, BC, UP): New extern decls.
22444
22445 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22446 (xftfont_open): Rename locals to avoid shadowing.
22447
22448 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22449 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22450 (OTF_TAG_SYM): Omit macro if not needed.
22451 (ftfont_list): Remove unused local.
22452 (get_adstyle_property, ftfont_pattern_entity):
22453 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22454 Rename locals to avoid shadowing.
22455
22456 * xfont.c (xfont_list_family): Mark var as initialized.
22457
22458 * xml.c (make_dom): Now static.
22459
22460 * composite.c (composition_compute_stop_pos): Rename local to
22461 avoid shadowing.
22462 (composition_reseat_it): Remove unused locals.
22463 (find_automatic_composition, composition_adjust_point): Likewise.
22464 (composition_update_it): Mark var as initialized.
22465 (find_automatic_composition): Mark vars as initialized,
22466 with a FIXME (Bug#8290).
22467
22468 character.h: Rename locals to avoid shadowing.
22469 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22470 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22471 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22472 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22473 to avoid shadowing.
22474
22475 * textprop.c (property_change_between_p): Remove; unused.
22476
22477 * intervals.c (interval_start_pos): Now static.
22478
22479 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22480
22481 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22482 Rename locals to avoid shadowing.
22483
22484 * sound.c (wav_play, au_play, Fplay_sound_internal):
22485 Fix pointer signedness.
22486 (alsa_choose_format): Remove unused local var.
22487 (wav_play): Initialize a variable to 0, to prevent undefined
22488 behavior (Bug#8278).
22489
22490 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22491
22492 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22493
22494 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22495 clobbering (Bug#8298).
22496 * sysdep.c (sys_subshell): Likewise.
22497 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22498
22499 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22500 This should get cleaned up, so that child_setup has the
22501 same signature on all platforms.
22502
22503 * callproc.c (call_process_cleanup): Now static.
22504 (relocate_fd): Rename locals to avoid shadowing.
22505
22506 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22507
22508 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22509 not to be necessary, and produces flickering.
22510
22511 2011-03-20 Glenn Morris <rgm@gnu.org>
22512
22513 * config.in: Remove file.
22514
22515 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22516
22517 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22518 are now in src/globals.h.
22519 (syms_of_minibuf): Remove spurious & from previous change.
22520
22521 2011-03-20 Leo Liu <sdl.web@gmail.com>
22522
22523 * minibuf.c (completing-read-function): New variable.
22524 (completing-read-default): Rename from completing-read.
22525 (completing-read): Call completing-read-function.
22526
22527 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22528
22529 * xfaces.c (Fx_load_color_file):
22530 Read color file from absolute filename (bug#8250).
22531
22532 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22533
22534 * makefile.w32-in: Update dependencies.
22535
22536 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22537
22538 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22539
22540 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22541
22542 Fix more problems found by GCC 4.5.2's static checks.
22543
22544 * process.c (make_serial_process_unwind, send_process_trap):
22545 (sigchld_handler): Now static.
22546
22547 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22548 That way, the code declares only the vars that it needs.
22549 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22550 * s/cygwin.h (PTY_ITERATION): Likewise.
22551 * s/darwin.h (PTY_ITERATION): Likewise.
22552 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22553
22554 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22555 * process.c (allocate_pty): Don't declare stb unless it's needed.
22556
22557 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22558 (CONSTANTLIM): Remove; unused.
22559 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22560 Define only if needed.
22561
22562 * unexelf.c (unexec): Name an expression,
22563 to avoid gcc -Wbad-function-cast warning.
22564 Use a different way to cause a compilation error if anyone uses
22565 n rather than nn, a way that does not involve shadowing.
22566 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22567
22568 * deps.mk (unexalpha.o): Remove; unused.
22569
22570 New file unexec.h, the (simple) interface for unexec (Bug#8267).
22571 * unexec.h: New file.
22572 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22573 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22574 Depend on unexec.h.
22575 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22576 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22577 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22578 Change as necessary to match prototype in unexec.h.
22579
22580 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22581 shadowing.
22582 (back_comment, skip_chars): Mark vars as initialized.
22583
22584 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22585 Rename locals to avoid shadowing.
22586
22587 * lread.c (read1): Rewrite so as not to use empty "else".
22588 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22589
22590 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22591
22592 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22593 warning when compiling print.c.
22594
22595 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22596 instead of using an uninitialized var.
22597 (font_sort_entities): Mark var as initialized.
22598
22599 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22600
22601 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22602 pointers to constants.
22603 (font_parse_fcname): Remove unused vars.
22604 (font_delete_unmatched): Now static.
22605 (font_get_spec): Remove; unused.
22606 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22607 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22608 Rename or move locals to avoid shadowing.
22609
22610 * fns.c (require_nesting_list, require_unwind): Now static.
22611 (Ffillarray): Rename locals to avoid shadowing.
22612
22613 * floatfns.c (domain_error2): Define only if needed.
22614 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22615
22616 * alloc.c (mark_backtrace): Move decl from here ...
22617 * lisp.h: ... to here, so that it can be checked.
22618
22619 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22620 (Fdefvar): Rewrite so as not to use empty "else".
22621 (lisp_indirect_variable): Name an expression,
22622 to avoid gcc -Wbad-function-cast warning.
22623 (Fdefvar): Rename locals to avoid shadowing.
22624
22625 * callint.c (quotify_arg, quotify_args): Now static.
22626 (Fcall_interactively): Rename locals to avoid shadowing.
22627 Use const pointer when appropriate.
22628
22629 * lisp.h (get_system_name, get_operating_system_release):
22630 Move decls here, to check interfaces.
22631 * process.c (get_operating_system_release): Move decl to lisp.h.
22632 * xrdb.c (get_system_name): Likewise.
22633 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22634 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22635 some of which prompt warnings from gcc -Wbad-function-cast.
22636 (Fformat_time_string, Fencode_time, Finsert_char):
22637 (Ftranslate_region_internal, Fformat):
22638 Rename or remove local vars to avoid shadowing.
22639 (Ftranslate_region_internal): Mark var as initialized.
22640
22641 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22642 avoid shadowing.
22643
22644 * lisp.h (eassert): Check that the argument compiles, even if
22645 ENABLE_CHECKING is not defined.
22646
22647 * data.c (Findirect_variable): Name an expression, to avoid
22648 gcc -Wbad-function-cast warning.
22649 (default_value, arithcompare, arith_driver, arith_error): Now static.
22650 (store_symval_forwarding): Rename local to avoid shadowing.
22651 (Fmake_variable_buffer_local, Fmake_local_variable):
22652 Mark variables as initialized.
22653 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22654
22655 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22656 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22657 Rename locals to avoid shadowing.
22658 (mark_stack): Move local variables into the #ifdef region where
22659 they're used.
22660 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22661 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22662 needed otherwise.
22663 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22664 (GC_STRING_CHARS): Remove; not used.
22665 (Fmemory_limit): Cast sbrk's returned value to char *.
22666
22667 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22668 avoids undefined behavior in theory.
22669
22670 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22671
22672 Use functions, not macros, for up- and down-casing (Bug#8254).
22673 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22674 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22675 to use the following functions instead of these macros.
22676 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22677 EMACS_INT, since callers assume the returned value fits in int.
22678 (upcase1): Likewise, for UPCASE_TABLE.
22679 (uppercasep, lowercasep, upcase): New static inline functions.
22680 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22681 the race-condition problem in the old DOWNCASE.
22682
22683 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22684 Rename locals to avoid shadowing.
22685 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22686 (regex_compile, re_search_2, re_match_2_internal):
22687 Remove unused local vars.
22688 (FREE_VAR): Rewrite so as not to use empty "else",
22689 which gcc can warn about.
22690 (regex_compile, re_match_2_internal): Mark locals as initialized.
22691 (RETALLOC_IF): Define only if needed.
22692 (WORDCHAR_P): Likewise. This one is never needed, but is used
22693 only in a comment talking about a compiler bug, so put inside
22694 the #if 0 of that comment.
22695 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22696 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22697 Remove; unused.
22698
22699 * search.c (boyer_moore): Rename locals to avoid shadowing.
22700 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22701 (PREV_CHAR_BOUNDARY): Likewise.
22702
22703 * search.c (simple_search): Remove unused var.
22704
22705 * dired.c (compile_pattern): Move decl from here ...
22706 * lisp.h: ... to here, so that it can be checked.
22707 (struct re_registers): New forward decl.
22708
22709 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22710
22711 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22712 All uses changed.
22713 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22714 Rename locals to avoid shadowing.
22715 (Fvertical_motion): Mark locals as initialized.
22716
22717 * casefiddle.c (casify_object, casify_region): Now static.
22718 (casify_region): Mark local as initialized.
22719
22720 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22721
22722 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22723 New macros, so that the caller can use some names other than
22724 gcpro1, gcpro2, etc.
22725 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22726 of the new macros.
22727 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22728 argument, for consistency with GCPRO2_VAR, etc: it is now the
22729 prefix of the variable, not the variable itself. All uses
22730 changed.
22731 * dired.c (directory_files_internal, file_name_completion):
22732 Rename locals to avoid shadowing.
22733
22734 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22735 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22736 dired.c's scmp function, had undefined behavior.
22737 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22738 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22739 * buffer.h: ... to here, because these macros use current_buffer,
22740 and the new implementation with inline functions needs to have
22741 current_buffer in scope now, rather than later when the macros
22742 are used.
22743 (downcase, upcase1): New static inline functions.
22744 (DOWNCASE, UPCASE1): Reimplement using these functions.
22745 This avoids undefined behavior in expressions like
22746 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22747 from race conditions in accessing the global variables
22748 case_temp1 and case_temp2.
22749 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22750 * lisp.h (case_temp1, case_temp2): Remove their decls.
22751 * character.h (ASCII_CHAR_P): Move from here ...
22752 * lisp.h: ... to here, so that the inline functions mentioned
22753 above can use them.
22754
22755 * dired.c (directory_files_internal_unwind): Now static.
22756
22757 * fileio.c (file_name_as_directory, directory_file_name):
22758 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22759 Now static.
22760 (file_name_as_directory): Use const pointers when appropriate.
22761 (Fexpand_file_name): Likewise. In particular, newdir might
22762 point at constant storage, so make it a const pointer.
22763 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22764 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22765 signedness issues.
22766 (Fset_file_times, Finsert_file_contents, auto_save_error):
22767 Rename locals to avoid shadowing.
22768
22769 * minibuf.c (choose_minibuf_frame_1): Now static.
22770 (Ftry_completion, Fall_completions): Rename or remove locals
22771 to avoid shadowing.
22772
22773 * marker.c (bytepos_to_charpos): Remove; unused.
22774
22775 * lisp.h (verify_bytepos, count_markers): New decls,
22776 so that gcc does not warn that these functions aren't declared.
22777
22778 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22779 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22780 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22781 (copy_text): Remove unused local var.
22782
22783 * filelock.c (within_one_second): Now static.
22784 (lock_file_1): Rename local to avoid shadowing.
22785
22786 * buffer.c (fix_overlays_before): Mark locals as initialized.
22787 (fix_start_end_in_overlays): Likewise. This function should be
22788 simplified by using pointers-to-pointers, but that's a different
22789 matter.
22790 (switch_to_buffer_1): Now static.
22791 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22792 (report_overlay_modification): Rename locals to avoid shadowing.
22793
22794 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22795 Fix pointer signedness issue.
22796 (sys_subshell): Mark local as volatile if checking for lint,
22797 to suppress a gcc -Wclobbered warning that does not seem to be right.
22798 (MAXPATHLEN): Define only if needed.
22799
22800 * process.c (serial_open, serial_configure): Move decls from here ...
22801 * systty.h: ... to here, so that they can be checked.
22802
22803 * fns.c (get_random, seed_random): Move extern decls from here ...
22804 * lisp.h: ... to here, so that they can be checked.
22805
22806 * sysdep.c (reset_io): Now static.
22807 (wait_for_termination_signal): Remove; unused.
22808
22809 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22810 (copy_keymap_item, append_key, push_text_char_description):
22811 Now static.
22812 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22813 (DENSE_TABLE_SIZE): Remove; unused.
22814 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22815 (describe_map_tree):
22816 Rename locals to avoid shadowing.
22817
22818 * keyboard.c: Declare functions static if they are not used elsewhere.
22819 (echo_char, echo_dash, cmd_error, top_level_2):
22820 (poll_for_input, handle_async_input): Now static.
22821 (read_char, kbd_buffer_get_event, make_lispy_position):
22822 (make_lispy_event, make_lispy_movement, apply_modifiers):
22823 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22824 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22825 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22826 (read_key_sequence, read_char): Mark locals as initialized.
22827 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22828
22829 * keyboard.h (make_ctrl_char): New decl.
22830 (mark_kboards): Move decl here ...
22831 * alloc.c (mark_kboards): ... from here.
22832
22833 * lisp.h (force_auto_save_soon): New decl.
22834
22835 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22836 (DEFINE_DUMMY_FUNCTION): New macro.
22837 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22838 Use it.
22839 (main): Add casts to avoid warnings
22840 if GCC considers string literals to be constants.
22841
22842 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22843
22844 * dbusbind.c: Pointer signedness fixes.
22845 (xd_signature, xd_append_arg, xd_initialize):
22846 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22847 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22848 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22849 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22850
22851 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22852 if GCC considers string literals to be constants.
22853 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22854
22855 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22856
22857 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22858 (print_preprocess, print_object): New macro to fix last change.
22859
22860 * print.c (print_preprocess): Don't forget font objects.
22861
22862 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
22863
22864 * emacs.c (USAGE3): Doc fixes.
22865
22866 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22867
22868 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22869 structure.
22870
22871 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
22872
22873 * lisp.h (VWindow_system, Qfile_name_history):
22874 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22875 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22876 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22877
22878 * w32select.c: Don't #include "keyboard.h".
22879 (run_protected): Add extern declaration for waiting_for_input.
22880
22881 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22882 * w32console.c (detect_input_pending, read_input_pending)
22883 (encode_terminal_code):
22884 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22885 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22886 (w32_system_caret_y, Qfile_name_history):
22887 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22888 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22889 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22890 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22891 * w32proc.c (Qlocal, report_file_error):
22892 * w32term.c (Vwindow_system, updating_frame):
22893 * w32uniscribe.c (initialized, uniscribe_font_driver):
22894 Remove unneeded extern declarations.
22895
22896 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
22897
22898 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22899
22900 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
22901
22902 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22903 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22904 These macros can no longer be used for assignment.
22905
22906 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22907 Assign struct members directly, instead of using BUF_BEGV etc.
22908 (record_buffer_markers, fetch_buffer_markers): New functions for
22909 recording and fetching special buffer markers.
22910 (set_buffer_internal_1, set_buffer_temp): Use them.
22911
22912 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22913
22914 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22915
22916 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22917 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22918
22919 * xdisp.c (hscroll_window_tree):
22920 (reconsider_clip_changes): Use PT instead of BUF_PT.
22921
22922 2011-03-13 Eli Zaretskii <eliz@gnu.org>
22923
22924 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22925 $(EMACS_ROOT)/lib/intprops.h.
22926
22927 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22928
22929 Fix more problems found by GCC 4.5.2's static checks.
22930
22931 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22932 to unsigned char * to avoid compiler diagnostic.
22933 (xg_free_frame_widgets): Make it clear that a local variable is
22934 needed only if USE_GTK_TOOLTIP.
22935 (gdk_window_get_screen): Make it clear that this macro is needed
22936 only if USE_GTK_TOOLTIP.
22937 (int_gtk_range_get_value): New function, which avoids a diagnostic
22938 from gcc -Wbad-function-cast.
22939 (xg_set_toolkit_scroll_bar_thumb): Use it.
22940 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22941 diagnostic from gcc -Wbad-function-cast.
22942 (get_utf8_string, xg_get_file_with_chooser):
22943 Rename locals to avoid shadowing.
22944 (create_dialog): Move locals to avoid shadowing.
22945
22946 * xgselect.c (xg_select): Remove unused var.
22947
22948 * image.c (four_corners_best): Mark locals as initialized.
22949 (gif_load): Initialize transparent_p to zero (Bug#8238).
22950 Mark another local as initialized.
22951 (my_png_error, my_error_exit): Mark with NO_RETURN.
22952
22953 * image.c (clear_image_cache): Now static.
22954 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22955 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22956 (x_edge_detection): Remove unnecessary cast that
22957 gcc -Wbad-function-cast diagnoses.
22958 (gif_load): Fix pointer signedness.
22959 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22960 (jpeg_load, gif_load): Rename locals to avoid shadowing.
22961
22962 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
22963
22964 Improve quality of tests for time stamp overflow.
22965 For example, without this patch (encode-time 0 0 0 1 1
22966 1152921504606846976) returns the obviously-bogus value (-948597
22967 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22968 reports time overflow. See
22969 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22970 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22971 * editfns.c: Include limits.h and intprops.h.
22972 (TIME_T_MIN, TIME_T_MAX): New macros.
22973 (time_overflow): Move earlier, to before first use.
22974 (hi_time, lo_time): New functions, for an accurate test for
22975 out-of-range times.
22976 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22977 (Fget_internal_run_time): Don't assume time_t fits in int.
22978 (make_time): Use list2 instead of Fcons twice.
22979 (Fdecode_time): More accurate test for out-of-range times.
22980 (check_tm_member): New function.
22981 (Fencode_time): Use it, to test for out-of-range times.
22982 (lisp_time_argument): Don't rely on undefined left-shift and
22983 right-shift behavior when checking for time stamp overflow.
22984
22985 * editfns.c (time_overflow): New function, refactoring common code.
22986 (Fformat_time_string, Fdecode_time, Fencode_time):
22987 (Fcurrent_time_string): Use it.
22988
22989 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22990 * dired.c (make_time): Move to ...
22991 * editfns.c (make_time): ... here.
22992 * systime.h: Note the move.
22993
22994 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22995
22996 * fringe.c (update_window_fringes): Remove unused variables.
22997
22998 * unexmacosx.c (copy_data_segment): Also copy __got section.
22999 (Bug#8223)
23000
23001 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23002
23003 * termcap.c [MSDOS]: Include "msdos.h".
23004 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23005 Constify `char *' arguments and their references according to
23006 prototypes in tparam.h.
23007
23008 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23009
23010 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23011 Adapt all references accordingly.
23012
23013 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23014
23015 2011-03-11 Tom Tromey <tromey@redhat.com>
23016
23017 * buffer.c (syms_of_buffer): Remove obsolete comment.
23018
23019 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23020
23021 * termhooks.h (encode_terminal_code): Declare prototype.
23022
23023 * msdos.c (encode_terminal_code): Don't declare prototype.
23024
23025 * term.c (encode_terminal_code): Now external again, used by
23026 w32console.c and msdos.c.
23027
23028 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23029 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23030
23031 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23032
23033 Fix some minor problems found by GCC 4.5.2's static checks.
23034
23035 * fringe.c (update_window_fringes): Mark locals as initialized
23036 (Bug#8227).
23037 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23038
23039 * alloc.c (mark_fringe_data): Move decl from here ...
23040 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23041 to check its interface.
23042 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23043
23044 * fontset.c (free_realized_fontset): Now static.
23045 (Fset_fontset_font): Rename local to avoid shadowing.
23046 (fontset_font): Mark local as initialized.
23047 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23048
23049 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23050
23051 * xselect.c (x_disown_buffer_selections): Remove; not used.
23052 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23053 (x_own_selection, Fx_disown_selection_internal): Rename locals
23054 to avoid shadowing.
23055 (x_handle_dnd_message): Remove local to avoid shadowing.
23056
23057 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23058 so that the caller can use some name other than gcpro1.
23059 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23060 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23061 (Fx_backspace_delete_keys_p):
23062 Use them to avoid shadowing, and rename vars to avoid shadowing.
23063 (x_decode_color, x_set_name, x_window): Now static.
23064 (Fx_create_frame): Add braces to silence GCC warning.
23065 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23066 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23067 Remove unused locals.
23068 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23069 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23070 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23071 macros.
23072
23073 * xterm.h (x_mouse_leave): New decl.
23074
23075 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23076 Remove unused functions.
23077 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23078 (x_calc_absolute_position): Now static.
23079 (XTread_socket): Don't define label "out" unless it's used.
23080 Don't declare local "event" unless it's used.
23081 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23082 unless they are used.
23083 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23084 (x_fatal_error_signal): Remove; not used.
23085 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23086 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23087 (x_error_catcher, x_connection_closed, x_error_handler):
23088 (x_error_quitter, xembed_send_message, x_iconify_frame):
23089 (my_log_handler): Rename locals to avoid shadowing.
23090 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23091 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23092
23093 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23094 Rename or move locals to avoid shadowing.
23095 (tty_defined_color, merge_face_heights): Now static.
23096 (free_realized_faces_for_fontset): Remove; not used.
23097 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23098 does not deduce is never used uninitialized.
23099 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23100 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23101
23102 * terminal.c (store_terminal_param): Now static.
23103
23104 * xmenu.c (menu_highlight_callback): Now static.
23105 (set_frame_menubar): Remove unused local.
23106 (xmenu_show): Rename parameter to avoid shadowing.
23107 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23108 since they might point to immutable storage.
23109 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23110 since it's unused otherwise.
23111
23112 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23113 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23114 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23115 avoids a gcc -Wuninitialized diagnostic.
23116 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23117 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23118 does not deduce are never used uninitialized.
23119
23120 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23121
23122 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23123 * window.c (window_loop, size_window):
23124 (run_window_configuration_change_hook, enlarge_window): Likewise.
23125
23126 * window.c (display_buffer): Now static.
23127 (size_window): Mark variables that gcc -Wuninitialized
23128 does not deduce are never used uninitialized.
23129 * window.h (check_all_windows): New decl, to forestall
23130 gcc -Wmissing-prototypes diagnostic.
23131 * dispextern.h (bidi_dump_cached_states): Likewise.
23132
23133 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23134 shadowing.
23135 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23136 Include <limits.h>.
23137 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23138 and to avoid gcc -Wuninitialized warning.
23139 (load_charset_map): Mark variables that gcc -Wuninitialized
23140 does not deduce are never used uninitialized.
23141 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23142
23143 * coding.c (coding_set_source, coding_set_destination):
23144 Use "else { /* comment */ }" rather than "else /* comment */;"
23145 for clarity, and to avoid gcc -Wempty-body warning.
23146 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23147 a block, when the outer 'i' will do.
23148 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23149 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23150 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23151 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23152 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23153 Rename locals to avoid shadowing.
23154 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23155 * coding.c (emacs_mule_char, encode_invocation_designation):
23156 Now static, since they're not used elsewhere.
23157 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23158 (decode_coding_object, encode_coding_object, detect_coding_system):
23159 (decode_coding_emacs_mule): Mark variables that gcc
23160 -Wuninitialized does not deduce are never used uninitialized.
23161 (detect_coding_iso_2022): Initialize a local variable that might
23162 be used uninitialized. Leave a FIXME because it's not clear that
23163 this initialization is needed. (Bug#8211)
23164 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23165 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23166 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23167 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23168 Remove unused macros.
23169
23170 * category.c (hash_get_category_set): Remove unused local var.
23171 (copy_category_table): Now static, since it's not used elsewhere.
23172 * character.c (string_count_byte8): Likewise.
23173
23174 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23175 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23176
23177 * chartab.c (copy_sub_char_table): Now static, since it's not used
23178 elsewhere.
23179 (sub_char_table_ref_and_range, char_table_ref_and_range):
23180 Rename locals to avoid shadowing.
23181 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23182
23183 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23184 (BIDI_BOB): Remove unused macro.
23185
23186 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23187 deduce are never used uninitialized.
23188 * term.c (encode_terminal_code): Likewise.
23189
23190 * term.c (encode_terminal_code): Now static. Remove unused local.
23191
23192 * tparam.h: New file.
23193 * term.c, tparam.h: Include it.
23194 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23195 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23196 Move these decls to tparam.h, and make them agree with what
23197 is actually in tparam.c. The previous trick of using incompatible
23198 decls in different modules does not conform to the C standard.
23199 All callers of tparam changed to use tparam's actual API.
23200 * tparam.c (tparam1, tparam, tgoto):
23201 Use const pointers where appropriate.
23202
23203 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23204 * cm.h (struct cm): Likewise.
23205 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23206 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23207 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23208 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23209 (turn_on_face, init_tty): Likewise.
23210 * termchar.h (struct tty_display_info): Likewise.
23211
23212 * term.c (term_mouse_position): Rename local to avoid shadowing.
23213
23214 * alloc.c (mark_ttys): Move decl from here ...
23215 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23216
23217 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23218
23219 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23220
23221 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23222
23223 * search.c (compile_pattern_1): Remove argument regp, unused since
23224 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23225 (compile_pattern): Don't pass it.
23226
23227 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23228
23229 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23230 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23231 for ! HAVE_GTK3.
23232 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23233
23234 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23235
23236 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23237 gdk_window_get_screen, gdk_window_get_geometry,
23238 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23239 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23240 (xg_get_pixbuf_from_pixmap): New function.
23241 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23242 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23243 Call xg_get_pixbuf_from_pixmap instead of
23244 gdk_pixbuf_get_from_drawable.
23245 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23246 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23247 (xg_check_special_colors): Use GtkStyleContext and its functions
23248 for HAVE_GTK3.
23249 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23250 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23251 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23252 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23253 Call gtk_widget_get_preferred_size.
23254 (xg_frame_resized): gdk_window_get_geometry only takes 5
23255 parameters.
23256 (xg_win_to_widget, xg_event_is_for_menubar):
23257 Call gdk_x11_window_lookup_for_display.
23258 (xg_set_widget_bg): New function.
23259 (delete_cb): New function.
23260 (xg_create_frame_widgets): Connect delete-event to delete_cb.
23261 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
23262 (xg_set_background_color): Call xg_set_widget_bg.
23263 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23264 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23265 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23266 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23267 if ! HAVE_GTK3.
23268 (update_frame_tool_bar): Call gtk_widget_hide.
23269 (xg_initialize): Use GDK_KEY_g.
23270
23271 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23272 if ! HAVE_GTK3
23273 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23274
23275 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23276 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23277 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23278
23279 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
23280
23281 * w32xfns.c (select_palette): Check success of RealizePalette against
23282 GDI_ERROR, not zero.
23283
23284 See ChangeLog.11 for earlier changes.
23285
23286 ;; Local Variables:
23287 ;; coding: utf-8
23288 ;; End:
23289
23290 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23291
23292 This file is part of GNU Emacs.
23293
23294 GNU Emacs is free software: you can redistribute it and/or modify
23295 it under the terms of the GNU General Public License as published by
23296 the Free Software Foundation, either version 3 of the License, or
23297 (at your option) any later version.
23298
23299 GNU Emacs is distributed in the hope that it will be useful,
23300 but WITHOUT ANY WARRANTY; without even the implied warranty of
23301 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23302 GNU General Public License for more details.
23303
23304 You should have received a copy of the GNU General Public License
23305 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.