]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* print.c (syms_of_print): Initialize debugging output not here...
[gnu-emacs] / src / ChangeLog
1 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
4 Signal error if window is not internal. Adjust docstring.
5 (delete_all_child_windows): Use combination_limit to save the buffer.
6 (Fset_window_configuration): Adjust accordingly.
7 * print.c (syms_of_print): Initialize debugging output not here...
8 (init_print_once): ...but in a new function here.
9 * lisp.h (init_print_once): Add prototype.
10 * emacs.c (main): Add call to init_print_once. Adjust comments.
11
12 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
13
14 * window.c (window_resize_check, window_resize_apply)
15 (window_from_coordinates, recombine_windows, set_window_buffer)
16 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
17 (Fsplit_window_internal, Fdelete_window_internal)
18 (freeze_window_starts): Use bool for booleans.
19 * window.h (window_frame_coordinates, resize_frame_windows)
20 (freeze_window_starts, set_window_buffer): Adjust prototypes.
21
22 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
23
24 * dispnew.c (bitch_at_user): Use `user-error'.
25
26 2013-03-17 Ken Brown <kbrown@cornell.edu>
27
28 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
29 as return type of image_background. (Bug#13981)
30 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
31
32 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
33
34 * nsterm.m (updateFrameSize:): Change resize increments if needed.
35 (ns_select): Don't return with result uninitialized.
36
37 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
38 and getDirectory.
39
40 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
41 New functions.
42 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
43 directories. If filename is nil, get directory name (Bug#13932).
44 Use getFilename and getDirectory.
45 (getFilename, getDirectory): New methods for EmacsSavePanel and
46 EmacsOpenPanel.
47 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
48
49 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
50
51 * coding.c (decode_coding_gap): Fix typo caught by static checking.
52
53 2013-03-15 handa <handa@gnu.org>
54
55 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
56 (adjust_after_replace): Make it back to static. Delete the third
57 arg text_at_gap_tail. Cancel the code for handling it.
58
59 * coding.h (struct coding_system): New member eol_seen.
60
61 * coding.c (detect_ascii): New function.
62 (detect_coding): Set coding->head_ascii and coding->eol_seen only
63 when the source bytes are actually scanned. On detecting for
64 coding_category_utf_8_auto, call detect_ascii instead of scanning
65 source bytes directly.
66 (produce_chars): Call insert_from_gap with the new arg 0.
67 (encode_coding): Likewise.
68 (decode_coding_gap): Control ASCII optimization by the variable
69 disable_ascii_optimization instead of #ifndef .. #endif.
70 Deccode EOL format according to coding->eol_seen.
71 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
72 variable.
73
74 * lisp.h (adjust_after_replace): Cancel externing it.
75 (insert_from_gap): Adjust prototype.
76
77 2013-03-15 Eli Zaretskii <eliz@gnu.org>
78
79 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
80 FULLSCREEN_MAXIMIZED. (Bug#13935)
81
82 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
83
84 * region-cache.c (find_cache_boundary, move_cache_gap)
85 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
86 Simplify debugging check and convert to eassert. Adjust comment.
87 (pp_cache): Put under ENABLE_CHECKING.
88
89 2013-03-14 Eli Zaretskii <eliz@gnu.org>
90
91 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
92 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
93 and WM_ACTIVATEAPP.
94 (w32fullscreen_hook): If the frame is visible, reset
95 f->want_fullscreen flag after changing the frame size. If the
96 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
97 (Bug#13953)
98
99 2013-03-13 Daniel Colascione <dancol@dancol.org>
100
101 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
102 too so that these builds can use Cygwin's file conversion
103 functions. (We've been building and linking cygw32.o all along
104 and just not using it.)
105
106 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
107
108 File synchronization fixes (Bug#13944).
109 * Makefile.in (LIB_FDATASYNC): New macro.
110 (LIBES): Use it.
111 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
112 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
113 Don't worry about HAVE_FSYNC, since a substitute fsync is
114 available if the system lacks one.
115 (Fwrite_regin): Retry fsync if interrupted.
116
117 2013-03-13 Eli Zaretskii <eliz@gnu.org>
118
119 * w32term.c (w32_read_socket): If the Emacs frame is being
120 activated, call w32fullscreen_hook, to make sure the new frame
121 dimensions are in effect. (Bug#13937)
122
123 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
124
125 * xdisp.c (init_iterator): Simplify because both character and byte
126 positions are either specified or -1. Add eassert. Adjust comment.
127 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
128 character and byte positions can be obtained from marker.
129
130 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
131
132 Static checking by Sun C 5.12.
133 * alloc.c (buffer_memory_full) [REL_ALLOC]:
134 * bytecode.c (exec_byte_code):
135 * dispnew.c (init_display):
136 * eval.c (error):
137 * fileio.c (Fsubstitute_in_file_name):
138 * keyboard.c (Fevent_convert_list):
139 * keymap.c (Fsingle_key_description):
140 * term.c (maybe_fatal, fatal):
141 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
142 * xsmfns.c (Fhandle_save_session):
143 Omit unreachable code.
144 * keymap.c (map_keymap_char_table_item): Cast void * to
145 a function pointer type; the C Standard requires this.
146
147 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
148 Include <sys/param.h> unconditionally, as that works elsewhere and
149 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
150 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
151 and FreeBSD now.
152
153 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
154
155 * insdel.c (adjust_after_replace): Use bool for boolean.
156
157 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
158
159 * keyboard.c: Move keyboard decoding to read_key_sequence.
160 (decode_keyboard_code): Remove.
161 (tty_read_avail_input): Don't try to decode input.
162 (read_decoded_char): New function.
163 (read_key_sequence): Use it.
164
165 2013-03-10 Daniel Colascione <dancol@dancol.org>
166
167 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
168 (GUI_SDATA, guichar_t): Macros to abstract out differences between
169 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
170 w32fns.c.
171
172 * w32term.c (construct_drag_n_drop): Use the above macros to make
173 drag-and-drop work for non-ASCII filenames in cygw32 builds.
174
175 * w32fns.c (x_set_name, x_set_title): Use the above macros to
176 properly display non-ASCII frame titles in cygw32 builds.
177
178 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
179 call ShellExecute in cygw32 builds.
180
181 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
182 common file dialog code.
183
184 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
185 can just use du like other systems.
186
187 * coding.c (from_unicode_buffer): Declare.
188 * coding.c (from_unicode_buffer): Implement.
189
190 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
191
192 * lread.c: Minor cleanup.
193 (FROM_FILE_P): New macro.
194 (skip_dyn_bytes, unreadchar, read1): Use it.
195 (read_list): Consolidate duplicated code.
196
197 * bytecode.c (struct byte_stack): Remove `constants' when unused.
198
199 2013-03-10 Eli Zaretskii <eliz@gnu.org>
200
201 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
202 (redisplay_internal, set_cursor_from_row, try_window)
203 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
204 (display_line, notice_overwritten_cursor)
205 (mouse_face_from_buffer_pos, note_mouse_highlight):
206 Use MATRIX_ROW_DISPLAYS_TEXT_P.
207 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
208 (mouse_face_from_string_pos, fast_find_string_pos):
209 Use MATRIX_ROW_VPOS.
210
211 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
212
213 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
214
215 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
216 MATRIX_MODE_LINE_ROW.
217
218 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
219
220 2013-03-10 handa <handa@gnu.org>
221
222 * lisp.h (adjust_after_replace): Extern it.
223
224 * coding.c (detect_coding): Cound the heading ASCII bytes in the
225 case of detection for coding_category_utf_8_auto.
226 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
227 Skip decoding if all bytes are ASCII.
228
229 * insdel.c (adjust_after_replace): Make it public. New arg
230 text_at_gap_tail.
231 (adjust_after_insert): Call adjust_after_replace with the new arg
232 value 0.
233
234 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
235
236 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
237 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
238 from Elisp via unread-command-events.
239
240 * keyboard.c (access_keymap_keyremap): Accept nil return value from
241 functions to mean "no change".
242
243 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
244
245 region-cache.c, scroll.c, search.c: Use bool for booleans.
246 * lisp.h (compile_pattern):
247 * scroll.c (do_scrolling, do_direct_scrolling):
248 * search.c (struct regexp_cache, compile_pattern_1)
249 (compile_pattern, string_match_1, search_command)
250 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
251 (search_regs_saved, Fregexp_quote):
252 Use bool for boolean.
253 * region-cache.c (region_cache_forward, region_cache_backward):
254 Fix comments to match code: these functions return int, not boolean.
255
256 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
257
258 * search.c (find_newline): Accept start and end byte positions
259 as arguments and allow -1 if not known.
260 (find_newline_no_quit): Likewise for start position.
261 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
262 * bidi.c (bidi_find_paragraph_start): Pass byte position to
263 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
264 * editfns.c (Fconstrain_to_field): Break long line.
265 Adjust call to find_newline.
266 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
267 Use DEC_BOTH to start next search from the previous buffer
268 position, where appropriate.
269 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
270 (get_visually_first_element, move_it_vertically_backward): Likewise.
271 Obtain byte position from the display iterator, where appropriate.
272
273 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
274
275 print.c, process.c: Use bool for booleans.
276 * lisp.h (wait_reading_process_output):
277 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
278 (strout, debug_output_compilation_hack, float_to_string, print)
279 (print_object):
280 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
281 (decode_status, status_message, create_process, create_pty)
282 (Fmake_network_process, Fnetwork_interface_info)
283 (wait_reading_process_output, read_process_output)
284 (write_queue_push, write_queue_pop, process_send_signal)
285 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
286 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
287 Use bool for booleans.
288 * process.c (Fnetwork_interface_list): Remove unused local.
289 (connect_counter): Now EMACS_INT, not int.
290
291 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
292
293 * bidi.c (bidi_fetch_char): Swap first and second arguments
294 to match other functions accepting character and byte positions.
295 Adjust comment.
296 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
297 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
298 when you need just to move to the previous buffer position.
299 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
300
301 2013-03-07 Eli Zaretskii <eliz@gnu.org>
302
303 * .gdbinit (prowlims): Display the enabled_p flag of the row.
304
305 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
306
307 Avoid character to byte conversions in motion subroutines.
308 * indent.h (compute_motion, vmotion): Add byte position argument.
309 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
310 Add eassert.
311 (Fcompute_motion): Break long line. Adjust call to compute_motion.
312 Use list5 for return value.
313 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
314 Adjust comments, style and calls to compute_motion.
315 (Fvertical_motion): Adjust call to vmotion.
316 * window.c (Fdelete_other_windows_internal): Record window start
317 byte position and adjust call to vmotion.
318 (window_scroll_line_based): Likewise with call to compute_motion.
319 Use SET_PT_BOTH.
320 (Frecenter): Adjust calls to vmotion.
321
322 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
323
324 * lisp.h (list2i, list3i): New functions.
325 (list4i): Move from window.c and make LISP_INLINE.
326 * editfns.c (make_lisp_time):
327 * fns.c (Flocale_info):
328 * keyboard.c (parse_modifiers):
329 * xterm.c (x_ewmh_activate_frame): Use list2i.
330 * instel.c (signal_after_change):
331 * nsfns.m (Fx_server_version, Fxw_color_values):
332 * w32fns.c (Fxw_color_values, Fx_server_version):
333 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
334 * fileio.c (Fvisited_file_modtime):
335 * nsfns.m (Fns_display_usable_bounds):
336 * w32.c (ltime): Use list4i.
337
338 2013-03-06 Eli Zaretskii <eliz@gnu.org>
339
340 * search.c (find_newline_no_quit): Rename from find_next_newline.
341 Add commentary.
342
343 * lisp.h (find_newline_no_quit): Rename prototype.
344
345 * xdisp.c (back_to_previous_line_start)
346 (forward_to_next_line_start, get_visually_first_element)
347 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
348 * indent.c (vmotion): Callers of find_newline_no_quit changed.
349 * bidi.c (bidi_find_paragraph_start): Callers of
350 find_newline_no_quit changed.
351
352 * msdos.c: Change encoding to cp850. (Bug#13879)
353 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
354
355 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
356
357 Coding system support cleanup and minor refactoring.
358 * coding.h (enum coding_result_code): Remove
359 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
360 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
361 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
362 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
363 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
364 (decode_coding_region, encode_coding_region, decode_coding_string):
365 Remove unused compatibility macros.
366 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
367 (record_conversion_result): Adjust user.
368 (syms_of_coding): Likewise.
369 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
370 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
371 (decode_coding_object): Simplify since xrealloc never returns NULL.
372 Add eassert.
373
374 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
375
376 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
377 * sysdep.c (list_system_processes)
378 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
379 Make it a stub in this case; otherwise the build might fail,
380 and this code hasn't been tested on such hosts anyway.
381 Problem reported by Nelson H. F. Beebe in
382 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
383 and analyzed by Jérémie Courrèges-Anglas in
384 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
385
386 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
387
388 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
389 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
390 (get_visually_first_element, move_it_vertically_backward): Ajust users.
391 * bidi.c (bidi_find_paragraph_start): Likewise.
392 * indent.c (vmotion): Likewise.
393
394 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
395
396 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
397 * filelock.c: Include <c-ctype.h>.
398 (MAX_LFINFO): New top-level constant.
399 (lock_info_type): Remove members pid, boot_time. Add members at,
400 dot, colon. Change user member to be the entire buffer, not a
401 pointer. This allows us to handle the case where a foreign
402 pid or boot time exceeds the local range. All uses changed.
403 (LINKS_MIGHT_NOT_WORK): New constant.
404 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
405 (defined_WINDOWSNT): Remove.
406 (MAKE_LOCK_NAME, file_in_lock_file_name):
407 Always use .#FILE (not .#-FILE) for the file lock,
408 even if it is a regular file.
409 (rename_lock_file): New function.
410 (create_lock_file): Use it.
411 (create_lock_file, read_lock_data):
412 Prefer a symbolic link for the lock file, falling back on a
413 regular file if symlinks don't work. Do not try to create
414 symlinks on MS-Windows, due to security hassles. Stick with
415 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
416 link, rename, unlink, mkstemp) when creating locks, as a GNUish
417 host may be using a Windowsish file system, and cannot use
418 MS-Windows-only system calls. Fall back on mktemp if mkstemp
419 doesn't work. Don't fail merely because of a symlink-contents
420 length limit in the current file system; fall back on regular
421 files. Increase the symlink contents length limit to 8 KiB, this
422 should be big enough for any real use and doesn't crunch the
423 stack.
424 (create_lock_file, lock_file_1, read_lock_data):
425 Simplify allocation of lock file buffers now that they fit in 8 KiB.
426 (lock_file_1): Return error number, not bool. All callers changed.
427 (ELOOP): New macro, if not already defined.
428 (read_lock_data): Return size of lock file contents, not Lisp object.
429 All callers changed. Handle a race condition if some other process
430 replaces a regular-file lock with a symlink lock or vice versa,
431 while we're trying to read the lock.
432 (current_lock_owner): Parse contents more carefully, to help avoid
433 confusing a regular-file lock with some other application's use
434 of the file. Check for lock file contents being too long, or
435 not parsing correctly.
436 (current_lock_owner, lock_file):
437 Allow foreign pid and boot times that exceed the local range.
438 (current_lock_owner, lock_if_free, lock_file):
439 Simplify allocation of lock file contents.
440 * w32.c (sys_rename_replace): New function, containing most of
441 the contents of the old sys_rename.
442 (sys_rename): Use it.
443 (fchmod): New dummy function.
444 * w32.h (sys_rename_replace, fchmod): New decls.
445
446 2013-03-05 Eli Zaretskii <eliz@gnu.org>
447
448 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
449 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
450 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
451 <dmantipov@yandex.ru>.
452
453 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
454
455 * composite.c (get_composition_id, fill_gstring_header):
456 Use make_uninit_vector where appropriate.
457 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
458 * xselect.c (clean_local_selection_data): Likewise.
459
460 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
461
462 Fix misuse of ImageMagick that caused core dump (Bug#13846).
463 * image.c (imagemagick_load_image): Calculate height and width
464 after flattening the image, not before.
465
466 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
467
468 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
469 * ftfont.c (ftfont_shape_by_flt): Likewise.
470 * w32uniscribe.c (uniscribe_shape): Likewise.
471
472 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
473
474 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
475 The old approach, which fell back on DIR/.#FILE.0 through
476 DIR/.#FILE.9, had race conditions that could not be easily fixed.
477 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
478 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
479 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
480 because the locking mechanism was never reliable in that case).
481 This patch fixes this and other bugs discovered by a code
482 inspection that was prompted by
483 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
484 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
485 to avoid interoperability problems between the MS-Windows and
486 non-MS-Windows implementations. MS-Windows and non-MS-Windows
487 instances of Emacs now ignore each others' locks.
488 * filelock.c (defined_WINDOWSNT): New constant.
489 (MAKE_LOCK_NAME, fill_in_lock_file_name):
490 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
491 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
492 regular files on MS-Windows hosts.
493 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
494 Use SAFE_ALLOCA to avoid problems with long file names.
495 (MAX_LFINFO): Now a local constant, not a global macro.
496 (IS_LOCK_FILE): Remove.
497 (lock_file_1): Don't inspect errno if symlink call succeeds;
498 that's not portable.
499 (lock_file): Document that this function can return if lock
500 creation fails.
501 (lock_file): Don't access freed storage.
502
503 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
504
505 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
506
507 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
508
509 * textprop.c: Use bool for booleans.
510 (validate_interval_range, Fadd_text_properties)
511 (Fremove_text_properties): Prefer bool to int when either works.
512
513 2013-03-02 Eli Zaretskii <eliz@gnu.org>
514
515 * textprop.c (Fadd_text_properties, Fremove_text_properties):
516 If the interval tree changes as a side effect of calling
517 modify_region, re-do processing starting from the call to
518 validate_interval_range. (Bug#13743)
519
520 2013-02-28 Eli Zaretskii <eliz@gnu.org>
521
522 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
523 (Bug#13546).
524
525 2013-02-27 Eli Zaretskii <eliz@gnu.org>
526
527 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
528 _SH_DENYRW flag, instead of emacs_open, to deny any other process
529 access to the lock file until it is written and closed.
530 (Bug#13807)
531
532 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
533
534 * callint.c (Qcall_interactively):
535 * macros.c (Qexecute_kbd_macro):
536 Now static.
537
538 2013-02-26 Bastien Guerry <bzg@gnu.org>
539
540 * window.c (Frecenter): Tiny docstring enhancement.
541
542 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
543
544 Minor textprop integer cleanup.
545 * intervals.h, textprop.c (add_text_properties_from_list):
546 Return void, not int, since nobody uses the return value.
547 * textprop.c (validate_plist, add_properties, remove_properties)
548 (Fadd_text_properties):
549 Don't assume list length fits in int.
550 (interval_has_all_properties, interval_has_some_properties)
551 (interval_has_some_properties_list, add_properties, remove_properties)
552 (Fadd_text_properties, Fremove_text_properties)
553 (Fremove_list_of_text_properties, text_property_stickiness):
554 Use bool for booleans.
555 (Fadd_text_properties, Fremove_text_properties):
556 (Fremove_list_of_text_properties):
557 Reindent do-while as per GNU style.
558
559 2013-02-25 Eli Zaretskii <eliz@gnu.org>
560
561 Implement CLASH_DETECTION for MS-Windows.
562
563 * filelock.c [WINDOWSNT]: Include w32.h.
564 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
565 function of that name. Up-case the macro arguments.
566 (IS_LOCK_FILE): New macro.
567 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
568 (create_lock_file): New function, with body extracted from
569 lock_file_1.
570 [WINDOWSNT]: Implement lock files by writing a regular file with
571 the lock information as its contents.
572 (read_lock_data): New function, on Posix platforms just calls
573 emacs_readlinkat.
574 [WINDOWSNT]: Read the lock info from the file.
575 (current_lock_owner): Call read_lock_data instead of calling
576 emacs_readlinkat directly.
577 (lock_file) [WINDOWSNT]: Run the file name through
578 dostounix_filename.
579
580 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
581 just check if the process by that PID exists.
582
583 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
584 also present, as doing so will fail to error out if the file
585 already exists.
586
587 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
588
589 * textprop.c (Fadd_text_properties, Fremove_text_properties)
590 (Fremove_list_of_text_properties): Skip all of the intervals in
591 the region between START and END that already have resp. don't
592 have the requested properties, not just the first one.
593 Add assertions that the loop afterwards always modifies the
594 properties. (Bug#13743)
595
596 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
597
598 * callint.c (Fcall_interactively): Use the right lexical environment
599 for `interactive' specs (bug#13811).
600 * eval.c (Feval): Accept a lexical environment.
601
602 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
603
604 Simplify data_start configuration (Bug#13783).
605 This is a followon simplification to the fix for Bug#13650.
606 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
607 (START_FILES): Remove. All uses removed.
608 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
609 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
610 (buildobj.h): Use it.
611 ($(ALLOBJS)): Depend on globals.h.
612 (temacs$(EXEEXT)): Use $(ALLOBJS).
613 * autodeps.mk (ALLOBJS): Move to Makefile.in.
614 * deps.mk (vm-limit.o):
615 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
616 Do not depend on mem-limits.h.
617 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
618 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
619 [__GNUC__ && !ORDINARY_LINK]: Remove.
620 * mem-limits.h, pre-crt0.c: Remove.
621 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
622 * unexcoff.c (etext): New decl.
623 (make_hdr): Use DATA_START instead of start_of_data.
624 * vm-limit.c: Move most of mem-limits.h's contents here.
625 (data_start): New decl. It's OK if this is approximate,
626 so simplify-away some unnecessary exactness.
627 (POINTER): Remove; all uses removed.
628 (data_space_start): Now char *, to avoid casts.
629 (exceeds_lisp_ptr): New function, replacing the old
630 EXCEEDS_LISP_PTR macro. All uses changed.
631 (check_memory_limits): Simplify and remove casts.
632 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
633 (memory_warnings): Use data_start instead of start_of_data.
634
635 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
636
637 * xdisp.c (set_message): Only check for debug-on-message if STRING
638 is a string. (Bug#13797)
639
640 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
641
642 Fix regression introduced by July 10 filelock.c patch.
643 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
644 2012-07-10 patch to this file. Reported by Eli Zaretskii in
645 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
646 and diagnosed by Andreas Schwab in
647 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
648
649 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
650
651 Assume C89 or better.
652 * ralloc.c (SIZE, POINTER, NIL):
653 * vm-limit.c (POINTER):
654 Remove, replacing all uses with C89 equivalents. These old
655 symbols were present only for porting to pre-C89 platforms.
656
657 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
658
659 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
660 This avoids warning messages reported as part of Bug#13546.
661
662 2013-02-21 Ken Brown <kbrown@cornell.edu>
663
664 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
665
666 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
667
668 * sheap.c (report_sheap_usage): Prefer message1_nolog.
669
670 * keyboard.c (Qcommand_execute): New var.
671 (command_loop_1, read_char): Use it.
672 (Fcommand_execute): Remove, replace by an Elisp implementation.
673 (syms_of_keyboard): Adjust accordingly.
674
675 2013-02-19 Daniel Colascione <dancol@dancol.org>
676
677 * sheap.c (report_sheap_usage): Use message, not message1, so
678 that we don't try to create a buffer while we're in the middle
679 of dumping Emacs. Explain why.
680
681 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
682
683 * search.c (find_newline): Return byte position in bytepos.
684 Adjust comment.
685 (find_next_newline_no_quit, find_before_next_newline):
686 Add bytepos argument.
687 * lisp.h (find_newline, find_next_newline_no_quit)
688 (find_before_next_newline): Adjust prototypes.
689 * bidi.c (bidi_find_paragraph_start):
690 * editfns.c (Fconstrain_to_field, Fline_end_position):
691 * indent.c (compute_motion, vmotion):
692 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
693 (get_visually_first_element, move_it_vertically_backward):
694 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
695
696 2013-02-19 Eli Zaretskii <eliz@gnu.org>
697
698 * w32proc.c (new_child): Avoid leaking handles if the subprocess
699 resources were not orderly released.
700
701 2013-02-17 Eli Zaretskii <eliz@gnu.org>
702
703 * xdisp.c (x_draw_vertical_border): For a window that is neither
704 the leftmost nor the rightmost, redraw both the left and the right
705 vertical borders. (Bug#13723)
706
707 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
708
709 * xml.c (init_libxml2_functions):
710 * sound.c (sound_warning):
711 * sheap.c (report_sheap_usage):
712 * process.c (wait_reading_process_output):
713 * msdos.c (XMenuActivate):
714 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
715 * keyboard.c (top_level_1):
716 * editfns.c (Fmessage, Fmessage_box):
717 * callint.c (Fcall_interactively):
718 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
719
720 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
721
722 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
723 * frame.c (syms_of_frame): ... to here.
724
725 2013-02-16 Eli Zaretskii <eliz@gnu.org>
726
727 * w32.c (sys_chown): Remove unused function.
728
729 * w32term.c <input_signal_count>: Declare 'volatile'
730 unconditionally. (Bug#9066)
731
732 * w32.c (set_errno): Reset h_errno and don't set it to any other
733 value. Set errno instead.
734 (check_errno): Reset h_errno.
735 (sys_socket, socket_to_fd, sys_bind, sys_connect)
736 (sys_gethostname, sys_getservbyname, sys_getpeername)
737 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
738 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
739 h_errno.
740 (sys_gethostbyname): Set h_errno only errors detected.
741
742 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
743
744 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
745
746 2013-02-15 Eli Zaretskii <eliz@gnu.org>
747
748 * keyboard.c (read_char): Fix calculation of auto-save time out
749 when auto-save-timeout is less than 4. (Bug#13720)
750
751 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
752 time. Improve diagnostics in DebPrint. (Bug#13546)
753
754 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
755 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
756 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
757 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
758 make sure errno is set to an appropriate value. (Bug#13546)
759 (socket_to_fd): Add assertion against indexing fd_info[] with a
760 value that is out of bounds.
761 (sys_accept): If fd is negative, do not set up the child_process
762 structure for reading.
763
764 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
765
766 * composite.c (fill_gstring_header): Remove useless prototype.
767 Break long line.
768 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
769 * print.c (PRINTDECLARE, print_object):
770 * search.c (compile_pattern, fast_looking_at, search_buffer):
771 (simple_search, boyer_moore, Freplace_match):
772 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
773 (get_overlay_arrow_glyph_row, display_mode_element):
774 (decode_mode_spec_coding, message3):
775 * xfaces.c (face_at_string_position): Use bool for booleans.
776 Adjust comments.
777
778 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
779
780 Fix AIX port (Bug#13650).
781 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
782 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
783 was #undeffed earlier, so it cannot be used as a macro here.
784 Use the constant and not the macro.
785
786 2013-02-15 Eli Zaretskii <eliz@gnu.org>
787
788 * w32proc.c (new_child): If no vacant slots are found in
789 child_procs[], make another pass looking for slots whose process
790 has exited or died. (Bug#13546)
791
792 * w32.c (sys_pipe): When failing due to file descriptors above
793 MAXDESC, set errno to EMFILE.
794 (_sys_read_ahead): Update cp->status when failing to read serial
795 communications input, so that the status doesn't stay at
796 STATUS_READ_IN_PROGRESS. (Bug#13546)
797
798 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
799
800 * gtkutil.c (tb_size_cb): New function.
801 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
802
803 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
804
805 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
806 an event.
807
808 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
809
810 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
811
812 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
813
814 * font.c (font_range): Add pos_byte argument. Adjust comment
815 and break long line.
816 * font.h (font_range): Adjust prototype.
817 * composite.c (autocmp_chars): Pass byte position to font_range.
818 Break long line. Remove useless prototype and format comment.
819
820 2013-02-13 Glenn Morris <rgm@gnu.org>
821
822 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
823
824 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
825
826 Improve AIX port some more (Bug#13650).
827 With this, it should be as good as it was in 23.3, though it's
828 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
829 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
830 * unexaix.c (start_of_text): Remove.
831 (_data, _text): Declare as char[], not int, as AIX manual suggests.
832 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
833 (orig_load_scnptr, orig_data_scnptr):
834 Now off_t, not long, since they are file offsets.
835 (make_hdr): Use _data, not start_of_data ().
836 This is the key part of the fix.
837 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
838 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
839
840 * pre-crt0.c (data_start): Initialize to 1.
841 This ports to compilers that optimize the external declaration
842 'int x = 0;' as if it were 'int x;' to shrink the executable.
843
844 Improve AIX port (Bug#13650).
845 This doesn't fix the bug, but it makes progress: Emacs builds now.
846 * unexaix.c: Include inttypes.h, stdarg.h.
847 (report_error, report_error_1): Mark as _Noreturn.
848 (report_error): Don't report the wrong errno.
849 (report_error_1): Now varargs. All callers changed.
850 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
851 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
852 (write_ptr): Use %p to print address rather than %lx and a cast
853 to unsigned long. Grow buffer a bit, to be safer.
854
855 2013-02-13 Eli Zaretskii <eliz@gnu.org>
856
857 * bidi.c (bidi_resolve_neutral): After finding the next
858 non-neutral character, accept NEUTRAL_ON type as well, because
859 directional control characters, such as LRE and RLE, have their
860 type converted to that by bidi_resolve_weak. This avoids aborts
861 when LRE/RLE follows a run of neutrals.
862 (bidi_move_to_visually_next): Assert that return value of
863 bidi_peek_at_next_level is non-negative. Negative values will
864 cause an infloop.
865
866 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
867
868 Minor getenv-related fixes.
869 * callproc.c (Fcall_process_region) [!DOS_NT]:
870 Avoid unnecessary duplicate call to getenv.
871 * callproc.c (init_callproc):
872 * dispnew.c (init_display):
873 * sysdep.c (sys_subshell):
874 Omit unnecessary cast of getenv or egetenv.
875
876 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
877
878 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
879 Update dependencies.
880
881 2013-02-12 Eli Zaretskii <eliz@gnu.org>
882
883 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
884 marker's position.
885 (display_line): Set w->region_showing to the value of
886 it->region_beg_charpos, not to -1. This fixes redisplay
887 optimization when cursor is moved up after M->. (Bug#13623)
888 (Bug#13626)
889 (try_scrolling): Scroll text up more if point is too close to ZV
890 and inside the scroll margin. This makes sure point is moved
891 outside the scroll margin in these cases.
892
893 * window.h (struct window): region_showing can no longer be
894 negative.
895
896 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
897
898 Tune by using memchr and memrchr.
899 * doc.c (Fsnarf_documentation):
900 * fileio.c (Fsubstitute_in_file_name):
901 * search.c (find_newline, scan_newline):
902 * xdisp.c (pos_visible_p, display_count_lines):
903 Use memchr and memrchr rather than scanning byte-by-byte.
904 * search.c (find_newline): Rename from scan_buffer.
905 Omit first arg TARGET, as it's always '\n'. All callers changed.
906
907 Clean up read_key_sequence a tiny bit more.
908 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
909 (read_key_sequence): Remove unused locals.
910
911 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
912
913 Clean up read_key_sequence a bit; reread active keymaps after first event.
914 * keyboard.c (read_char, read_char_x_menu_prompt)
915 (read_char_minibuf_menu_prompt):
916 Replace nmaps+maps with a single `map' arg.
917 (follow_key): Operate on a single map.
918 (active_maps): New function.
919 (test_undefined): Also return true for nil bindings.
920 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
921 a single (composed) keymap. Remember `first_event' to choose the right
922 set of active keymaps. Recompute the set of keymaps after receiving
923 the first event. Remove GOBBLE_FIRST_EVENT.
924 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
925 * keyboard.h (read_char): Update declaration.
926 * lread.c (read_filtered_event): Adjust call to read_char.
927
928 2013-02-11 Eli Zaretskii <eliz@gnu.org>
929
930 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
931 Don't use the limitation on backwards movement when lines are truncated
932 in the window. (Bug#13675)
933
934 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
935
936 * marker.c (set_marker_internal): If desired position is passed
937 as a marker, avoid call to buf_charpos_to_bytepos.
938 * window.c (Fset_window_point): Omit redundant type checking.
939 (Fset_window_start): Likewise. Format comment.
940 (window_scroll_pixel_based): Use set_marker_restricted_both
941 with character and byte positions obtained from an iterator.
942 (Fset_window_configuration): Use set_marker_restricted_both.
943 * xdisp.c (message_dolog): Likewise.
944
945 2013-02-10 Eli Zaretskii <eliz@gnu.org>
946
947 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
948 When text lines are longer than window's screen lines, don't move back
949 too far. This speeds up some redisplay operations. (Bug#13675)
950
951 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
952
953 * syntax.c (scan_sexps_forward): Fix byte position calculation
954 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
955
956 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
957
958 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
959 that was not needed.
960
961 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
962
963 Minor hashing refactoring.
964 * fns.c (SXHASH_REDUCE): Move to lisp.h.
965 (sxhash_float): Return EMACS_UINT, for consistency with the other
966 hash functions.
967 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
968 non-static inline function and therefore can't use static vars.
969 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
970 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
971 with the other hash functions.
972
973 2013-02-09 Eli Zaretskii <eliz@gnu.org>
974
975 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
976 XXXXXX part of the temporary file pattern is not downcased even
977 when w32-downcase-file-names is non-nil. (Bug#13661)
978
979 * xdisp.c (decode_mode_spec): Remove handling of %t.
980
981 * msdos.c (careadlinkatcwd): Remove.
982
983 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
984
985 * lread.c (skip_dyn_bytes): New function (bug#12598).
986 (read1): Use it. Use getc instead of READCHAR to read bytes.
987 (load_each_byte): Remove. Update users.
988
989 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
990
991 * search.c (scan_buffer): Calculate end byte position just once.
992 (scan_newline): Do not recalculate start_byte.
993 (search_command): Use eassert.
994 * syntax.c (struct lisp_parse_state): New member location_byte.
995 (scan_sexps_forward): Record from_byte and avoid redundant
996 character to byte position calculation ...
997 (Fparse_partial_sexp): ... here. Break too long line.
998
999 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1000
1001 * lisp.h (make_uninit_vector): New function.
1002 * alloc.c (Fvector, Fmake_byte_code):
1003 * ccl.c (Fregister_ccl_program):
1004 * charset.c (Fdefine_charset_internal, define_charset_internal):
1005 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1006 * composite.c (syms_of_composite):
1007 * font.c (Fquery_font, Ffont_info, syms_of_font):
1008 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1009 * ftfont.c (ftfont_shape_by_flt):
1010 * indent.c (recompute_width_table):
1011 * nsselect.m (clean_local_selection_data):
1012 * syntax.c (init_syntax_once):
1013 * w32unsubscribe.c (uniscribe_shape):
1014 * window.c (Fcurrent_window_configuration):
1015 * xfaces.c (Fx_family_fonts):
1016 * xselect.c (selection_data_to_lisp_data): Use it.
1017
1018 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1019
1020 * coding.c (Fdefine_coding_system_internal): Use AREF where
1021 argument is known to be a vector.
1022 * fns.c (Flocale_info): Likewise for ASET.
1023 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1024 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1025
1026 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1027
1028 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1029 height.
1030
1031 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1032 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1033 updateCollectionBehaviour.
1034
1035 * nsterm.m (NEW_STYLE_FS): Remove.
1036 (ns_last_use_native_fullscreen): New variable.
1037 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1038 (x_set_window_size): Do not take title bar and tool bar into account
1039 if isFullscreen returns YES.
1040 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1041 (check_native_fs): New function.
1042 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1043 (ns_term_init): Remove NEW_STYLE_FS.
1044 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1045 and tool bar if isFullscreen returns NO.
1046 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1047 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1048 with HAVE_NATIVE_FS.
1049 (window:willUseFullScreenPresentationOptions:): New method.
1050 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1051 Hide toolbar if not enabled (Bug#13444).
1052 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1053 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1054 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1055 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1056 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1057 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1058 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1059 (syms_of_nsterm): Add ns-use-native-fullscreen.
1060
1061 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1062
1063 * fileio.c (Qchoose_write_coding_system): Now static.
1064
1065 2013-02-04 Eli Zaretskii <eliz@gnu.org>
1066
1067 * xdisp.c (window_buffer_changed): region_showing can be negative,
1068 which still means region is being displayed.
1069 (redisplay_internal): Resurrect code that forced redisplay of the
1070 whole window when showing region and the mark has changed.
1071 Record the new mark position to allow redisplay optimizations.
1072 (display_line): If it->region_beg_charpos is non-zero, set the
1073 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1074
1075 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1076 not bitfield of 1 bit.
1077
1078 2013-02-03 Daniel Colascione <dancol@dancol.org>
1079
1080 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1081 daemon mode works on cygw32 when Emacs is installed and not just
1082 during development.
1083
1084 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1085
1086 Avoid file time stamp bug on MS-Windows (Bug#13149).
1087 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1088 as FAT32 doesn't update time stamps when truncating them.
1089 Also, check that a file time stamp is not a multiple of 100 ns;
1090 this should catch all instances of the problem on MS-Windows,
1091 as its native file system resolution is 100 ns or worse, and
1092 checking for a non-multiple of 100 ns should impose only a small
1093 overhead on systems with ns resolution.
1094
1095 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1096
1097 Avoid encoding file names on MS-Windows when they need to be run
1098 through dostounix_filename.
1099 * w32.c (normalize_filename): Accept an additional argument
1100 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1101 downcase it even if w32-downcase-file-names is non-nil.
1102 (dostounix_filename): Accept an additional argument MULTIBYTE and
1103 pass it to normalize_filename.
1104 (emacs_root_dir): Adjust.
1105
1106 * msdos.h (dostounix_filename): Adjust prototype.
1107
1108 * w32.h (dostounix_filename): Adjust prototype.
1109
1110 * msdos.c (dostounix_filename): Accept an additional argument and
1111 ignore it.
1112 (init_environment): Adjust callers of dostounix_filename.
1113
1114 * fileio.c (Ffile_name_directory, file_name_as_directory)
1115 (directory_file_name, Fexpand_file_name)
1116 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1117 dostounix_filename.
1118 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1119 non-nil.
1120 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1121 variables, as egetenv is case-insensitive for DOS_NT.
1122
1123 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1124 with an encoded file name.
1125
1126 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1127 Adjust calls to dostounix_filename.
1128
1129 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1130
1131 * unexw32.c (unexec): Adjust call to dostounix_filename.
1132
1133 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1134
1135 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1136 dostounix_filename.
1137
1138 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1139 dostounix_filename.
1140
1141 * callproc.c (Fcall_process): Make sure program name in PATH and
1142 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1143 is passed to exec/spawnve, which fails unless the file-name
1144 encoding is UTF-8.
1145
1146 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1147 even if w32-quote-process-args is nil.
1148
1149 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1150
1151 Fix timestamp bug when write-region appends nothing (Bug#13149).
1152 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1153 the file's time stamp doesn't change if Emacs happens to write nothing
1154 to the file, and on a buggy file system this could cause Emacs to
1155 incorrectly infer that the file system doesn't have the bug.
1156 Avoid this problem by inhibiting the inference in this case.
1157
1158 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1159
1160 * window.h (struct window): Convert base_line_number, base_line_pos
1161 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1162 Convert region_showing member from Lisp_Object to bitfield.
1163 Remove sequence_number member. Adjust comments.
1164 * window.c (sequence_number): Remove.
1165 (make_window): Initialize column_number_displayed.
1166 * print.c (print_object): Follow the printed representation of
1167 frames and print window pointer to distinguish between windows.
1168 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1169 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1170 (wset_column_number_displayed, wset_region_showing): Remove.
1171 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1172 (try_scrolling, try_cursor_movement, redisplay_window)
1173 (try_window_reusing_current_matrix, try_window_id, display_line)
1174 (display_mode_lines, decode_mode_spec): Adjust users.
1175 * .gdbinit (pwinx): Do not print sequence_number.
1176
1177 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1178
1179 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1180 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1181 * dired.c: Include <fcntl.h>.
1182 (open_directory): New function, which uses open and fdopendir
1183 rather than opendir. DOS_NT platforms still use opendir, though.
1184 (directory_files_internal, file_name_completion): Use it.
1185 (file_attributes): New function, with most of the old Ffile_attributes.
1186 (directory_files_internal, Ffile_attributes): Use it.
1187 (file_attributes, file_name_completion_stat): First arg is now fd,
1188 not dir name. All uses changed. Use fstatat rather than lstat +
1189 stat.
1190 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1191 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1192 (emacs_readlinkat): New function, with much of the old
1193 Ffile_symlink_p, but with an fd argument for speed.
1194 It uses readlinkat rather than careadlinkatcwd, so that it
1195 need not assume the working directory.
1196 (Ffile_symlink_p): Use it.
1197 * filelock.c (current_lock_owner): Use emacs_readlinkat
1198 rather than emacs_readlink.
1199 * lisp.h (emacs_readlinkat): New decl.
1200 (READLINK_BUFSIZE, emacs_readlink): Remove.
1201 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1202 (emacs_norealloc_allocator, emacs_readlink): Remove.
1203 This stuff is moved to fileio.c.
1204 * w32.c (fstatat, readlinkat): New functions.
1205 (careadlinkat): Don't check that fd == AT_FDCWD.
1206 (careadlinkatcwd): Remove; no longer needed.
1207
1208 2013-01-31 Glenn Morris <rgm@gnu.org>
1209
1210 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1211 (Fwrite_region): Update for new choose_write_coding_system args.
1212 Move the last piece of choose_write_coding_system here. (Bug#13522)
1213 (syms_of_fileio): Add choose-write-coding-system.
1214
1215 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1216
1217 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1218 (sys_close): Zero out the flags for the file descriptor before
1219 closing it. (Bug#13546)
1220
1221 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1222 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1223 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1224 DBCS. (Bug#13553)
1225
1226 * w32.c (w32_get_long_filename, init_environment, readlink):
1227 Support file names encoded in DBCS codepages.
1228 (readlink): Use the current file-name-coding-system, not the ANSI
1229 codepage, to decode and handle targets of symlinks.
1230
1231 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1232
1233 * w32.c (opendir): Now accepts a 'const char *'.
1234
1235 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1236
1237 Remove obsolete redisplay code. See the discussion at
1238 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1239 * dispnew.c (preemption_period, preemption_next_check): Remove.
1240 (Vredisplay_preemption_period): Likewise.
1241 (update_frame, update_single_window, update_window, update_frame_1):
1242 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1243 used, following the 2012-06-22 change.
1244
1245 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1246
1247 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1248
1249 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1250
1251 * font.c (num_fonts): Remove the leftover from old
1252 debugging code. Adjust comment style here and there.
1253 * insdel.c (insert_1): Remove.
1254 * lisp.h (insert_1): Remove prototype.
1255 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1256
1257 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1258
1259 * w32.c (max_filename_mbslen): New function.
1260 (normalize_filename, readdir): Use it to detect locales where ANSI
1261 encoding of file names uses a double-byte character set (DBCS).
1262 If a DBCS encoding is used, advance by characters using
1263 CharNextExA, instead of incrementing a 'char *' pointer.
1264 Use _mbslwr instead of _strlwr. (Bug#13515)
1265
1266 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1267 request of memory reservation to 1.7GB. (Bug#13065)
1268
1269 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
1270
1271 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1272 at check_extra_latin label. (Bug#13505)
1273
1274 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1275
1276 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1277 Avoid redundant calls to strlen.
1278
1279 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1280
1281 Drop async_visible and async_iconified fields of struct frame.
1282 This is possible because async input is gone; for details, see
1283 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1284 * frame.h (struct frame): Remove async_visible and async_iconified
1285 members, convert garbaged to unsigned bitfield. Adjust comments.
1286 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1287 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1288 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1289 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1290 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1291 * w32term.c: Ditto.
1292 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1293 properly. Likewise for obscured.
1294 * xterm.c: Ditto.
1295 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1296 properly.
1297 * nsterm.m: Ditto.
1298 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1299
1300 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1301
1302 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1303 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1304
1305 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1306
1307 * xdisp.c (message2, message2_nolog): Remove functions.
1308 (message3, message3_nolog): Extract nbytes and multibyteness directly
1309 from the string. Change all callers.
1310 (message3_nolog): Don't set message_enable_multibyte since set_message
1311 will reset it anyway.
1312 (message1, message1_nolog): Use message3.
1313 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1314 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1315 (set_message): Drop all but the second arg, which has to be a string.
1316 (set_message_1): Simplify now that we know that a1 is NULL and the
1317 second arg is a string.
1318 * frame.h (struct frame): Remove `message_buf' field.
1319 Use glyphs_initialized_p instead.
1320 (FRAME_MESSAGE_BUF): Remove macro.
1321 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1322 * lisp.h (message2, message2_nolog): Remove declarations.
1323 (message3, message3_nolog): Update declarations.
1324 * keyboard.c (read_char_minibuf_menu_text)
1325 (read_char_minibuf_menu_width): Remove vars.
1326 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1327 to correctly handle multibyte strings.
1328 * frame.c (delete_frame): Don't free message_buf any more.
1329 * editfns.c (message_text, message_length): Remove vars.
1330 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1331 * fileio.c (auto_save_error): Use message3 instead of message2.
1332 * dispnew.c (adjust_frame_message_buffer): Remove function.
1333
1334 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1335
1336 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1337 real estate used for the tool bar and the menu bar.
1338
1339 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1340
1341 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1342 hidden buffer is prepared to modification (Bug#13164).
1343
1344 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1345
1346 * window.h (struct window): Change window_end_valid member from
1347 Lisp_Object to a bitfield. Adjust comments.
1348 (wset_window_end_valid): Remove.
1349 * window.c (adjust_window_count): Clear window_end_valid.
1350 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1351 (Fwindow_line_height, set_window_buffer, Frecenter)
1352 (Fsplit_window_internal, Fdelete_other_windows_internal)
1353 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1354 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1355 * xdisp.c (check_window_end, reconsider_clip_changes)
1356 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1357 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1358 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1359
1360 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1361
1362 * xdisp.c (mark_window_display_accurate): Simplify the loop
1363 assuming that the only one of vchild, hchild or buffer window
1364 slots is non-nil. Call mark_window_display_accurate_1 for
1365 the leaf windows only.
1366 (mark_window_display_accurate_1): Always assume leaf window.
1367 Adjust comment.
1368
1369 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1370
1371 * emacs.c (Qkill_emacs_hook): Now static.
1372
1373 * fileio.c (Finsert_file_contents): Simplify.
1374 Remove unnecessary assignments and tests.
1375
1376 2013-01-21 Eli Zaretskii <eliz@gnu.org>
1377
1378 * w32.c (acl_set_file): Don't test for errors unless
1379 set_file_security returns FALSE. Avoids spurious errors when
1380 saving files.
1381
1382 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1383
1384 * fileio.c (Finsert_file_contents): Revert code introduced at
1385 2013-01-18 in favor of the simpler and generally better fix.
1386 Save stack space by removing 'buffer' and reusing 'read_buf'
1387 where appropriate.
1388
1389 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1390
1391 * lisp.h (eabs): Define unconditionally (Bug#13419).
1392 The old "#if !defined (eabs)" was an unnecessary revenant of back
1393 when this macro was called "abs". Document 'eabs' better.
1394
1395 2013-01-19 Glenn Morris <rgm@gnu.org>
1396
1397 * fns.c (Frandom): Doc fix.
1398
1399 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1400
1401 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1402 segfault when there are lots of overlays.
1403
1404 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1405 when there are lots of overlays.
1406 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1407 for the details and a way to reproduce.
1408
1409 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 * fileio.c: Use O_APPEND to append.
1412 This corresponds better to the natural interpretation of "append",
1413 and avoids the need to open the output file twice, or to invoke
1414 lseek when APPEND is neither nil nor a number.
1415 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1416 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1417 file possibly twice, and lseeking to its end; this avoids the
1418 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1419 at the same time: the combination is never needed and apparently
1420 it doesn't work with DOS_NT.
1421
1422 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1423 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1424
1425 Allow floating-point file offsets.
1426 Problem reported by Vitalie Spinu in
1427 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1428 * fileio.c (emacs_lseek): Remove.
1429 (file_offset): New function.
1430 (Finsert_file_contents, Fwrite_region): Use it.
1431
1432 2013-01-19 Chong Yidong <cyd@gnu.org>
1433
1434 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1435 aborting on Fsignal (Bug#13289).
1436
1437 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1438
1439 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1440 set_file_security as failure due to insufficient privileges.
1441 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1442 (fstat): Return owner and group like 'stat' and 'lstat' do.
1443
1444 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1445
1446 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1447 The bug was observed on Ubuntu operating inside a virtual machine,
1448 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1449 The workaround introduces a race condition on non-buggy hosts,
1450 but it's an unlikely race and anyway there's a nearly identical
1451 nearby race that can't be fixed.
1452 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1453 New static vars.
1454 (Fwrite_region): Test for file system time stamp bug.
1455 (init_fileio): New function.
1456 * lisp.h (init_fileio): Declare it.
1457 * emacs.c (main): Call it.
1458
1459 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1460 and make it more consistent with other stat-failure diagnostics.
1461
1462 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1463
1464 Fix crash when inserting data from non-regular files.
1465 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1466 for the error description produced by valgrind.
1467 * fileio.c (read_non_regular): Rename to read_contents.
1468 Free Lisp_Save_Value object used to pass parameters.
1469 (read_non_regular_quit): Rename to read_contents_quit.
1470 (Finsert_file_contents): Redesign internal file reading loop to adjust
1471 gap and end positions after each read and so help make_gap to work
1472 properly. Do not signal an I/O error too early and so do not leave
1473 not yet decoded characters in a buffer, which was the reason of
1474 redisplay crash. Use list2 to build return value. Adjust comments.
1475
1476 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1477
1478 Close a race when statting and reading files (Bug#13149).
1479 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1480 This avoids a race if the file is renamed between stat and open.
1481 This race is not the problem originally noted in Bug#13149;
1482 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1483
1484 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1485
1486 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1487 objects, related functions and macros.
1488 (make_save_value): Adjust prototype.
1489 (make_save_pointer): New prototype.
1490 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1491 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1492 * alloc.c (format_save_value): Rename to make_save_value.
1493 (make_save_pointer): New function.
1494 (record_xmalloc): Use make_save_pointer.
1495 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1496 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1497 Change users of make_save_value to make_save_pointer.
1498 Likewise for format_save_value and make_save_value.
1499
1500 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1501
1502 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1503 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1504 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1505 debugging stubs.
1506
1507 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1508
1509 * alloc.c (free_save_value): Now static.
1510
1511 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1512
1513 * keymap.c (map_keymap_internal): Use format_save_value.
1514 (map_keymap_char_table_item): Adjust accordingly.
1515 * fileio.c (non_regular_fd, non_regular_inserted)
1516 (non_regular_nbytes): Remove.
1517 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1518 Use format_save_value to pass parameters to read_non_regular.
1519 (read_non_regular): Use XSAVE_ macros to extract parameters.
1520 Adjust comment.
1521 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1522 format_save_value.
1523 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1524
1525 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1526
1527 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1528 extraction from any Lisp_Save_Value slot. Add type checking.
1529 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1530 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1531 * xselect.c: All users changed.
1532
1533 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1534
1535 Some convenient bits to deal with Lisp_Save_Values.
1536 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1537 (allocate_misc): Remove prototype.
1538 (format_save_value): New prototype.
1539 * alloc.c (allocate_misc): Revert back to static.
1540 (format_save_value): New function to build Lisp_Save_Value
1541 object with the specified internal structure.
1542 (make_save_value): Reimplement using format_save_value.
1543 * editfns.c (save_excursion_save): Use format_save_value.
1544 (save_excursion_restore): Use XSAVE_OBJECT.
1545
1546 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1547
1548 Avoid needless casts with XSAVE_POINTER.
1549 * alloc.c (mark_object) [GC_MARK_STACK]:
1550 * dired.c (directory_files_internal_unwind):
1551 * fileio.c (do_auto_save_unwind):
1552 * gtkutil.c (pop_down_dialog):
1553 * keymap.c (map_keymap_char_table_item):
1554 * lread.c (load_unwind):
1555 * nsmenu.m (pop_down_menu):
1556 * print.c (print_object) [GC_MARK_STACK]:
1557 * xfns.c (clean_up_file_dialog):
1558 * xmenu.c (cleanup_widget_value_tree):
1559 Omit casts between XSAVE_POINTER and a pointer type.
1560
1561 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1562
1563 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1564 * eval.c (eval_sub): Protect `form' from being GCed before its
1565 car and cdr becomes protected with the backtrace entry.
1566
1567 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1568
1569 Make Lisp_Save_Value more versatile storage for up to four objects.
1570 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1571 (struct Lisp_Save_Value): New layout. Adjust comments.
1572 (XSAVE_POINTER): New macro.
1573 (XSAVE_INTEGER): Likewise.
1574 (allocate_misc): Add prototype.
1575 (free_misc): Likewise.
1576 * alloc.c (allocate_misc): Now global.
1577 (free_misc): Likewise. Adjust comment.
1578 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1579 (free_save_value): Likewise.
1580 (mark_object): Likewise.
1581 * editfns.c (save_excursion_save): Pack everything within
1582 Lisp_Save_Value and so avoid xmalloc.
1583 (save_excursion_restore): Adjust to match new layout. Use free_misc
1584 because we do not allocate extra memory any more. Add eassert.
1585 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1586 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1587 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1588 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1589 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1590
1591 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1592
1593 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1594 (nsfont_draw): Remove disabling of LCD smoothing.
1595 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1596 Bug#11484 with LCD smoothing on.
1597
1598 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
1599
1600 Fix SIGDANGER handlers, for AIX (Bug#13408).
1601 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1602 Move handlers here from emacs.c; they were out of place.
1603
1604 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1605
1606 * xterm.c (syms_of_xterm): Adjust documentation for
1607 scroll-bar-adjust-thumb-portion.
1608
1609 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
1610
1611 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1612 determine whether scroll bar thumb size should be adjusted or
1613 not. Use variable for MOTIF.
1614
1615 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1616 GTK.
1617
1618 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1619
1620 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1621 event is generated.
1622 (doCommandBySelector:): Set processingCompose to NO.
1623
1624 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1625 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1626 (nsfont_list_family): Add block/unblock_input calls.
1627 (nsfont_open): Move block_input earlier. Add unblock_input before early
1628 return.
1629 (nsfont_draw): Add block/unblock_input calls.
1630
1631 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1632
1633 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1634 for old_charpos and old_bytepos.
1635
1636 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1637
1638 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1639 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1640 Clear tzvalbuf_in_environ if this workaround is in effect.
1641 Problem and fix reported by Kazuhiro Ito.
1642
1643 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1644
1645 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1646 Fix ambiguous doc string cross-reference(s).
1647
1648 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1649 doc string cross-reference(s).
1650
1651 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1652 string cross-reference(s).
1653
1654 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1655
1656 Avoid unnecessary byte position calculation for the gap movement.
1657 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1658 anyway, all of them should use move_gap_both instead.
1659 * lisp.h (move_gap): Remove prototype.
1660 * insdel.c (move_gap): Remove.
1661 (move_gap_both): Add eassert.
1662 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1663 * xml.c (parse_region): Likewise.
1664
1665 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 emacsclient -t should not suspend Emacs server (Bug#13387)
1668 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1669 New functions.
1670 * term.c (init_tty): Use them instead of rolling our own code.
1671 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1672 switches from 'signal' to 'pthread_sigmask', which is safer in
1673 multithreaded applications.
1674 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1675 which has already arranged for that.
1676 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1677 This is the main part of the bug fix.
1678
1679 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
1680
1681 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1682 x_last_font_name (Bug#13403).
1683
1684 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1685
1686 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1687 the type of per-buffer values where appropriate.
1688 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1689 predicate, which is how it's really used now. Adjust comment.
1690 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1691 * buffer.c (buffer_slot_type_mismatch): Remove.
1692 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1693 predicate. Adjust comment.
1694 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1695 fill-column, left-margin, tab-width, buffer-saved-size,
1696 left-margin-width, right-margin-width, left-fringe-width,
1697 right-fringe-width, scroll-bar-width and buffer-display-count.
1698 Use Qstringp for default-directory, buffer-file-name,
1699 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1700 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1701 line-spacing.
1702 * data.c (store_symval_forwarding): Adjust to call the predicate.
1703
1704 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
1705
1706 * w32.c (get_name_and_id, acl_set_file):
1707 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1708
1709 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1710
1711 * lisp.h (make_gap_1): New prototype.
1712 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1713 gap size values.
1714 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1715 naming convention.
1716 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
1717 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
1718 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1719 (make_gap_1): New function to adjust the gap of any buffer.
1720 * coding.c (coding_alloc_by_making_gap): Use it.
1721 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1722 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1723
1724 2013-01-08 Juri Linkov <juri@jurta.org>
1725
1726 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1727 of (supports :underline (:style wave)). (Bug#13000)
1728
1729 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1730
1731 * undo.c (Fprimitive_undo): Move to simple.el.
1732 (syms_of_undo): Remove declarations for Sprimitive_undo.
1733
1734 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1735
1736 * keyboard.c (echo_add_key): Rename from echo_add_char.
1737
1738 2013-01-06 Chong Yidong <cyd@gnu.org>
1739
1740 * keyboard.c (echo_add_char): New function, factored out from
1741 echo_char. Don't add a space if the previous echo string was
1742 empty (Bug#13255).
1743 (echo_char): Use it.
1744 (read_key_sequence): When echoing mock input, ensure that the
1745 trailing dash is properly added.
1746
1747 2013-01-05 Eli Zaretskii <eliz@gnu.org>
1748
1749 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1750 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
1751 digits for buffer positions, before misalignment starts.
1752 Display "0" for integer "object" field.
1753 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1754 Display the newline glyph more unambiguously.
1755
1756 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1757
1758 * nsterm.m (ns_draw_underwave):
1759 * w32term.c (w32_draw_underwave):
1760 * xterm.c (x_draw_underwave): Make underwave look more triangular
1761 and also degrade gracefully for small fonts. (Bug#13000)
1762
1763 * nsterm.m (ns_draw_text_decoration):
1764 * w32term.c (x_draw_glyph_string):
1765 * xterm.c (x_draw_glyph_string): Don't use previous underline
1766 thickness and position if previous underline type is underwave.
1767
1768 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1769
1770 * fileio.c (Ffile_acl): Undocument return format.
1771
1772 2013-01-02 Glenn Morris <rgm@gnu.org>
1773
1774 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1775
1776 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1777
1778 Simplify via eabs.
1779 * dired.c (file_name_completion):
1780 * doc.c (get_doc_string):
1781 * floatfns.c (round2):
1782 * font.c (font_score, font_delete_unmatched):
1783 * fringe.c (compute_fringe_widths):
1784 * lread.c (read_list):
1785 * minibuf.c (Ftry_completion):
1786 * term.c (tty_ins_del_lines):
1787 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1788 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1789
1790 2012-12-31 Eli Zaretskii <eliz@gnu.org>
1791
1792 * w32.c (unsetenv): Set up the string passed to _putenv
1793 correctly.
1794 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
1795 for the bug this caused.
1796
1797 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1798
1799 * coding.c (Qmac): Now static.
1800
1801 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1802
1803 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1804 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1805 handlebox_widget. Set toolbar_in_hbox to false/true, set
1806 toolbar_is_packed to true.
1807 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1808 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1809 Show all on TOOLBAR_TOP_WIDGET.
1810 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1811 by TOOLBAR_TOP_WIDGET.
1812 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1813 Check toolbar_is_packed.
1814 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1815 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1816 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1817 false.
1818 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1819 (xg_update_menubar): Update title only if
1820 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1821 (xg_update_submenu): Skip tearoff only if
1822 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1823 (xg_initialize): Initialize xg_detached_menus only if
1824 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1825
1826 * xterm.h (struct x_output): Surround handlebox_widget with
1827 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1828 toolbar_in_hbox is bool.
1829
1830 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
1831
1832 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1833 (LIBS_GNUSTEP): Define.
1834 (LIBES): Add $(LIBS_GNUSTEP).
1835 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1836
1837 2012-12-30 Eli Zaretskii <eliz@gnu.org>
1838
1839 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1840 continuation glyph on a TTY with an indication of an empty line.
1841 (Bug#13277)
1842
1843 2012-12-29 Eli Zaretskii <eliz@gnu.org>
1844
1845 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1846 file's SELinux context or ACLs successfully set, nil otherwise.
1847 (Bug#13298)
1848 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
1849
1850 * w32proc.c (reader_thread): Avoid passing NULL handles to
1851 SetEvent and WaitForSingleObject.
1852
1853 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1854
1855 Port EXTERNALLY_VISIBLE to Clang 3.2.
1856 * conf_post.h (__has_attribute): New macro.
1857 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1858
1859 2012-12-27 Glenn Morris <rgm@gnu.org>
1860
1861 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1862 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1863
1864 2012-12-27 Eli Zaretskii <eliz@gnu.org>
1865
1866 * fileio.c (file_name_as_directory, directory_file_name):
1867 Accept an additional argument MULTIBYTE to indicate whether the input C
1868 came from a multibyte or a unibyte Lisp string; all callers
1869 adjusted. Don't assume the input string is always multibyte.
1870 (Bug#13262)
1871 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1872 don't ENCODE_FILE them, and return a unibyte string if the input
1873 was unibyte.
1874 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1875 don't assume the input strings will always be multibyte. If the
1876 input strings are multibyte, decode strings obtained from C
1877 library functions.
1878
1879 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1880
1881 * lisp.h (toplevel): Add two notices to the comment about
1882 defining a new Lisp data type.
1883 * print.c (print_object): If Lisp_Save_Value object's pointer
1884 is the address of a memory area containing Lisp_Objects, try
1885 to print them.
1886 * alloc.c (valid_lisp_object_p): Adjust comment.
1887
1888 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1889
1890 * keyboard.c (record_asynch_buffer_change): Initialize an event
1891 only if it's really needed.
1892 * frame.h (enum output_method): Remove output_mac member since
1893 it's a leftover from the deleted code.
1894 * frame.c (Fframep): Adjust user here ...
1895 * terminal.c (Fterminal_live_p): ... and here.
1896 * coding.c (Qmac): Now here because it's only used to denote
1897 end-of-line encoding type.
1898 (syms_of_coding): DEFSYM it.
1899 * frame.h (Qmac): Remove duplicated declaration.
1900
1901 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1902
1903 * window.c (select_window_1): Now static, since it's used only here.
1904
1905 2012-12-25 Eli Zaretskii <eliz@gnu.org>
1906
1907 * window.c (window_body_cols): Subtract display margins from the
1908 window body width on TTYs as well. See
1909 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1910 for the original report.
1911
1912 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1913
1914 * xdisp.c (redisplay_window): Remove inner local variable
1915 because the outer shadowed one has the same meaning.
1916 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1917 set but never used.
1918 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1919 (xg_create_tool_bar): Adjust users.
1920
1921 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1922
1923 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1924 * buffer.c (Fget_buffer_create): Use it to set compact field of
1925 struct buffer_text to avoid accessing an uninitialized value
1926 when compact_buffer is called for the first time.
1927 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1928 (Fset_buffer_modified_p): Use buffer_window_count to check
1929 whether the buffer is displayed in some window.
1930 * xdisp.c (message_dolog): Likewise.
1931
1932 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1933
1934 * w32.c (acl_set_file): If setting the file security descriptor
1935 fails, and the new DACL is identical to the existing one, silently
1936 return success. This fixes problems for users backing up their
1937 own files without having the necessary privileges for setting
1938 security descriptors.
1939
1940 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1941 values.
1942 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1943 after WaitForSingleObject returns normally. This expedites reader
1944 thread shutdown when delete_child triggers it.
1945 (reap_subprocess): More accurate commentary for why we call
1946 delete_child only when cp->fd is negative.
1947
1948 * w32.c (sys_close): Do not call delete_child on a subprocess
1949 whose handle is not yet closed. Instead, set its file descriptor
1950 to a negative value, so that reap_subprocess will call
1951 delete_child on that subprocess when its SIGCHLD arrives.
1952 This avoids closing handles used for communications between sys_select
1953 and reader_thread, which doesn't give sys_select a chance to
1954 notice that the process exited and invoke the SIGCHLD handler for
1955 it.
1956
1957 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1958
1959 * nsfns.m (Fns_do_applescript): Run event loop until script has
1960 been executed (Bug#12969).
1961 (ns_run_ascript): Chech as_script for nil, set to nil after
1962 executing script.
1963
1964 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1965
1966 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1967
1968 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1969
1970 * w32term.c (w32fullscreen_hook): New function.
1971 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1972
1973 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1974
1975 * fileio.c (Finsert_file_contents): Doc fix.
1976
1977 * w32proc.c (new_child, delete_child, find_child_pid): For a
1978 subprocess, consider its slot being in use as long as its process
1979 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1980 slot when a new process is started immediately after killing
1981 another one, without waiting enough time for the first process to
1982 be reaped and resources allocated for it be orderly freed.
1983 (Bug#13086)
1984 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1985
1986 2012-12-21 Chong Yidong <cyd@gnu.org>
1987
1988 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1989
1990 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1991
1992 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1993
1994 * w32.c (get_name_and_id): Always pass NULL as the first argument
1995 of lookup_account_sid. Avoids crashes with UNC file names that
1996 refer to DFS domains, not to specific machine names. (Bug#12621)
1997 Remove now unused argument FNAME; all callers changed.
1998 (get_file_owner_and_group): Remove now unused argument FNAME; all
1999 callers changed.
2000
2001 2012-12-21 Chong Yidong <cyd@gnu.org>
2002
2003 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2004 error for invalid chars, don't check for a nil return value.
2005
2006 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2007
2008 Avoid calls to CHAR_TO_BYTE if byte position is known.
2009 * editfns.c (make_buffer_string_both): Use move_gap_both.
2010 (Fbuffer_string): Use make_buffer_string_both.
2011 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2012 Adjust comment.
2013 (buf_bytepos_to_charpos): Likewise.
2014 (charpos_to_bytepos): Remove.
2015 * fileio.c (Finsert_file_contents): Use move_gap_both.
2016 * search.c (Freplace_match): Likewise.
2017 * process.c (process_send_region): Likewise. Use convenient
2018 names for byte positions.
2019 * lisp.h (charpos_to_bytepos): Remove prototype.
2020 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2021 * insdel.c (move_gap): Likewise.
2022
2023 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2024
2025 * xdisp.c (redisplay_internal): Remove now-unused local.
2026
2027 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2028
2029 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2030 (redisplay_internal): Don't bother selecting the frame to get the
2031 proper value of frame-local variables (bug#13225).
2032
2033 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2034
2035 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2036 Rename 4th argument since it may be buffer or string. Adjust comment.
2037 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2038
2039 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2040
2041 * coding.c (Fdetect_coding_region): Do not check start and end with
2042 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2043 (code_convert_region): Likewise.
2044
2045 2012-12-18 Eli Zaretskii <eliz@gnu.org>
2046
2047 * w32.c (acl_get_file, acl_set_file): Run the file name through
2048 map_w32_filename, and resolve any symlinks in the file name, like
2049 Posix platforms do.
2050 (acl_set_file): Call revert_to_self, if any privileges were
2051 enabled.
2052
2053 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
2054
2055 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2056 ($(BLD)/w32.$(O)): Update dependencies.
2057
2058 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2059
2060 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2061 propagate redisplay's scrolling (if any) to the right window.
2062 (redisplay_internal): Use ensure_selected_frame.
2063 (display_mode_lines): Complete last fix.
2064 * window.c (select_window_1): New func, extracted from select_window.
2065 (select_window): Use it.
2066 * window.h (select_window_1): Declare.
2067
2068 2012-12-17 Eli Zaretskii <eliz@gnu.org>
2069
2070 Emulate Posix ACL APIs on MS-Windows.
2071 * w32.c: Include sddl.h and sys/acl.h.
2072 (SDDL_REVISION_1): Define if not already defined.
2073 (g_b_init_get_security_descriptor_dacl)
2074 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2075 (g_b_init_is_valid_security_descriptor)
2076 (g_b_init_set_file_security): New static flags.
2077 (globals_of_w32): Initialize them to zero.
2078 (SetFileSecurity_Name): New string constant.
2079 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2080 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2081 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2082 (IsValidSecurityDescriptor_Proc): New typedefs.
2083 (get_file_security, get_security_descriptor_owner)
2084 (get_security_descriptor_group): Set errno to ENOTSUP.
2085 (set_file_security, get_security_descriptor_dacl)
2086 (is_valid_security_descriptor, convert_sd_to_sddl)
2087 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2088 (acl_free, acl_get_file, acl_set_file): New functions.
2089
2090 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2091
2092 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2093
2094 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2095 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2096 for some of that bug's symptoms can now cause Emacs to abort.
2097 Remove the workaround.
2098 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2099 The bug that caused SIGCHLD to get lost has been fixed, and the
2100 workaround for it can now cause Emacs to abort.
2101
2102 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2103
2104 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2105 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2106 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2107
2108 2012-12-16 Romain Francoise <romain@orebokech.com>
2109
2110 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2111 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2112 and copy ACL entries of file in addition to SELinux context if set.
2113 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2114
2115 * Makefile.in (LIBACL_LIBS): New macro.
2116 (LIBES): Use it.
2117
2118 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2119
2120 * fileio.c (internal_delete_file): Use bool for boolean.
2121
2122 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2123
2124 Fix bug #13079 on MS-Windows with temp files not being deleted.
2125 * w32.h (_child_process): New members input_file and
2126 pending_deletion.
2127 (register_child): First argument is now pid_t.
2128 (record_infile, record_pending_deletion): New prototypes.
2129
2130 * w32proc.c (new_child): Initialize input_file and
2131 pending_deletion members of the child.
2132 (delete_child): Delete the child's temporary input file, if any,
2133 that is pending deletion.
2134 (register_child): First argument is now pid_t.
2135 (record_infile, record_pending_deletion): New functions.
2136 (reap_subprocess): Fix a typo in DebPrint string.
2137 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2138
2139 * fileio.c (internal_delete_file): Return an int again: non-zero
2140 if delete-file succeeds, zero otherwise.
2141
2142 * lisp.h (internal_delete_file): Adjust prototype.
2143
2144 * callproc.c (Fcall_process): Don't overwrite infile with result
2145 of DECODE_FILE.
2146 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2147 asynchronous subprocess, record the name of the input file name,
2148 if any.
2149 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2150 delete the file, record it as pending deletion when the subprocess
2151 exits.
2152
2153 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2154
2155 * editfns.c [HAVE_PWD_H]: Include grp.h.
2156
2157 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2158
2159 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 Fix permissions bugs with setgid directories etc. (Bug#13125)
2162 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2163 to mark it as a placeholder. The old value was often wrong.
2164 The only user of this attribute has been changed to use
2165 file-ownership-preserved-p instead, with its new group arg.
2166 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2167
2168 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2169
2170 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2171 Keep selected_window and selected_frame in sync.
2172
2173 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2174
2175 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2176 try to get accurate owner and group information from NT file
2177 security APIs. This is to make most callers of 'stat' and
2178 'lstat', which don't need that information, much faster.
2179
2180 * dired.c (Ffile_attributes) [WINDOWSNT]:
2181 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2182 owner and group information from 'lstat'.
2183
2184 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2185
2186 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2187 as that confuses set-auto-coding, so insist on the head-read
2188 returning the full 1024 bytes. Let lseek compute the tail offset;
2189 less work for us. Do not ignore I/O errors when reading the tail.
2190
2191 * xdisp.c: Minor style fixes.
2192 (init_iterator): Hoist assignment out of if-expression.
2193 (markpos_of_region): Callers now test for sign, not for -1.
2194
2195 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2196
2197 Minor redisplay optimization when the region length is zero.
2198 * xdisp.c (markpos_of_region): New function.
2199 (init_iterator): Do not highlight the region of zero length.
2200 (redisplay_window): Check whether the region is of non-zero length.
2201 (try_cursor_movement): Allow if the region length is zero.
2202 (try_window_reusing_current_matrix, try_window_id): Likewise.
2203
2204 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2205
2206 * search.c (search_buffer): Check the inverse translations of each
2207 character in pattern when the buffer being searched is unibyte.
2208 (Bug#13084)
2209
2210 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2211
2212 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2213 files, fixing a regression from 24.2.
2214 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2215
2216 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2217
2218 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2219 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2220 Remove unnecessary S_ISLNK test, as (contra the comments) this
2221 function can't copy symlinks. Improve quality of error message
2222 when attempting to copy files that are neither regular files nor
2223 directories.
2224
2225 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2226
2227 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2228 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2229 * window.c (Frecenter):
2230 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2231 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2232
2233 2012-12-12 Daniel Colascione <dancol@dancol.org>
2234
2235 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2236 the dumped Emacs is not a sparse file, greatly improving Cygwin
2237 "make bootstrap" performance.
2238
2239 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2240
2241 * inotify.c (inotify_callback): Generate an Emacs event for every
2242 incoming inotify event.
2243
2244 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2245
2246 * xdisp.c (handle_face_prop): Fix logic of computing
2247 it->start_of_box_run_p.
2248 (append_space_for_newline): If the glyph row is R2L, reset the
2249 iterator's end_of_box_run_p flag before prepending the space glyph.
2250 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2251 iterator's start_of_box_run_p flag before prepending the stretch.
2252 (append_glyph, produce_image_glyph, append_composite_glyph)
2253 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2254 left_box_line_p and right_box_line_p flags of the glyph for R2L
2255 glyph rows. (Bug#13011)
2256
2257 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2258
2259 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2260 if changed buffer is not shown in a window.
2261 * insdel.c (prepare_to_modify_buffer): Likewise.
2262 * window.c (replace_buffer_in_windows_safely): Do nothing
2263 if buffer is not shown in a window.
2264 (Fforce_window_update): Likewise if string or buffer argument
2265 is passed.
2266
2267 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2268
2269 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2270 encoded_file_name, which is what it is.
2271
2272 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2273
2274 Consistently use marker_position and marker_byte_position.
2275 * fringe.c (Ffringe_bitmaps_at_pos):
2276 * indent.c (Fvertical_motion):
2277 * insdel.c (prepare_to_modify_buffer):
2278 * keyboard.c (make_lispy_position):
2279 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2280 (window_scroll_pixel_based, displayed_window_lines)
2281 (Fset_window_configuration):
2282 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2283 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2284 Replace direct access to marker fields with calls
2285 to marker_position and/or marker_byte_position.
2286
2287 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2288
2289 * makefile.w32-in (SIG2STR_H): New macro.
2290 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2291 ($(BLD)/w32notify.$(O)): Update dependencies.
2292
2293 2012-12-10 Daniel Colascione <dancol@dancol.org>
2294
2295 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2296 Windows file notification functionality unless WINDOWSNT.
2297
2298 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2299 declarations.
2300
2301 * w32fns.c (cache_system_info): Initialize the global hinst
2302 variable here so various initialization calls DTRT.
2303
2304 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2305 (hinst): Remove unneeded extern declaration.
2306 (_start): Remove initialization of above variables; remove
2307 initialization of hinst, as cache_system_info now does that.
2308
2309 * emacs.c (main): Call cache_system_info early in startup; we
2310 previously weren't calling it in Cygwin builds.
2311
2312 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2313 Teach the autoconf build system how to compile a Windows resource file
2314 and link it to Emacs.
2315
2316 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2317
2318 Per-buffer window counters.
2319 * buffer.h (struct buffer): New member window_count.
2320 (buffer_window_count): New function.
2321 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2322 Initialize window_count.
2323 (Fkill_buffer): Verify window_count for the buffer being killed.
2324 (modify_overlay): Do not force redisplay if buffer is not shown
2325 in any window.
2326 (init_buffer_once): Initialize window_count for buffer_defaults
2327 and buffer_local_symbols.
2328 * window.h (buffer_shared): Remove declaration.
2329 (wset_buffer): Convert from inline ...
2330 * window.c (wset_buffer): ... to an ordinary function.
2331 (adjust_window_count): New function.
2332 (make_parent_window): Use it.
2333 * xdisp.c (buffer_shared): Remove.
2334 (redisplay_internal, redisplay_window): Adjust users.
2335 (buffer_shared_and_changed): Use per-buffer window counter.
2336
2337 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2338
2339 Support for filesystem notifications on MS-Windows.
2340 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2341 and this is a TTY frame, signal the caller that keyboard input is
2342 available.
2343
2344 * w32xfns.c (drain_message_queue): Now returns an int: an
2345 indication whether any WM_EMACS_FILENOTIFY messages were found in
2346 the queue.
2347
2348 * w32inevt.c (handle_file_notifications): New function.
2349 (w32_console_read_socket): Call it to process file notifications.
2350
2351 * w32console.c (initialize_w32_display): Record the main thread ID
2352 in dwMainThreadId.
2353
2354 * deps.mk (inotify.o): New dependency list.
2355
2356 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2357
2358 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2359 (WM_EMACS_END): Bump value by 1.
2360 (notification_buffer_in_use, file_notifications)
2361 (notifications_size, notifications_desc): Declare.
2362 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2363 Add prototypes.
2364
2365 * w32term.c (lispy_file_action, queue_notifications): New functions.
2366 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2367 <Qrenamed_to>: New symbols.
2368 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2369
2370 * w32notify.c: New file, implements file event notifications for
2371 MS-Windows.
2372
2373 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2374 by posting it to the w32_read_socket queue.
2375
2376 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2377
2378 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2379 (GLOBAL_SOURCES): Add w32notify.c
2380 ($(BLD)/w32notify.$(O)): New set of dependencies.
2381
2382 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2383
2384 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2385 Handle FILE_NOTIFY_EVENT.
2386 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2387 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2388 w32notify-handle-event by default.
2389
2390 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2391 syms_of_w32notify.
2392
2393 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2394
2395 Support for filesystem notifications on GNU/Linux via inotify.
2396 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2397
2398 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2399
2400 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2401 (syms_of_keyboard): DEFSYM it.
2402 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2403 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2404 Qfile_inotify events.
2405 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2406 special-event-map to inotify-handle-event.
2407
2408 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2409
2410 * Makefile.in (base_obj): Add inotify.o.
2411
2412 * inotify.c: New file.
2413
2414 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
2415
2416 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2417
2418 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
2419
2420 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2421 DWORD_PTR, for compatibility with 64-bit builds.
2422
2423 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2424 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2425 (system_process_attributes): Use SIZE_T rather than DWORD, for
2426 compatibility with 64-bit builds.
2427
2428 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
2429
2430 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2431
2432 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2433
2434 * indent.c (Fvertical_motion): If a display string will be
2435 displayed on the left or the right margin, don't consider it as a
2436 factor in cursor positioning. (Bug#13108)
2437
2438 2012-12-10 Martin Rudalics <rudalics@gmx.at>
2439
2440 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2441
2442 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2443
2444 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2445 for string length.
2446
2447 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2448
2449 * w32.c (unsetenv): Return 0 if the input string is too long.
2450
2451 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2452
2453 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2454 * alloc.c (xputenv): New function.
2455 * dbusbind.c (Fdbus_init_bus):
2456 * emacs.c (main):
2457 * xterm.c (x_term_init):
2458 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2459 * editfns.c (initial_tz): Move static var decl up.
2460 (tzvalbuf_in_environ): New static var.
2461 (init_editfns): Initialize these two static vars.
2462 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2463 Save old TZ value on stack, if it's small.
2464 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2465 instead, use xputenv+unsetenv to set and restore TZ.
2466 (environbuf): Remove static var. All uses removed.
2467 (Fset_time_zone_rule): Do not save TZ and environ;
2468 no longer needed here.
2469 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2470 Move to inside set_time_zone_rule; they don't need file scope any more.
2471 (set_time_zone_rule): Maintain the TZ=value string separately.
2472 (syms_of_editfns): Don't initialize initial_tz;
2473 init_editfns now does it.
2474 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2475 * lisp.h (xputenv): New decl.
2476
2477 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2478
2479 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2480
2481 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2482
2483 * w32.c (unsetenv, sys_putenv): New functions.
2484
2485 2012-12-08 Chong Yidong <cyd@gnu.org>
2486
2487 * editfns.c (Finsert_char): Make the error message more
2488 informative (Bug#12992).
2489
2490 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2491
2492 Simplify get_lim_data.
2493 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2494 Remove USG and vlimit methods; no longer used these days.
2495 Add #error catchall just in case.
2496
2497 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2498 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2499 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2500 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2501 (deleted_pid_list, Fdelete_process, create_process)
2502 (record_child_status_change, handle_child_signal, deliver_child_signal)
2503 (init_process_emacs, syms_of_process):
2504 Assume SIGCHLD is defined.
2505 (parse_signal): Remove. All uses removed.
2506 (abbr_to_signal): New static function.
2507 (Fsignal_process): Use it to convert signal names to ints.
2508 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2509 kill (getpgrp (), ...).
2510 (emacs_sigaction_init): Assume SIGCHLD is defined.
2511 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2512 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2513 * syssignal.h (EMACS_KILLPG): Remove.
2514 All uses replaced by 'kill' with a negative pid.
2515 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2516 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2517
2518 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2519
2520 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2521 This will cause a production Emacs to dump core instead of
2522 infinite-looping.
2523
2524 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2525
2526 * frame.c (make_frame): Do not set window's buffer to t.
2527 * window.c (Fsplit_window_internal): Likewise. Previously it was
2528 used to indicate that the window is being set up. Now we use
2529 set_window_buffer for all new windows, so the condition in ...
2530 (Fset_window_buffer): ... is always true and can be removed.
2531
2532 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2533
2534 Convenient macro to check whether the buffer is hidden.
2535 * buffer.h (BUFFER_HIDDEN_P): New macro.
2536 * frame.c (make_frame): Use it. Adjust comment.
2537 * buffer.c (candidate_buffer): New function.
2538 (Fother_buffer, other_buffer_safely): Use it.
2539
2540 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2541
2542 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2543 if the child process is still running. Instead, exit the wait
2544 loop and return zero. (Bug#13086)
2545
2546 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2547
2548 * frame.h (x_char_width, x_char_height): Remove prototypes.
2549 * w32term.h (x_char_width, x_char_height): Likewise.
2550 * xfns.c (x_char_width, x_char_height): Remove.
2551 * w32fns.c (x_char_width, x_char_height): Likewise.
2552 * nsfns.c (x_char_width, x_char_height): Likewise.
2553 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2554 all window frames.
2555 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2556 * keyboard.c (command_loop_1): Remove prototype.
2557 (command_loop_2, top_level_1): Add static to match prototype.
2558
2559 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2560
2561 Fix a recently-introduced delete-process race condition.
2562 * callproc.c, process.h (record_kill_process):
2563 New function, containing part of the old call_process_kill.
2564 (call_process_kill): Use it.
2565 This does not change call_process_kill's behavior.
2566 * process.c (Fdelete_process): Use record_kill_process to fix a
2567 race condition that could cause Emacs to lose track of a child.
2568
2569 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2570
2571 Avoid code duplication between prev_frame and next_frame.
2572 * frame.c (candidate_frame): New function. Add comment.
2573 (prev_frame, next_frame): Use it. Adjust comment.
2574
2575 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2576
2577 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2578 fails, signal an error instead of continuing with an empty
2579 string. (Bug#13079)
2580 Encode expanded temp file pattern before passing it to mkstemp or
2581 mktemp.
2582
2583 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2584 Encode the file name before passing it to dostounix_filename, in
2585 case it will downcase it (under w32-downcase-file-names).
2586 (Bug#12933)
2587
2588 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2589
2590 Minor call-process cleanups.
2591 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2592 at the same time as other platforms, to simplify analysis.
2593 No need for fd0_volatile since we have synch_process_fd.
2594 Avoid needless emacs_close; arg is always negative.
2595
2596 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2597
2598 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2599 processes.
2600
2601 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2602
2603 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2604 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2605 and mouse_face_hidden members to a bitfields.
2606 * frame.h (struct frame): Remove set-but-not-used space_width member.
2607 (FRAME_SPACE_WIDTH): Remove.
2608 * nsterm.m, w32term.c, xterm.c: Adjust users.
2609 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2610 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2611 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2612 members to a bitfields.
2613
2614 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2615
2616 Don't let call-process be a zombie factory (Bug#12980).
2617 Fixing this bug required some cleanup of the signal-handling code.
2618 As a side effect, this change also fixes a longstanding rare race
2619 condition whereby Emacs could mistakenly kill unrelated processes,
2620 and it fixes a bug where a second C-g does not kill a recalcitrant
2621 synchronous process in GNU/Linux and similar platforms.
2622 The patch should also fix the last vestiges of Bug#9488,
2623 a bug which has mostly been fixed on the trunk by other changes.
2624 * callproc.c, process.h (synch_process_alive, synch_process_death)
2625 (synch_process_termsig, sync_process_retcode):
2626 Remove. All uses removed, to simplify analysis and so that
2627 less consing is done inside critical sections.
2628 * callproc.c (call_process_exited): Remove. All uses replaced
2629 with !synch_process_pid.
2630 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2631 These take the role of what used to be in unwind-protect arg.
2632 All uses changed.
2633 (block_child_signal, unblock_child_signal):
2634 New functions, to avoid races that could kill innocent-victim processes.
2635 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2636 (call_process_kill): Record killed processes as deleted, so that
2637 zombies do not clutter up the system. Do this inside a critical
2638 section, to avoid a race that would allow the clutter.
2639 (call_process_cleanup): Fix code so that the second C-g works again
2640 on common platforms such as GNU/Linux.
2641 (Fcall_process): Create the child process in a critical section,
2642 to fix a race condition. If creating an asynchronous process,
2643 record it as deleted so that zombies do not clutter up the system.
2644 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2645 light of these changes. Omit unnecessary call to emacs_close
2646 before failure, as the unwind-protect code does that.
2647 * callproc.c (call_process_cleanup):
2648 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2649 * process.c (record_deleted_pid): New function, containing
2650 code refactored out of Fdelete_process.
2651 (Fdelete_process): Use it.
2652 (process_status_retrieved): Remove. All callers changed to use
2653 child_status_change.
2654 (record_child_status_change): Remove, folding its contents into ...
2655 (handle_child_signal): ... this signal handler. Now, this
2656 function is purely a handler for SIGCHLD, and is not called after
2657 a synchronous waitpid returns; the synchronous code is moved to
2658 wait_for_termination. There is no need to worry about reaping
2659 more than one child now.
2660 * sysdep.c (get_child_status, child_status_changed): New functions.
2661 (wait_for_termination): Now takes int * status and bool
2662 interruptible arguments, too. Do not record child status change;
2663 that's now the caller's responsibility. All callers changed.
2664 Reimplement in terms of get_child_status.
2665 (wait_for_termination_1, interruptible_wait_for_termination):
2666 Remove. All callers changed to use wait_for_termination.
2667 * syswait.h: Include <stdbool.h>, for bool.
2668 (record_child_status_change, interruptible_wait_for_termination):
2669 Remove decls.
2670 (record_deleted_pid, child_status_changed): New decls.
2671 (wait_for_termination): Adjust to API changes noted above.
2672
2673 * bytecode.c, lisp.h (Qbytecode): Remove.
2674 No longer needed after 2012-11-20 interactive-p changes.
2675
2676 2012-12-03 Eli Zaretskii <eliz@gnu.org>
2677
2678 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2679 the scroll margin, move point outside the margin. (Bug#13055)
2680
2681 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2682
2683 * gtkutil.c (my_log_handler): New function.
2684 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2685
2686 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2687
2688 * lisp.h (modify_region): Rename to...
2689 (modify_region_1): ...new prototype.
2690 * textprop.c (modify_region): Now static. Adjust users.
2691 * insdel.c (modify_region): Rename to...
2692 (modify_region_1): ...new function to work with current buffer.
2693 Adjust comment and users. Use true and false for booleans.
2694
2695 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2696
2697 * alloc.c (free_save_value): New function.
2698 (safe_alloca_unwind): Use it.
2699 * lisp.h (free_save_value): New prototype.
2700 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2701 Add comment.
2702 (save_excursion_restore): Adjust to match saved data structure.
2703 Use free_save_value to offload some work from GC. Drop obsolete
2704 #if 0 code.
2705
2706 2012-12-03 Chong Yidong <cyd@gnu.org>
2707
2708 * fileio.c (Vauto_save_list_file_name): Doc fix.
2709
2710 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
2711
2712 * w32fns.c: Remove prototype of atof.
2713 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2714 builds.
2715 (file_dialog_callback): Make it UINT_PTR.
2716
2717 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2718 with 64-bit builds.
2719
2720 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2721 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2722 defined.
2723
2724 2012-12-03 Glenn Morris <rgm@gnu.org>
2725
2726 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2727
2728 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2729
2730 Fix xpalloc confusion after memory is exhausted.
2731 * alloc.c (xpalloc): Comment fix.
2732 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2733 and signals an error, do not clear charset_table_size, as
2734 charset_table is still valid.
2735 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2736
2737 Use execve to avoid need to munge environ (Bug#13054).
2738 * callproc.c (Fcall_process):
2739 * process.c (create_process):
2740 Don't save and restore environ; no longer needed.
2741 * callproc.c (child_setup):
2742 Use execve, not execvp, to preserve environ.
2743
2744 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2745
2746 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2747
2748 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2749
2750 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2751 display for sliced images (Bug#10500).
2752
2753 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2754
2755 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2756
2757 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2758 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2759
2760 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2761
2762 * xdisp.c (window_outdated): Remove eassert since it hits
2763 some suspicious corner cases (see Bug#13007 and Bug#13012).
2764 (mode_line_update_needed): New function.
2765 (redisplay_internal, redisplay_window): Use it.
2766 (ensure_selected_frame): New function.
2767 (redisplay_internal, unwind_redisplay): Use it.
2768 (redisplay_internal): Move comment about buffer_shared...
2769 (buffer_shared_and_changed): ...near to its real use.
2770
2771 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2772
2773 * callproc.c (Fcall_process): Don't misreport vfork failure.
2774
2775 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2776
2777 * callproc.c (Fcall_process): Fix vfork portability problems.
2778 Do not assume that fd[0], count, filefd, and save_environ survive
2779 vfork. Fix bug whereby wrong errno value could be reported for
2780 pipe failure. Some minor cleanups, too, as follows. Move buf and
2781 bufsize to the context where they're needed. Change new_argv to
2782 be of type char **, as this is more convenient and avoids casts.
2783 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2784 Now local constants, not macros.
2785
2786 2012-11-18 Kenichi Handa <handa@gnu.org>
2787
2788 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2789 for the variable "f".
2790
2791 2012-11-13 Kenichi Handa <handa@gnu.org>
2792
2793 * font.c (font_unparse_xlfd): Exclude special characters from the
2794 generating XLFD name.
2795
2796 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2797
2798 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2799 * dired.c (stat_uname, stat_gname):
2800 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2801
2802 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2803 * dired.c (directory_files_internal, file_name_completion):
2804 Assume EAGAIN and EINTR are defined.
2805
2806 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2807 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2808 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2809 * lread.c (readbyte_from_file): Assume EINTR is defined.
2810 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2811 Assume EIO and EAGAIN are defined.
2812 * unexcoff.c (write_segment): Assume EFAULT is defined.
2813
2814 2012-11-27 Eli Zaretskii <eliz@gnu.org>
2815
2816 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2817 (Bug#11964)
2818
2819 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2820 highlighting on the frame was cleared. Prevents assertion
2821 violations when repeatedly clicking on the "Top" link of the
2822 "bread-crumbs" in Info buffers.
2823
2824 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2825
2826 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2827
2828 2012-11-24 Ken Brown <kbrown@cornell.edu>
2829
2830 * keyboard.c (HAVE_MOUSE):
2831 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2832 were always defined.
2833
2834 2012-11-24 Eli Zaretskii <eliz@gnu.org>
2835
2836 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2837 between bpos_covered and bpos_max. This fixes cursor display when
2838 several display strings follow each other.
2839
2840 * .gdbinit (pgx): If the glyph's object is a string, display the
2841 pointer to string data, rather than the value of the string object
2842 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2843
2844 * indent.c (Fvertical_motion): If the starting position is covered
2845 by a display string, return to one position before that, to avoid
2846 overshooting it inside move_it_to. (Bug#12930)
2847
2848 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2849
2850 * frame.h (struct frame): Remove display_preempted member
2851 since all users are dead long ago.
2852 * nsterm.h (struct x_output): Use the only dummy member.
2853 * w32menu.c (pending_menu_activation): Remove since not
2854 really used.
2855 (set_frame_menubar): Adjust user.
2856 * w32term.h (struct x_output): Drop outdated #if 0 code.
2857 (struct w32_output): Use bitfields for explicit_parent,
2858 asked_for_visible and menubar_active members.
2859 Drop unused pending_menu_activation member.
2860 * xterm.h (struct x_output): Drop outdated #if 0 code.
2861 Use bitfields for explicit_parent, asked_for_visible,
2862 has_been_visible and net_wm_state_hidden_seen members.
2863
2864 2012-11-23 Eli Zaretskii <eliz@gnu.org>
2865
2866 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2867 of a literal "/". (Bug#12955)
2868 (gl-stamp): Invoke fc.exe directly, not through cmd.
2869
2870 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2871
2872 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2873 * dired.c: Assume HAVE_DIRENT_H.
2874 (NAMLEN): Remove, replacing with ...
2875 (dirent_namelen): New function. All uses changed. Use the GNU macro
2876 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2877 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2878 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2879 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2880 $(NT_INC)/dirent.h.
2881 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2882 * ndir.h: Rename to ../nt/inc/dirent.h.
2883 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2884 Do not include <dirent.h>; no longer needed.
2885 * w32.c: Include <dirent.h> rather than "ndir.h".
2886
2887 2012-11-23 Chong Yidong <cyd@gnu.org>
2888
2889 * xftfont.c (xftfont_open): Remove duplicate assignment.
2890
2891 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2892
2893 * alloc.c (Fgarbage_collect): Unblock input after clearing
2894 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2895 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2896 * msdos.c (IT_frame_up_to_date): Use it here...
2897 * w32term.c (w32_frame_up_to_date): ...here...
2898 * xterm.c (XTframe_up_to_date): ...and here...
2899 * nsterm.m (ns_frame_up_to_date): ...but not here.
2900 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2901 Adjust users.
2902 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2903 Do not check whether GC is in progress.
2904
2905 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2906
2907 * xdisp.c (window_buffer_changed): New function.
2908 (update_menu_bar, update_tool_bar): Use it to
2909 simplify large 'if' statements.
2910 (redisplay_internal): Generalize commonly used
2911 'tail' and 'frame' local variables.
2912
2913 2012-11-22 Eli Zaretskii <eliz@gnu.org>
2914
2915 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2916 with Windows system header.
2917
2918 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2919
2920 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2921 * alloc.c: Assume unistd.h exists.
2922 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2923 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2924 (getwd) [USG]: Remove; no longer needed.
2925 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2926 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2927 * w32.h (getcwd): Remove decl.
2928
2929 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2930
2931 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2932 Make it set selected_window as well.
2933 (update_tool_bar): Use it.
2934
2935 2012-11-21 Ken Brown <kbrown@cornell.edu>
2936
2937 * emacs.c (main): Set the G_SLICE environment variable for all
2938 Cygwin builds, not just GTK builds. See
2939 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2940
2941 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2942
2943 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2944 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2945 Define for the MSVC compiler.
2946
2947 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2948
2949 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2950 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2951 dostounix_filename. Prevents crashes down the road, because
2952 dostounix_filename assumes it gets a unibyte string.
2953 Reported by Michel de Ruiter <michel@sentient.nl>, see
2954 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2955
2956 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2957
2958 Conflate Qnil and Qunbound for `symbol-function'.
2959 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2960 * lread.c (init_obarray): Set `function' fields to Qnil.
2961 * eval.c (Fcommandp): Ignore Qunbound.
2962 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2963 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2964 Test NILP rather than Qunbound.
2965 (Ffmakunbound): Set to Qnil.
2966 (Fsymbol_function): Never signal an error.
2967 (Finteractive_form): Ignore Qunbound.
2968
2969 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2970
2971 * eval.c (interactive_p): Remove no-longer-used decl.
2972
2973 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2974
2975 * xdisp.c (buffer_shared): Adjust comment.
2976 (buffer_shared_and_changed): New function.
2977 (prepare_menu_bars, redisplay_internal): Use it to
2978 decide whether all windows or frames should be updated.
2979 (window_outdated): New function.
2980 (text_outside_line_unchanged_p, redisplay_window): Use it.
2981 (redisplay_internal): Likewise. Fix indentation.
2982
2983 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2984
2985 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2986 (syms_of_eval): Remove corresponding defsubr.
2987 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2988
2989 2012-11-19 Daniel Colascione <dancol@dancol.org>
2990
2991 * w32fns.c (Fx_file_dialog):
2992 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2993 cygwin_convert_file_name*.
2994
2995 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2996 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2997
2998 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2999
3000 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3001
3002 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3003
3004 * w32select.c: Include w32common.h before w32term.h, so that
3005 windows.h gets included before w32term.h uses some of its
3006 features, see below.
3007
3008 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3009 New typedefs.
3010 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3011 New prototypes.
3012 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3013
3014 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3015
3016 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3017 (ns_select): Return at once if events are held (Bug#12834).
3018
3019 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3020
3021 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3022 Needed following 2012-10-20 change. (Bug#12902)
3023
3024 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3025
3026 * w32proc.c (waitpid): Remove unused label get_result.
3027
3028 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3029
3030 * makefile.w32-in (SYSWAIT_H): New macro.
3031 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3032 ($(BLD)/sysdep.$(O)): Update dependencies.
3033
3034 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3035
3036 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3037 * callproc.c (relocate_fd): Assume F_DUPFD.
3038 * emacs.c, term.c (O_RDWR): Remove.
3039 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3040 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3041 * nsterm.m: Assume <fcntl.h> exists.
3042 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3043 (create_pty, Fmake_network_process, server_accept_connection)
3044 (wait_reading_process_output, init_process_emacs):
3045 Assume O_NONBLOCK.
3046 (wait_reading_process_output): Put in a special case for WINDOWSNT
3047 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3048 It's not clear this is needed, but it's a more-conservative change.
3049 (create_process): Assume FD_CLOEXEC.
3050 (create_process, create_pty): Assume O_NOCTTY.
3051 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3052 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3053 Omit if not DOS_NT, since F_GETFL is not defined there.
3054 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3055 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3056 (O_NOCTTY): Remove.
3057 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3058 lack it, since gnulib guarantees this.
3059 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3060
3061 2012-11-17 Eli Zaretskii <eliz@gnu.org>
3062
3063 * w32.c (faccessat): Pretend that directories have the execute bit
3064 set. Emacs expects that, e.g., in files.el:cd-absolute.
3065
3066 * w32proc.c (create_child): Don't clip the PID of the child
3067 process to fit into an Emacs integer, as this is no longer a
3068 restriction.
3069 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3070 reaping only the process specified by PID argument, if that is
3071 positive. Use PID instead of dead_child to know which process to
3072 reap. Wait for the child to die only if WNOHANG is not in
3073 OPTIONS.
3074 (sys_select): Don't set dead_child.
3075
3076 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3077 as it is no longer needed.
3078
3079 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3080 no longer needed.
3081 (record_child_status_change): Remove the setting of
3082 record_at_most_one_child for the !WNOHANG case.
3083
3084 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 Fix problems in ns port found by static checking.
3087 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3088 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3089 not to process group.
3090 (ns_select): Use emacs_write, not write, as that's more robust
3091 in the presence of signals.
3092 (fd_handler:): Check for read errors.
3093
3094 2012-11-16 Glenn Morris <rgm@gnu.org>
3095
3096 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3097
3098 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3099
3100 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3101
3102 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3103
3104 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3105 use the same value of thread handle.
3106 (start_timer_thread): If the timer thread exited (due to error),
3107 clean up by closing the two handles it used. Duplicate the caller
3108 thread's handle here, so it gets duplicated only once, when
3109 launching the timer thread. Set priority of the timer thread, not
3110 the caller thread.
3111 (getitimer): Don't duplicate the caller thread's handle here.
3112 (Bug#12832)
3113
3114 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3115
3116 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3117 called (Bug#12834).
3118
3119 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3120
3121 Remove no-longer-used pty_max_bytes variable.
3122 * process.c (pty_max_bytes): Remove; unused.
3123 (send_process): Do not set it.
3124
3125 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3126
3127 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3128 Update dependencies.
3129
3130 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3131
3132 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3133 This follows up on the 2012-09-29 patch that removed indirection
3134 for the 'function' field. Reported by Sergey Vinokurov in
3135 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3136
3137 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3138
3139 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3140 different name, as the MS runtime does not have such a function,
3141 and probably never will.) All callers changed. Ignore DIRFD
3142 value if PATH is an absolute file name, to match Posix spec
3143 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3144 symlinks.
3145
3146 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3147
3148 * xdisp.c (echo_area_display, redisplay_internal):
3149 Omit redundant check whether frame_garbaged is set.
3150
3151 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3152
3153 Use faccessat, not access, when checking file permissions (Bug#12632).
3154 This fixes a bug that has been present in Emacs since its creation.
3155 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3156 which must set some sort of record. (Torek's bug report was against
3157 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3158 same common flaw.) See Torek's Usenet posting
3159 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3160 Posted: Fri Apr 8 14:18:56 1983.
3161 * Makefile.in (LIB_EACCESS): New macro.
3162 (LIBES): Use it.
3163 * callproc.c (init_callproc):
3164 * charset.c (init_charset):
3165 * fileio.c (check_existing, check_executable, check_writable)
3166 (Ffile_readable_p):
3167 * lread.c (openp, load_path_check):
3168 * process.c (allocate_pty):
3169 * xrdb.c (file_p):
3170 Use effective UID when checking permissions, not real UID.
3171 * callproc.c (init_callproc):
3172 * charset.c (init_charset):
3173 * lread.c (load_path_check, init_lread):
3174 Test whether directories are accessible, not merely whether they exist.
3175 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3176 * fileio.c (check_existing, check_executable, check_writable)
3177 (Ffile_readable_p):
3178 Use symbolic names instead of integers for the flags, as they're
3179 portable now.
3180 (check_writable): New arg AMODE. All uses changed.
3181 Set errno on failure.
3182 (Ffile_readable_p): Use faccessat, not stat + open + close.
3183 (Ffile_writable_p): No need to call check_existing + check_writable.
3184 Just call check_writable and then look at errno. This saves a syscall.
3185 dir should never be nil; replace an unnecessary runtime check
3186 with an eassert. When checking the parent directory of a nonexistent
3187 file, check that the directory is searchable as well as writable, as
3188 we can't create files in unsearchable directories.
3189 (file_directory_p): New function, which uses 'stat' on most platforms
3190 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3191 (Ffile_directory_p, Fset_file_times): Use it.
3192 (file_accessible_directory_p): New function, which uses a single
3193 syscall for efficiency.
3194 (Ffile_accessible_directory_p): Use it.
3195 * xrdb.c (file_p): Use file_directory_p.
3196 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3197 * lread.c (openp): When opening a file, use fstat rather than
3198 stat, as that avoids a permissions race. When not opening a file,
3199 use file_directory_p rather than stat.
3200 (dir_warning): First arg is now a usage string, not a format.
3201 Use errno. All uses changed.
3202 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3203 that merely introduced a race.
3204 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3205 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3206 and similarly for the other O_* flags.
3207 * w32.c (sys_faccessat): Rename from sys_access and switch to
3208 faccessat's API. All uses changed.
3209 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3210 (magic_db): Rename from magic_file_p.
3211 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3212 char *, so that we don't have to test for file existence
3213 separately from opening the file for reading. This removes a race
3214 fixes a permission-checking problem, and simplifies the code.
3215 All uses changed.
3216 (file_p): Remove; no longer needed.
3217
3218 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3219
3220 Omit glyphs initialization at startup.
3221 * dispnew.c (glyphs_initialized_initially_p): Remove.
3222 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3223 (Fredraw_frame): Move actual code from here...
3224 (redraw_frame): ...to here. Add eassert. Adjust comment.
3225 (Fredraw_display): Use redraw_frame.
3226 * xdisp.c (clear_garbaged_frames): Likewise.
3227
3228 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3229
3230 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3231 passed to pint2str and pint2hrstr to be at most the size of the
3232 frame's decode_mode_spec_buffer. This avoids crashes with very
3233 large values of FIELD_WIDTH argument to decode_mode_spec.
3234 (Bug#12867)
3235
3236 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3237
3238 Fix a race with verify-visited-file-modtime (Bug#12863).
3239 Since at least 1991 Emacs has ignored an mtime difference of no
3240 more than one second, but my guess is that this was to work around
3241 file system bugs that were fixed long ago. Since the race is
3242 causing problems now, let's remove that code.
3243 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3244 whose time stamp is off by no more than a second. Insist that the
3245 file time stamps match exactly.
3246
3247 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3248
3249 * frame.h (struct frame): Convert external_tool_bar member to
3250 1-bit unsigned bitfield.
3251 * termhooks.h (struct terminal): Remove mouse_moved member since
3252 all users are long dead. Adjust comment on mouse_position_hook.
3253
3254 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3255
3256 Simplify by using FOR_EACH_FRAME here and there.
3257 * frame.c (next_frame, prev_frame, other_visible_frames)
3258 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3259 * w32term.c (x_window_to_scroll_bar): Likewise.
3260 * window.c (window_list): Likewise.
3261 * xdisp.c (x_consider_frame_title): Likewise.
3262 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3263 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3264 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3265 * xmenu.c (menubar_id_to_frame): Likewise.
3266 * xselect.c (frame_for_x_selection): Likewise.
3267 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3268 (x_window_to_menu_bar): Likewise.
3269 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3270
3271 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3272
3273 * data.c (Qdefalias_fset_function): Now static.
3274
3275 Another tweak to vectorlike_header change.
3276 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3277 Remove, and replace all uses with ...
3278 (next_in_free_list, set_next_in_free_list):
3279 New functions, which respect C's aliasing rules better.
3280
3281 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3282
3283 * window.c (list4i): Rename from 'quad'. All uses changed.
3284 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3285
3286 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3287
3288 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3289 warning about mixing declarations and code in ISO C90.
3290
3291 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3292
3293 * window.c (Fsplit_window_internal): Set combination limit of
3294 new parent window to t iff Vwindow_combination_limit is t;
3295 fixing a regression introduced with the change from 2012-09-22.
3296 (Fset_window_combination_limit): Fix doc-string.
3297
3298 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3299
3300 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3301 amount when the scroll margins are too large. When scrolling
3302 backwards in the buffer, give up if cannot reach point or the
3303 scroll margin within a reasonable number of screen lines.
3304 Fixes point position in window under scroll-up/down-aggressively when
3305 point is positioned many lines beyond the window top/bottom.
3306 (Bug#12811)
3307
3308 * ralloc.c (relinquish): If real_morecore fails to return memory
3309 to the system, don't crash; instead, leave the last heap
3310 unchanged and return. (Bug#12774)
3311
3312 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3313
3314 * lisp.h (AUTOLOADP): New macro.
3315 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3316 * data.c (Ffset): Remove special ad-advice-info handling.
3317 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3318 (Fsubr_arity): CSE.
3319 (Finteractive_form): Simplify.
3320 (Fquo): Don't insist on having at least 2 arguments.
3321 (Qdefalias_fset_function): New var.
3322
3323 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3324
3325 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3326
3327 * nsfont.m (Qcondensed, Qexpanded): New variables.
3328 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3329 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3330
3331 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3332
3333 Fix recently introduced crash on MS-Windows (Bug#12839).
3334 * w32term.h (struct scroll_bar): Use convenient header.
3335 (SCROLL_BAR_VEC_SIZE): Remove.
3336 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3337
3338 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3339
3340 Tweak last vectorlike_header change.
3341 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3342 vectorlike object on the free list. This is introduced to avoid
3343 some (but not all) pointer casting and aliasing problems, see
3344 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3345 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3346 objects.
3347 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3348
3349 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3350
3351 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3352 been removed, so remove them here also.
3353
3354 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3355
3356 * doc.c (Fdocumentation): Handle new property
3357 dynamic-docstring-function to replace the old ad-advice-info.
3358
3359 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 * fns.c (Qeql, hashtest_eq): Now static.
3362
3363 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3364
3365 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3366 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3367 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3368 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3369
3370 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3371
3372 Use same hash function for hashfn_profiler as for hash_string etc.
3373 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3374 * lisp.h (sxhash_combine): New inline function, with the contents
3375 of the old SXHASH_COMBINE.
3376 * profiler.c (hashfn_profiler): Use it, instead of having a
3377 special hash function containing a comparison that always yields 1.
3378
3379 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3380
3381 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3382 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3383 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3384 Remove unused vars.
3385
3386 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3387
3388 * image.c (xpm_make_color_table_h): Fix compiler error because
3389 make_hash_table changed.
3390
3391 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
3392
3393 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3394
3395 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3396
3397 Use ad-hoc comparison function for the profiler's hash-tables.
3398 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3399 (make_log): Use them.
3400 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3401 call Fequal any more.
3402 (Ffunction_equal): New function.
3403 (cmpfn_profiler, hashfn_profiler): New functions.
3404 (syms_of_profiler): Initialize them.
3405 * lisp.h (struct hash_table_test): New struct.
3406 (struct Lisp_Hash_Table): Use it.
3407 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3408 * fns.c (make_hash_table): Take a struct to describe the test.
3409 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3410 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3411 (hash_lookup, hash_remove_from_table): Move assertion checking of
3412 hashfn result here. Check hash-equality before calling cmpfn.
3413 (Fmake_hash_table): Adjust call to make_hash_table.
3414 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3415 (syms_of_fns): Initialize them.
3416 * emacs.c (main): Move syms_of_fns earlier.
3417 * xterm.c (syms_of_xterm):
3418 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3419 * print.c (print_object): Adjust to new hash-table struct.
3420 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3421
3422 2012-11-08 Eli Zaretskii <eliz@gnu.org>
3423
3424 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3425 value of w32-scroll-lock-modifier is neither nil nor one of the
3426 known key modifiers. (Bug#12806)
3427
3428 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3429
3430 Shrink struct vectorlike_header to the only size field.
3431 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3432 Adjust comment.
3433 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3434 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3435 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3436 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3437 information from the vector header. Adjust comment.
3438 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3439 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3440 layout.
3441 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3442 (struct vectorlike_header): Remove next member. Adjust comment.
3443 (struct Lisp_Subr): Add convenient header. Adjust comment.
3444 (allocate_pseudovector): Adjust prototype.
3445 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3446 (sweep_string, lisp_malloc): Remove useless prototypes.
3447 (enum mem_type): Adjust comment.
3448 (NEXT_IN_FREE_LIST): New macro.
3449 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3450 (Fmake_bool_vector): Likewise.
3451 (struct large_vector): New type to represent allocation unit for
3452 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3453 (large_vectors): Change type to struct large_vector.
3454 (allocate_vector_from_block): Simplify.
3455 (PSEUDOVECTOR_NBYTES): Replace with...
3456 (vector_nbytes): ...new function. Adjust users.
3457 (sweep_vectors): Adjust processing of large vectors.
3458 (allocate_vectorlike): Likewise.
3459 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3460 Add easserts. Adjust XSETPVECTYPESIZE usage.
3461 (allocate_buffer): Use BUFFER_PVEC_INIT.
3462 (live_vector_p): Adjust to match large vector.
3463 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3464 * buffer.h (struct buffer): Add next member.
3465 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3466 New macros.
3467 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3468 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3469 (copy_hash_table): Adjust to match vector header change.
3470 * lread.c (defsubr): Use XSETPVECTYPE.
3471 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3472 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3473 (xvecsize): New command.
3474
3475 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3476
3477 * keyboard.c (event_to_kboard): Do not dereference
3478 frame_or_window field of SELECTION_REQUEST_EVENT
3479 and SELECTION_CLEAR_EVENT events (Bug#12814).
3480 * xterm.h (struct selection_input_event): Adjust comment.
3481
3482 2012-11-07 Eli Zaretskii <eliz@gnu.org>
3483
3484 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3485 such as Scroll Lock, if the respective keys are treated as
3486 function keys, not as modifiers. This avoids destroying non-ASCII
3487 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
3488
3489 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3490
3491 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3492
3493 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3494
3495 Restore some duplicate definitions (Bug#12814).
3496 This undoes part of the 2012-11-03 changes. Some people build
3497 with plain -g rather than with -g3, and they need the duplicate
3498 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3499 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3500 Define as macros, as well as as enums or as constants.
3501
3502 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3503
3504 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3505 to keypad keys (Bug#12816).
3506
3507 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3508
3509 Minor adjustments of recently-changed frame functions.
3510 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3511 known to be a frame (we're in the FRAMEP branch).
3512 * lisp.h (Qframep): Remove decl. frame.h declares this.
3513 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3514 since they're meant for Lisp fixnum values.
3515
3516 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3517
3518 * window.c (Fwindow_combination_limit): Revert to the only
3519 required argument and adjust docstring as suggested in
3520 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3521 by Martin Rudalics <rudalics@gmx.at>.
3522
3523 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3524
3525 Widely used frame validity and checking functions.
3526 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3527 * frame.c (decode_live_frame, decode_any_frame): New functions.
3528 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3529 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3530 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3531 (Fframe_pointer_visible_p): Use decode_any_frame.
3532 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3533 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3534 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3535 (Fframe_focus): Likewise. Allow zero number of arguments.
3536 Adjust docstring.
3537 (frame_buffer_list, frame_buffer_predicate): Remove.
3538 * lisp.h (frame_buffer_predicate): Remove prototype.
3539 * buffer.c (Fother_buffer): Use decode_any_frame.
3540 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3541 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3542 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3543 (Fclose_font, Ffont_info): Use decode_live_frame.
3544 * fontset.c (check_fontset_name): Likewise.
3545 * terminal.c (Fframe_terminal): Likewise.
3546 * w32fns.c (check_x_frame): Likewise.
3547 * window.c (Fminibuffer_window, Fwindow_at)
3548 (Fcurrent_window_configuration): Likewise.
3549 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3550 Likewise. Allow zero number of arguments. Adjust docstring.
3551 * dispnew.c (Fredraw_frame): Likewise.
3552 * xfaces.c (frame_or_selected_frame): Remove.
3553 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3554 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3555 (Fframe_face_alist): Use decode_live_frame.
3556 * xfns.c (check_x_frame): Likewise.
3557
3558 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3559
3560 * window.c (quad): New function.
3561 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3562 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3563 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3564 (Fwindow_line_height): Use it.
3565 (Fwindow_fringes): Use list3.
3566 (Fwindow_scroll_bars): Use list4.
3567 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3568 (Fwindow_combination_limit): Allow zero number of arguments.
3569
3570 2012-11-05 Eli Zaretskii <eliz@gnu.org>
3571
3572 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3573
3574 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3575 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3576 file descriptor 2 for standard error. (Bug#12805)
3577
3578 2012-11-05 Chong Yidong <cyd@gnu.org>
3579
3580 * process.c (wait_reading_process_output): Revert previous change.
3581
3582 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3583
3584 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3585 This removes code that has been obsolete since around 1990.
3586 * callproc.c (Fcall_process):
3587 * emacs.c (main):
3588 * process.c (create_process):
3589 * term.c (dissociate_if_controlling_tty):
3590 Assume setsid exists.
3591 * callproc.c (child_setup): Assume setpgid exists and behaves as
3592 per POSIX.1-1988 or later.
3593 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3594 * emacs.c (shut_down_emacs):
3595 * sysdep.c (sys_suspend, init_foreground_group):
3596 Assume getpgrp behaves as per POSIX.1-1998 or later.
3597 * msdos.c (setpgrp): Remove.
3598 (tcgetpgrp, setpgid, setsid): New functions.
3599 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3600 * term.c (no_controlling_tty): Remove; unused.
3601 * w32proc.c (setpgrp): Remove.
3602 (setsid, tcgetpgrp): New functions.
3603
3604 Simplify by assuming __fpending.
3605 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3606 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3607 Do not assume that __fpending's result fits in int.
3608
3609 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 Remove EMACS_OUTQSIZE+sleep hack.
3612 * dispnew.c (update_frame_1): Remove hack for terminals slower
3613 than 2400 bps, which throttled Emacs by having it sleep.
3614 This code hasn't worked since at least 2007, when the multi-tty stuff
3615 was added, and anyway those old terminals are long dead.
3616 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3617 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3618
3619 Fix data-loss with --version (Bug#9574).
3620 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3621 as we can't assume that emacs_strerror is initialized, and strerror
3622 is good enough here.
3623 (main): Invoke atexit earlier, to catch earlier instances of
3624 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3625
3626 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3627
3628 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3629 (keyDown): Remap keypad keys to X11 virtual key codes.
3630
3631 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 Fix data-loss with --batch (Bug#9574).
3634 * emacs.c: Include <close-stream.h>.
3635 (close_output_streams): New function.
3636 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3637 and handles errors appropriately.
3638 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3639 does that now.
3640
3641 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3642 The symptom is a diagnostic "GLib-WARNING **: In call to
3643 g_spawn_sync(), exit status of a child process was requested but
3644 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3645 waitpid(), so exit status can't be returned." The diagnostic
3646 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3647 The real bug is a race condition between Emacs and glib: Emacs
3648 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3649 so that glib can't find it. Work around the bug by invoking
3650 waitpid only on subprocesses that Emacs itself creates.
3651 * process.c (create_process, record_child_status_change):
3652 Don't use special value -1 in pid field, as the caller now must
3653 know the pid rather than having the callee infer it.
3654 The inference was sometimes incorrect anyway, due to another race.
3655 (create_process): Set new 'alive' member if child is created.
3656 (process_status_retrieved): New function.
3657 (record_child_status_change): Use it.
3658 Accept negative 1st argument, which means to wait for the
3659 processes that Emacs already knows about. Move special-case code
3660 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3661 processes that have already been waited for, by testing and
3662 clearing new 'alive' member.
3663 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3664 now does this internally.
3665 (handle_child_signal): Let record_child_status_change do all
3666 the work, since we do not want to reap all exited child processes,
3667 only the child processes that Emacs itself created.
3668 * process.h (Lisp_Process): New boolean member 'alive'.
3669
3670 Omit duplicate definitions no longer needed with gcc -g3.
3671 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3672 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3673 Define only as macros. There's no longer any need to also define
3674 these symbols as enums or as constants, since we now assume
3675 gcc -g3 when debugging.
3676
3677 2012-11-03 Eli Zaretskii <eliz@gnu.org>
3678
3679 * lisp.mk: Adjust comments to the fact that term/internal is now
3680 loaded from loadup.el.
3681
3682 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3683 (msdos_fatal_signal): New function.
3684 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3685 its argument list.
3686
3687 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3688 for GCC versions before 4.
3689 (emacs_raise): Define to call msdos_fatal_signal.
3690
3691 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3692 iterator when starting in the middle of a display or overlay
3693 string. (Bug#12745)
3694
3695 2012-11-03 Chong Yidong <cyd@gnu.org>
3696
3697 * process.c (wait_reading_process_output): Clean up the last
3698 change.
3699
3700 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3701
3702 * process.c (wait_reading_process_output): Avoid a race condition
3703 with SIGIO delivery (Bug#11536).
3704
3705 2012-11-03 Chong Yidong <cyd@gnu.org>
3706
3707 * buffer.c (cursor_type): Untabify docstring.
3708
3709 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3710
3711 * frame.h (struct frame): Drop can_have_scroll_bars member
3712 which is meaningless for a long time. Adjust comments.
3713 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3714 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3715
3716 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3717
3718 * window.c (decode_next_window_args): Update window arg after
3719 calling decode_live_window and so fix crash reported at
3720 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3721 by Juanma Barranquero <lekktu@gmail.com>.
3722 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3723 * font.c (Ffont_at): Likewise.
3724
3725 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3726
3727 * widget.c (resize_cb): New function.
3728 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3729 (EmacsFrameResize): Check if all is up to date before changing frame
3730 size.
3731
3732 2012-11-02 Eli Zaretskii <eliz@gnu.org>
3733
3734 Implement backtrace output for fatal errors on MS-Windows.
3735 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3736 (BACKTRACE_LIMIT_MAX): New macro.
3737 (w32_backtrace): New function.
3738 (emacs_abort): Use w32_backtrace when the user chooses not to
3739 attach a debugger. Update the text of the abort dialog.
3740
3741 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3742
3743 Window-related stuff cleanup here and there.
3744 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3745 Use decode_any_window.
3746 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3747 * xdisp.c (Fformat_mode_line): Likewise.
3748 * font.c (Ffont_at): Use decode_live_window.
3749 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3750 * window.c (decode_next_window_args): Likewise.
3751 (decode_any_window): Remove static.
3752 * window.h (decode_any_window): Add prototype.
3753 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3754 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3755 respectively.
3756
3757 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3758
3759 Remove pad from struct input_event.
3760 * termhooks.h (struct input_event): Remove padding field.
3761 Adjust comment.
3762 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3763 member is never cons for a long time. Adjust comment.
3764 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3765 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3766 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3767 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3768
3769 2012-11-01 Eli Zaretskii <eliz@gnu.org>
3770
3771 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3772
3773 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3774
3775 Fix crash when using Emacs as commit editor for git (Bug#12697).
3776 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3777 and it is configured in conf_post.h.
3778 (Fcall_process): Don't invoke both setsid and setpgid; the former
3779 is enough, if it exists.
3780 * callproc.c (Fcall_process, child_setup):
3781 * process.c (create_process): Use setpgid.
3782 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3783 for the real thing.
3784 * dispnew.c (init_display): Initialize the foreground group
3785 if we are running a tty display.
3786 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3787 * lisp.h (init_foreground_group): New decl.
3788 * sysdep.c (inherited_pgroup): New static var.
3789 (init_foreground_group, tcsetpgrp_without_stopping)
3790 (narrow_foreground_group, widen_foreground_group): New functions.
3791 (init_sys_modes): Narrow foreground group.
3792 (reset_sys_modes): Widen foreground group.
3793
3794 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
3795
3796 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3797
3798 2012-10-31 Martin Rudalics <rudalics@gmx.at>
3799
3800 * minibuf.c (read_minibuf): Restore current buffer since
3801 choose_minibuf_frame calling Fset_frame_selected_window may
3802 change it (Bug#12766).
3803
3804 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3805
3806 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3807
3808 2012-10-30 Kenichi Handa <handa@gnu.org>
3809
3810 * font.c (Ffont_at): If WINDOW is specified and it is not
3811 displaying the current buffer, signal an error.
3812
3813 2012-10-29 Daniel Colascione <dancol@dancol.org>
3814
3815 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3816 In preparation for fixing bug#12739, move these functions from
3817 here...
3818
3819 * coding.h, coding.c: ... to here, and compile them only when
3820 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3821 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
3822
3823 2012-10-28 Eli Zaretskii <eliz@gnu.org>
3824
3825 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3826 (timer_loop, getitimer, setitimer): Use it instead of
3827 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3828 'clock'.
3829 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3830 literal 10000.
3831
3832 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3833
3834 * nsterm.m (NO_APPDEFINED_DATA): New define.
3835 (last_appdefined_event_data): New variable
3836 (last_appdefined_event): Remove.
3837 (ns_select): Initialize t from last_appdefined_event_data instead
3838 of [last_appdefined_event data1].
3839 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3840 remove last_appdefined_event (Bug#12698).
3841
3842 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3843
3844 * frame.c (x_set_font): Catch internal error.
3845
3846 2012-10-27 Eli Zaretskii <eliz@gnu.org>
3847
3848 Avoid overflow in w32 implementation of interval timers.
3849 When possible, for ITIMER_PROF count only times the main thread
3850 actually executes.
3851 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
3852 'volatile ULONGLONG' types. All the other data which was
3853 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
3854 (GetThreadTimes_Proc): New typedef.
3855 (w32_get_timer_time): New function, returns a suitable time value
3856 for the timer.
3857 (timer_loop): Enter critical section when accessing ULONGLONG
3858 values of the itimer_data struct, as these accesses are no longer
3859 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3860 Remove unused variable.
3861 (init_timers): Initialize s_pfn_Get_Thread_Times.
3862 (start_timer_thread): Don't assign itimer->caller_thread here.
3863 (getitimer): Assign itimer->caller_thread here.
3864 (setitimer): Always call getitimer to get the value of ticks_now.
3865 (sys_spawnve): Avoid compiler warning about format mismatch.
3866
3867 2012-10-26 Eli Zaretskii <eliz@gnu.org>
3868
3869 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3870 mouse movement events if the menu bar is active. This avoids
3871 producing a busy "hour-glass" cursor by Windows if the mouse
3872 pointer is positioned over a tooltip shown for some menu item.
3873
3874 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 Don't assume process IDs fit in int.
3877 * emacs.c (shut_down_emacs) [!DOS_NT]:
3878 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3879 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3880 Use pid_t, not int, to store process IDs, as 'int'
3881 is not wide enough on a few platforms (e.g., AIX and IRIX).
3882
3883 2012-10-23 Kenichi Handa <handa@gnu.org>
3884
3885 The following change is to make face-font-rescale-alist work
3886 correctly for non-ASCII fonts.
3887
3888 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3889 (font_open_for_lface): Handle Vface_font_rescale_alist.
3890
3891 2012-10-23 Chong Yidong <cyd@gnu.org>
3892
3893 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3894
3895 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3896
3897 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3898 for screen font.
3899 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3900
3901 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3902 event (Bug#12681).
3903
3904 2012-10-21 Glenn Morris <rgm@gnu.org>
3905
3906 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3907
3908 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3909
3910 Port to OpenBSD 5.1.
3911 * frame.c (Fmouse_position, Fmouse_pixel_position):
3912 * xdisp.c (produce_stretch_glyph):
3913 Declare local vars only when they're needed.
3914 This is clearer and avoids a warning on OpenBSD about unused vars.
3915 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3916 This is safer, and avoids OpenBSD warnings about unused vars.
3917 * keyboard.c (record_menu_key): Remove unnecessary decl.
3918 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3919 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3920 as our definition clashes with OpenBSD's.
3921 * xfaces.c (load_face_colors, check_lface_attrs)
3922 (get_lface_attributes_no_remap, get_lface_attributes)
3923 (lface_fully_specified_p, x_supports_face_attributes_p)
3924 (tty_supports_face_attributes_p, face_fontset, realize_face)
3925 (realize_x_face, realize_tty_face):
3926 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3927 merely Lisp_Object *. This is more informative and avoids
3928 a warning on OpenBSD about accessing beyond an object's size.
3929
3930 2012-10-20 Chong Yidong <cyd@gnu.org>
3931
3932 * lread.c (Fload): Doc fix (Bug#12592).
3933
3934 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3935
3936 * font.c (Ffont_at): Fix previous change.
3937
3938 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3939
3940 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3941 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3942 for the reasons.
3943
3944 * alloc.c (NSTATICS): Decrease to 0x800.
3945
3946 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3947
3948 * fns.c (Fnreverse): Include the problem element when signaling an
3949 error (bug#12677).
3950
3951 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3952
3953 * nsterm.m (ns_select): Check writefds before call to
3954 FD_ISSET (Bug#12668).
3955
3956 2012-10-18 Daniel Colascione <dancol@dancol.org>
3957
3958 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3959 (staticpro): If we run out of staticpro slots, die with an
3960 informative error instead of just calling emacs_abort.
3961
3962 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3963
3964 Fix two flaws reported by Dmitry Antipov.
3965 * window.c (Ftemp_output_buffer_show): Remove.
3966 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3967 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3968
3969 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3970
3971 * makefile.w32-in ($(BLD)/w32.$(O)):
3972 ($(BLD)/vm-limit.$(O)):
3973 ($(BLD)/term.$(O)):
3974 ($(BLD)/unexw32.$(O)):
3975 ($(BLD)/fileio.$(O)):
3976 ($(BLD)/dispnew.$(O)): Update dependencies.
3977
3978 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3979 Add prototypes.
3980
3981 * w32proc.c: Include ctype.h.
3982
3983 * w32.h (init_environment, check_windows_init_file)
3984 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3985 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3986 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3987 (sys_link): Add prototypes.
3988
3989 * w32.c: Include w32select.h.
3990 (sys_access, e_malloc, sys_select): Add prototypes.
3991 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3992
3993 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3994
3995 * unexw32.c: Include lisp.h and w32.h.
3996
3997 * term.c [WINDOWSNT]: Include w32term.h.
3998
3999 * process.c [WINDOWSNT]: Add prototype of sys_select.
4000
4001 * fileio.c [WINDOWSNT]: Include w32.h.
4002
4003 * dispnew.c [WINDOWSNT]: Include w32.h.
4004
4005 * cygw32.c (Fcygwin_convert_path_to_windows)
4006 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4007 Lisp_Object values. (Bug#12661)
4008
4009 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4010 to Lisp_Object. (Bug#12661)
4011
4012 2012-10-17 Kenichi Handa <handa@gnu.org>
4013
4014 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4015 invalidate.
4016
4017 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4018
4019 * buffer.c (Fkill_buffer): When unchaining the marker,
4020 reset its buffer pointer to NULL (Bug#12652).
4021
4022 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4023
4024 Do not verify indirection counters of killed buffers (Bug#12579).
4025 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4026 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4027
4028 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4029
4030 * alloc.c (Fmake_byte_code): Fix typo in comment.
4031 * print.c (print_interval): Define as static to match prototype.
4032 * indent.c (disptab_matches_widthtab, recompute_width_table):
4033 Convert to eassert.
4034
4035 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 * editfns.c (get_system_name): Remove.
4038 * lisp.h (get_system_name): Remove prototype.
4039 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4040 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4041
4042 2012-10-15 Daniel Colascione <dancol@dancol.org>
4043
4044 * dbusbind.c: Add comment explaining reason for previous change.
4045
4046 2012-10-15 Martin Rudalics <rudalics@gmx.at>
4047
4048 * window.c (Fwindow_end): Rewrite check whether cached position
4049 can be used (Bug#12600).
4050 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4051 Set windows_or_buffers_changed.
4052
4053 2012-10-15 Daniel Colascione <dancol@dancol.org>
4054
4055 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4056 enabled by undefining the symbol "interface", which the platform
4057 headers define to something incompatible.
4058
4059 2012-10-14 Daniel Colascione <dancol@dancol.org>
4060
4061 * image.c (init_tiff_functions, init_imagemagick_functions)
4062 (init_svg_functions): Fix cygw32 build break by using these
4063 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4064
4065 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4066
4067 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4068
4069 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4070
4071 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4072
4073 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4074
4075 * coding.c (detect_coding): Set coding->id before calling
4076 this->detector.
4077
4078 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4079
4080 * fileio.c: Formatting fixes.
4081
4082 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4083
4084 Fix some stat-related races.
4085 * fileio.c (Fwrite_region): Avoid race condition if a file is
4086 removed or renamed by some other process immediately after Emacs
4087 writes it but before Emacs stats it. Do not assume that stat (or
4088 fstat) succeeds.
4089 * image.c (slurp_file): Resolve the file name with fopen + fstat
4090 rather than stat + fopen.
4091 (pbm_read_file) [0]: Remove unused code with stat race.
4092 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4093 Remove ineffective code with stat race.
4094
4095 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4096
4097 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4098
4099 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4100
4101 * nsterm.m (hold_event_q): New static variable.
4102 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4103 ! q_event_ptr.
4104 (hold_event): New function.
4105 (ns_read_socket): If hold_event_q have events, store them and
4106 return (Bug#12384).
4107 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4108 is zero (Bug#12384).
4109
4110 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4111
4112 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4113
4114 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4115
4116 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4117
4118 * fileio.c (check_existing): New function.
4119 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4120 instead of calling 'stat', when what's needed is to check whether
4121 a file exists. This avoids expensive system calls on MS-Windows.
4122 (Bug#12587)
4123
4124 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4125
4126 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4127 determine whether a file exists and is not a directory.
4128
4129 * lisp.h (check_existing): Add prototype.
4130
4131 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4132
4133 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4134
4135 2012-10-12 Glenn Morris <rgm@gnu.org>
4136
4137 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4138
4139 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4140
4141 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4142
4143 * eval.c (Fautoload): Remember previous autoload status in load-history.
4144
4145 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4146
4147 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4148 * lread.c (load_each_byte, new_backquote_flag, readchar)
4149 (read_filtered_event, lisp_file_lexically_bound_p)
4150 (safe_to_load_version, Fload, complete_filename_p, openp)
4151 (build_load_history, readevalloop, read_escape, read1)
4152 (string_to_number, read_vector, read_list):
4153 * macros.c (Fstart_kbd_macro):
4154 * marker.c (CONSIDER):
4155 * menu.c (parse_single_submenu, digest_single_submenu)
4156 (find_and_return_menu_selection, Fx_popup_menu):
4157 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4158 (Ftry_completion):
4159 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4160 (ns_menu_show):
4161 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4162 (xmenu_show, xdialog_show):
4163 Use bool for booleans.
4164 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4165 as it's not a predicate. All uses changed. Omit unnecessary
4166 buffer termination.
4167
4168 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4169
4170 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4171 (save_excursion_restore): Do not restore mark if it was not saved.
4172
4173 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4174
4175 * marker.c (cached_modiff): EMACS_INT, not int.
4176
4177 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4178 instead of having a wrong decl.
4179 * nsmenu.m (waiting_for_input): Remove wrong decl.
4180
4181 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4182
4183 keyboard.c, keymap.c: Use bool for booleans.
4184 * dispnew.c (sit_for): Distinguish between 3-way display_option
4185 and boolean do_display.
4186 * keyboard.c (single_kboard, this_command_key_count_reset)
4187 (waiting_for_input, echoing, immediate_quit, input_pending)
4188 (interrupt_input, interrupts_deferred, pop_kboard)
4189 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4190 (command_loop_1, adjust_point_for_property)
4191 (safe_run_hooks_error, input_polling_used, read_char):
4192 (help_char_p, readable_events, kbd_buffer_events_waiting)
4193 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4194 (lucid_event_type_list_p, get_input_pending):
4195 (gobble_input, menu_separator_name_p, menu_bar_item)
4196 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4197 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4198 (keyremap_step, test_undefined, read_key_sequence)
4199 (detect_input_pending, detect_input_pending_ignore_squeezables)
4200 (detect_input_pending_run_timers, requeued_events_pending_p)
4201 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4202 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4203 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4204 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4205 (accessible_keymaps_1, Fkey_description, push_key_description):
4206 (shadow_lookup, struct where_is_internal_data)
4207 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4208 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4209 (describe_map, describe_vector):
4210 * menu.c (single_menu_item):
4211 * nsmenu.m (ns_update_menubar):
4212 * process.c (wait_reading_process_output):
4213 * search.c (scan_buffer, scan_newline):
4214 Use bool for boolean.
4215 * keyboard.c (timers_run, swallow_events)
4216 (detect_input_pending_run_timers):
4217 * process.c (wait_reading_process_output):
4218 Use unsigned for counter where wraparound-on-overflow is desired,
4219 since unsigned is guaranteed to have that behavior and signed is not.
4220 (read_char): Use ptrdiff_t for string length.
4221 (get_input_pending): Remove first argument, since it was always
4222 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4223 and behave as if it had that value. Return new value of
4224 input_pending. All callers changed.
4225 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4226 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4227 a string length.
4228 * keymap.c (push_key_description): Omit last arg, which was always 1.
4229 All callers changed.
4230
4231 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4232
4233 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4234
4235 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4236 ($(BLD)/term.$(O)): Update dependencies.
4237
4238 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4239
4240 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4241 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4242 initializer for PVEC_NORMAL_VECTOR.
4243
4244 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 Clean out old termopts cruft.
4247 * termopts.h (flow_control, meta_key): Remove unused decls.
4248 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4249 Don't include termopts.h.
4250
4251 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4252
4253 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4254
4255 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4256
4257 * commands.h (immediate_quit): Remove duplicate decl.
4258
4259 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4260
4261 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4262 caching.
4263 (nsfont_open): Remove setting of Vfonts_in_cache.
4264 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4265
4266 2012-10-09 Eli Zaretskii <eliz@gnu.org>
4267
4268 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4269 match what GetLastError returns. Explain why the function is
4270 needed.
4271
4272 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4273 'is_tooltip_frame', to avoid confusion with its global namesake.
4274
4275 2012-10-08 Daniel Colascione <dancol@dancol.org>
4276
4277 * xdisp.c (start_hourglass): Call w32_note_current_window when
4278 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4279 build that caused Emacs to display the hourglass cursor forever.
4280
4281 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4282 which is broken under remote desktop, calculate the number of
4283 colors available for a display based on the display's number of
4284 planes and number of bits per pixel per plane. (bug#10397).
4285
4286 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4287
4288 * nsfont.m (Vfonts_in_cache): New variable.
4289 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4290 are used. Add cached fonts to Vfonts_in_cache.
4291 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4292
4293 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4294
4295 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4296 in nt/config.nt.
4297 (FONT_H): Define after FRAME_H.
4298 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4299 Update dependencies.
4300
4301 * w32term.c: Remove leftover declaration of keyboard_codepage.
4302
4303 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4304
4305 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4306 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4307 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4308 (GLOBAL_SOURCES): Add cygw32.c.
4309 ($(BLD)/unexw32.$(O)):
4310 ($(BLD)/w32.$(O)):
4311 ($(BLD)/w32console.$(O)):
4312 ($(BLD)/w32fns.$(O)):
4313 ($(BLD)/w32heap.$(O)):
4314 ($(BLD)/w32menu.$(O)):
4315 ($(BLD)/w32proc.$(O)): Add w32common.h.
4316
4317 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4318 'const char *'.
4319 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4320
4321 2012-10-08 Daniel Colascione <dancol@dancol.org>
4322
4323 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4324 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4325 accidental message numbering hole. Change other messages to
4326 match.
4327
4328 * w32select.h (HAVE_W32SELECT): Remove.
4329
4330 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4331 w32common.h instead of w32heap.h.
4332
4333 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4334 (get_allocation_unit, get_processor_type, get_w32_major_version)
4335 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4336 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4337 (OS_NT, os_subtype, cache_system_info): Move declarations to
4338 w32common.
4339
4340 * w32heap.c: Include w32common.h.
4341 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4342 (w32_minor_version, w32_build_number, w32_subtype):
4343 Remove duplicate definitions.
4344
4345 * w32fns.c: Include w32common.h; include w32heap.h only in
4346 WINDOWSNT.
4347
4348 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4349 Use `report_file_error' instead of `error' in order to better
4350 inform users of what went wrong. Increase NTGUI_UNICODE file
4351 dialog box file name length to 32k, the maximum allowed by the NT
4352 kernel.
4353
4354 * w32common.h: New file.
4355 (ROUND_UP, ROUND_DOWN, get_page_size)
4356 (get_allocation_unit, get_processor_type, get_w32_major_version)
4357 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4358 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4359 (OS_NT, os_subtype, cache_system_info): Move here.
4360
4361 * unexw32.c, unexcw.c: Include w32common.h.
4362
4363 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4364 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4365 to call syms_of_w32select.
4366
4367 * cygw32.h: Remove obsolete EXFUN declarations.
4368
4369 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4370
4371 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4372 of w32inevt.o from SOME_MACHINE_OBJECTS.
4373
4374 2012-10-08 Daniel Colascione <dancol@dancol.org>
4375
4376 * image.c: Permanent fix for JPEG compilation issue --- limit
4377 jpeglib `boolean' redefinition to Cygwin builds.
4378
4379 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4380
4381 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4382
4383 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4384 Cygwin.
4385
4386 2012-10-08 Daniel Colascione <dancol@dancol.org>
4387
4388 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4389 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4390 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4391 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4392 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4393 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4394 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4395 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4396 now a supported configuration.
4397
4398 * Makefile.in: consolidate image variables into LIBIMAGE; add
4399 W32_OBJ and W32_LIBS. Compile new files.
4400
4401 * conf_post.h:
4402 (_DebPrint) declare tracing facility for W32 debugging. We need
4403 to unify tracing later.
4404
4405 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4406 unconditional use of W32 Unicode functions. Cygwin runs only on
4407 100% Unicode operating systems.
4408
4409 * cygw32.c: New file. Define Cygwin-specific facilities.
4410 (Fcygwin_convert_path_to_windows)
4411 (Fcygwin_convert_path_from_windows): New user functions for
4412 accessing Cygwin path-munging routines.
4413
4414 * cygw32.h: New file.
4415 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4416 UTF-16LE strings temporarily inside non-Lisp-visible string
4417 objects.
4418
4419 (w32_strerror): Just what it says on the tin.
4420
4421 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4422 also run for Cygwin; both systems have the same problem with using
4423 GUI facilities in a forked child. Also call syms_of_cygw32,
4424 syms_of_w32select in correct places.
4425
4426 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4427 needs fork-then-exec for daemon launching.
4428
4429 * font.h: Include frame.h.
4430
4431 * image.c: Use the image library cache machinery only when we're
4432 compiling for native WINDOWSNT; Cygwin can use shared libraries
4433 like any other Unixlike system.
4434
4435 * keyboard.c: Clarify a comment regarding the input loop.
4436
4437 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4438 functions directly instead of trying to detect at runtime that our
4439 host operating system supports them. We make this change for two
4440 reasons: Cygwin lacks support for the multibyte character
4441 conversion functions used by the legacy menu code, and Cygwin
4442 never needs to rely on non-Unicode APIs.
4443
4444 * unexw32.c (hinst): Declare extern.
4445
4446 * w32.c: Change header order;
4447 (w32_strerror): Move to w32fns.c because we need it for
4448 non-WINDOWSNT builds.
4449
4450 * w32.h: Add #error macro to make sure we don't include w32.h for
4451 Cygwin builds. Remove w32select declarations.
4452
4453 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4454 w32fns.c. w32console.c is WINDOWSNT-only.
4455
4456 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4457 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4458 POSIXy alternative.
4459 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4460 (w32_major_version, w32_minor_version, w32_build_number)
4461 (os_subtype, sound_type): Define here
4462 (w32_defined_color): Make color parameter const for consistency
4463 with other _defined_color functions.
4464 (w32_createwindow): Unconditionally call w32_init_class instead of
4465 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4466 through the code is complex and unnecessary because class
4467 registration is practically free.
4468 (w32_name_of_message): New EMACSDEBUG-only function.
4469 (Fset_message_beep): Move here
4470 (Fx_open_connection): Require that the display name for Windows be
4471 "w32" for consistency, emacsclient disambiguation, and maybe, one
4472 day, multi-window-system support.
4473 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4474 Cygwin files for W32 GUI facilities, since these clearly don't
4475 expect Cygwin names.
4476 (_DebPrint): Define.
4477 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4478 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4479 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4480 (w32_last_error): Remove.
4481
4482 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4483
4484 * w32heap.c (syspage_mask): Declare here.
4485 (cache_system_info): Remove.
4486
4487 * w32inevt.c (faked_key): Define globally, not statically.
4488 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4489 (w32_console_toggle_lock_key): Move to w32fns.c.
4490
4491 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4492
4493 * w32proc.c (_DebPrint): Move to w32fns.c.
4494 * w32select.c: Include string.h, stdio.h for Cygwin.
4495 * w32select.h: New File.
4496
4497 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4498 get_osfhandle.
4499 (w32_message_fd): New variable. Under Cygwin, holds the file
4500 descriptor the system used to tell us about pending thread
4501 messages.
4502
4503 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4504 that prevented compilation under non-WINDOWSNT systems.
4505
4506 (w32_initialize): Open /dev/windows and assign it to
4507 w32_message_fd. Provide w32 feature.
4508
4509 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4510 (WM_EMACS_INPUT_READY): add.
4511 (prepend_msg, w32_message_fd): Declare globally.
4512
4513 * w32xfns.c:
4514 (keyboard_handle): Use only when WINDOWSNT.
4515 (notify_msg_ready): New function. Posts a message to the main
4516 thread's message queue under CYGWIN, which wakes up the main
4517 thread from select(2) by making the /dev/windows file descriptor
4518 ready. Under WINDOWSNT, it sets an event the same way the old
4519 code did.
4520
4521 (post, prepend_msg): Actually call notify_msg_ready instead of
4522 setting the input event directly.
4523
4524 2012-10-07 Eli Zaretskii <eliz@gnu.org>
4525
4526 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4527 but it still has blocs in it, don't return it to the system,
4528 instead of aborting. (Bug#12402)
4529
4530 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4531
4532 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4533
4534 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4535 MAC_OS_X_VERSION_10_6.
4536 (syms_of_nsterm): Remove comment about Panther and above for
4537 ns-antialias-text.
4538 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4539 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4540 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4541
4542 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4543 MAC_OS_X_VERSION_10_4.
4544
4545 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4546 MAC_OS_X_VERSION_10_2.
4547
4548 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4549
4550 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4551 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4552
4553 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4554 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4555 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4556 Remove ns_in_resize check.
4557 (ns_clear_frame_area): Remove resize handle code.
4558
4559 * nsfns.m (ns_in_resize): Remove.
4560 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4561 Remove ns_in_resize check.
4562
4563 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4564
4565 Improve sys_siglist detection.
4566 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4567 defined as a macro, as is done in Solaris.
4568 (sys_siglist_entries): New macro.
4569 (save_strsignal): Use it.
4570 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4571 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4572
4573 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4574
4575 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4576 fullscreen/Fullscreen.
4577
4578 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4579 tobar_height is new.
4580
4581 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4582 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4583 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4584 (windowDidResize:): Check for correct window if old style fullscreen.
4585 Capitalize word in comment. Remove incorrect comment.
4586 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4587 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4588 error in drawing background.
4589 (toggleFullScreen:): Remove comment. Rearrange calls.
4590 Set toolbar values to zero, save old height in tobar_height.
4591 Restore tool bar height when leaving fullscreen.
4592 (canBecomeMainWindow): New function.
4593
4594 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4595
4596 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4597
4598 2012-10-05 Eli Zaretskii <eliz@gnu.org>
4599
4600 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4601
4602 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4603 that time stamps of directories could also be changed.
4604 Don't request the too broad GENERIC_WRITE, only the more restrictive
4605 FILE_WRITE_ATTRIBUTES access rights.
4606
4607 * fileio.c (Fset_file_times): Special-case ignoring errors for
4608 directories only on MSDOS, not on MS-Windows.
4609
4610 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
4611
4612 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4613
4614 2012-10-04 Eli Zaretskii <eliz@gnu.org>
4615
4616 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4617 see whether CreateFile failed.
4618
4619 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4622 to avoid similar races.
4623 * keyboard.c (pending_signals): Now bool, not int.
4624
4625 Port timers to OpenBSD, plus check for timer failures.
4626 OpenBSD problem reported by Han Boetes.
4627 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4628 and/or setitimer.
4629 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4630 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4631 like OpenBSD, which has timer_settime but does not declare it.
4632 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4633 whether to use itimerspec-related primitives. All uses of
4634 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4635
4636 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4637
4638 * profiler.c (handle_profiler_signal): Fix a malloc race
4639 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4640
4641 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4642
4643 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4644
4645 2012-10-02 Eli Zaretskii <eliz@gnu.org>
4646
4647 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4648 consistent with the change in return value of 'safe_strsignal'.
4649
4650 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4651
4652 Prefer plain 'static' to 'static inline' (Bug#12541).
4653 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4654 (bidi_set_sor_type, bidi_push_embedding_level)
4655 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4656 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4657 (bidi_cache_search, bidi_cache_ensure_space)
4658 (bidi_cache_iterator_state, bidi_cache_find)
4659 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4660 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4661 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4662 Now 'static', not 'static inline'.
4663
4664 Count overruns when profiling; change units to ns.
4665 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4666 Give extra weight to samples after overruns, to attempt to count
4667 the time more accurately.
4668 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4669 the underlying primitives nominally do ns.
4670 (Fprofiler_cpu_start): Document the change. Mention that
4671 the sampling intervals are only approximate.
4672
4673 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4674
4675 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4676
4677 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4678 case for the special 0 coding-system.
4679
4680 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4681 (Fmake_overlay): Remove redundant tests.
4682 (fix_start_end_in_overlays): Remove redundant recentering.
4683
4684 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
4685
4686 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4687 Update dependencies.
4688
4689 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 Fix a malloc race condition involving strsignal.
4692 A signal can arrive in the middle of a malloc, and Emacs's signal
4693 handler can invoke strsignal, which can invoke malloc, which is
4694 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4695 Fix it by altering the signal handler so that it does not invoke
4696 strsignal.
4697 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4698 * process.c (status_message): Use const pointer, in case strsignal
4699 is #defined to safe_strsignal.
4700 * sysdep.c (sys_siglist, init_signals): Always define and
4701 initialize a substitute sys_siglist if the system does not define
4702 one, even if HAVE_STRSIGNAL.
4703 (safe_strsignal): Rename from strsignal. Always define,
4704 using sys_siglist. Return a const pointer.
4705 * syssignal.h (safe_strsignal): New decl.
4706 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4707
4708 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4709
4710 * w32proc.c (timer_loop): Fix code that waits for timer
4711 expiration, to avoid high CPU usage.
4712
4713 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4714
4715 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4716 (sweep_weak_table): Remove redundant prototypes.
4717
4718 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4719
4720 * emacs.c: Move the inclusion of TERM_HEADER after including
4721 windows.h on WINDOWSNT. This avoids compilation problems with
4722 MSVC.
4723
4724 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4725
4726 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4727 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4728 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4729 as the previous version used 'void *'.
4730
4731 * ralloc.c (ROUNDUP): Fix last change.
4732 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4733 'size_t'.
4734
4735 * w32proc.c <disable_itimers>: New static flag.
4736 (init_timers): Initialize it to zero, after creating the critical
4737 sections used by the timer threads.
4738 (term_timers): Set to 1 before deleting the critical sections.
4739 (getitimer, setitimer): If disable_itimers is non-zero, return an
4740 error indication without doing anything. Reported by Fabrice
4741 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4742 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4743 return results.
4744 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4745 support timers.
4746
4747 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4748 term_ntproc after all the other bookkeeping, to get timers working
4749 as long as possible.
4750
4751 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4752
4753 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4754 Suggested by Juri Linkov in
4755 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4756
4757 Prefer plain 'static' to 'static inline' (Bug#12541).
4758 With static functions, modern compilers inline pretty well by
4759 themselves; advice from programmers often hurts as much as it helps.
4760 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4761 this change shrinks the text size of the Emacs executable by 1.1%
4762 without affecting CPU significantly in my benchmark.
4763 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4764 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4765 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4766 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4767 (bset_auto_fill_function, bset_auto_save_file_format)
4768 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4769 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4770 (bset_cache_long_line_scans, bset_case_fold_search)
4771 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4772 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4773 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4774 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4775 (bset_header_line_format, bset_indicate_buffer_boundaries)
4776 (bset_indicate_empty_lines, bset_invisibility_spec)
4777 (bset_left_fringe_width, bset_major_mode, bset_mark)
4778 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4779 (bset_name, bset_overwrite_mode, bset_pt_marker)
4780 (bset_right_fringe_width, bset_save_length)
4781 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4782 (bset_scroll_up_aggressively, bset_selective_display)
4783 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4784 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4785 (set_buffer_overlays_after):
4786 * category.c (bset_category_table):
4787 * charset.c (read_hex):
4788 * coding.c (produce_composition, produce_charset)
4789 (handle_composition_annotation, handle_charset_annotation)
4790 (char_encodable_p):
4791 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4792 (assign_row, set_frame_matrix_frame, make_current)
4793 (add_row_entry):
4794 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4795 * fns.c (maybe_resize_hash_table):
4796 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4797 * gmalloc.c (register_heapinfo):
4798 * image.c (lookup_image_type):
4799 * intervals.c (set_interval_object, set_interval_left)
4800 (set_interval_right, copy_interval_parent, rotate_right)
4801 (rotate_left, balance_possible_root_interval):
4802 * keyboard.c (kset_echo_string, kset_kbd_queue)
4803 (kset_keyboard_translate_table, kset_last_prefix_arg)
4804 (kset_last_repeatable_command, kset_local_function_key_map)
4805 (kset_overriding_terminal_local_map, kset_real_last_command)
4806 (kset_system_key_syms, clear_event, set_prop):
4807 * lread.c (digit_to_number):
4808 * marker.c (attach_marker, live_buffer, set_marker_internal):
4809 * nsterm.m (ns_compute_glyph_string_overhangs):
4810 * process.c (pset_buffer, pset_command)
4811 (pset_decode_coding_system, pset_decoding_buf)
4812 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4813 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4814 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4815 * syntax.c (bset_syntax_table, dec_bytepos):
4816 * terminal.c (tset_param_alist):
4817 * textprop.c (interval_has_some_properties)
4818 (interval_has_some_properties_list):
4819 * window.c (wset_combination_limit, wset_dedicated)
4820 (wset_display_table, wset_hchild, wset_left_fringe_width)
4821 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4822 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4823 (wset_right_fringe_width, wset_right_margin_cols)
4824 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4825 (wset_vertical_scroll_bar_type, wset_window_parameters):
4826 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4827 (wset_column_number_displayed, wset_region_showing)
4828 (window_box_edges, run_window_scroll_functions)
4829 (append_glyph_string_lists, prepend_glyph_string_lists)
4830 (append_glyph_string, set_glyph_string_background_width)
4831 (append_glyph, append_composite_glyph)
4832 (take_vertical_position_into_account):
4833 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4834 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4835 (lface_hash, lface_same_font_attributes_p, lookup_face):
4836 * xml.c (libxml2_loaded_p):
4837 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4838 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4839 Now 'static', not 'static inline'.
4840
4841 * bidi.c: Tune.
4842 (bidi_copy_it): Do the whole copy with a single memcpy.
4843 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4844
4845 Revert the FOLLOW-SYMLINKS change for file-attributes.
4846 Doing it right would require several changes to Tramp, and there's
4847 not enough time to get that tested before the freeze today.
4848 * dired.c (directory_files_internal, Ffile_attributes):
4849 Undo last change.
4850
4851 * frame.c (x_report_frame_params): Port better to wider ints.
4852 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4853 or that pointers can be printed in 15 decimal digits.
4854 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4855
4856 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4857
4858 Support x64 build on MS-Windows.
4859 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4860 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4861 compatibility with x64.
4862 (x_get_focus_frame): Add prototype.
4863
4864 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4865 defining an XRectangle structure.
4866
4867 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4868 arithmetics for compatibility with x64.
4869
4870 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4871 compatibility with x64.
4872
4873 * w32heap.h: Adjust prototypes and declarations.
4874
4875 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4876 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4877 DWORD, long, and unsigned long, for compatibility with x64.
4878 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4879 (sbrk): Argument is now of type ptrdiff_t.
4880
4881 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4882 less than 0x0500.
4883 (w32_msg_pump): Use WPARAM type for 'result'.
4884
4885 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4886 architecture.
4887 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4888 compatibility with x64.
4889
4890 * vm-limit.c (lim_data): Now size_t.
4891 (check_memory_limits): Adjust prototypes of real_morecore and
4892 __morecore to receive argument of type ptrdiff_t. Use size_t for
4893 five_percent and data_size.
4894
4895 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4896 variables, for compatibility with x64.
4897 (rva_to_section, offset_to_section, relocate_offset)
4898 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4899 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4900 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4901 for compatibility with x64.
4902
4903 * sysdep.c (STDERR_FILENO): Define if not already defined.
4904
4905 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4906 (__morecore): Argument type is now ptrdiff_t.
4907 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4908 (relinquish): Use ptrdiff_t type for 'excess'.
4909 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4910
4911 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4912 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4913 instead of a literal number.
4914
4915 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4916 (min): Define only if not already defined.
4917
4918 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4919 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4920 hosts.
4921
4922 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4923 'bitmaps' is a pointer.
4924
4925 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4926
4927 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4928
4929 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4930
4931 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4932 * dired.c (directory_files_internal, Ffile_attributes):
4933 New arg follow_symlinks. All uses changed.
4934
4935 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4936
4937 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4938
4939 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4940
4941 Support atimers and CPU profiler via profile.c on MS-Windows.
4942 * w32proc.c (sig_mask, crit_sig): New static variables.
4943 (sys_signal): Support SIGALRM and SIGPROF.
4944 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4945 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4946 sigfillset, and sigprocmask are no longer no-ops.
4947 (sigismember): New function.
4948 (struct itimer_data): New definition.
4949 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4950 (crit_prof): New static variables.
4951 (MAX_SINGLE_SLEEP): New definition.
4952 (timer_loop, stop_timer_thread, term_timers, init_timers)
4953 (start_timer_thread, getitimer, setitimer): New functions.
4954 (alarm): No longer a no-op, calls setitimer.
4955
4956 * w32.c (term_ntproc): Call term_timers.
4957 (init_ntproc): Make sure all signals are unblocked at startup, to
4958 erase any traces of dumping. Call init_timers.
4959
4960 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4961 Windows-specific code to display the hourglass mouse pointer is no
4962 longer used.
4963 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4964 to hourglass timer expiration.
4965 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4966 Remove, no longer used.
4967 (w32_note_current_window, show_hourglass, hide_hourglass):
4968 New functions, in support of hourglass cursor display similar to other
4969 window systems.
4970 (syms_of_w32fns): Don't initialize hourglass_timer.
4971
4972 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4973 WINDOWSNT as well.
4974 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4975
4976 * w32.h (init_timers, term_timers): Add prototypes.
4977
4978 2012-09-30 Kenichi Handa <handa@gnu.org>
4979
4980 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4981 to the buffer relocation which may be caused by ccl_driver.
4982
4983 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4984
4985 * xfns.c (Fx_file_dialog): Update comment.
4986
4987 * w32fns.c (Fx_file_dialog): Update comment.
4988
4989 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4990 Initialize panel name field if OSX >= 10.6.
4991
4992 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4993
4994 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4995
4996 * nsterm.m (NEW_STYLE_FS): New define.
4997 (ns_fullscreen_hook, windowWillEnterFullScreen)
4998 (windowDidEnterFullScreen, windowWillExitFullScreen)
4999 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5000 (setFSValue): New functions.
5001 (EmacsFSWindow): New implementation.
5002 (canBecomeKeyWindow): New function for EmacsFSWindow.
5003 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5004 (dealloc): Release nonfs_window if in fullscreen.
5005 (updateFrameSize:): Call windowDidMove to update top/left.
5006 (windowWillResize:toSize:): Check if frame is still maximized.
5007 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5008 next_maximized, maximized_width, maximized_height and nonfs_window.
5009 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5010 tbar_height.
5011 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5012 fullscreen. Set maximized_width/height. Act on next_maximized.
5013
5014 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5015 (EmacsView): Add variables for fullscreen.
5016 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5017 (EmacsFSWindow): New interface for fullscreen.
5018
5019 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5020
5021 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5022
5023 2012-09-30 Chong Yidong <cyd@gnu.org>
5024
5025 * fns.c (Frandom): Doc fix.
5026
5027 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5028
5029 * window.c (Vwindow_combination_limit): New default value.
5030 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5031
5032 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5033
5034 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5035 Suggested by Eli Zaretskii in
5036 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5037
5038 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5039
5040 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5041 HAVE_TIMER_SETTIME is defined.
5042
5043 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5044
5045 Profiler improvements: more-accurate timers, overflow checks.
5046 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5047 signal.h, setjmp.h. Include systime.h instead.
5048 (saturated_add): New function.
5049 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5050 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5051 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5052 New static vars.
5053 (enum profiler_cpu_running): New enum.
5054 (profiler_cpu_running): Now of that enum type, not bool.
5055 All uses changed to store the new value.
5056 (handle_profiler_signal): Rename from sigprof_handler_1,
5057 for consistency with other handlers. Do not check whether
5058 cpu_log is a hash-table if garbage collecting, since it
5059 doesn't matter in that case.
5060 (deliver_profiler_signal): Rename from sigprof_handler,
5061 for consistency with other handlers.
5062 (setup_cpu_timer): New function, with much of what used to be in
5063 Fprofiler_cpu_start. Check for out-of-range argument.
5064 Prefer timer_settime if available, and prefer
5065 thread cputime clocks, then process cputime clocks, then
5066 monotonic clocks, to the old realtime clock. Use make_timeval
5067 to round more-correctly when falling back to setitimer.
5068 (Fprofiler_cpu_start): Use it.
5069 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5070 Don't assume that passing NULL as the 2nd argument of setitimer
5071 is the same as passing a pointer to all-zero storage.
5072 Ignore SIGPROF afterwards.
5073 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5074 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5075 non-fatal signal handlers. Ignore SIGPROF on startup.
5076 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5077 in profiler.c, since sysdep.c now uses it.
5078
5079 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5080 Suggested by Eli Zaretskii in
5081 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5082
5083 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5084
5085 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5086
5087 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5088
5089 * lisp.h (struct backtrace): Remove indirection for `function' field.
5090 * xdisp.c (redisplay_internal):
5091 * profiler.c (record_backtrace, sigprof_handler_1):
5092 * alloc.c (Fgarbage_collect):
5093 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5094 (Fbacktrace_frame): Adjust accordingly.
5095
5096 2012-09-28 Glenn Morris <rgm@gnu.org>
5097
5098 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5099 (Frun_hook_with_args_until_failure): Doc fixes.
5100
5101 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5102
5103 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5104 Qautomatic_redisplay and change the symbol name. All users changed.
5105
5106 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5107
5108 * profiler.c (sigprof_handler): Fix race condition.
5109
5110 2012-09-28 Glenn Morris <rgm@gnu.org>
5111
5112 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5113
5114 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5115
5116 Check more robustly for timer_settime.
5117 * Makefile.in (LIB_TIMER_TIME): New macro.
5118 (LIBES): Add it.
5119 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5120 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5121 call timer_settime.
5122
5123 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5124
5125 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5126
5127 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5128
5129 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5130
5131 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * character.h (MAYBE_UNIFY_CHAR): Remove.
5134 * charset.c, charset.h (maybe_unify_char): Now static.
5135 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5136 Since this stuff is now private to charset.c, there's no need for
5137 a public macro and no need to inline by hand.
5138
5139 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5140 Stefan Monnier <monnier@iro.umontreal.ca>
5141 Juanma Barranquero <lekktu@gmail.com>
5142
5143 * profiler.c: New file.
5144 * Makefile.in (base_obj): Add profiler.o.
5145 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5146 ($(BLD)/profiler.$(O)): New target.
5147 * emacs.c (main): Call syms_of_profiler.
5148 * alloc.c (Qautomatic_gc): New constant.
5149 (MALLOC_PROBE): New macro.
5150 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5151 (total_bytes_of_live_objects): New function.
5152 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5153 Call malloc_probe for the memory profiler.
5154 (syms_of_alloc): Define Qautomatic_gc.
5155 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5156 race condition.
5157 (struct backtrace): Move definition...
5158 * lisp.h (struct backtrace): ..here.
5159 (Qautomatic_gc, profiler_memory_running): Declare vars.
5160 (malloc_probe, syms_of_profiler): Declare functions.
5161 * xdisp.c (Qautomatic_redisplay): New constant.
5162 (redisplay_internal): Record itself in backtrace_list.
5163 (syms_of_xdisp): Define Qautomatic_redisplay.
5164
5165 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5166 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5167
5168 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5169
5170 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5171
5172 Prefer POSIX timers if available.
5173 They avoid a race if the timer is too close to the current time.
5174 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5175 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5176 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5177
5178 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5179
5180 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5181 CHAR_STRING_ADVANCE.
5182 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5183 STRING_CHAR_ADVANCE.
5184
5185 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5186
5187 Move Vlibrary_cache to emacs.c and reset before dumping.
5188
5189 * lisp.h (reset_image_types): Declare.
5190 [WINDOWSNT] (Vlibrary_cache): Declare.
5191
5192 * image.c (reset_image_types): New function.
5193
5194 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5195 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5196 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5197
5198 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5199 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5200
5201 * w32.h (Vlibrary_cache): Do not declare.
5202
5203 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5204
5205 * w32proc.c (sys_signal): Handle all signals defined by the
5206 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5207 handlers for signals supported by Windows. Don't override
5208 term_ntproc as the handler for SIGABRT.
5209 (sigaction): Rewrite to call sys_signal instead of duplicating its
5210 code.
5211 (sys_kill): Improve commentary.
5212
5213 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5214 consistency with a signature of a signal handler. All callers
5215 changed.
5216 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5217 install term_ntproc as a signal handler for SIGABRT, as that
5218 should be done by the dumped Emacs.
5219
5220 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5221
5222 * w32select.c (term_w32select): Protect against repeated
5223 invocation by setting clipboard_owner to NULL after calling
5224 DestroyWindow.
5225
5226 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5227 and term_ntproc to their modified signatures.
5228
5229 * character.c (char_string, string_char): Remove calls to
5230 MAYBE_UNIFY_CHAR. See the discussion starting at
5231 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5232 for the details.
5233
5234 2012-09-25 Chong Yidong <cyd@gnu.org>
5235
5236 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5237
5238 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5239
5240 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5241 when encountering an unknown bytecode.
5242
5243 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5244
5245 image.c, indent.c: Use bool for booleans.
5246 * dispextern.h (struct image_type): Members valid_p, load, init
5247 now return bool, not int. All uses changed.
5248 * image.c: Omit unnecessary static decls.
5249 (x_create_bitmap_mask, x_build_heuristic_mask):
5250 Return void, not int, since callers don't care about the return value.
5251 (x_create_bitmap_mask, define_image_type, valid_image_p)
5252 (struct image_keyword, parse_image_spec, image_spec_value)
5253 (check_image_size, image_background)
5254 (image_background_transparent, x_clear_image_1)
5255 (postprocess_image, lookup_image, x_check_image_size)
5256 (x_create_x_image_and_pixmap, xbm_image_p)
5257 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5258 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5259 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5260 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5261 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5262 (png_image_p, init_png_functions, png_load_body, png_load)
5263 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5264 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5265 (init_gif_functions, gif_load, imagemagick_image_p)
5266 (imagemagick_load_image, imagemagick_load, svg_image_p)
5267 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5268 (gs_load):
5269 * nsimage.m (ns_load_image):
5270 * nsterm.m (ns_defined_color):
5271 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5272 * xfns.c (x_defined_color):
5273 * xterm.c (x_alloc_lighter_color_for_widget)
5274 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5275 (x_alloc_lighter_color):
5276 * indent.c (disptab_matches_widthtab, current_column)
5277 (scan_for_column, string_display_width, indented_beyond_p)
5278 (compute_motion, vmotion, Fvertical_motion):
5279 Use bool for booleans.
5280
5281 2012-09-24 Chong Yidong <cyd@gnu.org>
5282
5283 * chartab.c (Fset_char_table_default): Obsolete function removed.
5284
5285 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5286
5287 Move pid_t related decls out of lisp.h.
5288 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5289 (interruptible_wait_for_termination):
5290 Move these decls from lisp.h to syswait.h, since they use pid_t.
5291 Needed on FreeBSD; see Herbert J. Skuhra in
5292 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5293 * callproc.c: Include syswait.h.
5294
5295 gnutls.c, gtkutil.c: Use bool for boolean.
5296 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5297 (emacs_gnutls_handle_error):
5298 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5299 (xg_hide_tooltip, xg_create_frame_widgets)
5300 (create_dialog, xg_uses_old_file_dialog)
5301 (xg_get_file_with_chooser, xg_get_file_with_selection)
5302 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5303 (xg_item_label_same_p, xg_update_menubar)
5304 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5305 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5306 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5307 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5308 (update_frame_tool_bar, free_frame_tool_bar):
5309 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5310 * nsmenu.m (ns_update_menubar):
5311 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5312 * xfns.c (Fx_show_tip) [USE_GTK]:
5313 Use bool for boolean.
5314 * gtkutil.c (xg_update_frame_menubar):
5315 * xmenu.c (update_frame_menubar):
5316 Return void, not int, since caller ignores return value.
5317 * gtkutil.c (xg_change_toolbar_position):
5318 Return void, not 1.
5319
5320 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5321
5322 * makefile.w32-in (BLOCKINPUT_H): Remove.
5323 (SYSSIGNAL_H): New macro.
5324 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5325 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5326 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5327 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5328 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5329 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5330 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5331 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5332 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5333 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5334 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5335 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5336 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5337 ($(BLD)/w32xfns.$(O)): Update dependencies.
5338
5339 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5340
5341 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5342 fatal_error_backtrace.
5343
5344 * w32proc.c (sys_kill): Undo last change: don't do anything when
5345 invoked to deliver SIGABRT to our own process. This is now
5346 handled by emacs_raise.
5347
5348 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5349
5350 * w32term.c (w32_read_socket): Remove leftover reference to
5351 interrupt_input_pending.
5352
5353 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5354
5355 Do not use SA_NODEFER.
5356 Problem reported by Dani Moncayo in
5357 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5358 * alloc.c (die):
5359 * sysdep.c (emacs_abort): Do not reset signal handler.
5360 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5361 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5362 wanted even on POSIXish hosts, and it doesn't work on Windows.
5363
5364 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5365
5366 * xterm.c (x_term_init): Call fixup_locale before and after calling
5367 gtk_init (Bug#12392).
5368
5369 2012-09-23 Chong Yidong <cyd@gnu.org>
5370
5371 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5372 Vdynamic_library_alist.
5373
5374 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5375 (Fgnutls_available_p): Caller changed.
5376
5377 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5378 (Flibxml_parse_xml_region): Likewise.
5379
5380 * dispextern.h (struct image_type): Remove arg from init function.
5381
5382 * image.c (Finit_image_library, lookup_image_type)
5383 (define_image_type): Remove now-unneeded second arg.
5384 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5385 (init_tiff_functions, init_gif_functions, init_svg_functions):
5386 Arglist and w32_delayed_load calling convention changed.
5387 (gs_type): Remove init_gs_functions; there is no such function.
5388 (valid_image_p, make_image): Fix caller to lookup_image_type.
5389
5390 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5391
5392 Simplify and avoid signal-handling races (Bug#12471).
5393 * alloc.c (die):
5394 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5395 Avoid recursive loop if there's a fatal error in the function itself.
5396 * atimer.c (pending_atimers):
5397 * blockinput.h: Don't include "atimer.h"; no longer needed.
5398 (interrupt_input_pending): Remove. All uses removed.
5399 pending_signals now counts both atimers and ordinary interrupts.
5400 This is less racy than having three separate pending-signal flags.
5401 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5402 (input_blocked_p):
5403 Rename from their upper-case counterparts BLOCK_INPUT,
5404 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5405 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5406 This makes it easier to access volatile variables more accurately.
5407 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5408 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5409 that's more reliable if the code is buggy and sets
5410 interrupt_input_blocked to a negative value. All uses changed.
5411 * atimer.c (deliver_alarm_signal):
5412 Remove. No need to deliver this to the parent; any thread can
5413 handle this signal now. All uses replaced by underlying handler.
5414 * atimer.c (turn_on_atimers):
5415 * dispnew.c (handle_window_change_signal):
5416 * emacs.c (handle_danger_signal):
5417 * keyboard.c (kbd_buffer_get_event):
5418 Don't reestablish signal handler; not needed with sigaction.
5419 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5420 (UNBLOCK_INPUT_TO):
5421 Rework to avoid unnecessary accesses to volatile variables.
5422 (UNBLOCK_INPUT_TO): Now a function.
5423 (totally_unblock_input, unblock_input): New decls.
5424 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5425 (init_data): Remove. Necessary stuff now done in init_signal.
5426 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5427 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5428 (fatal_error_code): Remove; no longer needed.
5429 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5430 it doesn't always backtrace. All uses changed. No need to reset
5431 signal to default, since sigaction and/or die does that for us now.
5432 Use emacs_raise (FOO), not kill (getpid (), FOO).
5433 (main): Check more-accurately whether we're dumping.
5434 Move fatal-error setup to sysdep.c
5435 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5436 * gtkutil.c (xg_get_file_name, xg_get_font):
5437 Remove no-longer-needed signal-mask manipulation.
5438 * keyboard.c, process.c (POLL_FOR_INPUT):
5439 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5440 * keyboard.c (read_avail_input): Remove.
5441 All uses replaced by gobble_input.
5442 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5443 (kbd_buffer_store_event_hold, gobble_input):
5444 (record_asynch_buffer_change) [USABLE_SIGIO]:
5445 (store_user_signal_events):
5446 No need to mess with signal mask.
5447 (gobble_input): If blocking input and there are terminals, simply
5448 set pending_signals to 1 and return. All hooks changed to not
5449 worry about whether input is blocked.
5450 (process_pending_signals): Clear pending_signals before processing
5451 them, in case a signal comes in while we're processing.
5452 By convention callers now test pending_signals before calling us.
5453 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5454 New functions, to support changes to blockinput.h.
5455 (handle_input_available_signal): Now extern.
5456 (reinvoke_input_signal): Remove. All uses replaced by
5457 handle_async_input.
5458 (quit_count): Now volatile, since a signal handler uses it.
5459 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5460 All callers changed. Block SIGINT only if not already blocked.
5461 Clear sigmask reliably, even if Fsignal returns, which it can.
5462 Omit unnecessary accesses to volatile var.
5463 (quit_throw_to_read_char): No need to restore sigmask.
5464 * keyboard.c (gobble_input, handle_user_signal):
5465 * process.c (wait_reading_process_output):
5466 Call signal-handling code rather than killing ourselves.
5467 * lisp.h: Include <float.h>, for...
5468 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5469 (pending_signals): Now volatile.
5470 (syms_of_data): Now const if IEEE floating point.
5471 (handle_input_available_signal) [USABLE_SIGIO]:
5472 (terminate_due_to_signal, record_child_status_change): New decls.
5473 * process.c (create_process): Avoid disaster if memory is exhausted
5474 while we're processing a vfork, by tightening the critical section
5475 around the vfork.
5476 (send_process_frame, process_sent_to, handle_pipe_signal)
5477 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5478 ignores SIGPIPE.
5479 (send_process): No need for setjmp/longjmp any more, since the
5480 SIGPIPE stuff is now gone. Instead, report an error if errno
5481 is EPIPE.
5482 (record_child_status_change): Now extern. PID and W are now args.
5483 Return void, not bool. All callers changed.
5484 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5485 Remove. All uses removed. This bug should be fixed now in a
5486 different way.
5487 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5488 and record the child status change directly. This avoids the
5489 need to futz with the signal mask.
5490 (process_fatal_action): Move here from emacs.c.
5491 (emacs_sigaction_flags): New function, containing
5492 much of what used to be in emacs_sigaction_init.
5493 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5494 caught by emacs, to make races less likely.
5495 (deliver_process_signal): Rename from handle_on_main_thread.
5496 All uses changed.
5497 (BACKTRACE_LIMIT_MAX): Now at top level.
5498 (thread_backtrace_buffer, threadback_backtrace_pointers):
5499 New static vars.
5500 (deliver_thread_signal, deliver_fatal_thread_signal):
5501 New functions, for more-accurate delivery of thread-specific signals.
5502 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5503 (deliver_arith_signal): Handle in this thread, not
5504 in the main thread, since it's triggered by this thread.
5505 (maybe_fatal_sig): New function.
5506 (init_signals): New arg DUMPING so that we can be more accurate
5507 about whether we're dumping. Caller changed.
5508 Treat thread-specific signals differently from process-general signals.
5509 Block all signals while handling fatal error; that's safer.
5510 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5511 on IEEE hosts.
5512 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5513 Ignore SIGPIPE unless batch.
5514 (emacs_backtrace): Output backtrace for the appropriate thread,
5515 which is not necessarily the main thread.
5516 * syssignal.h: Include <stdbool.h>.
5517 (emacs_raise): New macro.
5518 * xterm.c (x_connection_signal): Remove; no longer needed
5519 now that we use sigaction.
5520 (x_connection_closed): No need to mess with sigmask now.
5521 (x_initialize): No need to reset SIGPIPE handler here, since
5522 init_signals does this for us now.
5523
5524 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5525
5526 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5527 background rect may be larger (Bug#12245).
5528
5529 2012-09-23 Chong Yidong <cyd@gnu.org>
5530
5531 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5532
5533 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5534
5535 * .gdbinit: Just stop at fatal_error_backtrace.
5536 See Stefan Monnier's request in
5537 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5538 Remove no-longer-used query of system type.
5539
5540 2012-09-22 Chong Yidong <cyd@gnu.org>
5541
5542 * search.c (Freplace_match): Doc fix (Bug#12325).
5543
5544 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5545
5546 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5547 (Fline_end_position): Doc fix.
5548
5549 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5550
5551 2012-09-22 Chong Yidong <cyd@gnu.org>
5552
5553 * dispextern.h (struct image_type): Add new slot, storing a type
5554 initialization function.
5555
5556 * image.c (define_image_type): Call the image initializer function
5557 if it is defined. Arguments and return value changed.
5558 (valid_image_p, make_image): Callers changed.
5559 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5560 (gif_type, imagemagick_type, svg_type, gs_type):
5561 Add initialization functions.
5562 (Finit_image_library): Call lookup_image_type.
5563 (CHECK_LIB_AVAILABLE): Macro deleted.
5564 (lookup_image_type): Call define_image_type here, rather than via
5565 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5566 (syms_of_image): Move define_image_type calls for xbm_type and
5567 pbm_type to lookup_image_type.
5568
5569 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5570
5571 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5572 'idle_timers' from here ...
5573 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5574 lists, to avoid infloops when the timer does something stupid,
5575 like reinvoke itself with the same or smaller time-out.
5576 (Bug#12447)
5577
5578 2012-09-22 Martin Rudalics <rudalics@gmx.at>
5579
5580 * window.c (Fsplit_window_internal): Handle only Qt value of
5581 Vwindow_combination_limit separately.
5582 (Qtemp_buffer_resize): New symbol.
5583 (Vwindow_combination_limit): New default value.
5584 Rewrite doc-string.
5585
5586 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5587
5588 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5589 the new overlay string. (Bug#10159)
5590
5591 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5592
5593 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5594 or that fprintf is async-signal-safe. POSIX doesn't require
5595 either assumption.
5596
5597 2012-09-22 Chong Yidong <cyd@gnu.org>
5598
5599 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5600 (Bug#8207).
5601
5602 2012-09-22 Kenichi Handa <handa@gnu.org>
5603
5604 * composite.c (composition_reseat_it): Handle the case that a
5605 grapheme cluster is not covered by a single font (Bug#12352).
5606
5607 2012-09-21 Chong Yidong <cyd@gnu.org>
5608
5609 * image.c (define_image_type): Avoid adding duplicate types to
5610 image_types (Bug#12463). Suggested by Jörg Walter.
5611
5612 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5613
5614 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5615 (print_load_command_name): Add case LC_DATA_IN_CODE.
5616 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5617
5618 2012-09-21 Glenn Morris <rgm@gnu.org>
5619
5620 * eval.c (Frun_hook_with_args_until_success)
5621 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5622
5623 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
5624
5625 * fileio.c (Ffile_selinux_context): Only call freecon when
5626 lgetfilecon succeeded.
5627 (Fset_file_selinux_context): Likewise. (Bug#12444)
5628
5629 2012-09-21 Eli Zaretskii <eliz@gnu.org>
5630
5631 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5632 reordering, locate the cursor by calling set_cursor_from_row; if
5633 that fails, clear the desired glyph matrix before returning a
5634 failure indication to the caller. Fixes leaving garbled display
5635 when fast scrolling with a down-key. (Bug#12403)
5636 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5637 scrolling through multibyte text.
5638
5639 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5640
5641 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5642 calling mark_vectorlike since that's the one that marks the window.
5643 (mark_discard_killed_buffers): Mark the final cdr.
5644 * window.h (struct window): Move prev/next_buffers to the
5645 non-standard fields.
5646 * window.c (make_window): Initialize prev/next_buffers manually.
5647
5648 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5649
5650 Omit unused arg EXPECTED from socket hooks.
5651 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5652 * nsterm.m (ns_term_init):
5653 * termhooks.h (struct terminal.read_socket_hook):
5654 * w32inevt.c (w32_console_read_socket):
5655 * w32term.c (w32_read_socket):
5656 * xterm.c (XTread_socket):
5657 Omit unused arg EXPECTED. All callers changed.
5658 (store_user_signal_events): Return void, not int, since callers no
5659 longer care about the return value. All uses changed.
5660
5661 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
5662
5663 * w32gui.h (XParseGeometry): Do not declare.
5664
5665 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5666
5667 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5668 Ignore 'expected'. See Eli Zaretskii in
5669 <http://bugs.gnu.org/12471#8> (last line).
5670
5671 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5672 (XParseGeometry): Now static. Substitute extremal values for
5673 values that are out of range.
5674
5675 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5676
5677 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5678
5679 * nsfns.m (XParseGeometry): Remove.
5680 (Fx_create_frame): Call x_set_offset to correctly interpret
5681 top_pos in geometry.
5682
5683 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5684 (Fx_parse_geometry): If there is a space in string, call
5685 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5686
5687 2012-09-17 Eli Zaretskii <eliz@gnu.org>
5688
5689 * search.c (scan_buffer): Use character positions in calls to
5690 region_cache_forward and region_cache_backward, not byte
5691 positions. (Bug#12196)
5692
5693 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5694 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5695
5696 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5697 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5698 emacs_blocked_malloc, now deleted.
5699
5700 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5703 The workaround was for improving performance on Solaris 2.4, but
5704 is getting in the way now. Emacs will still work if someone is
5705 still running Solaris 2.4 in a museum somewhere; Sun dropped
5706 support for Solaris 2.4 in 2003.
5707 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5708 * process.c (create_process) [HAVE_WORKING_VFORK]:
5709 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5710 since Emacs no longer uses vfork on that platform.
5711
5712 2012-09-17 Glenn Morris <rgm@gnu.org>
5713
5714 * emacs.c: Use COPYRIGHT.
5715
5716 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5717
5718 Remove configure's --without-sync-input option (Bug#12450).
5719 When auditing signal-handling in preparation for cleaning it up,
5720 I found that SYNC_INPUT has race conditions and would be a real
5721 pain to fix. Since it's an undocumented and deprecated
5722 configure-time option, now seems like a good time to remove it.
5723 Also see <http://bugs.gnu.org/11080#16>.
5724 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5725 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5726 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5727 (malloc_hysteresis):
5728 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5729 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5730 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5731 (dont_register_blocks, bytes_used_when_reconsidered)
5732 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5733 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5734 [!SYSTEM_MALLOC && !SYNC_INPUT]:
5735 Remove. All uses removed.
5736 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5737 implementation, one that depends on whether the new macro
5738 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5739 is defined.
5740 * atimer.c (run_timers, handle_alarm_signal):
5741 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5742 (handle_async_input, process_pending_signals)
5743 (handle_input_available_signal, init_keyboard):
5744 * nsterm.m (ns_read_socket):
5745 * process.c (wait_reading_process_output):
5746 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5747 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5748 (emacs_write):
5749 * xterm.c (XTread_socket):
5750 Assume SYNC_INPUT.
5751 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5752 * eval.c (handling_signal): Remove. All uses removed.
5753 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5754 All uses replaced with the SYNC_INPUT version.
5755 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5756 Remove decls.
5757 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5758 Now static.
5759
5760 * font.c (Ffont_shape_gstring): Remove unused local.
5761
5762 2012-09-16 Glenn Morris <rgm@gnu.org>
5763
5764 * Makefile.in (clean): No longer run nextstep's clean.
5765
5766 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5767 (ns_frag): Remove.
5768 (ns-app): Move here from ns.mk, and simplify.
5769 (clean): Simplify nextstep entry.
5770 * ns.mk: Remove file.
5771
5772 2012-09-17 Kenichi Handa <handa@gnu.org>
5773
5774 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5775 not covert the last few charactes.
5776
5777 2012-09-16 Kenichi Handa <handa@gnu.org>
5778
5779 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5780 here, but just check the validity of glyphs in the glyph-string.
5781
5782 2012-09-16 Martin Rudalics <rudalics@gmx.at>
5783
5784 * window.c (Fwindow_parameter, Fset_window_parameter):
5785 Accept any window as argument (Bug#12452).
5786
5787 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5788
5789 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5790 to ns_term_init to avoid memory leak.
5791
5792 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5793 explicit retain/release.
5794 (ns_term_init): Only allow one display. Initialize outerpool and
5795 ns_*_types.
5796
5797 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5798
5799 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5800 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5801 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5802 the Microsoft problem in a different way, by altering ../nt/config.nt.
5803
5804 2012-09-15 Eli Zaretskii <eliz@gnu.org>
5805
5806 * w32xfns.c:
5807 * w32uniscribe.c:
5808 * w32term.c:
5809 * w32select.c:
5810 * w32reg.c:
5811 * w32proc.c:
5812 * w32menu.c:
5813 * w32inevt.c:
5814 * w32heap.c:
5815 * w32font.c:
5816 * w32fns.c:
5817 * w32console.c:
5818 * w32.c:
5819 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5820 by lisp.h. This completes removal of setjmp.h inclusion
5821 erroneously announced in the previous commit. (Bug#12446)
5822
5823 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5824 more accurate.
5825
5826 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5827 not defined as a macro. The latter happens on MS-Windows.
5828 (Bug#12446)
5829
5830 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5831
5832 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5833 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
5834 Some instances of '#include <setjmp.h>' removed, if the
5835 only reason for the instance was because "lisp.h" was included.
5836 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5837 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5838 and _longjmp with the new symbols. Emacs already uses _setjmp if
5839 available, so this change affects only POSIXish hosts that have
5840 sigsetjmp but not _setjmp, such as some versions of Solaris and
5841 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5842 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5843 (png_load_body) [HAVE_PNG]:
5844 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5845 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5846 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5847 since PNG requires jmp_buf. This is the only exception to the
5848 general rule that we now use sys_setjmp and sys_longjmp.
5849 This exception is OK since this code does not change the signal
5850 mask or longjmp out of a signal handler.
5851
5852 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5853
5854 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5855 Include "syssignal.h", for 'main_thread'.
5856
5857 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5858
5859 Avoid out-of-range marker position (Bug#12426).
5860 * insdel.c (replace_range, replace_range_2):
5861 Adjust markers before overlays, as suggested by comments.
5862 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5863 Remove redundant check before calling offset_intervals.
5864
5865 2012-09-14 Martin Rudalics <rudalics@gmx.at>
5866
5867 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5868 current buffer (Bug#12387).
5869
5870 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
5871
5872 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5873
5874 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5875
5876 Use a more backwards-compatible timer format (Bug#12430).
5877 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5878 vector element, not from the 4th, since PSECS is now at the end.
5879 (Fcurrent_idle_time): Doc fix.
5880
5881 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5882
5883 Function to mark objects and remove killed buffers at once.
5884 * alloc.c (discard_killed_buffers): Rename to ...
5885 (mark_discard_killed buffers) ... new name. Add marking
5886 of remaining objects. Fix comment. Adjust users.
5887 (mark_object): Do not touch frame buffer lists here.
5888 * frame.c (delete_frame): Reset frame buffer lists here.
5889
5890 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5891
5892 Better workaround for GNOME bug when --enable-gcc-warnings.
5893 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5894 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5895 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5896
5897 Simplify SIGIO usage (Bug#12408).
5898 The code that dealt with SIGIO was crufty and confusing, e.g., it
5899 played tricks like "#undef SIGIO" but these tricks were not used
5900 consistently. Simplify mostly by not #undeffing standard symbols,
5901 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5902 or not as we please) rather than "defined SIGIO" (standard symbol
5903 that we probably shouldn't #undef).
5904 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5905 Modules that need it can include it.
5906 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5907 * dispextern.h (ignore_sigio): New decl.
5908 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5909 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5910 * emacs.c (shut_down_emacs):
5911 * keyboard.c (kbd_buffer_store_event_hold):
5912 Use ignore_sigio rather than invoking 'signal' directly.
5913 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5914 for FIONREAD.
5915 (FIONREAD, SIGIO): Do not #undef.
5916 (tty_read_avail_input): Use #error rather than a syntax error.
5917 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5918 for I_PIPE, used by SETUP_SLAVE_PTY.
5919 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5920 * sysdep.c (croak): Remove; no longer needed. This bit of
5921 temporary code, with Fred N. Fish's comment that it's temporary,
5922 has been in Emacs since at least 1992!
5923 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5924 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5925 * syssignal.h (croak): Remove decl.
5926 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5927 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5928 now that we're termios-only.
5929 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5930 * term.c (dissociate_if_controlling_tty): Use #error rather than
5931 a run-time error.
5932
5933 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5934 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5935 to work around GNOME bug 683906.
5936 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5937 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5938 This works around GCC bug 54561.
5939
5940 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5941
5942 More fixes for 'volatile' and setjmp/longjmp.
5943 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5944 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5945 (png_load_body) [HAVE_PNG]:
5946 (jpeg_load_body) [HAVE_JPEG]:
5947 New function, with most of the old parent function's body.
5948 (png_load) [HAVE_PNG]:
5949 (jpeg_load) [HAVE_JPEG]:
5950 Invoke the new function, to avoid longjmp munging our locals.
5951 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5952 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5953 longjmp is passed 2, as the C standard doesn't guarantee this.
5954 Instead, store the failure code into mgr->failure_code.
5955
5956 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5957
5958 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5959 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5960 (syms_of_keyboard): Remove support for unread-command-char.
5961
5962 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5963
5964 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5965 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5966 violation. (Bug#12426)
5967
5968 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5969
5970 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5971
5972 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5973
5974 * eval.c: Add `inhibit-debugger'.
5975 (Qinhibit_debugger): New symbol.
5976 (call_debugger): Bind it instead of Qdebug_on_error.
5977 (maybe_call_debugger): Test Vinhibit_debugger.
5978 (syms_of_eval): Define inhibit-debugger.
5979 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5980 (syms_of_xdisp): Remove inhibit-debug-on-message.
5981
5982 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5983
5984 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5985 If a nonvolatile local variable is written before a _longjmp to
5986 the frame containing the variable, and is read after the _longjmp,
5987 the value read is indeterminate. Some local variables of type
5988 'struct handler' and 'struct catchtag' are used in this way, so
5989 mark each of their slots as volatile if the slot can be set before
5990 _longjmp and read afterwards.
5991 * lisp.h (struct handler): var and chosen_clause are now volatile.
5992 (struct catchtag): val, next, and pdlcount are now volatile.
5993
5994 * bidi.c (bidi_push_it, bidi_pop_it):
5995 * fns.c (copy_hash_table):
5996 * image.c (define_image_type):
5997 * keyboard.c (kbd_buffer_store_event_hold):
5998 * process.c (Fprocess_send_eof):
5999 * xfaces.c (x_create_gc) [HAVE_NS]:
6000 * xgselect.c (xg_select):
6001 Prefer assignment to memcpy when either will do.
6002
6003 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6004 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6005 time an item is removed. No need to mark this function 'inline';
6006 the compiler knows better than we do.
6007
6008 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6009
6010 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6011 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6012 to change_frame_size (Bug#12388).
6013 (windowDidResize:): Pass YES to updateFrameSize.
6014
6015 * nsterm.h: Add delay parameter to updateFrameSize.
6016
6017 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6018
6019 Discard killed buffers from deleted window and frame objects.
6020 This reduces an amount of references to killed buffers and
6021 helps GC to reclaim them faster.
6022 * alloc.c (discard_killed_buffers): New function.
6023 (mark_object): Use it for deleted windows and frames.
6024 (mark_object): If symbol's value is set up for a killed buffer
6025 or deleted frame, restore its global binding.
6026 * data.c (swap_in_global_binding): Add GC notice.
6027 (swap_in_symval_forwarding): Use convenient set_blv_where.
6028 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6029 * window.h: ... to here.
6030
6031 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6032
6033 Convenient macro to check whether the buffer is live.
6034 * buffer.h (BUFFER_LIVE_P): New macro.
6035 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6036 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6037
6038 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6039
6040 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6041 composition cases (Bug#12364).
6042
6043 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6044 overhang of succeeding glyphs overlapping box cursor.
6045
6046 * w32term.c (x_draw_glyph_string): Likewise.
6047
6048 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6049
6050 Simplify, document, and port floating-point (Bug#12381).
6051 The porting part of this patch fixes bugs on non-IEEE platforms
6052 with frexp, ldexp, logb.
6053 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6054 Now static.
6055 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6056 support, by removing commented-out code and briefly listing the
6057 C89 functions excluded. The commented-out stuff was confusing
6058 maintenance, e.g., we thought we needed cbrt but it was commented out.
6059 (logb): Remove decl; no longer needed.
6060 (isfinite): New macro, if not already supplied.
6061 (isnan): Don't replace any existing macro.
6062 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6063 are present on all C89 platforms.
6064 (Ffrexp): Do not special-case zero, as frexp does the right thing
6065 for that case.
6066 (Flogb): Do not use logb, as it doesn't have the desired meaning
6067 on hosts that use non-base-2 floating point. Instead, stick with
6068 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6069 frexp, to avoid getting an unspecified result.
6070
6071 * xdisp.c (Qinhibit_debug_on_message): Now static.
6072
6073 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6074
6075 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6076 NSBezierPath (Bug#12131).
6077
6078 2012-09-10 Chong Yidong <cyd@gnu.org>
6079
6080 * fns.c (Fdelq, Fdelete): Doc fix.
6081
6082 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6083
6084 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6085 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6086
6087 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6088
6089 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6090 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6091 Use it.
6092
6093 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6094
6095 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6096 left fringe if the window has a left margin. This avoids leaving
6097 traces of the cursor because its leftmost pixel is not drawn over.
6098
6099 * dispnew.c (update_window_line): When the left margin area of a
6100 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6101 that screen line. (Bug#12277)
6102
6103 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6104
6105 Assume C89 or later for math functions (Bug#12381).
6106 This simplifies the code, and makes it a bit smaller and faster,
6107 and (most important) makes it easier to clean up signal handling
6108 since we can stop worring about floating-point exceptions in
6109 library code. That was a problem before C89, but the problem
6110 went away many years ago on all practical Emacs targets.
6111 * data.c, image.c, lread.c, print.c:
6112 Don't include <math.h>; no longer needed.
6113 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6114 might be autoconfigured, as that never happens.
6115 * data.c (fmod):
6116 * doprnt.c (DBL_MAX_10_EXP):
6117 * print.c (DBL_DIG):
6118 Remove. C89 or later always defines these.
6119 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6120 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6121 (arith_error, domain_error, domain_error2):
6122 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6123 no longer needed -- we simply return what C returns. All uses removed.
6124 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6125 the wrapped code.
6126 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6127 Remove. All uses expanded, as these macros are no longer used
6128 more than once and are now more trouble than they're worth.
6129 (Ftan): Use tan, not sin / cos.
6130 (Flogb): Assume C89 frexp.
6131 (fmod_float): Assume C89 fmod.
6132 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6133 (init_floatfns): Remove. All uses removed.
6134
6135 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6136
6137 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6138 compositeToPoint for OSX < 10.6 (Bug#12390).
6139
6140 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6141
6142 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6143 This produces more-accurate results.
6144
6145 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6146
6147 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6148 changes (Bug#12088).
6149
6150 2012-09-08 Chong Yidong <cyd@gnu.org>
6151
6152 * syntax.c (Fstring_to_syntax): Doc fix.
6153
6154 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6155
6156 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6157 in the internal border.
6158 (x_set_window_size): Remove static variables and their usage.
6159 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6160 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6161 Remove fringe/internal border adjustment (Bug#11052).
6162 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6163 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6164 (ns_fix_rect_ibw): Remove.
6165 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6166 (ns_dumpglyphs_box_or_relief): Ditto.
6167 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6168 adjustment.
6169 (ns_dumpglyphs_image): Ditto.
6170 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6171 border adjustment.
6172 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6173 their usage. Add fringe_extended_p and its use as in other terms.
6174 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6175 scroll bar was removed.
6176 (updateFrameSize): New function.
6177 (windowDidResize): Move code to updateFrameSize and call it.
6178
6179 * nsterm.h (EmacsView): Add updateFrameSize.
6180
6181 2012-09-07 Chong Yidong <cyd@gnu.org>
6182
6183 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6184
6185 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6186
6187 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6188
6189 More signal-handler cleanup (Bug#12327).
6190 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6191 Problem introduced when merging patches. Noted by Eli Zaretskii in
6192 <http://bugs.gnu.org/12327#67>.
6193 * floatfns.c: Comment fix.
6194 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6195 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6196 and anyway the declaration is harmless even if SIGDANGER is not defined.
6197 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6198 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6199 source files not surprisingly expected syssignal.h to define, or
6200 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6201 Include <sys/ioctl.h>, for FIONREAD.
6202 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6203 This eliminates a problem whereby other files mysteriously had
6204 to include "syssignal.h" before including "systty.h" if they
6205 wanted to use "#ifdef SIGIO".
6206
6207 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6208
6209 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6210
6211 * w32.c (sigemptyset): Empty the set.
6212 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6213
6214 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6215
6216 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6217
6218 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6219 (mark_object): Likewise for frame objects.
6220
6221 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6222
6223 * syssignal.h (handle_on_main_thread): Always declare,
6224 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6225 This ports to platforms without HAVE_PTHREAD.
6226
6227 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6228
6229 Signal-handler cleanup (Bug#12327).
6230 Emacs's signal handlers were written in the old 4.2BSD style with
6231 sigblock and sigmask and so forth, and this led to some
6232 inefficiencies and confusion. Rewrite these to use
6233 pthread_sigmask etc. without copying signal sets around. Also,
6234 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6235 'signal', and instead use functions that do not attempt to take
6236 over the system name space. This patch causes Emacs's text
6237 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6238 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6239 Do not include <signal.h> or "syssignal.h", as these
6240 modules do not use signals.
6241 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6242 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6243 Do not include <signal.h>, as "syssignal.h" does that for us now.
6244 * atimer.c (sigmask_atimers): New function.
6245 (block_atimers, unblock_atimers): New functions,
6246 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6247 All uses replaced.
6248 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6249 no longer needed here.
6250 * emacs.c (main): Inspect existing signal handler with sigaction,
6251 so that there's no need to block and unblock SIGHUP.
6252 * sysdep.c (struct save_signal): New member 'action', replacing
6253 old member 'handler'.
6254 (save_signal_handlers, restore_signal_handlers):
6255 Use sigaction instead of 'signal' to save and restore.
6256 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6257 New function. All users of 'signal' modified to use set_sighandler
6258 if they're writeonly, and to use sys_signal if they're read+write.
6259 (emacs_sigaction_init, forwarded_signal): New functions.
6260 (sys_signal): Remove. All uses replaced by calls to sigaction
6261 and emacs_sigaction_init, or by direct calls to 'signal'.
6262 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6263 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6264 all uses replaced by pthread_sigmask etc. calls.
6265 * syssignal.h: Include <signal.h>.
6266 (emacs_sigaction_init, forwarded_signal): New decls.
6267 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6268 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6269 (sigmask, sys_sigmask): Remove; no longer needed.
6270 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6271 (sigblock, sigunblock, sigfree):
6272 (sigsetmask) [!defined sigsetmask]:
6273 Remove. All uses replaced by pthread_sigmask.
6274 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6275 no longer need to be replaced, and its typical old uses
6276 are now done via emacs_sigaction_init and sigaction.
6277 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6278 (sys_sigdel): Remove; unused.
6279 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6280
6281 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6282
6283 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6284 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6285
6286 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6287
6288 Explicitly mark buffer_defaults and buffer_local_symbols.
6289 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6290 mark_local_symbols here.
6291 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6292 since special buffers aren't marked here any more.
6293 (allocate_buffer): Chain new buffer with all_buffers here...
6294 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6295 not here.
6296 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6297 (syms_of_buffer): Remove staticpro of the above.
6298 (init_buffer_once): Set names for buffer_defaults and
6299 buffer_local_symbols.
6300
6301 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6302
6303 Use bool for booleans in font-related modules.
6304 * font.c (font_intern_prop, font_style_to_value)
6305 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6306 (generate_otf_features, font_check_otf_features, font_check_otf)
6307 (font_match_p, font_list_entities, font_at):
6308 * fontset.c (fontset_id_valid_p, reorder_font_vector
6309 (fontset_find_font, Fset_fontset_font)
6310 (face_suitable_for_char_p) [0]:
6311 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6312 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6313 (m17n_flt_initialized, ftfont_shape_by_flt):
6314 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6315 * nsfont.m (nsfont_draw):
6316 * w32font.c (w32font_draw):
6317 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6318 Use bool for booleans.
6319 * font.h: Adjust to above API changes.
6320 (struct font, struct font_driver, struct font_driver_list):
6321 Use bool for booleans.
6322 (struct font): Remove useless member encoding_type.
6323 All users removed.
6324 * fontset.c, xftfont.c: Omit unnecessary static decls.
6325
6326 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6327
6328 * alloc.c (mark_object): Revert window marking code
6329 since it's unsafe for the Fset_window_configuration.
6330
6331 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6332
6333 Fix race conditions with signal handlers and errno (Bug#12327).
6334 Be more systematic about preserving errno whenever a signal
6335 handler returns, even if it's not in the main thread. Do this by
6336 renaming signal handlers to distinguish between signal delivery
6337 and signal handling. All uses changed.
6338 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6339 * data.c (deliver_arith_signal): Rename from arith_error.
6340 * dispnew.c (deliver_window_change_signal): Rename from
6341 window_change_signal.
6342 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6343 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6344 * keyboard.c (deliver_input_available_signal): Rename from
6345 input_available_signal.
6346 (deliver_user_signal): Rename from handle_user_signal.
6347 (deliver_interrupt_signal): Rename from interrupt_signal.
6348 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6349 (deliver_child_signal): Rename from sigchld_handler.
6350 * atimer.c (handle_alarm_signal):
6351 * data.c (handle_arith_signal):
6352 * dispnew.c (handle_window_change_signal):
6353 * emacs.c (handle_fatal_signal, handle_danger_signal):
6354 * keyboard.c (handle_input_available_signal):
6355 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6356 * process.c (handle_pipe_signal, handle_child_signal):
6357 New functions, with the actual signal-handling code taken from the
6358 original respective signal handlers, sans the sporadic attempts to
6359 preserve errno, since that's now done by handle_on_main_thread.
6360 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6361 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6362 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6363 Move to sysdep.c.
6364 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6365 Move initialization of main_thread to sysdep.c's init_signals.
6366 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6367 our usage, and simplifies the mainline code.
6368 (record_child_status_change): New static function, as a helper
6369 for handle_child_signal, and with most of the old child handler's
6370 contents.
6371 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6372 (handle_child_signal): Use the above.
6373 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6374 Moved here from emacs.c.
6375 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6376 code moved here from emacs.c's main function.
6377 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6378 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6379 This lets callers save and restore errno properly.
6380
6381 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6382
6383 Remove redundant or unused things here and there.
6384 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6385 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6386 * editfns.c (Fcompare_buffer_substrings): Likewise.
6387 * frame.h (struct terminal, struct font_driver_list):
6388 Remove redundant declarations.
6389 * window.h (Qleft, Qright): Likewise.
6390
6391 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6392
6393 Do not mark objects from deleted buffers, windows and frames.
6394 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6395 (mark_object): Likewise for windows and frames.
6396
6397 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6398
6399 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6400 buffer_defaults and buffer_local_symbols as valid objects.
6401 Return special value to denote them.
6402
6403 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6404
6405 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6406 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6407 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6408 (file_name_absolute_p, Fsubstitute_in_file_name):
6409 (check_executable, check_writable, Ffile_accessible_directory_p)
6410 (Fset_file_selinux_context, Fdefault_file_modes)
6411 (Finsert_file_contents, choose_write_coding_system)
6412 (Fwrite_region, build_annotations, a_write, e_write)
6413 (Fdo_auto_save):
6414 * filelock.c (boot_time_initialized, get_boot_time)
6415 (get_boot_time_1, lock_file_1, within_one_second):
6416 * floatfns.c (in_float):
6417 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6418 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6419 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6420 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6421 * window.c (compare_window_configurations):
6422 Use bool for booleans.
6423 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6424 (Fdefault_file_modes): Now mode_t, not int, for modes.
6425 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6426 (internal_delete_file): Now returns void, not a (boolean) int,
6427 since nobody was looking at the return value.
6428 * lisp.h, window.h: Adjust to above API changes.
6429
6430 * xdisp.c (set_message): Simplify and reindent last change.
6431
6432 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
6433
6434 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6435
6436 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6437
6438 * eval.c (call_debugger): Make the function non-static so that we
6439 can call it from set_message.
6440
6441 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6442 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6443
6444 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6445
6446 Give more-useful info on a fatal error (Bug#12328).
6447 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6448 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6449 of doing the work ourselves.
6450 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6451 do most of the work.
6452 (fatal_error_backtrace): New function, taken from the guts
6453 of the old fatal_error_signal, but with a new option to output
6454 a backtrace.
6455 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6456 info about the signal than just its number.
6457 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6458 * sysdep.c: Include <execinfo.h>
6459 (emacs_backtrace): New function, taken partly from the previous
6460 code of the 'die' function.
6461 (emacs_abort): Call fatal_error_backtrace rather than abort.
6462
6463 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6464
6465 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6466 eager (load-time) macro-expansion.
6467 * lisp.mk (lisp): Add macroexp.
6468
6469 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6470
6471 Simplify redefinition of 'abort' (Bug#12316).
6472 Do not try to redefine the 'abort' function. Instead, redo
6473 the code so that it calls 'emacs_abort' rather than 'abort'.
6474 This removes the need for the NO_ABORT configure-time macro
6475 and makes it easier to change the abort code to do a backtrace.
6476 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6477 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6478 Remove; sysdep.c's emacs_abort now takes its place.
6479 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6480 'abort' changed to use 'emacs_abort'.
6481 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6482 (abort) [!defined abort]: Rename to ...
6483 (emacs_abort): ... new name.
6484 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6485 the place of the old 'abort' in emacs.c.
6486 * w32.c, w32fns.c (abort): Do not #undef.
6487 * w32.c (emacs_abort): Rename from w32_abort.
6488
6489 2012-09-04 Eli Zaretskii <eliz@gnu.org>
6490
6491 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6492 offsets[j].dv, since the y axis of the screen coordinates points
6493 down, while the y axis of the font definition coordinates points
6494 up. This fixes display of Arabic diacritics such as KASRA and
6495 KASRATAN. (Bug#11860)
6496
6497 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6498
6499 Be more systematic about _setjmp vs setjmp.
6500 * alloc.c (test_setjmp, mark_stack):
6501 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6502 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6503 (png_load, my_error_exit, jpeg_load):
6504 * process.c (send_process_trap, send_process):
6505 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6506 The underscored versions are up to 30x faster on some hosts.
6507 Formerly, the code used setjmp+longjmp sometimes and
6508 _setjmp+_longjmp at other times, with no particular reason to
6509 prefer setjmp+longjmp.
6510
6511 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6512
6513 Fix minor problem found by static checking.
6514 * buffer.c (Fdelete_all_overlays): Return nil.
6515
6516 2012-09-03 Martin Rudalics <rudalics@gmx.at>
6517
6518 * buffer.c (Fdelete_all_overlays): New function.
6519
6520 2012-09-03 Chong Yidong <cyd@gnu.org>
6521
6522 * gtkutil.c: Add extern decl for Qxft.
6523
6524 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6525
6526 * emacs.c, eval.c: Use bool for boolean.
6527 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6528 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6529 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6530 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6531 (main, decode_env_path, Fdaemon_initialized):
6532 * eval.c (call_debugger, Finteractive_p, interactive_p):
6533 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6534 (maybe_call_debugger, Fbacktrace):
6535 * process.c (read_process_output, exec_sentinel):
6536 Use bool for booleans.
6537 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6538 All callers changed.
6539 * eval.c (interactive_p): Omit always-true boolean argument
6540 EXCLUDE_SUBRS_P. All callers changed.
6541 * dispextern.h, lisp.h: Reflect above API changes.
6542 * firstfile.c (dummy): Use the address of 'main', whose signature
6543 won't change, instead of the address of 'initialize', whose
6544 signature just changed from int to bool.
6545 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6546 * msdos.c (fatal_error_in_progress): ... from here.
6547 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6548 of incrementing it.
6549 (redisplay_internal, unwind_redisplay): Simply clear
6550 REDISPLAYING_P when unwinding, instead of saving its previous,
6551 always-false value and then restoring it.
6552
6553 Clean up some extern decls.
6554 Mostly, this hoists extern decls out of .c files and into .h files.
6555 That way, we're more likely to catch errors if the interfaces change.
6556 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6557 declare xg_mark_data.
6558 * dispextern.h (x_frame_parm_handlers):
6559 * font.h (Qxft):
6560 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6561 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6562 (Qultra_bold, Qoblique, Qitalic):
6563 Move extern decl here from .c file.
6564 * alloc.c (xg_mark_data) [USE_GTK]:
6565 * doc.c (Qclosure):
6566 * eval.c (Qlexical_binding):
6567 * fns.c (time) [!HAVE_UNISTD_H]:
6568 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6569 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6570 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6571 * lread.c (Qinternal_interpreter_environment):
6572 * minibuf.c (Qbuffer):
6573 * process.c (QCfamily, QCfilter):
6574 * widget.c (free_frame_faces):
6575 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6576 * xfont.c (x_clear_errors):
6577 * xterm.c (x_frame_parm_handlers):
6578 Remove now-redundant extern decls.
6579 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6580 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6581 Now static.
6582 * xfaces.c: Remove unnecessary static decls.
6583 * xterm.c (updating_frame): Remove decl of nonexistent object.
6584
6585 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6586 when building globals.h, as the objects that are not built on
6587 this host are not needed to compile C files on this host.
6588
6589 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6590
6591 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6592
6593 * frame.h: Add missing prototype for x_wm_set_size_hint.
6594
6595 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6596
6597 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6598 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6599 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6600 (Fsubstitute_command_keys):
6601 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6602 (save_excursion_save, save_excursion_restore)
6603 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6604 (format_time_string, general_insert_function)
6605 (make_buffer_string, make_buffer_string_both)
6606 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6607 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6608 (copy_text, insert_1, insert_1_both, insert_from_string)
6609 (insert_from_string_before_markers, insert_from_string_1)
6610 (insert_from_buffer, insert_from_buffer_1, replace_range)
6611 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6612 (del_range_2, modify_region):
6613 * intervals.c (intervals_equal, balance_possible_root_interval)
6614 (adjust_intervals_for_insertion, merge_properties_sticky)
6615 (graft_intervals_into_buffer, lookup_char_property)
6616 (adjust_for_invis_intang, set_point_both)
6617 (get_property_and_range, compare_string_intervals)
6618 (set_intervals_multibyte_1, set_intervals_multibyte):
6619 * keyboard.c (decode_timer):
6620 Use bool for boolean.
6621 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6622 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6623
6624 2012-09-02 Chong Yidong <cyd@gnu.org>
6625
6626 * keymap.c (push_key_description): Print M-TAB as C-M-i
6627 (Bug#11758).
6628
6629 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
6630
6631 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6632 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6633 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6634 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6635 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6636 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6637 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6638
6639 2012-09-01 Eli Zaretskii <eliz@gnu.org>
6640
6641 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6642 more than one grapheme cluster passed to the shaper: compute the
6643 offset adjustment values separately for each cluster. (Bug#11860)
6644
6645 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6646 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6647 about implicit conversions from integer to pointer.
6648
6649 2012-09-01 Daniel Colascione <dancol@dancol.org>
6650
6651 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6652 system used too early.
6653
6654 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6655
6656 Better seed support for (random).
6657 * emacs.c (main): Call init_random.
6658 * fns.c (Frandom): Set the seed from a string argument, if given.
6659 Remove long-obsolete Gentzel cruft.
6660 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6661 (init_random): New function.
6662
6663 2012-09-01 Daniel Colascione <dancol@dancol.org>
6664
6665 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6666 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6667 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6668 x_wm_set_size_hint, x_query_colors, x_real_positions,
6669 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6670 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6671 all of which have been moved to common code.
6672
6673 * xfaces.c: Include TERM_HEADER instead of listing all possible
6674 window-system headers.
6675
6676 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6677 to match header.
6678
6679 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6680 directly accessing frame internals.
6681
6682 * w32font.h: Include font.h. Define syms_of_w32font and
6683 globals_of_w32font.
6684
6685 * process.c: Include TERM_HEADER instead of listing all possible
6686 window-system headers.
6687
6688 * nsterm.h: Remove declarations now in frame.h.
6689 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6690
6691 * menu.c: Include TERM_HEADER instead of listing all possible
6692 window-system headers.
6693
6694 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6695 window system.
6696
6697 * keyboard.c: Include TERM_HEADER instead of listing all possible
6698 window-system headers.
6699
6700 * image.c: Include TERM_HEADER instead of listing all possible
6701 window-system headers. Declare Vlibrary_cache when compiling for
6702 Windows.
6703
6704 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6705 window system declarations.
6706
6707 * frame.h: Move common functions here: set_frame_menubar,
6708 x_set_window_size, x_sync, x_get_focus_frame,
6709 x_set_mouse_position, x_set_mouse_pixel_position,
6710 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6711 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6712 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6713 x_activate_menubar, x_real_positions, x_bitmap_icon,
6714 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6715 and x_query_colors.
6716
6717 * frame.c: Include TERM_HEADER instead of listing all possible
6718 window-system headers.
6719
6720 * font.c: Include TERM_HEADER instead of listing all possible
6721 window-system headers.
6722
6723 * emacs.c: Include TERM_HEADER.
6724
6725 * dispnew.c: Include TERM_HEADER instead of listing all possible
6726 window-system headers.
6727
6728 * ccl.h: Include character.h.
6729
6730 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6731 the current window system; include in list of objects to link into
6732 Emacs.
6733
6734 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6735
6736 Remove mark_ttys function and fix tty_display_info initialization.
6737 * lisp.h (mark_ttys): Remove prototype.
6738 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6739 to mark_ttys because all possible values of 'top_frame' slot are
6740 the frames which are reachable from Vframe_list.
6741 * term.c (mark_ttys): Remove.
6742 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6743
6744 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6745
6746 Change struct frame bitfields from unsigned char to unsigned.
6747 * frame.h (struct frame): Change type of 'display_preempted',
6748 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6749 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6750 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6751 bitfields from unsigned char to unsigned.
6752
6753 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6754
6755 Remove unused member of struct x_output and struct w32_output.
6756 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6757 * w32term.h (struct w32_output): Likewise.
6758
6759 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6760
6761 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6762 does not become zero (Bug#12234).
6763
6764 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6767 for GCC 4.7.1 x86-64.
6768
6769 2012-08-30 Glenn Morris <rgm@gnu.org>
6770
6771 * lread.c (init_lread): For out-of-tree builds, only add the
6772 source directory's site-lisp dir to the load-path if it exists,
6773 consistent with in-tree builds. (Bug#12302)
6774
6775 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6776
6777 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6778 button_values to NULL. Call setStykeMask so dialogs get a close button.
6779 (windowShouldClose:): Set window_closed.
6780 (dealloc): New member, free button_values.
6781 (process_dialog:): Make member function. Remove window argument,
6782 replace window with self. Count buttons and allocate and store values
6783 in button_values.
6784 (addButton:value:row:): value is int with the name tag. Call setTag
6785 with tag. Remove return self, declare return value as void.
6786 (addString:row:): Remove return self, declare return value as void.
6787 (addSplit): Remove return self, declare return value as void.
6788 (clicked:): Remove return self, declare return value as void.
6789 Set dialog_return to button_values[seltag]. Code formatting change.
6790 (initFromContents:isQuestion:): Adjust call to process_dialog.
6791 Code formatting change.
6792 (timeout_handler:): Set timer_fired to YES.
6793 (runDialogAt:): Set timer_fired to NO.
6794 Handle click on close button as quit.
6795
6796 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6797 Add window_closed and button_values. Add void as return value for
6798 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6799 Add process_dialog as new member.
6800
6801 2012-08-28 Eli Zaretskii <eliz@gnu.org>
6802
6803 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6804 is not one of the heaps we manage. (Bug#12242)
6805
6806 2012-08-28 Glenn Morris <rgm@gnu.org>
6807
6808 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6809
6810 2012-08-28 Martin Rudalics <rudalics@gmx.at>
6811
6812 * window.c (Fset_window_configuration): Remove handling of
6813 auto-buffer-name window parameter. Install revision of reverted
6814 fix.
6815
6816 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6817
6818 Do not allow to set major mode for a dead buffer.
6819 * buffer.c (Fset_buffer_major_mode): Signal an error
6820 if the buffer is dead.
6821 (Fother_buffer, other_buffer_safely): Remove redundant
6822 nested declaration.
6823
6824 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6825
6826 Always use set_buffer_if_live to restore original buffer at unwind.
6827 * buffer.h (record_unwind_current_buffer): New function.
6828 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6829 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6830 * undo.c, window.c: Adjust users.
6831 * buffer.c (set_buffer_if_live): Fix comment.
6832
6833 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6834
6835 Fix usage of set_buffer_internal.
6836 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6837 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6838 * coding.c (decode_coding): Omit redundant test.
6839 * fileio.c (decide_coding_unwind): Likewise.
6840 * fns.c (secure_hash): Likewise.
6841 * insdel.c (modify_region): Likewise.
6842 * keyboard.c (command_loop_1): Likewise.
6843 * print.c (PRINTFINISH): Likewise.
6844 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6845
6846 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 * dispnew.c: Use bool for boolean.
6849 (frame_garbaged, display_completed, delayed_size_change)
6850 (fonts_changed_p, add_window_display_history)
6851 (add_frame_display_history, verify_row_hash)
6852 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6853 (row_equal_p, realloc_glyph_pool)
6854 (allocate_matrices_for_frame_redisplay)
6855 (showing_window_margins_p)
6856 (adjust_frame_glyphs_for_frame_redisplay)
6857 (build_frame_matrix_from_leaf_window, make_current)
6858 (mirrored_line_dance, mirror_line_dance, update_frame)
6859 (update_window_tree, update_single_window)
6860 (check_current_matrix_flags, update_window, update_text_area)
6861 (update_window_line, set_window_update_flags, scrolling_window)
6862 (update_frame_1, scrolling, buffer_posn_from_coords)
6863 (do_pending_window_change, change_frame_size)
6864 (change_frame_size_1, sit_for):
6865 Use bool for boolean.
6866 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6867 and remove last int (actually boolean) argument, which was always 0.
6868 All callers changed.
6869 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6870 * dispextern.h (struct composition_it): Use bool for boolean.
6871 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6872 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6873 * dired.c (file_name_completion):
6874 Use bool for boolean. (This was missed in an earlier change.)
6875
6876 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6877
6878 * window.c (Fset_window_configuration): Revert first part of
6879 last change.
6880
6881 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6882
6883 * nsterm.h (NSPanel): New class variable dialog_return.
6884
6885 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6886 Initialize dialog_return.
6887 (windowShouldClose:): Use stop instead of stopModalWithCode.
6888 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6889 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6890 event.
6891 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6892 modal loop returns.
6893
6894 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6895
6896 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6897 * composite.c (find_composition, composition_gstring_p)
6898 (composition_reseat_it, find_automatic_composition):
6899 * data.c (let_shadows_buffer_binding_p)
6900 (let_shadows_global_binding_p, set_internal, make_blv)
6901 (Fmake_variable_buffer_local, Fmake_local_variable)
6902 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6903 (cons_to_signed, arith_driver):
6904 * dbusbind.c (xd_in_read_queued_messages):
6905 * dired.c (directory_files_internal, file_name_completion):
6906 Use bool for booleans.
6907 * dired.c (file_name_completion):
6908 * process.h (fd_callback):
6909 Omit int (actually boolean) argument. It wasn't being used.
6910 All uses changed.
6911 * composite.h, lisp.h: Reflect above API changes.
6912
6913 * cmds.c, coding.c: Use bool for booleans.
6914 * cmds.c (move_point, Fself_insert_command):
6915 * coding.h (struct composition status, struct coding_system):
6916 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6917 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6918 (emacs_mule_char, decode_coding_emacs_mule)
6919 (encode_coding_emacs_mule, detect_coding_iso_2022)
6920 (decode_coding_iso_2022, encode_invocation_designation)
6921 (encode_designation_at_bol, encode_coding_iso_2022)
6922 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6923 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6924 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6925 (encode_coding_raw_text, detect_coding_charset)
6926 (decode_coding_charset, encode_coding_charset, detect_eol)
6927 (detect_coding, get_translation_table, produce_chars)
6928 (consume_chars, reused_workbuf_in_use)
6929 (make_conversion_work_buffer, code_conversion_save)
6930 (decode_coding_object, encode_coding_object)
6931 (detect_coding_system, char_encodable_p)
6932 (Funencodable_char_position, code_convert_region)
6933 (code_convert_string, code_convert_string_norecord)
6934 (Fset_coding_system_priority):
6935 * fileio.c (Finsert_file_contents):
6936 Use bool for booleans.
6937 * coding.h, lisp.h: Reflect above API changes.
6938 * coding.c: Remove unnecessary static function decls.
6939 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6940 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6941 not a boolean 'int', since callers never look at the return value.
6942 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6943 * coding.h (decoding_buffer_size, encoding_buffer_size)
6944 (emacs_mule_string_char): Remove unused extern decls.
6945 (struct iso_2022_spec, struct coding_system):
6946 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6947 (struct emacs_mule_spec): Remove unused field 'full_support'.
6948 All initializations removed.
6949 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6950
6951 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6952
6953 Fix spare memory change (Bug#12286).
6954 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6955 (valid_lisp_object_p): Likewise.
6956
6957 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6958
6959 * window.c (Fset_window_configuration): Record any window's old
6960 buffer if it's replaced (see Bug#8789). If the new current
6961 buffer doesn't appear in the selected window, go to its old
6962 point (Bug#12208).
6963
6964 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6965
6966 Special MEM_TYPE_SPARE to denote reserved memory.
6967 * alloc.c (enum mem_type): New memory type.
6968 (refill_memory_reserve): Use new type for spare memory.
6969 This prevents live_cons_p and live_string_p from incorrect
6970 detection of uninitialized objects from spare memory as live.
6971
6972 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6973
6974 Spelling fixes.
6975 * Makefile.in (.PHONY): versioclean -> versionclean.
6976
6977 Remove unused external symbols.
6978 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6979 * window.c (Qwindow_valid_p, decode_valid_window):
6980 Now static, not extern.
6981 * data.c (Qinterval): Remove; unused.
6982 (syms_of_data): Do not define 'interval'.
6983 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6984 * window.h (decode_valid_window):
6985 Remove decls.
6986
6987 * character.c, charset.c, chartab.c: Use bool for booleans.
6988 * character.c (lisp_string_width, string_count_byte8)
6989 (string_escape_byte8):
6990 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6991 (load_charset_map_from_file, map_charset_chars)
6992 (Fdefine_charset_internal, define_charset_internal)
6993 (Fdeclare_equiv_charset, find_charsets_in_text)
6994 (Ffind_charset_region, char_charset, Fiso_charset):
6995 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6996 (sub_char_table_set, sub_char_table_set_range)
6997 (char_table_set_range, optimize_sub_char_table)
6998 (map_sub_char_table):
6999 Use bool for boolean.
7000 * character.c (str_to_unibyte): Omit last boolean argument; it was
7001 always 0. All callers changed.
7002 * character.h, charset.h: Adjust to match previous changes.
7003 * character.h (char_printable_p): Remove decl of nonexistent function.
7004 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7005 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7006 are all boolean, so make them single-bit bitfields.
7007
7008 * lisp.h (ASET): Remove attempt to detect side effects.
7009 It was meant to be temporary and it often doesn't work,
7010 because when IDX has side effects the behavior of IDX==IDX
7011 is undefined. See Stefan Monnier in
7012 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7013
7014 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7015
7016 * lisp.h (functionp): New function (extracted from Ffunctionp).
7017 (FUNCTIONP): Use it.
7018 * eval.c (Ffunctionp): Use it.
7019
7020 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7023 as that's faster and simpler than static storage. Don't bother
7024 with the g_main_context_query overhead if g_main_context_pending
7025 says no events are pending.
7026 (gfds, gfds_size): Remove these static vars.
7027 (xgselect_initialize): Remove; no longer needed.
7028 All uses and decls removed.
7029
7030 * emacs.c (fatal_error_signal_hook): Remove.
7031 All uses removed. This leftover from old code was always 0.
7032
7033 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7034 * casefiddle.c (casify_object, casify_region):
7035 * casetab.c (set_case_table):
7036 * category.c, category.h (word_boundary_p):
7037 * category.h (CHAR_HAS_CATEGORY):
7038 Use bool for booleans, instead of int.
7039
7040 2012-08-25 Eli Zaretskii <eliz@gnu.org>
7041
7042 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7043
7044 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7045
7046 On assertion failure, print backtrace if available.
7047 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7048 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7049 * Makefile.in (LIB_EXECINFO): New macro.
7050 (LIBES): Use it.
7051
7052 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7053 * bytecode.c (exec_byte_code):
7054 * callint.c (check_mark, Fcall_interactively):
7055 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7056 (getenv_internal, sync_process_alive, call_process_exited):
7057 * lisp.h (USE_SAFE_ALLOCA):
7058 Use bool for booleans, instead of int.
7059 * lisp.h, process.h: Adjust prototypes to match above changes.
7060 * callint.c (Fcall_interactively): Don't assume the mark's
7061 offset fits in 'int'.
7062
7063 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 * buffer.c, buffer.h: Use bool for boolean.
7066 * buffer.c (reset_buffer_local_variables)
7067 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7068 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7069 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7070 (overlay_touches_p, overlay_strings, Foverlay_put)
7071 (report_overlay_modification, call_overlay_mod_hooks):
7072 (mmap_enlarge, mmap_set_vars):
7073 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7074 Use bool for booleans, instead of int.
7075 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7076 since the 1-or-0 return value is always ignored anyway.
7077 (mmap_initialized_p):
7078 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7079 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7080
7081 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7082
7083 * bidi.c: Use bool for boolean.
7084 This is a bit more readable, and makes the text segment of bidi.o
7085 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7086 Presumably it's faster too.
7087 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7088 Now bool.
7089 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7090 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7091 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7092 (bidi_explicit_dir_char, bidi_level_of_next_char)
7093 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7094 Use bool for booleans, instead of int.
7095 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7096 (bidi_unshelve_cache): Adjust decls to match code.
7097
7098 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7099
7100 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7101 argument.
7102
7103 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7106 * atimer.h: Include <stdbool.h>.
7107
7108 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7109
7110 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7111 compile time tests instead of run time tests on systems that do
7112 not use them.
7113 (FRAME_MAC_P): Remove leftover from deleted code.
7114 * frame.c (syms_of_frame): Remove leftover from deleted code.
7115
7116 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7117
7118 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7119
7120 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7121
7122 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7123 Otherwise, the compiler complains about (A?B:C) where B is void
7124 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7125 (fontset_add): Return void, for FONTSET_ADD.
7126
7127 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * alloc.c: Use bool for booleans.
7130 (gc_in_progress, abort_on_gc)
7131 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7132 (dont_register_blocks) [GC_MALLOC_CHECK]:
7133 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7134 (check_string_bytes, make_specified_string, memory_full)
7135 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7136 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7137 (mark_stack, valid_pointer_p, make_pure_string)
7138 (Fgarbage_collect, survives_gc_p, gc_sweep):
7139 Use bool for booleans, instead of int.
7140 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7141 Remove unused local.
7142 * alloc.c (PURE_POINTER_P):
7143 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7144 * editfns.c (Fformat):
7145 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7146 (Fdo_auto_save):
7147 * fns.c (sweep_weak_table):
7148 * lisp.h (suppress_checking, push_message, survives_gc_p)
7149 (make_pure_string, gc_in_progress, abort_on_gc):
7150 * lread.c (readchar, read1):
7151 * print.c (Fprin1_to_string):
7152 * xdisp.c (push_message):
7153 Use bool for booleans affected directly or indirectly by
7154 alloc.c's changes.
7155
7156 Make recently-introduced setters macros.
7157 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7158 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7159 (set_fontset_default, set_fontset_fallback): Rename from their
7160 upper-case counterparts, and make them functions rather than macros.
7161 This is more consistent with the other recently-introduced setters.
7162 These don't need to be inline, since they're local.
7163
7164 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7165
7166 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7167 the loop (Bug#12247).
7168
7169 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7170
7171 * lisp.h (vcopy): Use memcpy rather than our own loop.
7172 This fixes a performance regression introduced by the recent
7173 addition of vcopy. This means 'vcopy' will need to be modified
7174 for a copying collector, but that's OK. Also, tighten the
7175 checking in the assertion.
7176
7177 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7178
7179 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7180 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7181 non-base glyph for the width of the base character, according to
7182 what x_draw_composite_glyph_string_foreground expects.
7183 Generate WADJUST value according to composition_gstring_width's
7184 expectations, to produce correct width of the composed character.
7185 Reverse the sign of the DU offset produced by ScriptPlace.
7186
7187 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7188
7189 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7190
7191 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7192
7193 Avoid direct writes to contents member of struct Lisp_Vector.
7194 * lisp.h (vcopy): New function to copy data into vector.
7195 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7196 * fns.c (Ffillarray): Use ASET.
7197 * keyboard.c (timer_check_2): Use AREF and ASET.
7198 (append_tool_bar_item, Frecent_keys): Use vcopy.
7199 * lread.c (read_vector): Use ASET.
7200 * msdos.c (Frecent_doskeys): Use vcopy.
7201 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7202 (Finternal_merge_in_global_face): Use ASET and vcopy.
7203 * xfont.c (xfont_list_pattern): Likewise.
7204
7205 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7206
7207 * window.c (Fwindow_point): For the selected window always return
7208 the position of its buffer's point.
7209 (Fset_window_point): For the selected window always go in its
7210 buffer to the specified position.
7211
7212 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7213
7214 Setter macros for fontsets.
7215 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7216 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7217 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7218 Adjust users.
7219
7220 2012-08-20 Glenn Morris <rgm@gnu.org>
7221
7222 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7223 Don't assume that `ln -f' works.
7224
7225 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7226
7227 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7228 and later about non-assignments with no effect. See discussion at
7229 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7230 details.
7231
7232 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7233
7234 Inline setter functions for Lisp_Objects slots of struct specbinding.
7235 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7236 Adjust users.
7237
7238 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7239
7240 * window.c (select_window): Always make selected window's buffer
7241 current.
7242
7243 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7244
7245 Use AREF and ASET for docstrings of category tables.
7246 * category.h (CATEGORY_DOCSTRING): Use AREF.
7247 (SET_CATEGORY_DOCSTRING): Use ASET.
7248 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7249
7250 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7251
7252 Inline setter functions for hash table members.
7253 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7254 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7255 (set_hash_key_and_value, set_hash_index, set_hash_next)
7256 (set_hash_hash): New functions.
7257 * charset.c, fns.c: Adjust users.
7258
7259 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7260
7261 Inline getter and setter functions for per-buffer values.
7262 * buffer.h (per_buffer_default, set_per_buffer_default)
7263 (per_buffer_value, set_per_buffer_value): New functions.
7264 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7265 * buffer.c, data.c: Adjust users.
7266
7267 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
7268
7269 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7270
7271 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7272
7273 Rely on <config.h> + <unistd.h> to declare 'environ',
7274 as gnulib does this if the system doesn't.
7275 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7276 Remove declaration. MS-Windows declares it on stdlib.h which is
7277 included by conf_post.h.
7278 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7279 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7280 * vm-limit.c: Include <unistd.h>, for 'environ'.
7281
7282 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7283 (start_of_data): Remove decl; mem-limits.h provides it.
7284
7285 * xdisp.c (handle_invisible_prop): Make it a bit faster
7286 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7287
7288 2012-08-19 Chong Yidong <cyd@gnu.org>
7289
7290 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7291 ends (Bug#3874).
7292
7293 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7294
7295 * .gdbinit: Use call instead of set when calling a function in the
7296 inferior.
7297
7298 * data.c (set_internal): Don't use set_blv_found.
7299 (Fkill_local_variable): Likewise.
7300
7301 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7302
7303 * nsfont.m (ns_ascii_average_width): Ensure the string
7304 ascii_printable is initialized with a null-terminated character
7305 array. Otherwise, it can contain undesired extra characters.
7306
7307 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7308
7309 port new setting code to Sun C 5.8 2005/10/13
7310 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7311 Return void, not Lisp_Object. Otherwise, the compiler
7312 complains about (A?B:C) where B is void and C is Lisp_Object
7313 when compiling CHAR_TABLE_SET, due to the recent change to
7314 the API of sub_char_table_set_contents.
7315
7316 2012-08-18 Chong Yidong <cyd@gnu.org>
7317
7318 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7319 for the string case (Bug#3874).
7320
7321 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7322
7323 * buffer.h (BSET): Remove (Bug#12215).
7324 Replace all uses with calls to new setter functions.
7325 (bset_bidi_paragraph_direction, bset_case_canon_table)
7326 (bset_case_eqv_table, bset_directory, bset_display_count)
7327 (bset_display_time, bset_downcase_table)
7328 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7329 (bset_last_selected_window, bset_local_var_alist)
7330 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7331 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7332 (bset_width_table):
7333 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7334 (bset_auto_fill_function, bset_auto_save_file_format)
7335 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7336 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7337 (bset_cache_long_line_scans, bset_case_fold_search)
7338 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7339 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7340 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7341 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7342 (bset_header_line_format, bset_indicate_buffer_boundaries)
7343 (bset_indicate_empty_lines, bset_invisibility_spec)
7344 (bset_left_fringe_width, bset_major_mode, bset_mark)
7345 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7346 (bset_name, bset_overwrite_mode, bset_pt_marker)
7347 (bset_right_fringe_width, bset_save_length)
7348 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7349 (bset_scroll_up_aggressively, bset_selective_display)
7350 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7351 (bset_word_wrap, bset_zv_marker):
7352 * category.c (bset_category_table):
7353 * syntax.c (bset_syntax_table):
7354 New setter functions.
7355
7356 * process.h (PSET): Remove (Bug#12215).
7357 Replace all uses with calls to new setter functions.
7358 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7359 (PROCESS_INLINE): New macro.
7360 (pset_childp): New setter function.
7361 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7362 * process.c (PROCESS_INLINE):
7363 Define to EXTERN_INLINE, so that the corresponding functions
7364 are compiled into code.
7365 (pset_buffer, pset_command, pset_decode_coding_system)
7366 (pset_decoding_buf, pset_encode_coding_system)
7367 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7368 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7369 (pset_type, pset_write_queue): New setter functions.
7370
7371 * window.h (WSET): Remove (Bug#12215).
7372 Replace all uses with calls to new setter functions.
7373 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7374 (WINDOW_INLINE): New macro.
7375 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7376 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7377 (wset_total_lines, wset_vertical_scroll_bar)
7378 (wset_window_end_pos, wset_window_end_valid)
7379 (wset_window_end_vpos): New setter functions.
7380 * window.c (WINDOW_INLINE):
7381 Define to EXTERN_INLINE, so that the corresponding functions
7382 are compiled into code.
7383 (wset_combination_limit, wset_dedicated, wset_display_table)
7384 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7385 (wset_new_normal, wset_new_total, wset_next_buffers)
7386 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7387 (wset_prev_buffers, wset_right_fringe_width)
7388 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7389 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7390 (wset_window_parameters):
7391 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7392 (wset_column_number_displayed, wset_region_showing):
7393 New setter functions.
7394
7395 * termhooks.h (TSET): Remove (Bug#12215).
7396 Replace all uses with calls to new setter functions.
7397 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7398 (TERMHOOKS_INLINE): New macro.
7399 (tset_charset_list, tset_selection_alist): New setter functions.
7400 * terminal.c (TERMHOOKS_INLINE):
7401 Define to EXTERN_INLINE, so that the corresponding functions
7402 are compiled into code.
7403 (tset_param_alist): New setter function.
7404
7405 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 * keyboard.h (KSET): Remove (Bug#12215).
7408 Replace all uses with calls to new setter functions.
7409 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7410 (KEYBOARD_INLINE): New macro.
7411 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7412 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7413 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7414 New setter functions.
7415 * keyboard.c (KEYBOARD_INLINE):
7416 Define to EXTERN_INLINE, so that the corresponding functions
7417 are compiled into code.
7418 (kset_echo_string, kset_kbd_queue)
7419 (kset_keyboard_translate_table, kset_last_prefix_arg)
7420 (kset_last_repeatable_command, kset_local_function_key_map)
7421 (kset_overriding_terminal_local_map, kset_real_last_command)
7422 (kset_system_key_syms): New setter functions.
7423
7424 * frame.h (FSET): Remove (Bug#12215).
7425 Replace all uses with calls to new setter functions.
7426 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7427 (FRAME_INLINE): New macro.
7428 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7429 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7430 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7431 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7432 (fset_param_alist, fset_root_window, fset_scroll_bars)
7433 (fset_selected_window, fset_title, fset_tool_bar_items)
7434 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7435 * frame.c (FRAME_INLINE):
7436 Define to EXTERN_INLINE, so that the corresponding functions
7437 are compiled into code.
7438 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7439
7440 A few more naming-convention fixes for getters and setters.
7441 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7442 and rename from buffer_overlays_set_before.
7443 (set_buffer_overlays_after): Move here from buffer.h, and rename
7444 from buffer_overlays_set_after.
7445 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7446 All uses changed.
7447 (set_buffer_intervals): Rename from buffer_set_intervals.
7448 * intervals.c (set_interval_object): Move here from intervals.h,
7449 and rename from interval_set_object.
7450 (set_interval_left): Move here from intervals.h, and rename from
7451 interval_set_left.
7452 (set_interval_right): Move here from intervals.h, and rename from
7453 interval_set_right.
7454 (copy_interval_parent): Move here from intervals.h, and rename from
7455 interval_copy_parent.
7456 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7457 (set_interval_plist): Rename from interval_set_plist.
7458 Return void, not Lisp_Object, since no caller uses the result.
7459 * lisp.h (string_intervals): Rename from string_get_intervals.
7460 (set_string_intervals): Rename from string_set_intervals.
7461
7462 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7463 (set_char_table_contents): Rename from char_table_set_contents.
7464 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7465 All uses changed. See the end of
7466 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7467
7468 * lisp.h (CSET): Remove (Bug#12215).
7469 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7470 (set_char_table_purpose): New functions,
7471 replacing CSET. All uses changed. For example, replace
7472 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7473 "set_char_table_parent (char_table, parent);".
7474 The old version was confusing because it used the same name
7475 'parent' for two different things.
7476
7477 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7478
7479 Functions to get and set Lisp_Object fields of buffer-local variables.
7480 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7481 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7482 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7483 * data.c, eval.c, frame.c: Adjust users.
7484
7485 2012-08-17 Chong Yidong <cyd@gnu.org>
7486
7487 * xfaces.c (merge_face_vectors): If the target font specfies a
7488 font spec, make the font's attributes take precedence over
7489 directly-specified attributes.
7490 (merge_face_ref): Recognize :font.
7491
7492 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7493
7494 Do not use memcpy for copying intervals.
7495 * intervals.c (reproduce_interval): New function.
7496 (reproduce_tree, reproduce_tree_obj): Use it.
7497 (reproduce_tree_obj): Remove prototype.
7498
7499 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7500
7501 * lisp.h (duration_to_sec_usec): Remove unused decl.
7502
7503 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7504
7505 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7506 to an allocated instance of NSString, not to the class itself.
7507
7508 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
7509
7510 * makefile.w32-in (C_CTYPE_H): New macro.
7511 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7512 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7513 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7514
7515 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7516
7517 Use ASCII tests for character types.
7518 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7519 * xfns.c, xterm.c:
7520 Don't include <ctype.h>; was not needed.
7521 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7522 * sysdep.c, xfaces.c:
7523 Include <c-ctype.h> instead of <ctype.h>.
7524 * nsterm.m: Include <c-ctype.h>.
7525 * charset.c (read_hex):
7526 * doc.c (Fsnarf_documentation):
7527 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7528 (DRIVE_LETTER) [DOS_NT]:
7529 (Ffile_name_directory, Fexpand_file_name)
7530 (Fsubstitute_in_file_name):
7531 * font.c (font_parse_xlfd, font_parse_fcname):
7532 * frame.c (x_set_font_backend):
7533 * gtkutil.c (xg_get_font):
7534 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7535 * nsimage.m (hexchar):
7536 * nsterm.m (ns_xlfd_to_fontname):
7537 * sysdep.c (system_process_attributes):
7538 * xfaces.c (hash_string_case_insensitive):
7539 Use C-locale tests instead of locale-specific tests for character
7540 types, since we want the ASCII interpretation here, not the
7541 interpretation suitable for whatever happens to be the current locale.
7542
7543 2012-08-16 Martin Rudalics <rudalics@gmx.at>
7544
7545 Consistently check windows for validity/liveness
7546 (Bug#11984, Bug#12025, Bug#12026).
7547 * lisp.h (CHECK_VALID_WINDOW): New macro.
7548 * window.c (decode_window): Rename to decode_live_window.
7549 (decode_valid_window, Fwindow_valid_p): New functions.
7550 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7551 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7552 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7553 (Fwindow_prev_sibling, Fwindow_combination_limit)
7554 (Fset_window_combination_limit, Fwindow_use_time)
7555 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7556 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7557 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7558 (Fwindow_hscroll, Fset_window_hscroll)
7559 (Fwindow_redisplay_end_trigger)
7560 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7561 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7562 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7563 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7564 (Fwindow_end, Fset_window_point, Fset_window_start)
7565 (Fpos_visible_in_window_p, Fwindow_line_height)
7566 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7567 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7568 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7569 (Fset_window_parameter, Fwindow_display_table)
7570 (Fset_window_display_table, Fdelete_other_windows_internal)
7571 (Fset_window_buffer, Fset_window_new_total)
7572 (Fset_window_new_normal, Fdelete_window_internal)
7573 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7574 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7575 (Fwindow_scroll_bars): Check whether argument window is a valid or
7576 live window. Update doc-strings.
7577 (syms_of_window): New symbol Qwindow_valid_p.
7578 * keyboard.c (Fposn_at_x_y): Check whether argument
7579 frame_or_window denotes a valid window.
7580
7581 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7582
7583 Fix previous char table change.
7584 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7585 * chartab.c (optimize_sub_char_table): Likewise.
7586
7587 2012-08-16 Chong Yidong <cyd@gnu.org>
7588
7589 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7590
7591 * xfont.c (xfont_open):
7592 * xftfont.c (xftfont_open): Set the font's max_width field.
7593
7594 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7595 min_width to space_width and average_width to the average over
7596 printable ASCII characters.
7597 (ns_char_width): Code cleanup.
7598 (ns_ascii_average_width): New utility function.
7599
7600 * font.h (struct font): Update comments.
7601
7602 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7603
7604 Simple interface to set Lisp_Object fields of character tables.
7605 * lisp.h (CSET): New macro.
7606 (char_table_set_extras, char_table_set_contents)
7607 (sub_char_table_set_contents): New function.
7608 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7609 * syntax.c: Adjust users.
7610
7611 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7612
7613 * eval.c (eval_sub): Bind lexical-binding.
7614 * lread.c (Qlexical_binding): Make non-static.
7615
7616 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7617
7618 * nsmenu.m (popupSession): Remove.
7619 (pop_down_menu): Remove endModalSession.
7620 (timeout_handler:): New method.
7621 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7622 Call runModalForWindow. Check timer_fired when it returns.
7623 If not set, cancel timer and break out of loop.
7624 Otherwise loop again, with a new timeout.
7625
7626 * nsterm.m: Include fcntl.h if present.
7627 (fd_entry, t_readfds, inNsSelect): Remove.
7628 (select_writefds, select_valid, select_timeout, selfds)
7629 (select_mutex, apploopnr): Add.
7630 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7631 Otherwise call kbd_buffer_store_event.
7632 (ns_send_appdefined): Remove release of fd_entry.
7633 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7634 Increment and decrement apploopnr.
7635 (ns_select): If no file descriptors, just do a NSTimer.
7636 Otherwise copy read/write masks and start select thread (fd_handler).
7637 Start main loop and wait for application defined event.
7638 Inform select thread to stop selecting after main loop is exited.
7639 (ns_term_init): Create selfds pipe and set non-blocking.
7640 Initialize select_mutex. Start the select thread (fd_handler).
7641 (fd_handler:): Loop forever, wait for info from the main thread
7642 to either start or stop selecting. When select returns, send
7643 and appdefined event.
7644 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7645 If not call kbd_buffer_store_event.
7646
7647 * nsterm.h (EmacsApp): fd_handler takes id argument.
7648 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7649
7650 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7651
7652 2012-08-15 Eli Zaretskii <eliz@gnu.org>
7653
7654 * region-cache.c (move_cache_gap): Update gap_len using the actual
7655 growth of the boundaries array. Do not change cache_len.
7656 (Bug#12196)
7657
7658 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7659
7660 Generalize and cleanup font subsystem checks.
7661 * font.h (FONT_DEBUG, font_assert): Remove.
7662 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7663 Change font_assert to eassert. Use eassert where appropriate.
7664
7665 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7666
7667 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7668
7669 2012-08-15 Chong Yidong <cyd@gnu.org>
7670
7671 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7672 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7673 extract the font descriptor instead of just the font name.
7674 In that case, return a font spec instead of a string.
7675 (x_last_font_name): Move to this file from xfns.c.
7676
7677 * xfns.c (Fx_select_font): The return value can also be a font
7678 spec. Move x_last_font_name management to gtkutil.c.
7679
7680 * xfaces.c: Make font weight and style symbols non-static.
7681
7682 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7683
7684 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7685 (bug#12117).
7686
7687 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7688
7689 * alloc.c (Fgarbage_collect): Use plural form consistently.
7690
7691 2012-08-14 Eli Zaretskii <eliz@gnu.org>
7692
7693 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7694 iteration through the command loop. Fixes a problem whereby mouse
7695 movements are ignored until the first mouse click.
7696
7697 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7698
7699 Use bool, not int, for Lisp booleans.
7700 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7701 makes Emacs a bit smaller and presumably a bit faster.
7702 * lisp.h: Include <stdbool.h>.
7703 (struct Lisp_Boolfwd, defvar_bool):
7704 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7705 * regex.c [!emacs]: Include <stdbool.h>.
7706 (false, true): Remove; <stdbool.h> does this for us now.
7707
7708 2012-08-14 Chong Yidong <cyd@gnu.org>
7709
7710 * character.c (Fcharacterp): Doc fix (Bug#12076).
7711
7712 * data.c (Findirect_variable): Doc fix (Bug#11040).
7713
7714 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7715
7716 * editfns.c (Fformat): Doc fix (Bug#12059).
7717 (Fsave_current_buffer): Doc fix (Bug#11542).
7718
7719 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7720
7721 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7722 (bug#12022).
7723
7724 2012-08-14 Martin Rudalics <rudalics@gmx.at>
7725
7726 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7727 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7728 * minibuf.c (choose_minibuf_frame, read_minibuf):
7729 * w32fns.c (x_create_tip_frame):
7730 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7731 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7732
7733 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7734
7735 * intervals.c (offset_intervals): Remove obsolete comment.
7736
7737 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7738
7739 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7740
7741 2012-08-14 Gergely Risko <gergely@risko.hu>
7742
7743 * coding.c (decode_coding): Record buffer modification before
7744 disabling undo_list (Bug#11773).
7745
7746 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7747
7748 Revert and cleanup some recent overlay changes.
7749 * buffer.h (enum overlay_type): Remove.
7750 (buffer_get_overlays, buffer_set_overlays): Likewise.
7751 (buffer_set_overlays_before, buffer_set_overlays_after):
7752 New function. Adjust users.
7753 (unchain_both): Add eassert.
7754
7755 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7756
7757 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7758
7759 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7760
7761 * gtkutil.c (xg_mark_data): Don't assume C99.
7762
7763 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7764
7765 * gtkutil.c (xg_frame_tb_info): New struct.
7766 (TB_INFO_KEY): New define.
7767 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7768 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7769 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7770 if not present.
7771 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7772 is up to date. Otherwise store new data.
7773 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7774
7775 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7776
7777 Use KSET for write access to Lisp_Object members of struct kboard.
7778 * keyboard.h (KSET): New macro.
7779 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7780 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7781 * xterm.c: Adjust users.
7782
7783 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7784
7785 Use BSET for write access to Lisp_Object members of struct buffer.
7786 * buffer.h (BSET): New macro.
7787 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7788 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7789 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7790 * window.c, xdisp.c, xfns.c: Adjust users.
7791
7792 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7793
7794 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7795
7796 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7797
7798 * nsterm.m (not_in_argv): New function.
7799 (application:openFile, application:openTempFile:):
7800 (application:openFileWithoutUI:, application:openFiles:): Open file
7801 if not_in_argv returns non-zero (bug#12171).
7802
7803 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
7804 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7805 Define for Gtk+ versions less than 3.2.
7806 (xg_get_font_name): Use those functions/macros here.
7807 Reported by Frans Oilinki <moilinki@gmail.com>.
7808
7809 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7810
7811 * unexmacosx.c (copy_data_segment): Copy initialized data in
7812 statically linked libraries from input file rather than memory.
7813
7814 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7815 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7816 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7817
7818 2012-08-10 Glenn Morris <rgm@gnu.org>
7819
7820 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7821 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7822
7823 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7824
7825 Fix last change to allow compilation with low optimization levels.
7826 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7827 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7828
7829 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7830
7831 Use common inline syntax in intervals.h.
7832 * intervals.h (INTERVALS_INLINE): New macro.
7833 Change all users from LISP_INLINE.
7834
7835 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7836
7837 Define Qnone once for all platforms.
7838 * frame.c (Qnone): Define here.
7839 (syms_of_frame): DEFSYM it.
7840 * lisp.h (Qnone): New declaration.
7841 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7842 * xfns.c: Remove duplication. Adjust users.
7843
7844 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7845
7846 Remove unused macros from intervals.h.
7847 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7848 * intervals.c: Adjust comment.
7849
7850 2012-08-10 Eli Zaretskii <eliz@gnu.org>
7851
7852 * w32fns.c <w32_unicode_gui>: New static variable.
7853 (globals_of_w32fns): Initialize it according to os_subtype.
7854 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7855 testing os_subtype.
7856
7857 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
7858 Eli Zaretskii <eliz@gnu.org>
7859
7860 Fix bug #10299 with Unicode characters sent by customized
7861 keyboards created by MSKLC.
7862 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7863 (w32_init_class): Use it to initialize the Emacs class with either
7864 ANSI or Unicode API calls.
7865 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7866 later.
7867 (w32_wnd_proc): If the character code sent by WM_CHAR or
7868 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7869 original message. Call DefWindowProcW on NT and later.
7870
7871 2012-08-10 Glenn Morris <rgm@gnu.org>
7872
7873 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7874
7875 * lisp.h (DIRECTORY_SEP): Let configure set it.
7876
7877 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7878
7879 Use TSET for write access to Lisp_Object slots of struct terminal.
7880 * termhooks.h (TSET): New macro.
7881 * coding.c, terminal.c, xselect.c: Adjust users.
7882
7883 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7884
7885 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7886 the failing expression, include them in the error message.
7887 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7888 * lisp.h (internal_condition_case_n): Update declaration.
7889
7890 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7891
7892 Inline functions to examine and change buffer overlays.
7893 * buffer.c (unchain_both): New function.
7894 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7895 (buffer_has_overlays): New function.
7896 (enum overlay_type): New enum.
7897 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7898 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7899
7900 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7901
7902 Inline functions to examine and change buffer intervals.
7903 * alloc.c (mark_interval_tree): Remove.
7904 (MARK_INTERVAL_TREE): Simplify.
7905 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7906 * intervals.c (buffer_balance_intervals): New function.
7907 (graft_intervals_into_buffer): Adjust indentation.
7908 (set_intervals_multibyte): Simplify.
7909 * buffer.h (BUF_INTERVALS): Remove.
7910 (buffer_get_intervals, buffer_set_intervals): New function.
7911 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7912 * intervals.c, textprop.c: Adjust users.
7913
7914 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7915
7916 Inline functions to examine and change string intervals.
7917 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7918 (string_get_intervals, string_set_intervals): New function.
7919 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7920 * lread.c, print.c, textprop.c: Adjust users.
7921
7922 2012-08-08 Glenn Morris <rgm@gnu.org>
7923
7924 * lisp.mk (lisp): Remove language/persian.elc.
7925
7926 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7927
7928 Cleanup intervals.
7929 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7930 (NULL_INTERVAL_P): Likewise. Adjust users.
7931 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7932 Adjust comment. Move under #if 0.
7933 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7934 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7935
7936 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7937
7938 Check total length of intervals with eassert.
7939 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7940 * intervals.c: Change all users to eassert.
7941
7942 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7943
7944 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7945 Rename fields to match removal of FGET and WGET and disuse of
7946 INTERNAL_FIELD in Lisp_Cons.
7947
7948 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7949
7950 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7951 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7952 name since all xname users are fixed long time ago. Do not
7953 use INTERNAL_FIELD.
7954 (set_symbol_name, set_symbol_function, set_symbol_plist):
7955 (set_symbol_next, set_overlay_plist): New function.
7956 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7957 (struct Lisp_Overlay): Likewise.
7958 (CVAR, MVAR, SVAR): Remove.
7959 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7960 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7961 * xterm.c: Adjust users.
7962 * .gdbinit: Change to use name field of struct Lisp_Symbol
7963 where appropriate.
7964
7965 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7966
7967 Basic functions to set Lisp_Object and pointer slots of intervals.
7968 * intervals.h (interval_set_parent, interval_set_object):
7969 (interval_set_left, interval_set_right, interval_set_plist):
7970 (interval_copy_parent): New function.
7971 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7972 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7973 Adjust indentation.
7974 (INTERVAL_SIZE): Remove. Adjust users.
7975 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7976
7977 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7978
7979 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7980 * process.h (PGET): Remove.
7981 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7982 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7983
7984 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7985
7986 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7987 * window.h (WGET): Remove.
7988 (struct window): Do not use INTERNAL_FIELD.
7989 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7990 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7991 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7992 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7993 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7994 Adjust users.
7995
7996 2012-08-07 Chong Yidong <cyd@gnu.org>
7997
7998 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7999 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8000 (Fdelete_window_internal): Signal an error if the window is not on
8001 a live frame (Bug#12025).
8002
8003 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8004
8005 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8006 * frame.h (FGET): Remove.
8007 (struct frame): Do not use INTERNAL_FIELD.
8008 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8009 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8010 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8011 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8012
8013 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8014
8015 * w32.c: Silence compiler warnings.
8016 (map_w32_filename): Remove unused variable `is_fat'.
8017 (chase_symlinks): Add parentheses around expression.
8018
8019 2012-08-06 Glenn Morris <rgm@gnu.org>
8020
8021 * sysdep.c: Respect BROKEN_GETWD.
8022
8023 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8024 Let configure handle it.
8025 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8026
8027 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8028
8029 Use GCALIGNMENT where appropriate.
8030 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8031 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8032 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8033
8034 2012-08-06 Eli Zaretskii <eliz@gnu.org>
8035
8036 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8037 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8038
8039 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8040
8041 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8042 that should be sufficient for everyone.
8043
8044 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8045
8046 * keyboard.c (timer_check_2): Add break so timer_check returns next
8047 timeout.
8048
8049 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8050
8051 Fix Windows build errors introduced after converting to WGET and WSET.
8052 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8053 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8054
8055 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8056
8057 * nsterm.m (ns_frame_rehighlight): Use FSET.
8058
8059 * nsmenu.m (ns_update_menubar): Use FSET.
8060
8061 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8062
8063 Separate read and write access to Lisp_Object slots of Lisp_Process.
8064 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8065 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8066
8067 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8068
8069 Separate read and write access to Lisp_Object slots of struct window.
8070 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8071 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8072 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8073 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8074 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8075 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8076 Adjust users.
8077
8078 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8079
8080 Fix Windows build errors introduced after converting to FGET and FSET.
8081 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8082 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8083 (w32_judge_scroll_bars): Change to use FSET.
8084 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8085
8086 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8087
8088 Fix replacement typo.
8089 * window.c (replace_window): Set root_window instead of
8090 selected_window. This fixes a total window subsystem
8091 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8092
8093 2012-08-06 Glenn Morris <rgm@gnu.org>
8094
8095 * lisp.mk (lisp): Add language/persian.elc.
8096
8097 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8098
8099 Separate read and write access to Lisp_Object slots of struct frame.
8100 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8101 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8102 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8103 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8104 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8105
8106 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8107
8108 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8109
8110 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8111
8112 Generalize common compile-time constants.
8113 * lisp.h (header_size, bool_header_size, word_size): Now here.
8114 (struct Lisp_Vector): Add comment.
8115 (struct Lisp_Bool_Vector): Move up to define handy constants.
8116 (VECSIZE, PSEUDOVECSIZE): Simplify.
8117 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8118 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8119 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8120 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8121 * xfont.c, xmenu.c: Use word_size where appropriate.
8122
8123 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8124
8125 * search.c (Freplace_match): Treat \? in the replacement text
8126 literally (Bug#8161).
8127
8128 2012-08-05 Chong Yidong <cyd@gnu.org>
8129
8130 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8131 * frame.c (Vdelete_frame_functions):
8132 * emacs.c (Vkill_emacs_hook): Doc fix.
8133
8134 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8135
8136 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8137 --with-x-toolkit=no builds.
8138 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8139
8140 2012-08-04 Chong Yidong <cyd@gnu.org>
8141
8142 * syntax.c (Fmodify_syntax_entry): Doc fix.
8143
8144 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8145
8146 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8147 * w32.c (init_environment): Change the default values of many
8148 environment variables in dflt_envvars[] to NULL, to avoid pushing
8149 them into environment when they were not already defined.
8150 Remove the code that deletes site-lisp subdirectories from the default
8151 value of EMACSLOADPATH, as it is no longer needed.
8152 (check_windows_init_file): Now external, not static.
8153 Use Vload_path as is, without adding anything, as this function is now
8154 called when Vload_path is already set up.
8155
8156 * w32.h (check_windows_init_file): Add prototype.
8157
8158 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8159 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8160 compatibility with Posix platforms.
8161 (main): Move the call to check_windows_init_file to here from
8162 w32.c.
8163 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8164 any, in the DEFALT argument into the root of the Emacs build or
8165 installation tree, as appropriate.
8166
8167 * callproc.c (init_callproc_1): Call decode_env_path instead of
8168 doing its equivalent by hand.
8169 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8170 the code that sets Vexec_path run on MS-Windows.
8171
8172 * lread.c (init_lread): Add comments to #ifdef's.
8173
8174 * msdos.c (dos_set_window_size, IT_update_begin)
8175 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8176 instead of direct references.
8177
8178 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 Export DEFAULT_REHASH_* to GDB.
8181 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8182 Now constants, not macros.
8183
8184 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8185
8186 Remove unnecessary casts involving pointers.
8187 These casts are no longer needed now that we assume C89 or later,
8188 since they involve casting to or from void *.
8189 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8190 (make_pure_float, make_pure_vector):
8191 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8192 * macros.c (Fstart_kbd_macro):
8193 * menu.c (find_and_return_menu_selection):
8194 * minibuf.c (read_minibuf_noninteractive):
8195 * sysdep.c (closedir):
8196 * xdisp.c (x_produce_glyphs):
8197 * xfaces.c (compare_fonts_by_sort_order):
8198 * xfns.c (x_real_positions, select_visual):
8199 * xselect.c (x_stop_queuing_selection_requests)
8200 (x_get_window_property, x_get_window_property_as_lisp_data):
8201 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8202 Remove unnecessary pointer casts.
8203 * alloc.c (record_xmalloc): New function.
8204 * lisp.h (record_xmalloc): New decl.
8205 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8206 more like a function. This is because the pointer cast is not
8207 needed. All uses changed.
8208 * print.c (print_string, print_error_message): Avoid length recalc.
8209
8210 Improve fix for macroexp crash with debugging (Bug#12118).
8211 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8212 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8213 not supposed to be invoked from the garbage collector.
8214 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8215 (gc_aset): New function, which is like ASET but can be
8216 used in the garbage collector.
8217 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8218 (set_hash_index): Use it instead of ASET.
8219
8220 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8221
8222 Support symlinks on latest versions of MS-Windows.
8223 * w32.c: Include winioctl.h and aclapi.h.
8224 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8225 (revert_to_self): Forward declarations of static functions.
8226 <static BOOL g_b_init_get_security_info>:
8227 <g_b_init_create_symbolic_link>: New static flags.
8228 (globals_of_w32): Initialize them to zero.
8229 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8230 (map_w32_filename): Improve commentary. Simplify switch.
8231 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8232 headers (most versions of MinGW w32api don't).
8233 (get_security_info, create_symbolic_link)
8234 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8235 New functions.
8236 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8237 in the argument file name.
8238 (sys_access): Call unc_volume_file_attributes only if
8239 GetFileAttributes fails with network-related error codes.
8240 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8241 have the required privileges.
8242 (get_file_security_desc_by_name): Rename from
8243 get_file_security_desc.
8244 (stat_worker): New function, with most of the guts of 'stat', and
8245 with addition of handling of symlinks and support for 'lstat'.
8246 If possible, get file's attributes and security information by
8247 handle, not by name. Produce S_IFLNK bit for symlinks, when
8248 called from 'lstat'.
8249 (stat, lstat): New functions, call 'stat_worker'.
8250 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8251 symlinks when the underlying filesystem supports them.
8252
8253 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8254
8255 Fix macroexp crash on Windows with debugging (Bug#12118).
8256 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8257 checking subscripts; problem introduced with the recent
8258 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8259 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8260 since it's used in non-static inline functions now.
8261
8262 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8263 Don't assume buffer size fits in 'int'. Remove unused local.
8264
8265 Use C99-style 'extern inline' if available.
8266 * buffer.h (BUFFER_INLINE):
8267 * category.h (CATEGORY_INLINE):
8268 * character.h (CHARACTER_INLINE):
8269 * charset.h (CHARSET_INLINE):
8270 * composite.h (COMPOSITE_INLINE):
8271 * dispextern.h (DISPEXTERN_INLINE):
8272 * lisp.h (LISP_INLINE):
8273 * systime.h (SYSTIME_INLINE):
8274 New macro, replacing 'static inline' in this header.
8275 * buffer.h, category.h, character.h, charset.h, composite.h:
8276 * dispextern.h, lisp.h, systime.h:
8277 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8278 * alloc.c (LISP_INLINE):
8279 * buffer.c (BUFFER_INLINE):
8280 * category.c (CATEGORY_INLINE):
8281 * character.c (CHARACTER_INLINE):
8282 * charset.c (CHARSET_INLINE):
8283 * composite.c (COMPOSITE_INLINE):
8284 * dispnew.c (DISPEXTERN_INLINE):
8285 * sysdep.c (SYSTIME_INLINE):
8286 Define to EXTERN_INLINE, so that the corresponding functions
8287 are compiled into code.
8288 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8289 (INLINE_HEADER_END): New macros.
8290 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8291 since it's used in non-static inline functions now.
8292 (VALMASK) [!USE_LSB_TAG]: Likewise.
8293
8294 2012-08-02 Glenn Morris <rgm@gnu.org>
8295
8296 * s/: Remove empty directory.
8297
8298 * s/ms-w32.h: Move to ../nt/inc.
8299 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8300 Update for new ms-w32.h location.
8301
8302 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8303
8304 Port to Solaris 8.
8305 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8306
8307 2012-08-02 Glenn Morris <rgm@gnu.org>
8308
8309 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8310 hard-coding the path separator.
8311
8312 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8313
8314 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8315 This how ASET and AREF are supposed to work, and makes
8316 it easier to think about future improvements. See
8317 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8318 * charset.h (set_charset_attr): New function.
8319 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8320 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8321 (aref_addr): New function. All uses of &AREF(...) changed.
8322 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8323 (set_hash_index): New functions. All lvalue-style uses of
8324 HASH_KEY etc. changed.
8325 * keyboard.c (set_prop): New function. All lvalue-style uses
8326 of PROP changed.
8327
8328 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8329
8330 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8331 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8332 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8333 * nsfns.m (ns_set_name_as_filename): Likewise.
8334 * nsmenu.m (ns_update_menubar): Likewise.
8335 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8336
8337 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8338
8339 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8340 Adapt to latest changes in field names of the corresponding Lisp
8341 objects.
8342
8343 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8344
8345 2012-08-01 Glenn Morris <rgm@gnu.org>
8346
8347 * s/msdos.h: Remove file.
8348 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8349 * Makefile.in (S_FILE): Remove.
8350 (config_h): Remove S_FILE.
8351
8352 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8353
8354 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8355 Remove; moved to nt/config.nt.
8356
8357 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8358
8359 Use INTERNAL_FIELD for conses and overlays.
8360 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8361 Remove obsolete comment.
8362 (MVAR): New macro.
8363 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8364 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8365
8366 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8367
8368 Use INTERNAL_FIELD for symbols.
8369 * lisp.h (SVAR): New macro. Adjust users.
8370 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8371 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8372
8373 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8374
8375 Use INTERNAL_FIELD for processes.
8376 * process.h (PVAR): New macro. Adjust style.
8377 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8378 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8379
8380 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8381
8382 Use INTERNAL_FIELD for windows.
8383 * window.h (WVAR): New macro.
8384 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8385 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8386 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8387 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8388 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8389 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8390
8391 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8392
8393 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8394
8395 2012-08-01 Glenn Morris <rgm@gnu.org>
8396
8397 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8398 Move to configure.ac.
8399
8400 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8401
8402 * makefile.w32-in (CONFIG_H): Update dependencies.
8403 (CONF_POST_H): New macro.
8404
8405 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8406
8407 2012-07-31 Glenn Morris <rgm@gnu.org>
8408
8409 * Makefile.in (S_FILE): No longer set by configure.
8410
8411 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8412 is available.
8413 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8414
8415 * process.h (NULL_DEVICE):
8416 * emacs.c (SEPCHAR):
8417 * editfns.c (USER_FULL_NAME): Let configure set them.
8418
8419 * s/README, s/template.h: Remove files.
8420
8421 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8422
8423 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8424 Move to configure.ac.
8425
8426 2012-07-31 Eli Zaretskii <eliz@gnu.org>
8427
8428 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8429 resulting renaming of 'struct frame' members.
8430
8431 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8432
8433 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8434 after introduction of FVAR.
8435
8436 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8437
8438 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8439
8440 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8441 instead of compositeToPoint.
8442 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8443
8444 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8445
8446 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8447
8448 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8449 * lisp.h (INTERNAL_FIELD): New macro.
8450 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8451 (BVAR): Change to use INTERNAL_FIELD.
8452 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8453 (KVAR): Change to use INTERNAL_FIELD.
8454 * frame.h (FVAR): New macro.
8455 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8456 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8457 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8458 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8459 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8460
8461 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8462
8463 Miscellaneous fixes for non-default X toolkits.
8464 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8465 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8466 Move under #ifdef USE_LUCID.
8467 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8468 definition and usage to avoid warnings.
8469
8470 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8471
8472 * nsterm.m (openFiles): Fix previous checkin.
8473
8474 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8475
8476 * indent.c (compute_motion): Remove unused local.
8477
8478 2012-07-31 Glenn Morris <rgm@gnu.org>
8479
8480 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8481
8482 * conf_post.h [USG5_4]:
8483 Move remaining contents of s/usg5-4-common.h here.
8484 * s/usg5-4-common.h: Remove file.
8485
8486 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8487 * s/irix6-5.h: Remove file.
8488
8489 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8490 * s/darwin.h: Remove file.
8491
8492 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8493 * s/hpux10-20.h: Remove file, which is now empty.
8494
8495 2012-07-30 Glenn Morris <rgm@gnu.org>
8496
8497 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8498 * Makefile.in (config_h): Add conf_post.h.
8499 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8500
8501 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8502
8503 * nsterm.m (ns_do_open_file): New variable.
8504 (ns_term_init): Set ns_do_open_file to YES after run returns.
8505 (openFile, openTempFile, openFileWithoutUI, openFiles):
8506 Open files only if ns_do_open_file.
8507
8508 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8509
8510 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8511 This no-op macro hasn't been needed for many years.
8512 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8513
8514 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8515 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8516 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8517 gdb_make_enums_visible.
8518 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8519 (DIRECTORY_SEP): Now a constant, not a macro.
8520
8521 2012-07-30 Eli Zaretskii <eliz@gnu.org>
8522
8523 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8524 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8525
8526 * w32term.c <w32_keyboard_codepage>: Renamed from
8527 keyboard_codepage and now external. All users changed.
8528
8529 * w32term.h: Add declaration of w32_keyboard_codepage.
8530
8531 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8532 the codepage to translate keys to Unicode. If this argument is
8533 -1, use the value returned by GetConsoleCP. All callers changed.
8534
8535 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8536
8537 Update .PHONY listings in makefiles.
8538 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8539 bootstrap-clean, distclean, maintainer-clean, versioclean,
8540 extraclean, frc.
8541
8542 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8543 This is a bit clearer. Fix some commentary typos.
8544
8545 2012-07-30 Glenn Morris <rgm@gnu.org>
8546
8547 * s/netbsd.h: Let configure include signal.h if needed.
8548 Remove file, which is now empty.
8549
8550 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8551 Let configure set them.
8552 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8553 No more need to undefine.
8554
8555 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8556
8557 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8558 non-single-byte char when adding meta modifier. (Bug#12090)
8559
8560 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8561
8562 Convert safe_call to use variable number of arguments.
8563 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8564 (safe_call2): Fix comment.
8565 * lisp.h (safe_call): Adjust prototype.
8566 * coding.c (encode_coding_object): Change to use safe_call2.
8567 * xfaces.c (merge_face_heights): Change to use safe_call1.
8568
8569 2012-07-30 Glenn Morris <rgm@gnu.org>
8570
8571 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8572 does that unconditionally. Remove file, which is now empty.
8573
8574 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8575 Remove empty files.
8576
8577 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8578
8579 Export to GDB most of lisp.h's remaining object-like macros.
8580 * lisp.h (min, max): Move earlier, because they're used earlier now.
8581 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8582 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8583 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8584 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8585 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8586 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8587 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8588 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8589 Now constants, for GDB. They need not be macros.
8590 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8591 Now constants, for GDB, as well as macros, for static initializers.
8592 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8593 Move to after the definition of struct Lisp_Char_Table,
8594 since the former now needs that type defined.
8595 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8596 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8597 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8598 New enums, for gdb_make_enums_visible.
8599 (GLYPH_MODE_LINE_FACE): Remove; unused.
8600 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8601 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8602 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8603 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8604 enum maxargs, enum MAX_ALLOCA.
8605 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8606 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8607 no longer needed, now that they are done in lisp.h.
8608
8609 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8610
8611 Cleanup string bytes checking.
8612 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8613 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8614 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8615 (check_sblock, compact_small_strings): Simplify.
8616
8617 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8618
8619 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8620 These macros are confusing and no longer need to be defined, as
8621 the enum values now suffice. All uses replaced with definiens.
8622 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8623
8624 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
8625
8626 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8627 ($(BLD)/w32console.$(O)): Update dependencies.
8628
8629 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8630
8631 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8632 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8633 time. Adjust users.
8634 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8635
8636 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8637
8638 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8639 setting sitelisp (Bug#12010).
8640
8641 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8642
8643 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8644
8645 * w32heap.c (cache_system_info):
8646 * w32.c (sys_rename):
8647 * w32proc.c (find_child_console, sys_kill): All users changed.
8648
8649 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8650
8651 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8652
8653 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8654
8655 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8656
8657 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8658
8659 Cleanup statistics calculation in Fgarbage_collect.
8660 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8661 Fix zombies percentage calculation. Simplify elapsed time calculation.
8662
8663 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8664
8665 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8666 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8667 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8668 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8669 (replace_range, replace_range_2, del_range_2): Change to eassert.
8670 * marker.c (byte_char_debug_check): Adjust style.
8671
8672 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8673
8674 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8675 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8676 long-ago-commented-out code that talks about "WIN32".
8677 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8678 All uses changed.
8679
8680 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8681
8682 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8683 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8684 Simplify by using alignof.
8685 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8686 * lisp.h: Include <stdalign.h>.
8687 (GCALIGNMENT): New macro and constant.
8688 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8689 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8690 (stdalign): New macro, if not already defined.
8691
8692 2012-07-28 Eli Zaretskii <eliz@gnu.org>
8693
8694 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8695 * w32inevt.c: Include w32inevt.h.
8696 (w32_read_console_input): New inline function, calls either
8697 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8698 w32_console_unicode_input.
8699 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8700 (w32_kbd_patch_key, key_event): Use the codepage returned by
8701 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8702 (key_event): use uChar.UnicodeChar only if
8703 w32_console_unicode_input is non-zero.
8704
8705 * w32console.c: Include w32heap.h.
8706 <w32_console_unicode_input>: New global variable.
8707 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8708 family of Windows, zero otherwise.
8709
8710 * w32inevt.h: Declare w32_console_unicode_input.
8711
8712 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8713 --without-x. (Bug#11742)
8714
8715 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8716
8717 Adjust GDB to reflect pvec_type changes (Bug#12036).
8718 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8719 2012-07-04 changes to pseudovector representation.
8720 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8721
8722 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
8723
8724 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8725 bus address.
8726 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8727
8728 2012-07-27 Eli Zaretskii <eliz@gnu.org>
8729
8730 * alloc.c (listn): Fix the order the arguments are consed onto the
8731 list.
8732
8733 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8734 enumeration constants, as PURE and HEAP are too general, and clash
8735 with other headers and sources, such as gmalloc.c and the
8736 MS-Windows system headers. All users changed.
8737
8738 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8739
8740 Revert last save_excursion_save and save_excursion_restore changes.
8741 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8742 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8743
8744 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8745
8746 Fix recently-introduced typos in Windows port.
8747 Reported by Martin Rudalics <rudalics@gmx.at>.
8748 * w32.c (init_environment): Replace comma with semicolon.
8749 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8750
8751 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8752
8753 Improve GDB symbol export (Bug#12036).
8754 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8755 arms of an 'if', not using conditional expressions; otherwise GDB
8756 complains about the types in the unevaluated arm when the argument
8757 is an integer literal.
8758 (xgetint): Simplify expression.
8759 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8760 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8761 Zaretskii in <http://bugs.gnu.org/12036#13>.
8762 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8763 needed now that we have gdb_make_enums_visible.
8764 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8765 (enum enum_USE_LSB_TAG):
8766 New enum types, packaging up enums that need to be exported to GDB.
8767
8768 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8769
8770 Utility function to make a list from specified amount of objects.
8771 * lisp.h (enum constype): New datatype.
8772 (listn): New prototype.
8773 * alloc.c (listn): New function.
8774 (Fmemory_use_count, syms_of_alloc): Use it.
8775 * buffer.c (syms_of_buffer): Likewise.
8776 * callint.c (syms_of_callint): Likewise.
8777 * charset.c (define_charset_internal): Likewise.
8778 * coding.c (syms_of_coding): Likewise.
8779 * keymap.c (syms_of_keymap): Likewise.
8780 * search.c (syms_of_search): Likewise.
8781 * syntax.c (syms_of_syntax): Likewise.
8782 * w32.c (init_environment): Likewise.
8783 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8784 * xdisp.c (syms_of_xdisp): Likewise.
8785 * xfns.c (syms_of_xfns): Likewise.
8786
8787 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8788
8789 Fast save_excursion_save and save_excursion_restore.
8790 * lisp.h (struct Lisp_Excursion): New data type.
8791 (PVEC_EXCURSION): New pseudovector type.
8792 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8793 to deal with it. Adjust comments.
8794 (init_marker, attach_marker): New prototype.
8795 (unchain_marker): Adjust prototype.
8796 * marker.c (attach_marker): Change to global.
8797 (init_marker): New function.
8798 * alloc.c (Fmake_marker, build_marker): Use it.
8799 (build_marker): More easserts.
8800 (mark_object): Handle struct Lisp_Excursion.
8801 * editfns.c (save_excursion_save, save_excursion_restore):
8802 Reimplement to use struct Lisp_Excursion. Add comments.
8803
8804 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8805
8806 Fix export of symbols to GDB (Bug#12036).
8807 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8808 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8809 emacs.c, as this is a more-suitable home. Had this been done earlier
8810 the fix for 12036 would have avoided some of the problems noted in
8811 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8812 would have been more obvious.
8813 * emacs.c: Do not include <verify.h>; no longer needed.
8814 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
8815 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8816 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8817 Remove; now done in lisp.h.
8818 * lisp.h (PUBLISH_TO_GDB): New macro.
8819 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8820 (DATA_SEG_BITS): Use it.
8821 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8822 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8823 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8824 not be usable in #if. This simplifies things.
8825
8826 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
8827
8828 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8829
8830 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8831
8832 Simplify export of symbols to GDB (Bug#12036).
8833 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8834 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8835 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8836 Adjust to changes in lisp.h and emacs.c, by using
8837 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8838 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8839 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8840 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8841 instead of gdb_valbits.
8842 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8843 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8844 instead of gdb_array_mark_flag.
8845 (xboolvector): Get size from $->size, not $->header.size.
8846 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8847 (xreload, hook-run, hookpost-run): Remove.
8848 * emacs.c: Include <verify.h>.
8849 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8850 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8851 Remove.
8852 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8853 (gdb_USE_LSB_TAG): New enum constants.
8854 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8855 Also define these as enum constants, so they're visible to GDB.
8856 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8857 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8858 as constants, so they're visible to GDB.
8859 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8860 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8861 Now enum constants, not macros, so they're visible to GDB.
8862 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8863 more convenient now. All uses changed.
8864 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8865 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8866
8867 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8868
8869 Explicitly free restriction data that are not needed anymore.
8870 * editfns.c (save_restriction_restore): Free restriction data.
8871
8872 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8873
8874 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8875 add argument, tune behavior, and adjust all callers.
8876
8877 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8878
8879 Use typedef for EMACS_INT, EMACS_UINT.
8880 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8881 than macros. This simplifies debugging in the usual case, since
8882 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8883 and it allows expressions involving EMACS_INT casts.
8884 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8885
8886 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8887
8888 * nsterm.m (ns_read_socket): Return early if there is a modal
8889 window (Bug#12043).
8890
8891 2012-07-25 Martin Rudalics <rudalics@gmx.at>
8892
8893 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8894 that FOCUS-FRAME can be omitted.
8895
8896 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8897
8898 Adjust buffer text indirection counters at the end of Fkill_buffer.
8899 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8900 buffer is definitely dead. This should really fix an issue reported
8901 by Christoph Scholtes again. (Bug#12007).
8902 (init_buffer_once): Initialize indirection counters of
8903 buffer_defaults and buffer_local_symbols (for sanity and safety).
8904
8905 2012-07-24 Eli Zaretskii <eliz@gnu.org>
8906
8907 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8908 and continuation glyphs on tooltip frames, leave them at zero.
8909 Avoids continued lines in tooltips. (Bug#11832)
8910
8911 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8912
8913 Simplify copy_overlay.
8914 * buffer.c (copy_overlay): Simplify. Use build_marker.
8915 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8916
8917 2012-07-23 Eli Zaretskii <eliz@gnu.org>
8918
8919 * print.c (print_object): Don't crash when a frame's name is nil
8920 or invalid. (Bug#12025)
8921
8922 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8923 it signals an error when a tooltip frame is being created.
8924
8925 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8926
8927 Cleanup miscellaneous objects allocation and initialization.
8928 * alloc.c (allocate_misc): Change to static. Add argument to
8929 specify the subtype. Adjust comment and users.
8930 (build_overlay): New function.
8931 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8932 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8933 (allocate_misc): Remove prototype.
8934 (build_overlay): Add prototype.
8935
8936 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8937
8938 Swap buffer text indirection counters in Fbuffer_swap_text.
8939 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8940 This avoids crash reported by Christoph Scholtes at
8941 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8942
8943 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8944
8945 * nsmenu.m (Popdown_data): New struct.
8946 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8947 free Popdown_data.
8948 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8949 (initWithContentRect): Make imgView and contentView non-static
8950 and autorelease them. Also autorelease img and matrix (Bug#12005).
8951 (dealloc): Remove (Bug#12005).
8952
8953 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8954
8955 Adjust consing_since_gc when objects are explicitly freed.
8956 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8957 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8958 (free_cons, free_misc): Subtract object size from consing_since_gc.
8959
8960 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8961
8962 Simplify and cleanup markers positioning code.
8963 * marker.c (attach_marker): More useful eassert.
8964 (live_buffer, set_marker_internal): New function.
8965 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8966 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8967
8968 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8971 as it's limited by the amount of memory, not by INT_MAX.
8972
8973 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8974
8975 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8976 in special-event-map. See the discussion at
8977 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8978 for the reasons.
8979
8980 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8981 info.dwItemData. Fixes crashes on 64-bit Windows.
8982 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8983
8984 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8985
8986 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8987 (conversationIdentifier): Return value is NSInteger.
8988 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8989
8990 2012-07-21 Chong Yidong <cyd@gnu.org>
8991
8992 * window.c (decode_any_window): Signal an error if the window is
8993 on a dead frame (Bug#11984).
8994
8995 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8996
8997 Add indirection counting to speed up Fkill_buffer.
8998 * buffer.h (struct buffer): New member.
8999 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9000 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9001 base buffer indirection counter.
9002 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9003 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9004 through buffer list if indirection counter is 0.
9005
9006 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9007
9008 Extend the value returned by Fgarbage_collect with heap statistics.
9009 * alloc.c (Qheap): New symbol.
9010 (syms_of_alloc): DEFSYM it.
9011 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9012 (Fmemory_free): Remove.
9013 (syms_of_alloc): Don't defsubr it.
9014 * buffer.c (Fcompact_buffer): Remove.
9015 (syms_of_buffer): Don't defsubr it.
9016
9017 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9018
9019 Make maybe_gc inline.
9020 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9021 * lisp.h (consing_since_gc, gc_relative_threshold)
9022 (memory_full_cons_threshold): Revert declaration.
9023 (maybe_gc): Remove prototype, define as inline.
9024 * alloc.c: Remove old commented-out code.
9025 (consing_since_gc, gc_relative_threshold)
9026 (memory_full_cons_threshold): Revert to global.
9027 (maybe_gc): Remove.
9028
9029 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9030
9031 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9032 * lisp.h (build_unibyte_string): New function.
9033 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9034 * sysdep.c, w32fns.c, xfns.c: Use it.
9035 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9036 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9037 Adjust users accordingly.
9038 * font.h (font_open_by_name): Adjust prototype.
9039
9040 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9041
9042 Cleanup calls to Fgarbage_collect.
9043 * lisp.h (maybe_gc): New prototype.
9044 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9045 Remove declarations.
9046 * alloc.c (maybe_gc): New function.
9047 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9048 Make them static.
9049 * bytecode.c (MAYBE_GC): Use maybe_gc.
9050 * eval.c (eval_sub, Ffuncall): Likewise.
9051 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9052 to avoid dependency from auto-save feature.
9053
9054 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9055
9056 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9057 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9058 'for_each_per_buffer_object_at'.
9059 All uses changed. It's better to use upper-case for macros that
9060 cannot be implemented as functions, to give the reader a clue
9061 that they're special.
9062
9063 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9064
9065 * alloc.c (Fgarbage_collect): Tweak docstring.
9066
9067 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9068
9069 Tweak the value returned from Fgarbage_collect again.
9070 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9071 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9072 Adjust documentation.
9073 (total_vector_bytes): Rename to total_vector_slots, adjust
9074 accounting.
9075 (total_free_vector_bytes): Rename to total_free_vector_slots,
9076 adjust accounting.
9077 (Qstring_bytes, Qvector_slots): New symbols.
9078 (syms_of_alloc): DEFSYM them.
9079
9080 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9081
9082 Buffer compaction primitive which may be used from Lisp.
9083 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9084 (syms_of_buffer): Register Fcompact_buffer.
9085 * alloc.c (Fgarbage_collect): Use compact_buffer.
9086 * buffer.h (compact_buffer): New prototype.
9087 (struct buffer_text): New member.
9088
9089 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9090
9091 New macro to iterate over all buffers, miscellaneous cleanups.
9092 * lisp.h (all_buffers): Remove declaration.
9093 * buffer.h (all_buffers): Add declaration, with comment.
9094 (for_each_buffer): New macro.
9095 * alloc.c (Fgarbage_collect, mark_object): Use it.
9096 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9097 (init_buffer): Likewise.
9098 * data.c (Fset_default): Likewise.
9099 * coding.c (code_conversion_restore): Remove redundant check
9100 for dead buffer.
9101 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9102
9103 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9104
9105 Fix bug that created negative-length intervals.
9106 * intervals.c (merge_interval_right, merge_interval_left):
9107 Do not zero out this interval if it is absorbed by its children,
9108 as this interval's total length doesn't change in that case. See
9109 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9110
9111 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9112
9113 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9114 when invoking (make-bool-vector N t) and N is a positive
9115 multiple of 8 -- the last 8 bits were mistakenly cleared.
9116
9117 Remove some struct layout assumptions in bool vectors.
9118 * alloc.c (bool_header_size): New constant.
9119 (header_size, word_size): Move earlier, as they're now used earlier.
9120 Use 'word_size' in a few more places, where it's appropriate.
9121 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9122 padding before the data member of a bool vector.
9123 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9124 than doing the check by hand with an abort ().
9125
9126 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9127
9128 * eval.c (Fdefvar): Don't check constants since we only set the var if
9129 it's not yet defined anyway (bug#11904).
9130
9131 * lisp.h (last_undo_boundary): Declare new var.
9132 * keyboard.c (command_loop_1): Set it.
9133 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9134 were auto-added by the command loop (bug#11774).
9135
9136 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9137
9138 * w32font.c (Qsymbol): Remove local definition.
9139 (syms_of_w32font): Don't DEFSYM it.
9140
9141 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9142
9143 Fix sweep_vectors to handle large bool vectors correctly.
9144 * alloc.c (sweep_vectors): Account total_vector_bytes for
9145 bool vectors larger than VBLOCK_BYTES_MAX.
9146
9147 2012-07-18 Chong Yidong <cyd@gnu.org>
9148
9149 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9150 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9151
9152 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9153
9154 Return more descriptive data from Fgarbage_collect.
9155 Suggested by Stefan Monnier in
9156 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9157 * alloc.c (bounded_number): New function.
9158 (total_buffers, total_vectors): New variable.
9159 (total_string_size): Rename to total_string_bytes, adjust users.
9160 (total_vector_size): Rename to total_vector_bytes, adjust users.
9161 (sweep_vectors): Account total_vectors and total_vector_bytes.
9162 (Fgarbage_collect): New return value. Adjust documentation.
9163 (gc_sweep): Account total_buffers.
9164 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9165 (VECTOR_SIZE): Remove.
9166 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9167 (Qinterval, Qmisc): New symbols.
9168 (syms_of_data): Initialize them.
9169 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9170 (Qcons, Qbuffer): New declarations.
9171
9172 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9175 Round up, not down. Improve doc.
9176
9177 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9178
9179 Restore old code in allocate_string_data to avoid Faset breakage.
9180 Reported by Julien Danjou <julien@danjou.info> in
9181 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9182 * alloc.c (allocate_string_data): Restore old code with minor
9183 adjustments, fix comment to explain this subtle issue.
9184
9185 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9186
9187 Remove FILE_SYSTEM_CASE.
9188 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9189
9190 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9191 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9192 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9193 call-process-region passes it through expand-file-name.
9194
9195 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9196
9197 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9198
9199 Fix crash when creating indirect buffer (Bug#11917)
9200 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9201 Don't handle unbound variables specially if non-zero.
9202 (Fbuffer_local_variables): Pass zero.
9203 (clone_per_buffer_values): Pass non-zero.
9204
9205 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9206
9207 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9208 to make the loop interruptible.
9209
9210 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9211
9212 * gnutls.c (emacs_gnutls_handshake): Only retry if
9213 GNUTLS_E_INTERRUPTED.
9214
9215 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9216
9217 Cleanup and convert miscellaneous checks to eassert.
9218 * alloc.c (mark_interval): Fix comment, partially rephrase
9219 old comment from intervals.h (see below).
9220 * intervals.c (find_interval, adjust_intervals_for_insertion)
9221 (delete_interval, adjust_intervals_for_deletion)
9222 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9223 Convert to eassert.
9224 (adjust_intervals_for_insertion, make_new_interval):
9225 Remove obsolete and unused code.
9226 * intervals.h (struct interval): Remove obsolete comment.
9227 * textprotp.c (erase_properties): Remove unused code.
9228 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9229 (Fremove_list_of_text_properties): Convert to eassert.
9230
9231 2012-07-17 Chong Yidong <cyd@gnu.org>
9232
9233 * editfns.c (Finsert_char): Doc fix.
9234
9235 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9236
9237 Fix previous change to make Fmemory_free always accurate.
9238 * alloc.c (make_interval): Update total_free_intervals.
9239 (make_float): Likewise for total_free_floats.
9240 (free_cons, Fcons): Likewise for total_free_conses.
9241 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9242 Likewise for total_free_vector_bytes.
9243 (Fmake_symbol): Likewise for total_free_symbols.
9244 (bytes_free): Remove.
9245
9246 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9247
9248 Simple free memory accounting feature.
9249 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9250 (sweep_vectors): Accumulate size of free vectors.
9251 (Fgarbage_collect): Setup bytes_free.
9252 (Fmemory_free): New function.
9253 (syms_of_alloc): Register it.
9254
9255 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9256
9257 Cleanup overlays checking.
9258 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9259 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9260 eassert and OVERLAYP.
9261 (sort_overlays): Change to use OVERLAYP.
9262
9263 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9264
9265 * editfns.c (Finsert_char): Make it interactive, and make the
9266 second arg optional. Copy interactive spec and docstring from
9267 ucs-insert.
9268
9269 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9270
9271 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9272 Unlike the other wrapped functions, fabs has an unspecified
9273 effect on errno.
9274
9275 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9276
9277 * nsterm.m (keyDown): Interpret flags without left/right bits
9278 as the left key (Bug#11670).
9279
9280 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9281
9282 Remove empty and useless init functions.
9283 * lisp.h (init_character_once, init_fns, init_image)
9284 (init_filelock, init_sound): Remove prototype.
9285 * character.c (init_character_once): Remove.
9286 * filelock.c (init_filelock): Likewise.
9287 * fns.c (init_fns): Likewise.
9288 * image.c (init_image): Likewise.
9289 * sound.c (init_sound): Likewise.
9290 * emacs.c (main): Adjust accordingly.
9291
9292 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9293
9294 * gtkutil.h: Tiny cleanups.
9295 (use_old_gtk_file_dialog): Remove useless declaration.
9296 (xg_uses_old_file_dialog): Add suggested const attribute.
9297
9298 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9299
9300 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9301 (bidi_paragraph_init): Use it to limit search forward for a strong
9302 directional character in abnormally large paragraphs full of
9303 neutral or weak characters. (Bug#11943)
9304
9305 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9306
9307 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9308 the toolbar (Bug#9451).
9309 (xg_make_tool_item): Give the widget event box a transparent
9310 background.
9311
9312 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9313
9314 Cleanup basic allocation variables and functions.
9315 * alloc.c (ignore_warnings, init_intervals, init_float)
9316 (init_cons, init_symbol, init_marker): Remove.
9317 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9318 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9319 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9320 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9321 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9322 (staticidx, init_alloc_once, init_strings, free_ablock):
9323 Remove redundant initialization.
9324 * fns.c (init_weak_hash_tables): Remove.
9325 * lisp.h (init_weak_hash_tables): Remove prototype.
9326
9327 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9328
9329 Use zero_vector where appropriate.
9330 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9331 accordingly.
9332 * lisp.h (zero_vector): New declaration.
9333 * font.c (null_vector): Remove.
9334 (syms_of_font): Remove initialization and staticpro.
9335 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9336 * keymap.c (Faccessible_keymaps): Likewise.
9337
9338 2012-07-15 Leo Liu <sdl.web@gmail.com>
9339
9340 * fringe.c: Fix typo in comments.
9341
9342 2012-07-14 Leo Liu <sdl.web@gmail.com>
9343
9344 * fringe.c: Add a new bitmap exclamation-mark.
9345
9346 2012-07-14 Eli Zaretskii <eliz@gnu.org>
9347
9348 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9349
9350 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9351 (HAVE_MENUS): Don't define, defined by editing config.in with
9352 msdos/sed2v2.inp.
9353 (GMALLOC_INHIBIT_VALLOC): Don't define.
9354 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9355
9356 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
9357
9358 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9359
9360 2012-07-14 Glenn Morris <rgm@gnu.org>
9361
9362 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9363 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9364 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9365
9366 2012-07-13 Glenn Morris <rgm@gnu.org>
9367
9368 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9369
9370 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9371 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9372
9373 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9374
9375 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9376 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9377 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9378 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9379 where appropriate.
9380 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9381 as boolean expression.
9382 (x_set_window_size): Remove unused variable toolbar.
9383 (ns_get_color_default, ns_mod_to_lisp): Remove.
9384 (ns_mouse_position): Remove unused variables xchar and ychar.
9385 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9386 (ns_set_vertical_scroll_bar): Remove unused variable count.
9387 (ns_delete_terminal): Remove unused variable i.
9388 (ns_term_init): Remove unused variables r, g and b.
9389 (mouseDown): Remove unused variable window.
9390 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9391 (initFrameFromEmacs): Remove unused variable vbextra.
9392 (mouseEntered): Remove unused variables p and dpyinfo.
9393 (mouseExited): Remove unused variables p and r.
9394 (ns_define_frame_cursor, ns_clear_frame_area)
9395 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9396 (menuDown): Assign [sender tag] to variable and cast the variable.
9397
9398 * nsterm.h (menuDown): Add id as type to argument sender.
9399 (ns_display_info_for_name): Add Lisp_Object argument.
9400 (ns_term_init): Add Lisp_Object argument.
9401 (ns_map_event_to_object): Add void argument.
9402 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9403 prototype with arguments and only declare if __OBJC__.
9404 (nxatoms_of_nsselect): Add void argument.
9405 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9406 (ns_alloc_autorelease_pool): Add void argument.
9407 (ns_release_autorelease_pool): Add void* argument.
9408 (ns_get_defaults_value): Add const char* argument.
9409
9410 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9411 (initFromContents): Use SSDATA where appropriate.
9412 (ns_update_menubar): Add braces to ambigous if-else.
9413 (initWithTitle): Put () around assignment in if statement.
9414 (ns_menu_show): Remove unused variables window and keymap.
9415 (update_frame_tool_bar): Remove unused variable selected_p.
9416 (initWithContentRect): Remove unused variable this_cmd_name.
9417
9418 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9419 appropriate.
9420 (setXBMColor): Remove unused variable len.
9421 (setPixmapData): Put () around assignment in loop statement.
9422
9423 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9424 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9425 where appropriate.
9426 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9427 around assignment in loop statement.
9428 (nsfont_open): Remove unused variable i.
9429 (nsfont_open): Remove unused variable len.
9430 (nsfont_draw): Remove unused variable cs.
9431
9432 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9433 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9434 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9435 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9436 (Fns_font_name, Fns_perform_service)
9437 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9438 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9439 (ns_set_name): Remove unused variable view.
9440 (x_set_menu_bar_lines): Remove unused variable olines.
9441 (x_set_tool_bar_lines): Remove unused variable root_window.
9442 (Fns_list_colors): Put () around assignment in while statement.
9443 (Fns_perform_service): Remove unused variable len.
9444 (Fns_display_usable_bounds): Remove unused variable top.
9445 (syms_of_nsfns): Remove unused variable i.
9446
9447 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9448 memcpy (Bug#11907).
9449
9450 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
9451
9452 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9453 and free it with DestroyExceptionInfo (Bug#11558).
9454
9455 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
9456
9457 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9458 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9459 Set here, not in nt/config.nt.
9460
9461 2012-07-13 Eli Zaretskii <eliz@gnu.org>
9462
9463 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9464 cursor overflow into the last glyph on display line when the right
9465 fringe is off. (Bug#11832)
9466
9467 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9468
9469 * xdisp.c (produce_special_glyphs): Now static.
9470 * dispextern.h (produce_special_glyphs): Remove decl.
9471
9472 2012-07-13 Glenn Morris <rgm@gnu.org>
9473
9474 * s/bsd-common.h, s/cygwin.h: Remove empty files.
9475 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9476
9477 * s/usg5-4-common.h (USG, USG5):
9478 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9479 * s/sol2-6.h (SOLARIS2):
9480 * s/irix6-5.h (IRIX6_5):
9481 * s/hpux10-20.h (USG, USG5, HPUX):
9482 * s/gnu-linux.h (USG, GNU_LINUX):
9483 * s/freebsd.h (BSD_SYSTEM):
9484 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9485 * s/cygwin.h (CYGWIN):
9486 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9487 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9488
9489 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
9490
9491 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9492
9493 2012-07-13 Glenn Morris <rgm@gnu.org>
9494
9495 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9496
9497 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9498
9499 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9500 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9501
9502 2012-07-12 Glenn Morris <rgm@gnu.org>
9503
9504 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9505
9506 * process.c (init_process_emacs): Rename from init_process.
9507 The old name is also the name of a Mach system call.
9508 * lisp.h, emacs.c: Update for this name change.
9509 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9510 longer needed.
9511
9512 2012-07-12 Eli Zaretskii <eliz@gnu.org>
9513
9514 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9515 memmove call that removes glyphs covered by the left truncation
9516 glyph. Improve commentary.
9517 (display_line): Fix display of continuation glyphs on GUI frames
9518 when the right fringe is turned off and variable-size fonts are
9519 used in the window. Move the code that appends a stretch glyph to
9520 produce_special_glyphs, so that it could be used for truncation
9521 and continuation glyphs alike.
9522 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9523 glyph of a suitably computed width, to align the special glyphs at
9524 the window margin. Code moved from display_line. (Bug#11832)
9525
9526 2012-07-12 Glenn Morris <rgm@gnu.org>
9527
9528 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9529
9530 * s/gnu-linux.h, s/hpux10-20.h:
9531 Do not unconditionally define HAVE_XRMSETDATABASE.
9532
9533 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9534
9535 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9536
9537 Fix typos that broke OS X build.
9538 Reported by Randal L. Schwartz in
9539 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9540 * nsterm.m (ns_timeout): Add missing local decl.
9541 (ns_get_color): snprintf -> sprintf, to fix typo.
9542
9543 2012-07-12 Glenn Morris <rgm@gnu.org>
9544
9545 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9546 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9547 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9548 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9549
9550 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9551 Move PTY_OPEN to configure.
9552
9553 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9554 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9555 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9556
9557 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9558
9559 Use empty_unibyte_string where applicable.
9560 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9561 * lread.c (read1): Likewise.
9562 * xsettings.c (syms_of_xsettings): Likewise.
9563
9564 2012-07-12 Glenn Morris <rgm@gnu.org>
9565
9566 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9567 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9568 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9569 * s/hpux10-20.h (RUN_TIME_REMAP):
9570 * s/bsd-common.h (TABDLY): Move to configure.
9571
9572 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9573
9574 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9575
9576 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9577 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9578
9579 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9580
9581 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9582 * s/template.h: Move NARROWPROTO to configure.
9583
9584 2012-07-11 Glenn Morris <rgm@gnu.org>
9585
9586 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9587 unused since 2011-01-17 change to systty.h.
9588
9589 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9590 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9591 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9592
9593 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9594
9595 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9596
9597 2012-07-11 Glenn Morris <rgm@gnu.org>
9598
9599 * s/darwin.h, s/gnu-linux.h, s/template.h:
9600 Move INTERRUPT_INPUT to configure.
9601
9602 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9603
9604 Minor adjustments to interning code.
9605 * lisp.h (intern, intern_c_string): Redefine as static inline
9606 wrappers for intern_1 and intern_c_string_1, respectively.
9607 (intern_1, intern_c_string_1): Rename prototypes.
9608 * lread.c (intern_1, intern_c_string_1, oblookup):
9609 Simplify Vobarray checking.
9610 * font.c (font_intern_prop): Likewise. Adjust comment.
9611 * w32font.c (intern_font_name): Likewise.
9612
9613 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9614
9615 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9616
9617 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9618 of Fcar/Fcdr if possible.
9619 * font.c (check_otf_features): Likewise.
9620 * fontset.c (Fnew_fontset): Likewise.
9621 * gnutls.c (Fgnutls_boot): Likewise.
9622 * minibuf.c (read_minibuf): Likewise.
9623 * msdos.c (IT_set_frame_parameters): Likewise.
9624 * xmenu.c (Fx_popup_dialog): Likewise.
9625 * w32menu.c (Fx_popup_dialog): Likewise.
9626
9627 2012-07-11 Glenn Morris <rgm@gnu.org>
9628
9629 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9630 since nothing has defined it on these platforms.
9631
9632 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9633 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9634
9635 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9636 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9637 Move CLASH_DETECTION to configure.
9638
9639 * s/gnu.h: Remove file, which is now empty.
9640
9641 * s/gnu.h, s/gnu-linux.h:
9642 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9643
9644 2012-07-11 John Wiegley <johnw@newartisans.com>
9645
9646 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9647 function attribute, so we only use it if it exists in the
9648 compiler.
9649
9650 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9651
9652 Avoid call to strlen in fast_c_string_match_ignore_case.
9653 * search.c (fast_c_string_match_ignore_case): Change to use
9654 length argument. Adjust users accordingly.
9655 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9656
9657 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9658
9659 Assume mkdir, rmdir.
9660 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9661 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9662
9663 Assume rename.
9664 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9665
9666 Assume perror.
9667 * s/hpux10-20.h (HAVE_PERROR): Remove.
9668 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9669 Remove dummy definition, as this problem was obsolete long ago.
9670
9671 Assume strerror.
9672 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9673
9674 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9675
9676 Avoid calls to strlen in font processing functions.
9677 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9678 (font_open_by_name): Change to use length argument.
9679 Adjust users accordingly.
9680 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9681 Adjust prototypes.
9682 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9683 Change to return ptrdiff_t.
9684 (xfont_list_pattern, xfont_match): Use length returned by
9685 xfont_decode_coding_xlfd.
9686 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9687
9688 2012-07-11 Glenn Morris <rgm@gnu.org>
9689
9690 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9691 Move DONT_REOPEN_PTY to configure.
9692
9693 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9694 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9695
9696 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9697
9698 Remove "#define unix" that is no longer needed (Bug#11905).
9699 * s/aix4-2.h (unix): Remove; no longer needed.
9700
9701 EMACS_TIME simplification (Bug#11875).
9702 This replaces macros (which typically do not work in GDB)
9703 with functions, typedefs and enums, making the code easier to debug.
9704 The functional style also makes code easier to read and maintain.
9705 * systime.h: Include <sys/time.h> on all hosts, not just if
9706 WINDOWSNT, since 'struct timeval' is needed in general.
9707 (EMACS_TIME): Now a typedef, not a macro.
9708 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9709 not macros.
9710 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9711 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9712 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9713 (EMACS_TIME_LE): Now functions, not macros.
9714 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9715 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9716 which are not functions. All uses rewritten to use:
9717 (make_emacs_time): New function.
9718 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9719 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9720 not functions. All uses rewritten to use the following, respectively:
9721 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9722 (add_emacs_time, sub_emacs_time): New functions.
9723 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9724 * fileio.c (Fcopy_file):
9725 * xterm.c (XTflash): Get the current time closer to when it's used.
9726 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9727
9728 * bytecode.c (targets): Suppress -Woverride-init warnings.
9729
9730 Simplify by avoiding confusing use of strncpy etc.
9731 * doc.c (Fsnarf_documentation):
9732 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9733 * frame.c (Fmake_terminal_frame):
9734 * gtkutil.c (get_utf8_string):
9735 * lread.c (openp):
9736 * nsmenu.m (ns_update_menubar):
9737 * regex.c (regerror):
9738 Prefer memcpy to strncpy and strncat when either will do.
9739 * fileio.c (Fsubstitute_in_file_name):
9740 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9741 (menu_separator_name_p):
9742 * nsmenu.m (ns_update_menubar):
9743 Prefer memcmp to strncmp when either will do.
9744 * nsterm.m: Include <ftoastr.h>.
9745 (ns_get_color):
9746 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9747 Prefer snprintf to strncpy.
9748 * nsterm.m (ns_term_init):
9749 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9750 * nsterm.m (ns_term_init):
9751 Avoid the need for strncpy, by using build_string or
9752 make_unibyte_string directly. Use dtoastr, not snprintf.
9753 * process.c (Fmake_network_process): Diagnose service names that
9754 are too long, rather than silently truncating them or creating
9755 non-null-terminated names.
9756 (Fnetwork_interface_info): Likewise, for interface names.
9757 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9758 Prefer sprintf to strncat.
9759 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9760 Prefer vsnprintf to vsprintf + strncpy.
9761
9762 2012-07-10 Glenn Morris <rgm@gnu.org>
9763
9764 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9765 Clarify fallback case.
9766
9767 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9768
9769 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9770 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9771 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9772 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9773 where argument type is known to be a Lisp_Cons.
9774
9775 2012-07-10 Tom Tromey <tromey@redhat.com>
9776
9777 * bytecode.c (BYTE_CODE_THREADED): New macro.
9778 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9779 (enum byte_code_op): New type.
9780 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9781 (exec_byte_code): Use them. Use token threading when applicable.
9782
9783 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9784
9785 Optimize pure C strings initialization.
9786 * lisp.h (make_pure_string): Fix prototype.
9787 (build_pure_c_string): New function, defined as static inline. This
9788 provides a better opportunity to optimize away calls to strlen when
9789 the function is called with compile-time constant argument.
9790 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9791 argument, adjust users accordingly. Use build_pure_c_string where
9792 appropriate.
9793 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9794 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9795 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9796
9797 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9798
9799 Avoid calls to strlen in miscellaneous functions.
9800 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9801 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9802 * lread.c (openp): Likewise.
9803
9804 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9805
9806 Avoid calls to strlen in path processing functions.
9807 * fileio.c (file_name_as_directory): Add comment. Change to add
9808 srclen argument and return the length of result. Adjust users
9809 accordingly.
9810 (directory_file_name): Fix comment. Change to add srclen argument,
9811 swap 1st and 2nd arguments to obey the common convention.
9812 Adjust users accordingly.
9813 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9814
9815 2012-07-10 Glenn Morris <rgm@gnu.org>
9816
9817 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9818 Move PENDING_OUTPUT_COUNT definition to configure.
9819
9820 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9821 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9822 * s/gnu.h (DATA_START): Move definitions to configure.
9823
9824 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9825 We include usg5-4-common.h, which defines them both.
9826
9827 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9828 O_RDONLY already includes it).
9829
9830 Stop ns builds setting the EMACSLOADPATH environment variable.
9831 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9832 Now it does not set EMACSLOADPATH, just returns the load-path string.
9833 * nsterm.h: Update accordingly.
9834 * lread.c [HAVE_NS]: Include nsterm.h.
9835 (init_lread) [HAVE_NS]: Use ns_load_path.
9836 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9837
9838 2012-07-09 Glenn Morris <rgm@gnu.org>
9839
9840 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9841 since the included bsd-common.h does so.
9842
9843 Stop ns builds setting the EMACSPATH environment variable.
9844 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9845 (ns_init_paths): Do not set EMACSPATH.
9846 * nsterm.h (ns_exec_path): Add it.
9847 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9848 Use ns_exec_path.
9849
9850 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9851
9852 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9853
9854 * process.c (wait_reading_process_output): 'waitchannels' was unset
9855 when read_kbd || !NILP (wait_for_cell); fix this.
9856
9857 Add GCC-style 'const' attribute to functions that can use it.
9858 * character.h (char_resolve_modifier_mask):
9859 * keyboard.h (make_ctrl_char):
9860 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9861 (init_character_once, next_almost_prime, init_fns, init_image)
9862 (flush_pending_output, init_sound):
9863 * mem-limits.h (start_of_data):
9864 * menu.h (finish_menu_items):
9865 Add ATTRIBUTE_CONST.
9866 * emacs.c (DEFINE_DUMMY_FUNCTION):
9867 Declare the dummy function with ATTRIBUTE_CONST.
9868 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9869 Add decls with ATTRIBUTE_CONST.
9870
9871 Minor improvements to make_formatted_string.
9872 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9873 where int is good enough, as vsprintf returns an int.
9874 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9875
9876 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9877
9878 Use make_formatted_string to avoid double length calculation.
9879 * lisp.h (make_formatted_string): New prototype.
9880 * alloc.c (make_formatted_string): New function.
9881 * buffer.c (Fgenerate_new_buffer_name): Use it.
9882 * dbusbind.c (syms_of_dbusbind): Likewise.
9883 * editfns.c (Fcurrent_time_zone): Likewise.
9884 * filelock.c (get_boot_time): Likewise.
9885 * frame.c (make_terminal_frame, set_term_frame_name)
9886 (x_report_frame_params): Likewise.
9887 * image.c (gs_load): Likewise.
9888 * minibuf.c (get_minibuffer): Likewise.
9889 * msdos.c (dos_set_window_size): Likewise.
9890 * process.c (make_process): Likewise.
9891 * xdisp.c (ensure_echo_area_buffers): Likewise.
9892 * xsettings.c (apply_xft_settings): Likewise.
9893
9894 2012-07-09 Glenn Morris <rgm@gnu.org>
9895
9896 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9897 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9898 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9899 * nsterm.h (ns_etc_directory): Add it.
9900 * callproc.c [HAVE_NS]: Include nsterm.h.
9901 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9902
9903 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9904
9905 Move marker debugging code under MARKER_DEBUG.
9906 * marker.c (MARKER_DEBUG): Move marker debugging code under
9907 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9908 for bootstrap with --enable-checking (~3x slowdown reported
9909 by Juanma Barranquero <lekktu@gmail.com>).
9910 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9911
9912 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9915 See <http://bugs.gnu.org/11825#29>.
9916
9917 2012-07-08 Eli Zaretskii <eliz@gnu.org>
9918
9919 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9920 has no font, use the frame's font. (Bug#11813)
9921 (display_line): Add commentary about displaying truncation glyphs
9922 on GUI frames.
9923 (produce_special_glyphs): Move here from term.c.
9924
9925 * term.c (produce_special_glyphs): Move to xdisp.c.
9926
9927 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9928 section.
9929
9930 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9931
9932 * xdisp.c (display_line): Avoid warning about implicit declaration
9933 of FRAME_FONT.
9934
9935 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9936
9937 * lisp.h: Remove empty conditional.
9938
9939 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9940
9941 * lread.c (load_path_check): Now static.
9942
9943 Fix some minor --with-ns problems found by static checking.
9944 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9945 (x_set_font) [!HAVE_X_WINDOWS]:
9946 * image.c (xpm_load_image) [HAVE_NS]:
9947 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9948 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9949 Remove unused local.
9950 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9951 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9952 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9953 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9954 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9955 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9956 Fix pointer signedness problem.
9957 * xfaces.c (FRAME_X_FONT_TABLE):
9958 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9959
9960 2012-07-07 Glenn Morris <rgm@gnu.org>
9961
9962 * lread.c (load_path_check): New function, split from init_lread.
9963 (init_lread): Reorganize. Motivation:
9964 If EMACSLOADPATH is set, check/warn about that rather than the
9965 defaults, which we are not going to use. Hence we can remove
9966 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9967 Don't warn if site-lisp directories are missing.
9968 If not installed, start from a blank load-path, since
9969 PATH_LOADSEARCH refers to the eventual installation directories.
9970
9971 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9972
9973 Support truncation and continuation glyphs on GUI frames, when
9974 fringes are disabled. (Bug#11832)
9975 * xdisp.c (init_iterator): Get dimensions of truncation and
9976 continuation glyphs even if on GUI frames.
9977 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9978 or both, are absent.
9979 (start_display, move_it_in_display_line_to): Handle the case of a
9980 GUI frame without a fringe to display continuation or truncation
9981 glyphs.
9982 (insert_left_trunc_glyphs): Support GUI frames: make sure
9983 truncation glyphs overwrite enough glyphs from the current line to
9984 have sufficient space in pixels.
9985 (display_line): Support truncation and continuation glyphs on GUI
9986 frames. If some spare pixels are left on the line after inserting
9987 the truncation glyphs, fill that space with a stretch glyph of a
9988 suitably computed width.
9989
9990 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9991 produce_glyphs, to support GUI sessions.
9992
9993 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9994
9995 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9996
9997 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9998
9999 Do not require float-time's arg to fit in time_t (Bug#11825).
10000 This works better on hosts where time_t is unsigned, and where
10001 float-time is applied to the (negative) difference between two times.
10002 * editfns.c (decode_time_components): Last arg is now double *,
10003 not int *, and means to store all the result as a double, without
10004 worrying about whether the seconds part fits in time_t.
10005 All callers changed.
10006 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10007 All callers changed.
10008 (Ffloat_time): Do not fail merely because the specified time falls
10009 outside of time_t range.
10010
10011 2012-07-07 Glenn Morris <rgm@gnu.org>
10012
10013 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10014 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10015 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10016
10017 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10018
10019 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10020 Update dependencies.
10021
10022 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10023
10024 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10025
10026 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10027 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10028 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10029 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10030 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10031 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10032
10033 * xfont.c (compare_font_names): Redo to omit the need for casts.
10034
10035 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10036
10037 * xfns.c (Fx_change_window_property): Doc fix.
10038 * w32fns.c (Fx_change_window_property): Doc fix.
10039
10040 * w32fns.c (Fx_window_property): Accept the same arguments as the
10041 X Windows version. Doc fix.
10042 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10043
10044 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
10045 Eli Zaretskii <eliz@gnu.org>
10046
10047 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10048 Windows-specific code from nt/config.nt moved here.
10049 Obsolete settings removed.
10050
10051 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10052
10053 * process.c: Avoid unnecessary calls to gettime.
10054 (wait_reading_process_output): Don't get the time of day
10055 when gobbling data immediately and not waiting, as there's no need
10056 for it in that case. This removes a FIXME.
10057
10058 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10059
10060 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10061 is defined (Bug#11768).
10062
10063 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10064
10065 Fix marker debugging code.
10066 * marker.c (byte_char_debug_check): Do not perform the check
10067 if buffer is not multibyte.
10068 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10069 Call byte_char_debug_check with correct arguments.
10070
10071 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10072
10073 Compile marker debugging code only if ENABLE_CHECKING is defined.
10074 * marker.c (byte_char_debug_check, count_markers):
10075 Use only if ENABLE_CHECKING is defined.
10076 (byte_debug_flag): Remove.
10077 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10078 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10079
10080 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10081
10082 Avoid code repetition in marker-related functions.
10083 * marker.c (attach_marker): New function.
10084 (Fset_marker, set_marker_restricted, set_marker_both)
10085 (set_marker_restricted_both): Use it.
10086 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10087 Consistently rename charno to charpos.
10088 (marker_position): Add eassert.
10089 (marker_byte_position): Convert to eassert.
10090
10091 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10092
10093 Simplify list operations in unchain_overlay and unchain_marker.
10094 * buffer.c (unchain_overlay): Simplify. Add comment.
10095 * marker.c (unchain_marker): Simplify. Fix comments.
10096
10097 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10098
10099 Introduce fast path for the widely used marker operation.
10100 * alloc.c (build_marker): New function.
10101 * lisp.h (build_marker): New prototype.
10102 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10103 * composite.c (autocmp_chars): Likewise.
10104 * editfns.c (buildmark): Remove.
10105 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10106 (save_restriction_save): Use build_marker.
10107 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10108 * window.c (save_window_save): Likewise.
10109
10110 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10111
10112 Do not use Fdelete_overlay in delete_all_overlays
10113 to avoid redundant calls to unchain_overlay.
10114 * buffer.c (drop_overlay): New function.
10115 (delete_all_overlays, Fdelete_overlay): Use it.
10116 * minibuf.c (get_minibuffer): Fix comment.
10117
10118 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 Port to OpenBSD 5.1 amd64.
10121 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10122 This is needed for OpenBSD, and should be harmless on all BSD systems.
10123 Also, include <sys/sysctl.h>, as it should be available on all
10124 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10125 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10126 use p_pid member, not kp_proc.pid.
10127
10128 2012-07-06 Glenn Morris <rgm@gnu.org>
10129
10130 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10131
10132 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10133
10134 More xmalloc and related cleanup.
10135 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10136 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10137 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10138 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10139 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10140 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10141 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10142 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10143 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10144 * xterm.c:
10145 Omit needless casts involving void * pointers and allocation.
10146 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10147 as the former is more robust if P's type is changed.
10148 Prefer xzalloc to xmalloc + memset 0.
10149 Simplify malloc-or-realloc to realloc.
10150 Don't worry about xmalloc returning a null pointer.
10151 Prefer xstrdup to xmalloc + strcpy.
10152 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10153 growing it.
10154 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10155 alloca of a constant.
10156
10157 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10158
10159 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10160 hscroll is larger than the line width. Fixes long and futile
10161 looping inside extend_face_to_end_of_line (on a TTY) producing
10162 glyphs that are not needed and thrown away.
10163
10164 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10165
10166 * marker.c (set_marker_restricted_both): Simplify by using
10167 clip_to_bounds.
10168
10169 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10170
10171 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10172
10173 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10174
10175 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10176 not defined (Bug#11768).
10177 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10178 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10179 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10180 followed by gtk_box_set_homogeneous (Bug#11768).
10181 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10182 (update_theme_scrollbar_width, xg_create_scroll_bar):
10183 Use gtk_scrollbar_new (Bug#11768).
10184 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10185 (is_box_type): New function (Bug#11768).
10186 (xg_tool_item_stale_p): Call is_box_type.
10187 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10188 with default display (Bug#11768).
10189
10190 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10191
10192 * xdisp.c (window_hscroll_limited): New function.
10193 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10194 coordinates when window's hscroll is set to insanely large
10195 values. (Bug#11857)
10196
10197 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10198
10199 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10200 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10201
10202 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10203
10204 Cleanup xmalloc.
10205 * lisp.h (xzalloc): New prototype. Omit needless casts.
10206 * alloc.c (xzalloc): New function. Omit needless casts.
10207 * charset.c: Omit needless casts. Convert all calls to
10208 xmalloc with following memset to xzalloc.
10209 * dispnew.c: Likewise.
10210 * fringe.c: Likewise.
10211 * image.c: Likewise.
10212 * sound.c: Likewise.
10213 * term.c: Likewise.
10214 * w32fns.c: Likewise.
10215 * w32font.c: Likewise.
10216 * w32term.c: Likewise.
10217 * xfaces.c: Likewise.
10218 * xfns.c: Likewise.
10219 * xterm.c: Likewise.
10220 * atimer.c: Omit needless casts.
10221 * buffer.c: Likewise.
10222 * callproc.c: Likewise.
10223 * ccl.c: Likewise.
10224 * coding.c: Likewise.
10225 * composite.c: Likewise.
10226 * doc.c: Likewise.
10227 * doprnt.c: Likewise.
10228 * editfns.c: Likewise.
10229 * emacs.c: Likewise.
10230 * eval.c: Likewise.
10231 * filelock.c: Likewise.
10232 * fns.c: Likewise.
10233 * gtkutil.c: Likewise.
10234 * keyboard.c: Likewise.
10235 * lisp.h: Likewise.
10236 * lread.c: Likewise.
10237 * minibuf.c: Likewise.
10238 * msdos.c: Likewise.
10239 * print.c: Likewise.
10240 * process.c: Likewise.
10241 * region-cache.c: Likewise.
10242 * search.c: Likewise.
10243 * sysdep.c: Likewise.
10244 * termcap.c: Likewise.
10245 * terminal.c: Likewise.
10246 * tparam.c: Likewise.
10247 * w16select.c: Likewise.
10248 * w32.c: Likewise.
10249 * w32reg.c: Likewise.
10250 * w32select.c: Likewise.
10251 * w32uniscribe.c: Likewise.
10252 * widget.c: Likewise.
10253 * xdisp.c: Likewise.
10254 * xmenu.c: Likewise.
10255 * xrdb.c: Likewise.
10256 * xselect.c: Likewise.
10257
10258 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 * fileio.c (time_error_value): Check the right error number.
10261 Problem reported by Troels Nielsen in
10262 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10263
10264 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10265
10266 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10267 This should be fixed in a better way; see Eli Zaretskii in
10268 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10269 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10270
10271 * fileio.c (time_error_value): Rename from special_mtime.
10272 The old name's problems were noted by Eli Zaretskii in
10273 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10274
10275 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10276 This variable's comment says Emacs needs at least one GDB-visible
10277 symbol of type enum pvec_type, to work around GDB problems.
10278 The symbol's value doesn't matter.
10279
10280 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10281 that causes compilation to fail on pre-C99 compilers.
10282
10283 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10284
10285 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10286 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10287
10288 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10289
10290 * buffer.c (init_buffer_once): Fix initialization of
10291 headers for buffer_defaults and buffer_local_symbols.
10292 Reported by Juanma Barranquero <lekktu@gmail.com>.
10293
10294 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10295
10296 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10297 * lisp.h (enum pvec_type): Use fewer bits.
10298 (PSEUDOVECTOR_SIZE_BITS): New constant.
10299 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10300 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10301 change in pvec_type.
10302 (PSEUDOVECTOR_TYPEP): New macro.
10303 (TYPED_PSEUDOVECTORP): Use it.
10304 * fns.c (internal_equal): Adapt code to extract pvectype.
10305 * emacs.c (gdb_pvec_type): Update type.
10306 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10307 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10308 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10309 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10310 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10311 abusing vector->header.next.nbytes.
10312 (live_vector_p): Use PVEC_TYPE.
10313 (mark_object): Adapt code to extract pvectype. Use switch.
10314
10315 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10316
10317 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10318 Tighten new eassert a bit.
10319
10320 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10321
10322 Fix compilation with --enable-gcc-warnings and -O1
10323 optimization level.
10324 * doprnt.c (doprnt): Change type of tem to int, initialize
10325 to avoid compiler warning. Add eassert.
10326 * search.c (simple_search): Initialize match_byte to avoid
10327 compiler warning. Add eassert.
10328
10329 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10330
10331 Avoid weird behavior with large horizontal scrolls.
10332 Without this change, for example, large hscroll values would
10333 mess up Emacs's display on Fedora 15 x86, presumably due to
10334 overflows in int calculations in the display code.
10335 Also, if buffers had long lines, Emacs would freeze.
10336 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10337 (set_window_hscroll): New function, containing the old guts of
10338 Fset_window_hscroll. Return the clipped value.
10339 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10340 This avoids the need to check against PTRDIFF_MAX.
10341
10342 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10343
10344 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10345
10346 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10347
10348 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10349
10350 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10351 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10352 since GCC 4.4.6 issues a bogus warning for them.
10353
10354 Fix bugs in file timestamp newness comparisons.
10355 * fileio.c (Ffile_newer_than_file_p):
10356 * lread.c (Fload): Use full timestamp resolution of files,
10357 not just the 1-second resolution, so that files that are only
10358 slightly newer still count as newer.
10359 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10360 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10361
10362 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10363
10364 * fileio.c: Improve handling of file time marker. (Bug#11852)
10365 (special_mtime): New function.
10366 (Finsert_file_contents, Fverify_visited_file_modtime):
10367 Use it to set special mtime values consistently.
10368
10369 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10370
10371 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10372 marker for non-existing file. (Bug#11852)
10373
10374 2012-07-03 Glenn Morris <rgm@gnu.org>
10375
10376 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10377 and did not make it into globals.h).
10378
10379 2012-07-03 Tom Tromey <tromey@redhat.com>
10380
10381 * window.c (Fset_window_margins, Fset_window_fringes)
10382 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10383 * textprop.c (Fprevious_property_change): No longer static.
10384 * syntax.c (Fsyntax_table_p): No longer static.
10385 * process.c (Fget_process, Fprocess_datagram_address): No longer
10386 static.
10387 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10388 * keyboard.c (Fcommand_execute): No longer static.
10389 Remove EXFUN.
10390 * insdel.c (Fcombine_after_change_execute): No longer static.
10391 * image.c (Finit_image_library): No longer static.
10392 * fileio.c (Fmake_symbolic_link): No longer static.
10393 * eval.c (Ffetch_bytecode): No longer static.
10394 * editfns.c (Fuser_full_name): No longer static.
10395 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10396 No longer static.
10397 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10398 static.
10399 * dired.c (Ffile_attributes): No longer static.
10400 * composite.c (Fcomposition_get_gstring): No longer static.
10401 * callproc.c (Fgetenv_internal): No longer static.
10402
10403 * ccl.h: Remove EXFUNs.
10404 * buffer.h: Remove EXFUNs.
10405 * dispextern.h: Remove EXFUNs.
10406 * intervals.h: Remove EXFUNs.
10407 * fontset.h: Remove EXFUN.
10408 * font.h: Remove EXFUNs.
10409 * dosfns.c (system_process_attributes): Remove EXFUN.
10410 * keymap.h: Remove EXFUNs.
10411 * lisp.h: Remove EXFUNs.
10412 * w32term.h: Remove EXFUNs.
10413 * window.h: Remove EXFUNs.
10414 * xsettings.h: Remove EXFUN.
10415 * xterm.h: Remove EXFUN.
10416
10417 2012-07-03 Glenn Morris <rgm@gnu.org>
10418
10419 * lisp.h (Frandom): Make it visible to C.
10420 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10421 buffer for invisible buffers. (Bug#1229)
10422
10423 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10424
10425 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10426 values which aren't power of 2.
10427 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10428 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
10429 accordingly.
10430
10431 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10432
10433 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10434
10435 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10436
10437 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10438
10439 * alloc.c (allocate_vector_block): Remove redundant
10440 calls to mallopt if DOUG_LEA_MALLOC is defined.
10441 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10442 avoid calls to mallopt if zero_vector is returned.
10443
10444 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10445
10446 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10447 is enabled, avoid dereferencing NULL current_sblock if
10448 running undumped.
10449
10450 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10451
10452 Cleanup basic buffer management.
10453 * buffer.h (struct buffer): Change layout to use generic vector
10454 marking code. Fix some comments. Change type of 'clip_changed'
10455 to bitfield. Remove unused #ifndef old.
10456 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10457 (GET_OVERLAYS_AT): Fix indentation.
10458 (for_each_per_buffer_object_at): New macro.
10459 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10460 (Fbuffer_local_variables): Use it.
10461 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10462 * alloc.c (allocate_buffer): Adjust to match new layout of
10463 struct buffer. Fix comment.
10464 (mark_overlay): New function.
10465 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10466 Lisp area of struct buffer.
10467 (mark_object): Use it. Adjust marking of misc objects
10468 and related comments.
10469
10470 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10471
10472 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10473 wrapper that is not needed because the wrapped code is a no-op (zero
10474 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10475 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10476
10477 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10478
10479 * alloc.c (mark_buffer): Simplify. Remove prototype.
10480 (mark_object): Add comment. Reorganize marking of vector-like
10481 objects. Use CHECK_LIVE for all vector-like objects except buffers
10482 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10483 Avoid redundant calls to mark_vectorlike for bool vectors.
10484
10485 2012-06-30 Glenn Morris <rgm@gnu.org>
10486
10487 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10488
10489 * epaths.in (PATH_SITELOADSEARCH): New.
10490 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10491 This is rather than relying on --enable-locallisppath elements
10492 having "site-lisp" in their names. (Bug#10208#25, 11658)
10493
10494 2012-06-30 Eli Zaretskii <eliz@gnu.org>
10495
10496 * w32proc.c (sys_select): Accept and ignore one more argument.
10497
10498 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10499
10500 * sysselect.h [DOS_NT]: Don't include sys/select.h.
10501 (pselect) [!MS_DOS]: Redirect to sys_select.
10502
10503 * sysdep.c: Don't include dos.h and dosfns.h.
10504
10505 * process.c (sys_select):
10506 * msdos.c (sys_select): Accept one more argument and ignore it.
10507
10508 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10509 adapt data types and code to that.
10510
10511 * dosfns.c:
10512 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10513 which clashes with the gnulib function of the same name.
10514
10515 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10516
10517 * font.c (font_style_to_value, font_style_symbolic)
10518 (font_prop_validate_style): Add type checks for values in
10519 font_style_table.
10520
10521 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10522 argument.
10523 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10524 uses.
10525
10526 2012-06-29 Eli Zaretskii <eliz@gnu.org>
10527
10528 * xdisp.c (try_window_id): Undo last change.
10529
10530 * w32.c (getwd): Adjust commentary about startup_dir.
10531 (init_environment): Always call sys_access, even in non-MSVC
10532 builds. Don't chdir to the directory of the Emacs executable.
10533 This undoes code from 1997 which was justified by the need to
10534 "avoid conflicts when removing and renaming directories". But its
10535 downside was that every relative file name was being interpreted
10536 relative to the directory of the Emacs executable, which can never
10537 be TRT. In particular, it broke sys_access when called with
10538 relative file names.
10539 (sys_access): Map GetLastError to errno.
10540
10541 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10542
10543 * window.h (struct window): Change type of 'fringes_outside_margins'
10544 to bitfield. Fix comment. Adjust users accordingly.
10545 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10546 Adjust comment.
10547 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10548 to ptrdiff_t.
10549
10550 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
10551
10552 * gnutls.c (emacs_gnutls_handshake):
10553 Add QUIT to make the loop interruptible.
10554
10555 2012-06-29 Glenn Morris <rgm@gnu.org>
10556
10557 * charset.c (init_charset): Make lack of etc/charsets fatal.
10558
10559 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10560
10561 * editfns.c (region_limit): Fix type mismatch.
10562
10563 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10564
10565 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10566 undefined. Convert from xassert to eassert.
10567 * nsmenu.m: Convert from xassert to eassert.
10568 * nsterm.m: Likewise.
10569
10570 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10571
10572 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10573
10574 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10575
10576 Avoid integer overflow on scroll-left and scroll-right.
10577 * window.c (HSCROLL_MAX): New macro.
10578 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10579 overflow when requested scroll falls outside ptrdiff_t range.
10580
10581 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10582
10583 * window.h (struct window): Change type of 'hscroll',
10584 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10585 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10586 Adjust users accordingly.
10587 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10588 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10589 from EMACS_INT to ptrdiff_t.
10590 (make_window): Omit redundant initialization.
10591
10592 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
10593
10594 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10595
10596 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10597
10598 * window.h (struct window): Change type of 'use_time' and
10599 'sequence_number' from Lisp_Object to int.
10600 * frame.c (make_frame): Adjust users accordingly.
10601 * print.c (print_object): Likewise.
10602 * window.c (select_window, Fwindow_use_time, make_parent_window)
10603 (make_window): Likewise.
10604
10605 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10606
10607 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10608 enabled with --enable-checking=[all,glyphs] configure option.
10609 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10610 adjust comments accordingly.
10611 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10612 undefined, adjust comments accordingly.
10613 * image.c: Likewise.
10614 * scroll.c: Likewise.
10615 * w32fns.c: Likewise.
10616 * w32term.c: Likewise.
10617 * xdisp.c: Likewise.
10618 * xfaces.c: Likewise.
10619 * xfns.c: Likewise.
10620 * xterm.c: Likewise.
10621
10622 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10623
10624 Generalize run-time debugging checks.
10625 * dispextern.h (XASSERTS): Remove.
10626 * fontset.c (xassert): Remove.
10627 Convert from xassert to eassert.
10628 * alloc.c: Convert from xassert to eassert.
10629 * bidi.c: Likewise.
10630 * dispnew.c: Likewise.
10631 * fns.c: Likewise.
10632 * fringe.c: Likewise.
10633 * ftfont.c: Likewise.
10634 * gtkutil.c: Likewise.
10635 * image.c: Likewise.
10636 * keyboard.c: Likewise.
10637 * menu.c: Likewise.
10638 * process.c: Likewise.
10639 * scroll.c: Likewise.
10640 * sound.c: Likewise.
10641 * term.c: Likewise.
10642 * w32console.c: Likewise.
10643 * w32fns.c: Likewise.
10644 * w32term.c: Likewise.
10645 * window.c: Likewise.
10646 * xdisp.c: Likewise.
10647 * xfaces.c: Likewise.
10648 * xfns.c: Likewise.
10649 * xselect.c: Likewise.
10650 * xterm.c: Likewise.
10651
10652 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10653
10654 * fns.c (maybe_resize_hash_table): Output message when growing the
10655 purify-hashtable.
10656
10657 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10658
10659 * alloc.c (allocate_string_data): Remove dead code.
10660 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10661 avoid GCC warning about unused macro.
10662
10663 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10664
10665 * alloc.c (allocate_string): Omit intervals initialization.
10666 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10667 as in make_pure_string and make_pure_c_string.
10668
10669 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10670
10671 * alloc.c (allocate_string): Fix last change.
10672
10673 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10674
10675 * alloc.c (allocate_string): Remove two redundant calls
10676 to memset, add explicit initialization where appropriate.
10677
10678 2012-06-27 Glenn Morris <rgm@gnu.org>
10679
10680 * lisp.mk (lisp): Remove paths.elc.
10681
10682 2012-06-27 Chong Yidong <cyd@gnu.org>
10683
10684 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10685
10686 2012-06-26 John Wiegley <johnw@newartisans.com>
10687
10688 * unexmacosx.c (copy_data_segment): Add two section names used
10689 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10690
10691 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10692 when building with Clang.
10693
10694 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10695
10696 * eval.c (Fapply): Allow calling it with a single argument.
10697
10698 2012-06-26 Eli Zaretskii <eliz@gnu.org>
10699
10700 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10701 _stricmp and _strnicmp.
10702 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10703
10704 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10705
10706 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10707 allocated window.
10708 (allocate_process): Likewise for new process.
10709 (allocate_terminal): Change to use offsetof.
10710 (allocate_frame): Likewise.
10711 * frame.c (make_frame): Omit redundant initialization.
10712 * window.c (make_parent_window): Use memset.
10713 (make_window): Omit redundant initialization.
10714 * process.c (make_process): Omit redundant initialization.
10715 * terminal.c (create_terminal): Likewise.
10716
10717 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10718
10719 * term.c (delete_tty): Remove redundant call to memset.
10720
10721 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10722
10723 * alloc.c: Remove build_string.
10724 * lisp.h: Define build_string as static inline. This provides
10725 a better opportunity to optimize away calls to strlen when the
10726 function is called with compile-time constant argument.
10727 * image.c (imagemagick_error): Convert to build_string.
10728 * w32proc.c (sys_spawnve): Likewise.
10729 * xterm.c (x_term_init): Likewise.
10730
10731 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10732
10733 Use sprintf return value instead of invoking strlen on result.
10734 In the old days this wasn't portable, since some sprintf
10735 implementations returned char *. But they died out years ago and
10736 Emacs already assumes sprintf returns int.
10737 Similarly for float_to_string.
10738 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10739 * ccl.c (ccl_driver):
10740 * character.c (string_escape_byte8):
10741 * data.c (Fnumber_to_string):
10742 * doprnt.c (doprnt):
10743 * print.c (print_object):
10744 * xdisp.c (message_dolog):
10745 * xfns.c (syms_of_xfns):
10746 Use sprintf or float_to_string result to avoid need to call strlen.
10747 * data.c (Fnumber_to_string):
10748 Use make_unibyte_string, since the string must be ASCII.
10749 * lisp.h, print.c (float_to_string): Now returns int length.
10750 * term.c (produce_glyphless_glyph):
10751 Use sprintf result rather than recomputing it.
10752
10753 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10754 * Makefile.in (ALL_CFLAGS):
10755 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10756 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10757
10758 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10759
10760 * dispextern.h (xstrcasecmp): Define to library function
10761 strcasecmp if available.
10762 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10763
10764 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10765
10766 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10767 Avoid comma operator.
10768 * menu.c (push_submenu_start, push_submenu_end)
10769 (push_left_right_boundary, push_menu_pane): Likewise.
10770 * msdos.c (dos_rawgetc): Likewise.
10771
10772 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10773
10774 * xfns.c (xic_create_fontsetname): Remove redundant calls
10775 to memset.
10776
10777 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10778
10779 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10780 sprintf already null-terminates its output.
10781
10782 * xfns.c (x_window): Remove redundant cast.
10783
10784 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10785
10786 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10787 `const char *' to `char *' to avoid compiler warning.
10788
10789 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10790
10791 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10792 instead of truncating it to 63 (admittedly a generous limit).
10793
10794 * process.c: Fix spelling and caps in comments.
10795
10796 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10797
10798 * emacs.c (setpgrp): Remove definition, unused.
10799 * sysdep.c (setpgrp): Remove definition, not used in this file.
10800
10801 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
10802
10803 * makefile.w32-in: Update dependencies.
10804
10805 2012-06-24 Eli Zaretskii <eliz@gnu.org>
10806
10807 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10808 (SYSTIME_H): Add nt/inc/sys/time.h.
10809
10810 * systime.h [WINDOWSNT]: Include sys/time.h.
10811
10812 * s/ms-w32.h (struct timespec): Definition moved from
10813 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10814
10815 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10816
10817 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10818 * buffer.h (buffer_slot_type_mismatch):
10819 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10820 * eval.c (unwind_to_catch):
10821 * image.c (my_png_error, my_error_exit):
10822 * keyboard.c (quit_throw_to_read_char, user_error)
10823 (Fexit_recursive_edit, Fabort_recursive_edit):
10824 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10825 (wrong_type_argument, buffer_overflow, __executable_start)
10826 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10827 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10828 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10829 (fatal):
10830 (child_setup) [!DOS_NT]:
10831 * lread.c (end_of_file_error, invalid_syntax):
10832 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10833 * puresize.h (pure_write_error):
10834 * search.c (matcher_overflow):
10835 * sound.c (sound_perror, alsa_sound_perror):
10836 * sysdep.c, syssignal.h (croak):
10837 * term.c (maybe_fatal, vfatal):
10838 * textprop.c (text_read_only):
10839 * undo.c (user_error):
10840 * unexmacosx.c (unexec_error):
10841 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10842 Use _Noreturn rather than NO_RETURN.
10843 No need for separate decl merely because of _Noreturn.
10844 * sound.c (sound_warning, parse_sound):
10845 Remove unnecessary forward decls.
10846
10847 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10848
10849 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10850 * lisp.h (WAIT_READING_MAX): New macro.
10851 * dispnew.c (Fsleep_for, sit_for):
10852 * keyboard.c (kbd_buffer_get_event):
10853 * process.c (Faccept_process_output):
10854 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10855 This improves on the previous patch, which introduced a bug
10856 when time_t is unsigned and as wide as intmax_t.
10857 See <http://bugs.gnu.org/9000#51>.
10858
10859 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10860
10861 * dispnew.c (sit_for, Fsleep_for):
10862 * keyboard.c (kbd_buffer_get_event):
10863 * process.c (Faccept_process_output): Avoid compiler warnings when
10864 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10865
10866 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
10867
10868 * makefile.w32-in: Update dependencies.
10869
10870 * w32.c (ltime): Add return type and declare static.
10871 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10872
10873 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10876 Privately reported by Herbert J. Skuhra.
10877 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10878 All uses changed.
10879 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10880 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10881
10882 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10883
10884 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10885 last argument of make_unibyte_string.
10886
10887 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10888 language ID in the event parameters.
10889
10890 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10891 event.code, not the obscure "character set ID".
10892
10893 2012-06-23 Chong Yidong <cyd@gnu.org>
10894
10895 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10896
10897 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10898
10899 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10900 * w32.c (fdutimens): New function.
10901
10902 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10903
10904 * s/ms-w32.h (pselect): Redirect to sys_select.
10905
10906 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10907
10908 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10909 in the logic of incrementing and decrementing the value of
10910 use_relocatable_buffers.
10911
10912 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10913
10914 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10915 Privately reported by Herbert J. Skuhra.
10916 [__FreeBSD__]: Remove "*/" typo after "#include".
10917 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10918 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10919 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10920 Don't assume EMACS_TIME and struct timeval are the same type.
10921
10922 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 Support higher-resolution time stamps (Bug#9000).
10925 The time stamps are only nanosecond-resolution at the C level,
10926 since that's the best that any real-world system supports now.
10927 But they are picosecond-resolution at the Lisp level, as that's
10928 easy, and leaves room for future OS improvements.
10929
10930 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10931 (LIBES): Use it.
10932
10933 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10934 Don't get current time unless it's needed.
10935
10936 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10937 now provides it if it's absent.
10938 (start_atimer): Port to higher-res time stamps.
10939 Check for time stamp overflow. Don't get current time more
10940 often than is needed.
10941
10942 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10943 Include systime.h, not time.h.
10944 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10945
10946 * dired.c: Include stat-time.h.
10947 (Ffile-attributes): File times now have higher resolution.
10948
10949 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10950 (struct image): Timestamp now has higher resolution.
10951
10952 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10953 has at least microseconds now. All uses removed.
10954 (update_frame, update_single_window, update_window, update_frame_1)
10955 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10956 (duration_to_sec_usec): Remove; no longer needed.
10957
10958 * editfns.c (time_overflow): Now extern.
10959 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10960 (float-time, Fformat_time_string, Fcurrent_time_string)
10961 (Fcurrent_time_zone): Accept and generate higher-resolution
10962 time stamps.
10963 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10964 (decode_time_components, lisp_seconds_argument): New functions.
10965 (make_time): Now static.
10966 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10967 Report an error if the time is invalid, rather than having the caller
10968 do that.
10969
10970 * fileio.c: Include <stat-time.h>
10971 (Fcopy_file): Copy higher-resolution time stamps.
10972 Prefer to set the time stamp via a file descriptor if that works.
10973 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10974 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10975 (Fvisited_file_modtime, Fset_visited_file_modtime):
10976 Support higher-resolution time stamps.
10977
10978 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10979
10980 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10981
10982 * image.c (prepare_image_for_display, clear_image_cache)
10983 (lookup_image): Port to higer-resolution time stamps.
10984
10985 * keyboard.c (start_polling, bind_polling_period):
10986 Check for time stamp overflow.
10987 (read_char, kbd_buffer_get_event, timer_start_idle)
10988 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10989 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10990 Port to higher-resolution time stamps. Do not assume time_t is signed.
10991 (decode_timer): New function. Timers are now vectors of length 9,
10992 not 8, to accommodate the picosecond component.
10993 (timer_check_2): Use it.
10994
10995 * nsterm.m (select_timeout, timeval_subtract): Remove.
10996 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10997 as they're a bit more accurate and handle overflow better.
10998 (ns_select): Change prototype to be compatible with pselect.
10999 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11000 * nsterm.h (ns_select): Adjust prototype.
11001
11002 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11003 us-resolution time stamps.
11004 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11005
11006 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11007
11008 * lisp.h (time_overflow): New decl.
11009 (wait_reading_process_output): First arg is now intmax_t, not int,
11010 to accommodate larger waits.
11011
11012 * process.h (struct Lisp_Process.read_output_delay):
11013 Now counts nanoseconds, not microseconds.
11014 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11015 EMACS_HAS_USECS.
11016 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11017 (wait_reading_process_output):
11018 Port to ns-resolution time stamps.
11019 (Faccept_process_output, wait_reading_process_output):
11020 Check for time stamp overflow. Do not assume time_t is signed.
11021 (select_wrapper): Remove; we now use pselect.
11022 (Fprocess_attributes): Now generates ns-resolution time stamps.
11023
11024 * sysdep.c: Include utimens.h. Don't include utime.h
11025 or worry about struct utimbuf; gnulib does that for us now.
11026 (gettimeofday): Remove; gnulib provides a substitute.
11027 (make_timeval): New function.
11028 (set_file_times): Now sets ns-resolution time stamps.
11029 New arg FD; all uses changed.
11030 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11031 (system_process_attributes):
11032 Now returns ns-resolution time stamp. All uses changed.
11033 Check for time stamp overflow.
11034
11035 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11036 provides a substitute now.
11037
11038 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11039 since it guarantees struct timespec.
11040 (EMACS_TIME): Now struct timespec, so that we can support
11041 ns-resolution time stamps.
11042 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11043 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11044 (EMACS_USECS): Remove.
11045 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11046 so multiply the arg by 1000 before storing it.
11047 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11048 New macros.
11049 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11050 Port to ns-resolution time stamps.
11051 (EMACS_TIME_NEG_P): Remove; replaced by....
11052 (EMACS_TIME_SIGN): New macro.
11053 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11054 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11055 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11056 (make_timeval, make_lisp_time, decode_time_components): New decls.
11057 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11058 that it mishandled time_t overflow. You can't compare by subtracting!
11059 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11060 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11061
11062 * term.c: Include <sys/time.h>.
11063 (timeval_to_Time): New function, for proper overflow wraparound.
11064 (term_mouse_position, term_mouse_click): Use it.
11065
11066 * undo.c (record_first_change): Support higher-resolution time stamps
11067 in the undo buffer.
11068 (Fprimitive_undo): Use them when restoring time stamps.
11069
11070 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11071 (w32_get_internal_run_time):
11072 Port to higher-resolution Emacs time stamps.
11073 (ltime): Now accepts single 64-bit integer, as that's more convenient
11074 for callers.
11075
11076 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11077
11078 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11079 for compatibility with pselect. Support ns-resolution time stamps.
11080
11081 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11082
11083 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11084 Check for time stamp overflow, and support ns-resolution time stamps.
11085
11086 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11087 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11088 (timeval_subtract): Remove; no longer needed.
11089 (XTflash, XTring_bell, x_wait_for_event):
11090 Port to ns-resolution time stamps. Don't assume time_t is signed.
11091
11092 2012-06-22 Chong Yidong <cyd@gnu.org>
11093
11094 * xdisp.c (x_consider_frame_title): Revert last change.
11095
11096 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11097
11098 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11099 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11100 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11101 staticidx goes up to 1597 out of 1600 = 0x640.)
11102
11103 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11104
11105 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11106 Otherwise, the umask might be mistakenly 0 while handling input signals.
11107
11108 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11109
11110 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11111
11112 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11113
11114 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11115 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11116 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11117 access to `contents' member of Lisp_Vector objects with AREF and ASET
11118 where appropriate.
11119
11120 2012-06-19 Chong Yidong <cyd@gnu.org>
11121
11122 * frame.c (delete_frame): When selecting a frame on a different
11123 text terminal, do not alter the terminal's top-frame.
11124
11125 * xdisp.c (format_mode_line_unwind_data): Record the target
11126 frame's selected window and its terminal's top-frame.
11127 (unwind_format_mode_line): Restore them.
11128 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11129 Callers changed.
11130 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11131 since tty frames can be explicitly named.
11132 (prepare_menu_bars): Likewise.
11133
11134 * term.c (Ftty_top_frame): New function.
11135
11136 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11137
11138 Port byte-code-meter to modern targets.
11139 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11140 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11141 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11142 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11143 (METER_1, METER_2): Simplify.
11144
11145 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11146
11147 * data.c (Fdefalias): Return `symbol' (bug#11686).
11148
11149 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11150
11151 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11152 gets killed during executing of this function (Bug#11665).
11153 Try to always return Qt when the buffer has been actually killed.
11154 (Vkill_buffer_query_functions): In doc-string say that functions
11155 run by this hook should not change the current buffer.
11156
11157 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11158
11159 Fix recently-introduced process.c problems found by static checking.
11160 * process.c (write_queue_push, write_queue_pop, send_process):
11161 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11162 (write_queue_pop): Fix pointer signedness problem.
11163 (send_process): Remove unused local.
11164
11165 2012-06-17 Chong Yidong <cyd@gnu.org>
11166
11167 * xdisp.c (redisplay_internal): No need to redisplay terminal
11168 frames that are not on top.
11169
11170 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11171
11172 * process.c (make_process): Initialize write_queue.
11173 (write_queue_push, write_queue_pop): New functions.
11174 (send_process): Use them to maintain correct ordering of process
11175 writes (Bug#10815).
11176
11177 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 * lisp.h (eassert): Assume C89 or later.
11180 This removes the need for CHECK.
11181 (CHECK): Remove. Its comments about always evaluating its
11182 argument were confusing, as 'eassert' typically does not evaluate
11183 its argument.
11184
11185 * coding.c (produce_chars): Use ptrdiff_t, not int.
11186
11187 * xterm.c (x_draw_underwave): Check for integer overflow.
11188 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11189
11190 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11191
11192 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11193 referenced (Bug#11583).
11194
11195 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11196
11197 Implement wave-style variant of underlining.
11198 * dispextern.h (face_underline_type): New enum.
11199 (face): Add field for underline type.
11200 * nsterm.m (ns_draw_underwave): New function.
11201 (ns_draw_text_decoration): Use it.
11202 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11203 New functions.
11204 (x_draw_glyph_string): Use them.
11205 * xfaces.c (Qline, Qwave): New Lisp objects.
11206 (check_lface_attrs, merge_face_ref)
11207 (Finternal_set_lisp_face_attribute, realize_x_face):
11208 Handle wave-style underline face attributes.
11209 * xterm.c (x_draw_underwave): New function.
11210 (x_draw_glyph_string): Use it.
11211
11212 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11213
11214 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11215 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11216 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11217 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11218 ($(BLD)/w32select.$(O)): Update dependencies.
11219
11220 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11221
11222 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11223 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11224 * character.c (_fetch_multibyte_char_p): Remove.
11225 * alloc.c: Include "character.h" before "buffer.h".
11226 * bidi.c: Likewise.
11227 * buffer.c: Likewise.
11228 * bytecode.c: Likewise.
11229 * callint.c: Likewise.
11230 * callproc.c: Likewise.
11231 * casefiddle.c: Likewise.
11232 * casetab.c: Likewise.
11233 * category.c: Likewise.
11234 * cmds.c: Likewise.
11235 * coding.c: Likewise.
11236 * composite.c: Likewise.
11237 * dired.c: Likewise.
11238 * dispnew.c: Likewise.
11239 * doc.c: Likewise.
11240 * dosfns.c: Likewise.
11241 * editfns.c: Likewise.
11242 * emacs.c: Likewise.
11243 * fileio.c: Likewise.
11244 * filelock.c: Likewise.
11245 * font.c: Likewise.
11246 * fontset.c: Likewise.
11247 * fringe.c: Likewise.
11248 * indent.c: Likewise.
11249 * insdel.c: Likewise.
11250 * intervals.c: Likewise.
11251 * keyboard.c: Likewise.
11252 * keymap.c: Likewise.
11253 * lread.c: Likewise.
11254 * macros.c: Likewise.
11255 * marker.c: Likewise.
11256 * minibuf.c: Likewise.
11257 * nsfns.m: Likewise.
11258 * nsmenu.m: Likewise.
11259 * print.c: Likewise.
11260 * process.c: Likewise.
11261 * regex.c: Likewise.
11262 * region-cache.c: Likewise.
11263 * search.c: Likewise.
11264 * syntax.c: Likewise.
11265 * term.c: Likewise.
11266 * textprop.c: Likewise.
11267 * undo.c: Likewise.
11268 * unexsol.c: Likewise.
11269 * w16select.c: Likewise.
11270 * w32fns.c: Likewise.
11271 * w32menu.c: Likewise.
11272 * window.c: Likewise.
11273 * xdisp.c: Likewise.
11274 * xfns.c: Likewise.
11275 * xmenu.c: Likewise.
11276 * xml.c: Likewise.
11277 * xselect.c: Likewise.
11278
11279 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11280
11281 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11282 If all the glyphs of the glyph row came from strings, and we have no
11283 cursor positioning clues, put the cursor on the first glyph of the
11284 row.
11285 (handle_face_prop): Use chunk-relative overlay string index when
11286 indexing into it->string_overlays array. (Bug#11653)
11287 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11288 the rightmost. (Bug#11720)
11289
11290 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11291
11292 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11293 (CATEGORY_MEMBER): Enforce 1/0 value.
11294 * category.c (_temp_category_set): Remove.
11295
11296 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11297
11298 * window.c (Fdelete_other_windows_internal)
11299 (Fdelete_window_internal): Don't access frame's mouse highlight
11300 info of the initial frame. (Bug#11677)
11301
11302 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11305 Assume USE_2_TAGS_FOR_INTS.
11306 (xreload): Adjust $tagmask width to match recent lisp.h change.
11307
11308 Simplify lisp.h in minor ways that should not affect code.
11309 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11310 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11311 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11312 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11313 (INTTYPEBITS): New macro, for clarity.
11314 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11315 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11316 Simplify now that USE_LSB_TAG is always defined.
11317 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11318 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11319
11320 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11321
11322 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11323
11324 2012-06-13 Glenn Morris <rgm@gnu.org>
11325
11326 * s/bsd-common.h (BSD4_3):
11327 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11328
11329 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11330
11331 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11332 instead of union.
11333 (XLI, XIL): Define.
11334 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11335 Use them.
11336 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11337 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11338 * alloc.c (widen_to_Lisp_Object): Remove.
11339 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11340 * frame.c (delete_frame): Remove outdated comment.
11341 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11342 USE_LISP_UNION_TYPE.
11343 (Fw32_unregister_hot_key): Likewise.
11344 (Fw32_toggle_lock_key): Likewise.
11345 * w32menu.c (add_menu_item): Likewise.
11346 (w32_menu_display_help): Use XIL instead of checking
11347 USE_LISP_UNION_TYPE.
11348 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11349 (init_heap): Likewise.
11350 * w32term.c (w32_read_socket): Update comment.
11351
11352 2012-06-13 Glenn Morris <rgm@gnu.org>
11353
11354 * s/usg5-4-common.h, src/s/unixware.h:
11355 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11356
11357 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11358
11359 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11360
11361 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11362 * alloc.c (make_number) [!defined make_number]:
11363 Remove, as lisp.h always defines this now.
11364 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11365 (roundup_size): Verify that it is a power of 2.
11366 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11367 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11368 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11369 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11370 USE_LSB_TAG now is always defined to be either 0 or 1.
11371 All uses changed.
11372 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11373 code works fine either way, and efficiency is not a concern here,
11374 as the union type is for debugging, not for production.
11375 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11376 Use an inline function on all platforms when using the union type,
11377 since this is simpler and 'static inline' can be used portably
11378 within Emacs now.
11379 (LISP_INITIALLY_ZERO): New macro.
11380 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11381 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11382
11383 2012-06-12 Glenn Morris <rgm@gnu.org>
11384
11385 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11386
11387 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11388
11389 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11390 Move BROKEN_SIGIO to configure.
11391
11392 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11393 Move NO_TERMIO to configure.
11394
11395 2012-06-12 Chong Yidong <cyd@gnu.org>
11396
11397 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11398 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11399 MagickExportImagePixels is undefined.
11400
11401 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11402
11403 * image.c (imagemagick_load_image): Remove unused label.
11404
11405 2012-06-11 Glenn Morris <rgm@gnu.org>
11406
11407 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11408 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11409 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11410 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11411
11412 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11413
11414 * alloc.c (make_byte_code): New function.
11415 (Fmake_byte_code): Use it. Don't purify here.
11416 * lread.c (read1): Use it as well to avoid extra allocation.
11417
11418 2012-06-11 Chong Yidong <cyd@gnu.org>
11419
11420 * image.c (imagemagick_load_image): Implement transparency.
11421
11422 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11423
11424 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11425 account for preceding backslashes. (Bug#11663)
11426
11427 2012-06-09 Chong Yidong <cyd@gnu.org>
11428
11429 * term.c: Support italics in capable terminals (Bug#9652).
11430 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11431 (turn_on_face): Output using TS_enter_italic_mode if available.
11432 Don't handle unused blinking and alt-charset cases.
11433 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11434 and tty_alt_charset_p cases.
11435 (tty_capable_p, init_tty): Support italics.
11436
11437 * termchar.h (struct tty_display_info): Add field for italics.
11438 Remove unused blink field.
11439
11440 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11441 Handle slant.
11442
11443 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11444 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11445 tty_alt_charset_p. Add tty_italic_p.
11446
11447 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
11448
11449 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11450 dbus_type_is_basic if available.
11451 (xd_extract_signed, xd_extract_unsigned): Rename from
11452 extract_signed and extract_unsigned, respectively. Adapt callers.
11453
11454 2012-06-09 Chong Yidong <cyd@gnu.org>
11455
11456 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11457
11458 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11459 case (Bug#9752).
11460
11461 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11462
11463 * xdisp.c (vmessage): Treat frame message as multibyte.
11464 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11465 would generate the diagnostic "Making \302\247 buffer-local while
11466 let-bound!".
11467
11468 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11469
11470 * dispnew.c (showing_window_margins_p): Undo last change, which
11471 was done due to an inadvertent commit.
11472 (adjust_frame_glyphs_for_frame_redisplay): Do call
11473 showing_window_margins_p.
11474
11475 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11476
11477 * eval.c (Fmake_var_non_special): New primitive.
11478 (syms_of_eval): Defsubr it.
11479 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11480
11481 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
11482
11483 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11484 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11485
11486 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11487
11488 * alloc.c (allocate_vectorlike): Fix last change.
11489
11490 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11491
11492 Block-based vector allocation of small vectors.
11493 * lisp.h (struct vectorlike_header): New field `nbytes',
11494 adjust comment accordingly.
11495 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11496 to denote vector blocks. Adjust users (live_vector_p,
11497 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11498 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11499 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11500 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11501 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11502 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11503 (roundup_size): New constant.
11504 (struct vector_block): New data type.
11505 (vector_blocks, vector_free_lists, zero_vector): New variables.
11506 (all_vectors): Rename to `large_vectors'.
11507 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11508 (sweep_vectors): New functions.
11509 (allocate_vectorlike): Return `zero_vector' as the only vector of
11510 0 items. Allocate new vector from block if vector size is less than
11511 or equal to VBLOCK_BYTES_MAX.
11512 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11513 (init_alloc_once): Add call to init_vectors.
11514
11515 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11516
11517 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11518
11519 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11520
11521 * doprnt.c (doprnt): Truncate multibyte char correctly.
11522 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11523 would mishandle a string argument "Xc" if X was a multibyte
11524 character of length 2: it would truncate after X's first byte
11525 rather than including all of X.
11526
11527 2012-06-06 Chong Yidong <cyd@gnu.org>
11528
11529 * buffer.c (word_wrap): Doc fix.
11530
11531 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11532
11533 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11534
11535 2012-06-03 Glenn Morris <rgm@gnu.org>
11536
11537 * xdisp.c (tool-bar-style): Doc fix.
11538
11539 2012-06-03 Ulrich Müller <ulm@gentoo.org>
11540
11541 * Makefile.in (PAXCTL): Define.
11542 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11543 binary via PaX flags if the paxctl utility is available.
11544 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11545 Restore PaX flags to their default. (Bug#11398)
11546
11547 2012-06-03 Chong Yidong <cyd@gnu.org>
11548
11549 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11550 buffer (Bug#11226).
11551
11552 2012-06-03 Chong Yidong <cyd@gnu.org>
11553
11554 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11555 (note_mode_line_or_margin_highlight): If there is no help echo,
11556 use mode-line-default-help-echo. Handle the case where the mouse
11557 position is past the end of the mode line string.
11558
11559 * buffer.c (buffer_local_value_1): New function, split from
11560 Fbuffer_local_value; can return Qunbound.
11561 (Fbuffer_local_value): Use it.
11562 (Vmode_line_format): Docstring tweaks.
11563
11564 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11565
11566 * sysdep.c (system_process_attributes): Improve comment.
11567
11568 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11569
11570 * keyboard.c: Export real-this-command to Elisp.
11571 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11572 and DEFVAR it. Update all users.
11573
11574 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11575
11576 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11577
11578 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11579 Convert pctcpu and pctmem to Lisp float properly.
11580 Let the compiler fold better, as 100.0/0x8000 is exact.
11581
11582 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11583
11584 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11585 cons_block.
11586
11587 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11588
11589 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11590
11591 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11592
11593 For a 'struct window', replace some Lisp_Object fields to
11594 bitfields where appropriate, remove unused fields.
11595 * window.h (struct window): Remove unused 'last_mark_x' and
11596 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
11597 change its type from Lisp_Object to bitfield.
11598 Change type of 'force_start', 'optional_new_start',
11599 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11600 fields from Lisp_Object to bitfield. Adjust users accordingly.
11601
11602 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11603
11604 Pacify gcc -Wdouble-precision when using Xaw.
11605 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11606 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11607 Use 'float' consistently, rather than 'float' in most places
11608 and 'double' in a couple of places.
11609
11610 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11611
11612 * xdisp.c (handle_stop): Detect whether we have overlay strings
11613 loaded by testing it->current.overlay_string_index to be
11614 non-negative, instead of checking whether n_overlay_strings is
11615 positive. (Bug#11587)
11616
11617 2012-05-31 Chong Yidong <cyd@gnu.org>
11618
11619 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11620
11621 * doc.c (Fsubstitute_command_keys): Doc fix.
11622
11623 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11624
11625 * search.c (search_buffer): Remove calls to
11626 r_alloc_inhibit_buffer_relocation, as it is now called by
11627 maybe_unify_char, which was the cause of relocation of buffer text
11628 in bug#11519.
11629
11630 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11631
11632 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11633 for the duration of call to load_charset, to avoid problems with
11634 callers of maybe_unify_char that access buffer text through C
11635 pointers.
11636
11637 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11638 decrement the inhibition flag, instead of just setting or
11639 resetting it.
11640
11641 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11642
11643 Remove obsolete '#define static' cruft.
11644 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11645 This #undef was "temporary" in 2000; it is no longer needed
11646 now that '#define static' has gone away.
11647 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11648 (gray_bitmap_bits): Remove; no longer needed.
11649 All uses replaced with definiens.
11650 * xterm.c: Include "bitmaps/gray.xbm".
11651
11652 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11653
11654 Clean up __executable_start, monstartup when --enable-profiling.
11655 The following changes affect the code only when profiling.
11656 * dispnew.c (__executable_start): Rename from safe_bcopy.
11657 Define only on platforms that need it.
11658 * emacs.c: Include <sys/gmon.h> when profiling.
11659 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11660 (__executable_start): Remove decl, since lisp.h does it now.
11661 (safe_bcopy): Remove decl; no longer has that name.
11662 (main): Coalesce #if into single bit of code, for simplicity.
11663 Cast pointers to uintptr_t, since standard libraries want integers
11664 and not pointers.
11665 * lisp.h (__executable_start): New decl.
11666
11667 2012-05-31 Glenn Morris <rgm@gnu.org>
11668
11669 * image.c (Fimagemagick_types): Doc fix.
11670
11671 2012-05-30 Jim Meyering <meyering@redhat.com>
11672
11673 * callproc.c (Fcall_process_region): Include directory component
11674 in mkstemp error message (Bug#11586).
11675
11676 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11677
11678 * alloc.c, lisp.h (make_pure_vector): Now static.
11679
11680 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11681
11682 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11683 Move to byte-run.el.
11684 (Fautoload): Do the hash-doc more carefully.
11685 * data.c (Fdefalias): Purify definition, except for keymaps.
11686 (Qdefun): Move from eval.c.
11687 * lisp.h (Qdefun): Remove.
11688 * lread.c (read1): Tiny simplification.
11689
11690 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
11691
11692 Do not create empty overlays with the evaporate property (Bug#9642).
11693 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11694 Bug#9642, but explicitly check that the buffer the overlay would
11695 be moved to is live and rearrange lines to make sure that errors
11696 will not put the overlay in an inconsistent state.
11697 (Fdelete_overlay): Cosmetics.
11698
11699 2012-05-28 Eli Zaretskii <eliz@gnu.org>
11700
11701 * w32term.c (my_bring_window_to_top): New function.
11702 (x_raise_frame): Use handle returned by DeferWindowPos, which
11703 could be different from the original one.
11704 Call my_bring_window_to_top instead of my_set_foreground_window.
11705 (Bug#11513)
11706
11707 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11708 by calling BringWindowToTop.
11709
11710 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11711 (WM_EMACS_END): Increase by one.
11712
11713 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11716 This avoids undefined behavior that might cause the eassert
11717 to not catch an out-of-range value.
11718
11719 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
11720
11721 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11722 Update dependencies.
11723
11724 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11725
11726 * bidi.c (bidi_mirror_char): Fix last change.
11727
11728 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11729
11730 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11731 when referring to sectname field in printf format.
11732
11733 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11734
11735 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11736 Only r_alloc_inhibit_buffer_relocation needed to be added;
11737 the others were already declared.
11738
11739 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11740 before checking whether it's out of range. Put the check inside
11741 eassert. See
11742 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11743
11744 2012-05-27 Ken Brown <kbrown@cornell.edu>
11745
11746 * callproc.c (Fcall_process): Restore a line that was accidentally
11747 commented out in the 2011-02-13 change (bug#11547).
11748
11749 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11750
11751 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11752 defined on ralloc.c.
11753
11754 * buffer.c [REL_ALLOC]: Remove prototypes of
11755 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11756 they are now on lisp.h.
11757
11758 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11759
11760 * search.c (search_buffer): Use it to inhibit relocation of buffer
11761 text while re_search_2 is doing its job, because re_search_2 is
11762 passed C pointers to buffer text. (Bug#11519)
11763
11764 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11765 Update value to 24.
11766
11767 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11768 state after an additional call to move_it_in_display_line_to, keep
11769 the values of it->max_ascent and it->max_descent found for the
11770 entire line.
11771 (pos_visible_p): Revert the comparison against bottom_y to what it
11772 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11773 (Bug#11464)
11774
11775 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11776
11777 Fix coding-related core dumps with gcc -ftrapv.
11778 The code was computing A - B, where A and B are pointers, and B is
11779 random garbage. This can lead to core dumps on platforms that
11780 have special pointer registers, and it also leads to core dumps on
11781 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11782 A - B only when B is initialized properly.
11783 * coding.c (coding_set_source, coding_set_destination): Return void.
11784 (coding_change_source, coding_change_destinations): New functions,
11785 with the old behaviors of coding_set_source and coding_set_destination.
11786 All callers that need an offset changed to use these new functions.
11787
11788 2012-05-26 Glenn Morris <rgm@gnu.org>
11789
11790 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11791
11792 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11793
11794 Extend mouse support on W32 text-mode console.
11795 * xdisp.c (draw_row_with_mouse_face):
11796 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
11797
11798 * w32console.c: Include window.h.
11799 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11800 New functions.
11801 (initialize_w32_display): Initialize mouse-highlight data.
11802
11803 * w32inevt.c: Include termchar.h and window.h.
11804 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11805 moves, call note_mouse_highlight. If help_echo changed, call
11806 gen_help_event to produce help-echo message in the echo area.
11807 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11808 highlight info.
11809
11810 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11811
11812 * lread.c (read1): Simplify slightly to avoid an overflow warning
11813 with GCC 4.7.0 on x86-64.
11814
11815 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11816
11817 * bidi.c (bidi_mirror_char): Revert last change: an int is
11818 definitely wide enough here.
11819
11820 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
11821
11822 Fix integer width and related bugs (Bug#9874).
11823 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
11824 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11825 (string_bytes, check_sblock, allocate_string_data):
11826 (compact_small_strings, Fmake_bool_vector, make_string)
11827 (make_unibyte_string, make_multibyte_string)
11828 (make_string_from_bytes, make_specified_string)
11829 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11830 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11831 (mark_vectorlike):
11832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11833 (allocate_pseudovector):
11834 Use int, not EMACS_INT, where int is wide enough.
11835 (inhibit_garbage_collection, Fgarbage_collect):
11836 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11837 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11838 int might not be wide enough.
11839 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11840 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11841 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11842 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11843 (bidi_level_of_next_char, bidi_move_to_visually_next):
11844 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11845 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11846 (Fkill_buffer, Fset_buffer_major_mode)
11847 (advance_to_char_boundary, Fbuffer_swap_text)
11848 (Fset_buffer_multibyte, overlays_at, overlays_in)
11849 (overlay_touches_p, struct sortvec, record_overlay_string)
11850 (overlay_strings, recenter_overlay_lists)
11851 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11852 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11853 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11854 (Foverlay_recenter, last_overlay_modification_hooks_used)
11855 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11856 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11857 (validate_region): Omit unnecessary test for b <= e,
11858 since that's guaranteed by the previous test.
11859 (adjust_overlays_for_delete): Avoid pos + length overflow.
11860 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11861 (report_overlay_modification):
11862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11863 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11864 Omit pointer cast, which isn't needed anyway, and doesn't work
11865 after the EMACS_INT -> ptrdiff_t change.
11866 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11867 * buffer.h: Adjust decls to match defn changes elsewhere.
11868 (struct buffer_text, struct buffer):
11869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11870 Use EMACS_INT, not int, where int might not be wide enough.
11871 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11872 not int, to avoid needless 32-bit limit on 64-bit hosts.
11873 (exec_byte_code): Use tighter memory-full test, one that checks
11874 for alloca overflow. Don't compute the address of the object just
11875 before an array, as that's not portable. Use EMACS_INT, not
11876 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11877 * callint.c (Fcall_interactively):
11878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11879 * callproc.c (call_process_kill, Fcall_process):
11880 Don't assume pid_t fits into an Emacs fixnum.
11881 (call_process_cleanup, Fcall_process, child_setup):
11882 Don't assume pid_t fits into int.
11883 (call_process_cleanup, Fcall_process, delete_temp_file)
11884 (Fcall_process_region):
11885 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11886 (Fcall_process): Simplify handling of volatile integers.
11887 Use int, not EMACS_INT, where int will do.
11888 * casefiddle.c (casify_object, casify_region, operate_on_word)
11889 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11891 (casify_object): Avoid integer overflow when overallocating buffer.
11892 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11893 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
11894 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11895 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11896 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11897 integers are now checked earlier. All uses replaced with XINT.
11898 (ccl_driver):
11899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11900 For CCL_MapSingle, check that content and value are in int range.
11901 (ccl_driver, Fregister_code_conversion_map):
11902 Check that Vcode_version_map_vector is a vector.
11903 (resolve_symbol_ccl_program): Check that vector header is in range.
11904 Always copy the vector, so that we can check its contents reliably
11905 now rather than having to recheck each instruction as it's being
11906 executed. Check that vector words fit in 'int'.
11907 (ccl_get_compiled_code, Fregister_ccl_program)
11908 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11909 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11910 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11911 contents are in range.
11912 (Fccl_execute_on_string): Check that status is in range.
11913 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11914 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11915 Accept and return EMACS_INT, not int, because callers can pass values
11916 out of 'int' range.
11917 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11918 (multibyte_chars_in_text, parse_str_as_multibyte)
11919 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11920 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11921 (string_escape_byte8, Fget_byte):
11922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11923 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11924 avoid mishandling large integers.
11925 * character.h: Adjust decls to match defn changes elsewhere.
11926 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11927 (Ffind_charset_region):
11928 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11929 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11930 (load_charset_map_from_vector, Fdefine_charset_internal):
11931 Don't assume fixnum fits in int.
11932 (load_charset_map_from_vector, Fmap_charset_chars):
11933 Remove now-unnecessary CHECK_NATNUMs.
11934 (Fdefine_charset_internal): Check ranges here, more carefully.
11935 Don't rely on undefined behavior with signed left shift overflow.
11936 Don't assume unsigned int fits into fixnum, or that fixnum fits
11937 into unsigned int. Don't require max_code to be a valid fixnum;
11938 that's not true for gb10830 4-byte on a 32-bit host. Allow
11939 invalid_code to be a cons, for the same reason. Require code_offset
11940 to be a character. Avoid int overflow if max_char is close
11941 to INT_MAX.
11942 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11943 this is intended anyway and avoids some undefined behavior.
11944 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11945 INDEX_TO_CODE_POINT, as that's what it expects.
11946 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11947 * charset.h (DECODE_CHAR): Return int, not unsigned;
11948 this is what was intended anyway, and it avoids undefined behavior.
11949 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11950 integer-overflow issues.
11951 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11952 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11953 where the argument is EMACS_INT, and this behavior is not intended.
11954 * chartab.c (Fmake_char_table, Fset_char_table_range)
11955 (uniprop_get_decoder, uniprop_get_encoder):
11956 Don't assume fixnum fits in int.
11957 * cmds.c (move_point): New function, that does the gist of
11958 Fforward_char and Fbackward_char, but does so while checking
11959 for integer overflow more accurately.
11960 (Fforward_char, Fbackward_char): Use it.
11961 (Fforward_line, Fend_of_line, internal_self_insert)
11962 (internal_self_insert):
11963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11964 Fix a FIXME, by checking for integer overflow when calculating
11965 target_clm and actual_clm.
11966 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11967 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11968 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11969 (coding_alloc_by_making_gap, alloc_destination)
11970 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11971 (encode_coding_utf_16, detect_coding_emacs_mule)
11972 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11973 (detect_coding_iso_2022, decode_coding_iso_2022)
11974 (encode_invocation_designation, encode_designation_at_bol)
11975 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11976 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11977 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11978 (encode_coding_ccl, encode_coding_raw_text)
11979 (detect_coding_charset, decode_coding_charset)
11980 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11981 (produce_composition, produce_charset, produce_annotation)
11982 (decode_coding, handle_composition_annotation)
11983 (handle_charset_annotation, consume_chars, decode_coding_gap)
11984 (decode_coding_object, encode_coding_object, detect_coding_system)
11985 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11986 (code_convert_region, code_convert_string)
11987 (Fdefine_coding_system_internal)
11988 (coding_set_source, coding_set_destination):
11989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11990 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11991 (Fdefine_coding_system_internal):
11992 Don't assume fixnums fit in int.
11993 (decode_coding_gap, decode_coding_object, encode_coding_object)
11994 (Fread_coding_system, Fdetect_coding_region)
11995 (Funencodable_char_position, Fcheck_coding_systems_region)
11996 (get_translation, handle_composition_annotation, consume_chars):
11997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11998 (consume_chars): Rewrite to not calculate an address outside buffer.
11999 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12000 Don't access memory outside of the args array.
12001 (Fdefine_coding_system_internal): Check for charset-id overflow.
12002 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12003 result of ENCODE_CHAR.
12004 * coding.h: Adjust decls to match defn changes elsewhere.
12005 (struct coding_system):
12006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12007 * composite.c (get_composition_id, find_composition)
12008 (run_composition_function, update_compositions)
12009 (compose_text, composition_gstring_put_cache)
12010 (composition_gstring_p, composition_gstring_width)
12011 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12012 (composition_compute_stop_pos, composition_reseat_it)
12013 (composition_update_it, struct position_record)
12014 (find_automatic_composition, composition_adjust_point)
12015 (Fcomposition_get_gstring, Ffind_composition_internal):
12016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12017 (update_compositions):
12018 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12019 * composite.h: Adjust decls to match defn changes elsewhere.
12020 (struct composition):
12021 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12022 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12023 Do not attempt to compute the address of the object just before a
12024 buffer; this is not portable.
12025 (Faref, Faset):
12026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12027 (Faset): Use int, not EMACS_INT, where int is wide enough.
12028 (Fstring_to_number): Don't assume fixnums fit in int.
12029 (Frem): Don't assume arg is nonnegative.
12030 * dbusbind.c (xd_append_arg): Check for integers out of range.
12031 (Fdbus_call_method): Don't overflow the timeout int.
12032 (extract_signed, extract_unsigned): New functions.
12033 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12034 (xd_get_connection_references): Return ptrdiff_t, not int.
12035 All uses changed.
12036 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12037 (xd_read_message_1):
12038 Use int, not unsigned, where the dbus API uses int.
12039 (Fdbus_message_internal): Don't overflow mtype.
12040 (syms_of_dbusbind): Allocate right-sized buffer for integers.
12041 * dired.c (directory_files_internal, file_name_completion, scmp)
12042 (file_name_completion_stat):
12043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12044 (file_name_completion): Don't overflow matchcount.
12045 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12046 * dispextern.h: Adjust decls to match defn changes elsewhere.
12047 (struct text_pos, struct glyph, struct bidi_saved_info)
12048 (struct bidi_string_data, struct bidi_it, struct composition_it)
12049 (struct it):
12050 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12051 (struct display_pos, struct composition_it, struct it):
12052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12053 * dispnew.c (increment_matrix_positions)
12054 (increment_row_positions, mode_line_string)
12055 (marginal_area_string):
12056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12057 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12059 (duration_to_sec_usec): New function, to check for overflow better.
12060 (Fsleep_for, sit_for): Use it.
12061 * doc.c (get_doc_string, store_function_docstring):
12062 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12063 (get_doc_string, Fsnarf_documentation):
12064 Use int, not EMACS_INT, where int is wide enough.
12065 (get_doc_string):
12066 Use SAFE_ALLOCA, not alloca.
12067 Check for overflow when converting EMACS_INT to off_t.
12068 * doprnt.c (doprnt):
12069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12070 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12071 Don't assume uid_t fits into fixnum.
12072 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12073 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12074 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12075 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12076 (general_insert_function)
12077 (Finsert_char, make_buffer_string, make_buffer_string_both)
12078 (update_buffer_properties, Fbuffer_substring)
12079 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12080 (Fsubst_char_in_region, check_translation)
12081 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12082 (transpose_markers, Ftranspose_regions):
12083 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12084 (clip_to_bounds): Move to lisp.h as an inline function).
12085 (Fconstrain_to_field): Don't assume integers are nonnegative.
12086 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12087 (Fsubst_char_in_region, Fsave_restriction):
12088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12089 (Femacs_pid): Don't assume pid_t fits into fixnum.
12090 (lo_time): Use int, not EMACS_INT, when int suffices.
12091 (lisp_time_argument): Check for usec out of range.
12092 (Fencode_time): Don't assume fixnum fits in int.
12093 (Fuser_login_name, Fuser_full_name): Signal an error
12094 if a uid argument is out of range, rather than relying on
12095 undefined behavior.
12096 (Fformat_time_string): Remove now-unnecessary check.
12097 lisp_time_argument checks for out-of-range usec now.
12098 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12099 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12100 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12101 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12102 (init_cmdargs, Fdump_emacs):
12103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12104 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12105 the bottom (typically) 32 bits of the fixnum.
12106 * eval.c (specpdl_size, call_debugger):
12107 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12108 (when_entered_debugger, Fbacktrace_debug):
12109 Don't assume fixnum can fit in int.
12110 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12111 the object just before a buffer; this is not portable.
12112 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12113 (grow_specpdl, unbind_to):
12114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12115 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12116 (grow_specpdl): Simplify allocation by using xpalloc.
12117 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12118 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12119 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12121 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12122 (a_write, e_write):
12123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12124 (Fcopy_file, non_regular_nbytes, read_non_regular)
12125 (Finsert_file_contents):
12126 Use int, not EMACS_INT, where int is wide enough.
12127 (READ_BUF_SIZE): Verify that it fits in int.
12128 (Finsert_file_contents): Check that counts are in proper range,
12129 rather than assuming fixnums fit into ptrdiff_t etc.
12130 Don't assume fixnums fit into int.
12131 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12132 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12133 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12134 (string_char_to_byte, string_byte_to_char)
12135 (string_make_multibyte, string_to_multibyte)
12136 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12137 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12138 (substring_both, Fdelete, internal_equal, Ffillarray)
12139 (Fclear_string, mapcar1)
12140 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12141 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12142 (larger_vector, make_hash_table, maybe_resize_hash_table)
12143 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12144 (Fmaphash, secure_hash):
12145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12146 (concat): Check for string index and length overflow.
12147 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12148 (Frequire):
12149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12150 (larger_vector): New API (vec, incr_min, size_max) replaces old
12151 one (vec, new_size, init). This catches size overflow.
12152 INIT was removed because it was always Qnil.
12153 All callers changed.
12154 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12155 the upper bound on a hash table index size.
12156 (make_hash_table, maybe_resize_hash_table): Use it.
12157 (secure_hash): Computer start_byte and end_byte only after
12158 they're known to be in ptrdiff_t range.
12159 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12160 (Ffont_get_glyphs, Ffont_at):
12161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12162 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12163 (Flist_fonts, Fopen_font):
12164 Don't assume fixnum can fit in int.
12165 (check_gstring): Don't assume index can fit in int.
12166 (font_match_p): Check that fixnum is a character, not a nonnegative
12167 fixnum, since the later code needs to stuff it into an int.
12168 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12169 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12170 conversion overflow issues.
12171 (Fopen_font): Check for integer out of range.
12172 (Ffont_get_glyphs): Don't assume index can fit in int.
12173 * font.h: Adjust decls to match defn changes elsewhere.
12174 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12175 integer overflow.
12176 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12177 printmax_t, where ptrdiff_t is wide enough.
12178 (Finternal_char_font):
12179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12180 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12181 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12182 (Fset_frame_position, x_set_frame_parameters)
12183 (x_set_line_spacing, x_set_border_width)
12184 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12185 Check that fixnums are in proper range for system types.
12186 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12188 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12189 Use SAFE_ALLOCA_LISP, not alloca.
12190 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12191 intptr_t is wide enough.
12192 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12193 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12194 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12195 Check for fixnum out of range.
12196 * ftfont.c (ftfont_list): Don't assume index fits in int.
12197 Check that fixnums are in proper range for system types.
12198 (ftfont_shape_by_flt):
12199 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12200 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12202 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12203 Check that fixnums are in proper range for system types.
12204 * gnutls.h: Adjust decls to match defn changes elsewhere.
12205 * gtkutil.c (xg_dialog_run):
12206 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12207 (update_frame_tool_bar):
12208 Check that fixnums are in proper range for system types.
12209 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12210 (lookup_image): Check that fixnums are in range for system types.
12211 * indent.c (last_known_column, last_known_column_point):
12212 (current_column_bol_cache):
12213 (skip_invisible, current_column, check_display_width):
12214 (check_display_width, scan_for_column, current_column_1)
12215 (Findent_to, Fcurrent_indentation, position_indentation)
12216 (indented_beyond_p, Fmove_to_column, compute_motion):
12217 (Fcompute_motion, Fvertical_motion):
12218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12219 (last_known_column_modified): Use EMACS_INT, not int.
12220 (check_display_width):
12221 (Fcompute_motion):
12222 Check that fixnums and floats are in proper range for system types.
12223 (compute_motion): Don't assume index or fixnum fits in int.
12224 (compute_motion, Fcompute_motion):
12225 Use int, not EMACS_INT, when it is wide enough.
12226 (vmotion): Omit local var start_hpos that is always 0; that way
12227 we don't need to worry about overflow in expressions involving it.
12228 * indent.h: Adjust decls to match defn changes elsewhere.
12229 (struct position):
12230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12231 Use int, not EMACS_INT, where int is wide enough.
12232 Remove unused members ovstring_chars_done and tab_offset;
12233 all uses removed.
12234 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12235 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12236 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12237 (make_gap, copy_text, insert, insert_and_inherit)
12238 (insert_before_markers, insert_before_markers_and_inherit)
12239 (insert_1, count_combining_before, count_combining_after)
12240 (insert_1_both, insert_from_string)
12241 (insert_from_string_before_markers, insert_from_string_1)
12242 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12243 (adjust_after_replace, adjust_after_insert, replace_range)
12244 (replace_range_2, del_range, del_range_1, del_range_byte)
12245 (del_range_both, del_range_2, modify_region)
12246 (prepare_to_modify_buffer, signal_before_change)
12247 (signal_after_change, Fcombine_after_change_execute):
12248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12249 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12250 (balance_an_interval, split_interval_right, split_interval_left)
12251 (find_interval, next_interval, update_interval)
12252 (adjust_intervals_for_insertion, delete_node, delete_interval)
12253 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12254 (static_offset_intervals, offset_intervals)
12255 (merge_interval_right, merge_interval_left, make_new_interval)
12256 (graft_intervals_into_buffer, temp_set_point_both)
12257 (temp_set_point, set_point, adjust_for_invis_intang)
12258 (set_point_both, move_if_not_intangible, get_property_and_range)
12259 (get_local_map, copy_intervals, copy_intervals_to_string)
12260 (compare_string_intervals, set_intervals_multibyte_1):
12261 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12262 * intervals.h: Adjust decls to match defn changes elsewhere.
12263 (struct interval):
12264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12265 * keyboard.c (this_command_key_count, this_single_command_key_start)
12266 (before_command_key_count, before_command_echo_length, echo_now)
12267 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12268 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12269 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12270 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12271 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12272 (last_non_minibuf_size, last_point_position, echo_truncate)
12273 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12274 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12275 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12276 (stuff_buffered_input):
12277 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12278 (last_auto_save, command_loop_1, read_char):
12279 Use EMACS_INT, not int, to avoid integer overflow.
12280 (record_char): Avoid overflow in total_keys computation.
12281 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12282 * keyboard.h: Adjust decls to match defn changes elsewhere.
12283 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12284 (Fkey_description, Fdescribe_vector, Flookup_key):
12285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12286 (click_position): New function, to check that positions are in range.
12287 (Fcurrent_active_maps):
12288 (describe_command):
12289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12290 (Faccessible_keymaps, Fkey_description):
12291 (preferred_sequence_p):
12292 Don't assume fixnum can fit into int.
12293 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12294 Check for integer overflow in size calculations.
12295 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12296 avoid mishandling large integers.
12297 * lisp.h: Adjust decls to match defn changes elsewhere.
12298 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12299 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12300 (struct Lisp_Marker):
12301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12302 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12303 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12304 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12305 All callers changed.
12306 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12307 Assume the arg has valid form, since it always does.
12308 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12309 unsigned integer system type.
12310 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12311 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12313 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12314 (duration_to_sec_usec): New decl.
12315 * lread.c (read_from_string_index, read_from_string_index_byte)
12316 (read_from_string_limit, readchar, unreadchar, openp)
12317 (read_internal_start, read1, oblookup):
12318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12319 (Fload, readevalloop, Feval_buffer, Feval_region):
12320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12321 (openp): Check for out-of-range argument to 'access'.
12322 (read1): Use int, not EMACS_INT, where int is wide enough.
12323 Don't assume fixnum fits into int.
12324 Fix off-by-one error that can read outside a buffer.
12325 (read_filtered_event): Use duration_to_sec_usec
12326 to do proper overflow checking on durations.
12327 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12328 in size calculation.
12329 (Fexecute_kbd_macro):
12330 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12331 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12332 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12333 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12334 (set_marker_both, set_marker_restricted_both, marker_position)
12335 (marker_byte_position, Fbuffer_has_markers_at):
12336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12337 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12338 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12339 It now merely ensures that the menu is large enough, without
12340 necessarily growing it, as this avoids some integer overflow issues.
12341 All callers changed.
12342 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12343 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12344 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12345 Use SAFE_ALLOCA_LISP, not alloca.
12346 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12347 to EMACS_INT. Check that fixnums are in proper range for system types.
12348 * minibuf.c (minibuf_prompt_width, string_to_object)
12349 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12350 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12352 (get_minibuffer, read_minibuf_unwind):
12353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12354 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12355 this simplifies overflow checking. All callers changed.
12356 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12357 (Ftest_completion):
12358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12359 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12360 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12361 Check that fixnums are in proper range for system types.
12362 (Fx_create_frame, Fx_show_tip):
12363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12364 * nsfont.m (ns_findfonts, nsfont_list_family):
12365 Don't assume fixnum fits in long.
12366 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12368 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12369 wide enough.
12370 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12372 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12373 (PRINTDECLARE, PRINTPREPARE):
12374 (strout, print_string):
12375 (print, print_preprocess, print_check_string_charset_prop)
12376 (print_object):
12377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12378 (PRINTDECLARE):
12379 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12381 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12382 (printchar, strout): Use xpalloc to catch size calculation overflow.
12383 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12384 (print_error_message): Use SAFE_ALLOCA, not alloca.
12385 (print_object): Use int, not EMACS_INT, where int is wide enough.
12386 (print_depth, new_backquote_output, print_number_index):
12387 Use ptrdiff_t, not int, where int might not be wide enough.
12388 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12389 (Fset_process_window_size, Fformat_network_address)
12390 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12391 (sigchld_handler):
12392 Check that fixnums are in proper range for system types.
12393 (Fsignal_process): Simplify by avoiding a goto.
12394 Check for process-ids out of pid_t range rather than relying on
12395 undefined behavior.
12396 (process_tick, update_tick): Use EMACS_INT, not int.
12397 (Fformat_network_address, read_process_output, send_process)
12398 (Fprocess_send_region, status_notify):
12399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12400 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12401 (wait_reading_process_output, read_process_output, exec_sentinel):
12402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12403 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12404 (Faccept_process_output): Use duration_to_sec_usec to do proper
12405 overflow checking on durations.
12406 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12407 Don't assume pid_t fits in int.
12408 * process.h (struct Lisp_Process): Members tick and update_tick
12409 are now of type EMACS_INT, not int.
12410 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12411 configured --with-wide-int.
12412 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12413 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12414 * search.c (looking_at_1, string_match_1):
12415 (fast_string_match, fast_c_string_match_ignore_case)
12416 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12417 (scan_newline, find_before_next_newline, search_command)
12418 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12419 (set_search_regs, wordify):
12420 (Freplace_match):
12421 (Fmatch_data):
12422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12423 (string_match_1, search_buffer, set_search_regs):
12424 (Fmatch_data):
12425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12426 (wordify): Check for overflow in size calculation.
12427 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12428 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12429 Check that fixnums are in proper range for system types.
12430 * sound.c (struct sound_device)
12431 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12433 (Fplay_sound_internal):
12434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12435 * syntax.c (struct lisp_parse_state, find_start_modiff)
12436 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12437 (Fparse_partial_sexp):
12438 Don't assume fixnums can fit in int.
12439 (struct lisp_parse_state, find_start_pos, find_start_value)
12440 (find_start_value_byte, find_start_begv)
12441 (update_syntax_table, char_quoted, dec_bytepos)
12442 (find_defun_start, prev_char_comend_first, back_comment):
12443 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12444 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12446 (Finternal_describe_syntax_value): Check that match_lisp is a
12447 character, not an integer, since the code stuffs it into int.
12448 (scan_words, scan_sexps_forward):
12449 Check that fixnums are in proper range for system types.
12450 (Fforward_word):
12451 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12452 (scan_sexps_forward):
12453 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12454 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12455 * syntax.h: Adjust decls to match defn changes elsewhere.
12456 (struct gl_state_s):
12457 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12458 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12459 MOST_POSITIVE_FIXNUM.
12460 * sysdep.c (wait_for_termination_1, wait_for_termination)
12461 (interruptible_wait_for_termination, mkdir):
12462 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12463 (emacs_read, emacs_write):
12464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12465 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12466 and double all fit in int.
12467 * term.c (set_tty_color_mode):
12468 Check that fixnums are in proper range for system types.
12469 * termhooks.h (struct input_event):
12470 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12471 * textprop.c (validate_interval_range, interval_of)
12472 (Fadd_text_properties, set_text_properties_1)
12473 (Fremove_text_properties, Fremove_list_of_text_properties)
12474 (Ftext_property_any, Ftext_property_not_all)
12475 (copy_text_properties, text_property_list, extend_property_ranges)
12476 (verify_interval_modification):
12477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12478 (Fnext_single_char_property_change)
12479 (Fprevious_single_char_property_change):
12480 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12481 (copy_text_properties):
12482 Check for integer overflow in index calculation.
12483 * undo.c (last_boundary_position, record_point, record_insert)
12484 (record_delete, record_marker_adjustment, record_change)
12485 (record_property_change):
12486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12487 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12489 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12490 (Fx_hide_tip, Fx_file_dialog):
12491 * w32menu.c (set_frame_menubar):
12492 Use ptrdiff_t, not int, for consistency with rest of code.
12493 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12494 (select_window, Fdelete_other_windows_internal)
12495 (window_scroll_pixel_based, window_scroll_line_based)
12496 (Frecenter, Fset_window_configuration):
12497 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12498 (Fset_window_hscroll, run_window_configuration_change_hook)
12499 (set_window_buffer, temp_output_buffer_show, scroll_command)
12500 (Fscroll_other_window, Frecenter):
12501 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12502 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12503 Don't assume fixnum fits in int.
12504 (Fset_window_scroll_bars):
12505 Check that fixnums are in proper range for system types.
12506 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12507 (string_pos, c_string_pos, number_of_chars, init_iterator)
12508 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12509 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12510 (compute_display_string_end, handle_face_prop)
12511 (face_before_or_after_it_pos, handle_invisible_prop)
12512 (handle_display_prop, handle_display_spec, handle_single_display_spec)
12513 (display_prop_intangible_p, string_buffer_position_lim)
12514 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12515 (get_overlay_strings_1, get_overlay_strings)
12516 (iterate_out_of_display_property, forward_to_next_line_start)
12517 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12518 (get_next_display_element, set_iterator_to_next)
12519 (get_visually_first_element, compute_stop_pos_backwards)
12520 (handle_stop_backwards, next_element_from_buffer)
12521 (move_it_in_display_line_to, move_it_in_display_line)
12522 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12523 (add_to_log, message_dolog, message_log_check_duplicate)
12524 (message2, message2_nolog, message3, message3_nolog
12525 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12526 (current_message_1, truncate_echo_area, truncate_message_1)
12527 (set_message, set_message_1, store_mode_line_noprop)
12528 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12529 (text_outside_line_unchanged_p, check_point_in_composition)
12530 (reconsider_clip_changes)
12531 (redisplay_internal, set_cursor_from_row, try_scrolling)
12532 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12533 (redisplay_window, find_last_unchanged_at_beg_row)
12534 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12535 (trailing_whitespace_p, find_row_edges, display_line)
12536 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12537 (display_mode_element, store_mode_line_string)
12538 (pint2str, pint2hrstr, decode_mode_spec)
12539 (display_count_lines, display_string, draw_glyphs)
12540 (x_produce_glyphs, x_insert_glyphs)
12541 (rows_from_pos_range, mouse_face_from_buffer_pos)
12542 (fast_find_string_pos, mouse_face_from_string_pos)
12543 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12545 (safe_call, init_from_display_pos, handle_fontified_prop)
12546 (handle_single_display_spec, load_overlay_strings)
12547 (with_echo_area_buffer, setup_echo_area_for_printing)
12548 (display_echo_area, echo_area_display)
12549 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12550 (update_tool_bar, hscroll_window_tree, redisplay_internal)
12551 (redisplay_window, dump_glyph_row, display_mode_line)
12552 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12553 (handle_display_spec, display_prop_string_p):
12554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12555 (handle_single_display_spec, build_desired_tool_bar_string)
12556 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12557 (get_specified_cursor_type):
12558 Check that fixnums are in proper range for system types.
12559 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12560 (Flookup_image_map):
12561 Don't assume fixnums fit in int.
12562 (compare_overlay_entries):
12563 Avoid mishandling comparisons due to subtraction overflow.
12564 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12565 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12566 (handle_tool_bar_click):
12567 Use int, not unsigned, since we prefer signed and the signedness
12568 doesn't matter here.
12569 (get_next_display_element, next_element_from_display_vector):
12570 Use int, not EMACS_INT, when int is wide enough.
12571 (start_hourglass): Use duration_to_sec_usec to do proper
12572 overflow checking on durations.
12573 * xfaces.c (Fbitmap_spec_p):
12574 Check that fixnums are in proper range for system types.
12575 (compare_fonts_by_sort_order):
12576 Avoid mishandling comparisons due to subtraction overflow.
12577 (Fx_family_fonts, realize_basic_faces):
12578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12579 (Fx_family_fonts):
12580 Don't assume fixnum fits in int.
12581 Use SAFE_ALLOCA_LISP, not alloca.
12582 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12583 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12584 (face_at_buffer_position, face_for_overlay_string)
12585 (face_at_string_position):
12586 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12587 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12588 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12589 (Fx_show_tip):
12590 Check that fixnums are in proper range for system types.
12591 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12592 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12594 (Fx_change_window_property): Don't assume fixnums fit in int.
12595 * xfont.c (xfont_chars_supported):
12596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12597 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12598 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12600 * xml.c (parse_region):
12601 * xrdb.c (magic_file_p):
12602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12603 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12604 (x_get_local_selection, x_reply_selection_request)
12605 (x_handle_selection_request, wait_for_property_change):
12606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12607 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12608 short is wide enough.
12609 (x_send_client_event): Don't assume fixnum fits in int.
12610 * xterm.c (x_x_to_emacs_modifiers):
12611 Don't assume EMACS_INT overflows nicely into int.
12612 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12613 may come from Lisp.
12614 (handle_one_xevent): NATNUMP can eval its arg twice.
12615 (x_connection_closed):
12616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12617 * xterm.h: Adjust decls to match defn changes elsewhere.
12618 (struct scroll_bar): Use struct vectorlike_header
12619 rather than rolling our own approximation.
12620 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12621
12622 2012-05-25 Glenn Morris <rgm@gnu.org>
12623
12624 * lisp.mk (lisp): Update for more files being compiled now.
12625
12626 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12627
12628 * lread.c: Remove `read_pure' which makes no difference.
12629 (read_pure): Remove var.
12630 (unreadpure): Remove function.
12631 (readevalloop): Don't call read_list with -1 flag.
12632 (read1, read_vector): Don't test read_pure any more.
12633 (read_list): Simplify.
12634
12635 * fileio.c, character.h: Minor style tweaks.
12636
12637 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12638
12639 * window.h (clip_changed): Remove useless declaration.
12640
12641 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
12642
12643 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12644 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12645
12646 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12647
12648 Remove src/m/*.
12649 This directory predates autoconf and is no longer needed nowadays.
12650 Move its few remaining bits of functionality to where they're needed.
12651 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12652 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12653 * m/template.h: Remove.
12654 * Makefile.in (M_FILE): Remove. All uses removed.
12655 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12656 * lisp.h (USE_LSB_TAG):
12657 * mem-limits.h (EXCEEDS_LISP_PTR):
12658 Use VAL_MAX, not VALBITS, in #if.
12659 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12660 (EMACS_UINT): Define unconditionally now.
12661 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12662 (BITS_PER_EMACS_INT): New constants, replacing
12663 what used to be in config.h, but not useful in #if.
12664 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12665 define them any more.
12666 (VAL_MAX): New macro.
12667 (VALMASK): Use it.
12668 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12669 BITS_PER_EMACS_INT, in #if.
12670 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12671 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12672 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12673 * s/ms-w32.h (DATA_START):
12674 Move here from removed file m/intel386.h.
12675 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12676 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12677
12678 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12679
12680 Assume C89 or later.
12681 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12682 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12683 (xrealloc):
12684 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12685 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12686 * textprop.c, tparam.c (NULL): Remove.
12687 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12688 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12689 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12690 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12691 * xterm.c (input_signal_count): Assume volatile works.
12692
12693 2012-05-21 Ken Brown <kbrown@cornell.edu>
12694
12695 * xgselect.c (xg_select): Fix first argument in call to 'select'
12696 (bug#11508).
12697
12698 2012-05-20 Ken Brown <kbrown@cornell.edu>
12699
12700 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12701 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12702
12703 2012-05-19 Ken Brown <kbrown@cornell.edu>
12704
12705 * xfns.c (x_in_use): Remove `static' qualifier.
12706 * xterm.h (x_in_use): Declare.
12707 * xgselect.c: Include xterm.h.
12708 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12709 and `display_arg' (bug#9754).
12710
12711 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12712
12713 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12714
12715 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12716 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12717
12718 2012-05-18 Eli Zaretskii <eliz@gnu.org>
12719
12720 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12721
12722 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12723 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12724
12725 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12726 reference to image_cache->refcount.
12727 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12728
12729 2012-05-17 Juri Linkov <juri@jurta.org>
12730
12731 * search.c (Fword_search_regexp, Fword_search_backward)
12732 (Fword_search_forward, Fword_search_backward_lax)
12733 (Fword_search_forward_lax): Move functions to isearch.el
12734 (bug#10145, bug#11381).
12735
12736 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12737
12738 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12739
12740 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12741
12742 * lread.c (init_obarray): Declare Qt and Qnil as special.
12743
12744 2012-05-14 Glenn Morris <rgm@gnu.org>
12745
12746 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12747 Put "libexec" before "bin", for the sake of init_callproc_1.
12748
12749 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12750
12751 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12752
12753 * unexaix.c: Port to more-recent AIX compilers.
12754 (report_error, report_error_1, make_hdr, copy_sym)
12755 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12756 Make arguments const char *, not char *, to avoid violations of C
12757 standard and to fix some AIX warnings reported by Gilles Pion.
12758
12759 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12760
12761 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12762 already have overlays loaded.
12763 (handle_single_display_spec): Before returning without displaying
12764 fringe bitmap, synchronize the bidi iterator with the main display
12765 iterator, by calling iterate_out_of_display_property.
12766 (iterate_out_of_display_property): Detect buffer iteration by
12767 testing that it->string is a Lisp string.
12768 (get_next_display_element): When the current object is exhausted,
12769 and there's something on it->stack, call set_iterator_to_next to
12770 proceed with what's on the stack, instead of returning zero.
12771 (set_iterator_to_next): If called at the end of a Lisp string,
12772 proceed to consider_string_end without incrementing string
12773 position. Don't increment display vector index past the end of
12774 the display vector. (Bug#11417)
12775 (pos_visible_p): Don't report a position visible when move_it_to
12776 stopped at the last line of window, which happens to be scanned
12777 backwards by the bidi iteration. (Bug#11464)
12778
12779 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12780
12781 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12782 and right-margin display specs even if the spec is invalid or we
12783 are on a TTY, and thus unable to display on the fringes.
12784 That's because the text with the property will not be displayed anyway,
12785 so we need to signal to the caller that this is a "replacing"
12786 display spec. This fixes display when the spec is invalid or we
12787 are on a TTY.
12788
12789 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12790
12791 * unexaix.c (make_hdr): Fix typo in prototype.
12792 This bug broke the build on AIX. Problem reported by Gilles Pion.
12793
12794 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
12795
12796 * keyboard.c (kbd_buffer_get_event): Read special events also in
12797 batch mode. (Bug#11415)
12798
12799 2012-05-12 Glenn Morris <rgm@gnu.org>
12800
12801 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12802
12803 2012-05-12 Eli Zaretskii <eliz@gnu.org>
12804
12805 * lisp.mk (lisp): Add newcomment.elc.
12806
12807 2012-05-12 Glenn Morris <rgm@gnu.org>
12808
12809 * Makefile.in (MKDIR_P): New, set by configure.
12810 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12811
12812 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12813
12814 Remove unused function hourglass_started.
12815 * dispextern.h (hourglass_started):
12816 * w32fns.c (hourglass_started):
12817 * xdisp.c (hourglass_started): Remove.
12818
12819 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
12820
12821 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12822 Update dependencies.
12823
12824 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12825
12826 * xgselect.c (xg_select): Put maxfds+1 into a var.
12827 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12828
12829 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12830
12831 2012-05-10 Dave Abrahams <dave@boostpro.com>
12832
12833 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12834 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12835
12836 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
12837
12838 * dbusbind.c (xd_registered_buses): New internal Lisp object.
12839 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
12840 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12841 Initialize xd_registered_buses.
12842
12843 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12844
12845 Untag more efficiently if USE_LSB_TAG.
12846 This is based on a proposal by YAMAMOTO Mitsuharu in
12847 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12848 For an admittedly artificial (nth 8000 longlist) benchmark on
12849 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12850 Emacs's overall text size by 1%.
12851 * lisp.h (XUNTAG): New macro.
12852 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12853 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12854 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12855 * eval.c (Fautoload):
12856 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12857 * frame.h (XFRAME): Use XUNTAG.
12858
12859 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12860 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12861 Remove unportable assumptions about print widths of types like
12862 dbus_uint32_t.
12863 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12864 intptr_t when converting between pointer and integer, to avoid GCC
12865 warnings about wrong width.
12866
12867 2012-05-09 Eli Zaretskii <eliz@gnu.org>
12868
12869 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12870 stack for each reader_thread, instead of defaulting to 8MB
12871 determined by the linker. This avoids failures in creating
12872 subprocesses on Windows 7, see the discussion in this thread:
12873 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12874
12875 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12876
12877 Fix up display of the *Minibuf-0* buffer in the mini window.
12878 * keyboard.c (read_char): Don't clear the echo area if there's no
12879 message to clear.
12880 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12881 contents of *Minibuf-0*) if there's no message displayed in its stead.
12882
12883 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
12884
12885 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12886 batch mode.
12887
12888 2012-05-06 Chong Yidong <cyd@gnu.org>
12889
12890 * lisp.mk (lisp): Update.
12891
12892 2012-05-05 Jim Meyering <meyering@redhat.com>
12893
12894 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12895
12896 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12897
12898 * data.c (PUT_ERROR): New macro.
12899 (syms_of_data): Use it. Add new error type `user-error'.
12900 * undo.c (user_error): New function.
12901 (Fprimitive_undo): Use it.
12902 * print.c (print_error_message): Adjust print style for `user-error'.
12903 * keyboard.c (user_error): New function.
12904 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12905
12906 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12907
12908 Do not limit current-time-string to years 1000..9999.
12909 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12910 (Fcurrent_time_string): Support any year that is supported by the
12911 underlying localtime representation. Don't use asctime, as it
12912 has undefined behavior for years outside the range -999..9999.
12913
12914 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12915
12916 Fix race conditions involving setenv, gmtime, localtime, asctime.
12917 Without this fix, interrupts could mess up code that uses these
12918 nonreentrant functions, since setting TZ invalidates existing
12919 tm_zone or tzname values, and since most of these functions return
12920 pointers to static storage.
12921 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12922 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12923 Grow the critical sections to include not just invoking
12924 localtime/gmtime, but also accessing these functions' results
12925 including their tm_zone values if any, and any related TZ setting.
12926 (format_time_string): Last arg is now struct tm *, not struct tm **,
12927 so that the struct tm is saved in the critical section.
12928 All callers changed. Simplify allocation of initial buffer, partly
12929 motivated by the fact that memory allocation needs to be outside
12930 the critical section.
12931
12932 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12933
12934 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12935 with RESET_INTERVAL.
12936
12937 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12938 Remove duplicated buffer name initialization.
12939
12940 2012-05-02 Jim Meyering <jim@meyering.net>
12941
12942 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12943
12944 * xfns.c (x_window): Use xstrdup (Bug#11375).
12945
12946 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12947
12948 * xdisp.c (pos_visible_p): If already at a newline from the
12949 display string before the 'while' loop, don't walk back the glyphs
12950 from it3.glyph_row. Solves assertion violation when the display
12951 string begins with a newline (egg.el). (Bug#11367)
12952
12953 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12954
12955 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12956 Move to simple.el.
12957
12958 2012-05-01 Glenn Morris <rgm@gnu.org>
12959
12960 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12961 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12962 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12963 All were removed before 23.1.
12964
12965 * dispnew.c: Remove HAVE_LIBNCURSES test;
12966 it is always true on relevant platforms.
12967
12968 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12969 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12970
12971 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12972
12973 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12974
12975 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12976 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12977 Remove.
12978
12979 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12980
12981 Do not avoid creating empty evaporating overlays (Bug#9642).
12982 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12983 That is, do not delete an evaporating overlay if it becomes
12984 empty after its bounds are adjusted to fit within its buffer.
12985 This fix caused other problems, and I'm reverting it until we get
12986 to the bottom of them.
12987
12988 2012-04-27 Chong Yidong <cyd@gnu.org>
12989
12990 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12991
12992 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12993
12994 * xdisp.c (pos_visible_p): If the window start position is beyond
12995 ZV, start the display from buffer beginning. Prevents assertion
12996 violation in init_iterator when the minibuffer window is scrolled
12997 via the scroll bar.
12998
12999 * window.c (window_scroll_pixel_based): Likewise.
13000
13001 2012-04-27 Chong Yidong <cyd@gnu.org>
13002
13003 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13004
13005 2012-04-27 Glenn Morris <rgm@gnu.org>
13006
13007 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13008 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13009
13010 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13011
13012 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13013 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13014
13015 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13016
13017 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13018 display element, check also the underlying string or buffer
13019 character. (Bug#11341)
13020
13021 * w32menu.c: Include w32heap.h.
13022 (add_menu_item): If the call to AppendMenuW (via
13023 unicode_append_menu) fails, disable Unicode menus only if we are
13024 running on Windows 9X/Me.
13025
13026 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13027
13028 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13029 (xgetint): Add missing shift for LSB tags.
13030
13031 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13032
13033 * keyboard.c (read_char): Don't wipe echo area for select window
13034 events: These might get delayed via `mouse-autoselect-window'
13035 (Bug#11304).
13036
13037 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
13038
13039 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13040 manipulation of :loaded-from data.
13041
13042 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
13043
13044 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13045 now a cons (bug#11311).
13046
13047 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13048
13049 Do not create empty overlays with the evaporate property (Bug#9642).
13050 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13051 if it becomes empty after its bounds are adjusted to fit within
13052 its buffer. Without this fix, in a nonempty buffer (let ((o
13053 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13054 yields an empty overlay that has the evaporate property, which is
13055 not supposed to happen.
13056
13057 Fix minor GTK3 problems found by static checking.
13058 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13059 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13060 (struct _EmacsFixedClass, emacs_fixed_get_type):
13061 Move decls here from emacsgtkfixed.h, since they needn't be public.
13062 (emacs_fixed_get_type): Now static.
13063 (emacs_fixed_class_init): Omit unused local.
13064 (emacs_fixed_child_type): Remove; unused.
13065 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13066 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13067 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13068 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13069 (EMACS_FIXED_GET_CLASS): Remove; unused.
13070 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13071
13072 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13073 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13074
13075 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13076
13077 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13078 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13079 (__malloc_size_t, __malloc_ptrdiff_t):
13080 Remove. All uses removed, replaced by the definiens if needed,
13081 since we can assume C89 or better now.
13082 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13083 (protect_malloc_state, align, get_contiguous_space)
13084 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13085 (malloc_atfork_handler_child, malloc_enable_thread)
13086 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13087 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13088 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13089 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13090 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13091 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13092 Define using prototypes, not old style.
13093 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13094 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13095 (align): Don't assume that signed integer overflow wraps around.
13096 Omit unused local var.
13097 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13098 (_free_internal_nolock, memalign, mallochook, reallochook):
13099 Omit no-longer-needed casts.
13100 (valloc): Use getpagesize, not __getpagesize.
13101 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13102 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13103
13104 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13105
13106 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13107
13108 Move functions from C to Lisp. Make non-blocking method calls
13109 the default. Implement further D-Bus standard interfaces.
13110
13111 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13112 (QCdbus_request_name_allow_replacement)
13113 (QCdbus_request_name_replace_existing)
13114 (QCdbus_request_name_do_not_queue)
13115 (QCdbus_request_name_reply_primary_owner)
13116 (QCdbus_request_name_reply_in_queue)
13117 (QCdbus_request_name_reply_exists)
13118 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13119 (QCdbus_registered_serial, QCdbus_registered_method)
13120 (QCdbus_registered_signal): New Lisp objects.
13121 (XD_DEBUG_MESSAGE): Use sizeof.
13122 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13123 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13124 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13125 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13126 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13127 (xd_signature, xd_append_arg): Allow float for integer types.
13128 (xd_get_connection_references): New function.
13129 (xd_get_connection_address): Rename from xd_initialize.
13130 Return cached address.
13131 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13132 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13133 level.
13134 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13135 Return number of refcounts.
13136 (Fdbus_get_unique_name): Make stronger parameter check.
13137 (Fdbus_message_internal): New defun.
13138 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13139 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13140 (Fdbus_send_signal, Fdbus_register_service)
13141 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13142 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13143 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13144 (Vdbus_compiled_version, Vdbus_runtime_version)
13145 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13146 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13147 (Vdbus_message_type_signal): New defvars.
13148 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13149 Adapt docstring.
13150
13151 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13152
13153 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13154 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13155 Do not assume ptrdiff_t is the same width as 'int'.
13156
13157 * alloc.c: Handle unusual debugging option combinations.
13158 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13159 since the two debugging options are incompatible.
13160 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13161 is defined.
13162 (mem_init, mem_insert, mem_insert_fixup):
13163 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13164 (NEED_MEM_INSERT): Remove; no longer needed.
13165
13166 2012-04-22 Leo Liu <sdl.web@gmail.com>
13167
13168 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13169
13170 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13171
13172 * sysdep.c [__FreeBSD__]: Minor cleanups.
13173 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13174 Use Emacs indenting style more consistently. Avoid some casts.
13175 Use 'double' consistently rather than mixing 'float' and 'double'.
13176
13177 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13178
13179 * sysdep.c (list_system_processes, system_process_attributes):
13180 Add implementation for FreeBSD (Bug#5243).
13181
13182 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13183
13184 * lisp.mk (lisp): Update.
13185
13186 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13187
13188 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13189 It is never used otherwise.
13190
13191 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13192
13193 * print.c (print_preprocess): Only check print_depth if print-circle
13194 is nil.
13195 (print_object): Check for cycles even when print-circle is nil and
13196 print-gensym is t, but only check print_depth if print-circle is nil.
13197
13198 2012-04-20 Chong Yidong <cyd@gnu.org>
13199
13200 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13201 set the status to "failed" and ensure that sentinel is run.
13202
13203 2012-04-20 Glenn Morris <rgm@gnu.org>
13204
13205 * process.c (Fset_process_inherit_coding_system_flag)
13206 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13207 (Fmake_network_process, Fmake_serial_process): Doc fix.
13208
13209 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13210
13211 * xdisp.c (string_buffer_position_lim): Limit starting position to
13212 BEGV.
13213 (set_cursor_from_row): If called for a mode-line or header-line
13214 row, return zero immediately.
13215 (try_cursor_movement): If inside continuation line, don't back up
13216 farther than the first row after the header line, if any.
13217 Don't consider the header-line row as "partially visible", even if
13218 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13219
13220 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13221
13222 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13223 (bug#11238).
13224
13225 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13226 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13227
13228 configure: new option --enable-gcc-warnings (Bug#11207)
13229 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13230 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13231 (ALL_CFLAGS): Use new macros rather than old.
13232 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13233 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13234 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13235 -Wunused-result, -Wunused-variable. This should go away once
13236 the Emacs and Gnulib regex code is merged.
13237 (xmalloc, xrealloc): Now static.
13238
13239 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13240
13241 * dired.c (Fsystem_groups): Remove unused local.
13242
13243 2012-04-17 Glenn Morris <rgm@gnu.org>
13244
13245 * dired.c (Fsystem_users): Doc fix.
13246
13247 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13248
13249 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13250 (syms_of_dired): Add them.
13251
13252 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13253
13254 Fix minor alloc.c problems found by static checking.
13255 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13256 New extern decls, to avoid calling undeclared functions.
13257 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13258 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13259 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13260 (NEED_MEM_INSERT): New macro.
13261 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13262 Remove one incorrect comment and fix another.
13263
13264 Fix minor ralloc.c problems found by static checking.
13265 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13266 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13267 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13268 (r_alloc_sbrk): Now static.
13269
13270 Improve ralloc.c interface checking.
13271 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13272 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13273 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13274 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13275 [REL_ALLOC]: ... to here, to check interface.
13276 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13277 Remove decls. This fixes an "It stinks!".
13278
13279 * alloc.c (which_symbols): Fix alignment issue / type clash.
13280
13281 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13282
13283 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13284 (struct Lisp_Misc_Any): Likewise.
13285 (struct Lisp_Free): Likewise.
13286 * alloc.c (union aligned_Lisp_Symbol): Define.
13287 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13288 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13289 (union aligned_Lisp_Misc): Define.
13290 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13291 aligned_Lisp_Misc instead of union Lisp_Misc.
13292 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13293
13294 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13295
13296 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13297 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13298 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13299 * s/netbsd.h, s/sol2-6.h:
13300 Remove definition of GC_MARK_STACK, since the default now works.
13301 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13302 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13303 no longer the default.
13304 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13305
13306 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13307
13308 * lread.c (lisp_file_lexically_bound_p):
13309 Fix hang at ";-*-\n" (bug#11238).
13310
13311 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13312
13313 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13314 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13315
13316 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13317
13318 * nsterm.m (constrainFrameRect): Always constrain when there is only
13319 one screen (Bug#10962).
13320
13321 2012-04-13 Ken Brown <kbrown@cornell.edu>
13322
13323 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13324
13325 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13326
13327 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13328
13329 2012-04-11 Daniel Colascione <dancol@dancol.org>
13330
13331 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13332 against is gone. It's better to use vfork now so that when Cygwin
13333 gains a new, working vfork, we use it automatically (bug#10398).
13334
13335 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13336
13337 * window.c (save_window_save): Obey window-point-insertion-type.
13338
13339 2012-04-11 Glenn Morris <rgm@gnu.org>
13340
13341 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13342
13343 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13344
13345 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13346
13347 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
13348
13349 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13350 (force_quit_count): New var.
13351 (handle_interrupt): Use it.
13352
13353 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
13354
13355 * w32.c (w32_delayed_load): Record the full path of the library
13356 being loaded (bug#10424).
13357
13358 2012-04-09 Glenn Morris <rgm@gnu.org>
13359
13360 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13361 not just in the obarray, before snarfing them. (Bug#11036)
13362
13363 * Makefile.in ($(leimdir)/leim-list.el):
13364 Pass EMACS rather than BUILT_EMACS.
13365
13366 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13367
13368 * process.c (make_process):
13369 * process.h: Add integer `gnutls_handshakes_tried' member to
13370 process struct.
13371
13372 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13373 Add convenience `GNUTLS_LOG2i' macro.
13374
13375 * gnutls.c (gnutls_log_function2i): Convenience log function.
13376 (emacs_gnutls_read): Use new log functions,
13377 `gnutls_handshakes_tried' process member, and
13378 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13379 attempts per process (connection).
13380
13381 2012-04-09 Chong Yidong <cyd@gnu.org>
13382
13383 * eval.c (Fuser_variable_p, user_variable_p_eh)
13384 (lisp_indirect_variable): Functions deleted.
13385 (Fdefvar): Caller changed.
13386
13387 * callint.c (Finteractive, Fcall_interactively):
13388 * minibuf.c (Fread_variable): Callers changed.
13389
13390 2012-04-09 Eli Zaretskii <eliz@gnu.org>
13391
13392 * xdisp.c (set_cursor_from_row): If the display string appears in
13393 the buffer at position that is closer to point than the position
13394 after the display string, display the cursor on the first glyph of
13395 the display string. Fixes cursor display when a 'display' text
13396 property immediately follows invisible text. (Bug#11094)
13397
13398 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13399
13400 composite.c: use 'double' consistently
13401 * composite.c (get_composition_id): Use 'double' consistently
13402 instead of converting 'float' to 'double' and vice versa; this is
13403 easier to understand and avoids a GCC warning.
13404
13405 2012-04-09 Glenn Morris <rgm@gnu.org>
13406
13407 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13408 preparation for dumping it with emacs. (Bug#4789)
13409 (leimdir): New variable.
13410 ($(leimdir)/leim-list.el): New rule.
13411 (emacs$(EXEEXT)): Depend on leim-list.el.
13412
13413 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13414 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13415 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13416
13417 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13418
13419 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13420 proper alignment.
13421
13422 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
13423
13424 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13425 Remove unused local variable.
13426
13427 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13428
13429 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13430 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13431 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13432 objects, as mark_maybe_pointer will catch them otherwise.
13433 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13434 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13435
13436 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13437
13438 Fix typo that broke non-Windows builds.
13439 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13440
13441 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13442
13443 Support building on MS-Windows with libxml2.
13444
13445 * makefile.w32-in (OBJ2): Add xml.$(O).
13446 (GLOBAL_SOURCES): Add xml.c.
13447 ($(BLD)/xml.$(O)): New dependency list.
13448
13449 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13450 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13451 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13452 [!WINDOWSNT]: New macros.
13453 (init_libxml2_functions, libxml2_loaded_p): New functions.
13454 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13455 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13456 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13457 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13458 linked in).
13459 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13460 Call init_libxml2_functions before calling libxml2 functions.
13461 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13462
13463 * emacs.c: Don't include libxml/parser.h.
13464 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13465 xmlCleanupParser directly.
13466
13467 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13468
13469 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13470
13471 * indent.c (Fvertical_motion): If there is a display string at
13472 point, use it.vpos to compute how many lines to backtrack after
13473 move_it_to point. (Bug#11133)
13474
13475 2012-04-06 Eli Zaretskii <eliz@gnu.org>
13476
13477 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13478 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13479 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13480 macros related to unification of CJK characters. For the details,
13481 see the discussion following the message here:
13482 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13483
13484 2012-04-04 Chong Yidong <cyd@gnu.org>
13485
13486 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13487
13488 2012-04-01 Eli Zaretskii <eliz@gnu.org>
13489
13490 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13491 instead of alloca. (Bug#11138)
13492
13493 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13494
13495 * w32menu.c (is_simple_dialog): Properly check lisp types.
13496 (Bug#11141)
13497
13498 2012-03-31 Eli Zaretskii <eliz@gnu.org>
13499
13500 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13501 position we get to after a call to move_it_to fails the
13502 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13503 only if we wind up in a string from display property. (Bug#11063)
13504
13505 * window.c (Fdelete_other_windows_internal): Invalidate the row
13506 and column information about mouse highlight, so that redisplay
13507 restores it after reallocating the glyph matrices. (Bug#7464)
13508
13509 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13510 string comes from a `display' text property, use the buffer
13511 position of that property as if we actually saw that position in
13512 the row's glyphs.
13513 (move_it_by_lines): Remove the assertion that
13514 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13515 violated when there's a before-string at the beginning of a line.
13516 (Bug#11063)
13517
13518 2012-03-30 Eli Zaretskii <eliz@gnu.org>
13519
13520 * xdisp.c (append_space_for_newline): If the default face was
13521 remapped, use the remapped face for the appended newline.
13522 (extend_face_to_end_of_line): Use the remapped default face for
13523 extending the face to the end of the line.
13524 (display_line): Call extend_face_to_end_of_line when the default
13525 face was remapped. (Bug#11068)
13526
13527 2012-03-29 Eli Zaretskii <eliz@gnu.org>
13528
13529 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13530
13531 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13532
13533 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13534
13535 2012-03-27 Glenn Morris <rgm@gnu.org>
13536
13537 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13538 Doc fixes.
13539
13540 2012-03-26 Kenichi Handa <handa@m17n.org>
13541
13542 * dispextern.h (struct glyph): Fix previous change. Change the
13543 bit length of glyphless.ch to 25 (Bug#11082).
13544
13545 2012-03-26 Chong Yidong <cyd@gnu.org>
13546
13547 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13548 (command_loop_1): Use it; inhibit selection update for
13549 handle-select-window too (Bug#8996).
13550
13551 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13552
13553 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13554
13555 2012-03-25 Kenichi Handa <handa@m17n.org>
13556
13557 * dispextern.h (struct glyph): Change the bit length of
13558 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13559
13560 2012-03-24 Eli Zaretskii <eliz@gnu.org>
13561
13562 * s/ms-w32.h (tzname): Include time.h before redirecting to
13563 _tzname. Fixes the MSVC build. (Bug#9960)
13564
13565 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13566
13567 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13568 characters.
13569
13570 * xterm.c (XTread_socket): Only modify handling_signal if
13571 !SYNC_INPUT. (Bug#11080)
13572
13573 2012-03-23 Eli Zaretskii <eliz@gnu.org>
13574
13575 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13576 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13577 when fetching a multibyte character consumes more bytes than
13578 CHAR_BYTES returns, due to unification of CJK characters in
13579 string_char. (Bug#11073)
13580
13581 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13582
13583 * process.c (wait_reading_process_output): Handle pty disconnect
13584 by refraining from sending oneself a SIGCHLD (bug#10933).
13585
13586 2012-03-22 Chong Yidong <cyd@gnu.org>
13587
13588 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13589
13590 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13591 Mark string as coming from a prefix property.
13592 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13593 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13594
13595 2012-03-21 Chong Yidong <cyd@gnu.org>
13596
13597 * xfaces.c (Vface_remapping_alist): Doc fix.
13598
13599 2012-03-20 Eli Zaretskii <eliz@gnu.org>
13600
13601 * w32proc.c (Fw32_set_console_codepage)
13602 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13603 Doc fixes.
13604
13605 2012-03-20 Chong Yidong <cyd@gnu.org>
13606
13607 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13608 to reflect default non-nil value of redisplay-dont-pause.
13609
13610 2012-03-19 Kenichi Handa <handa@m17n.org>
13611
13612 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13613 it fit in a valid range (Bug#11003).
13614
13615 2012-03-18 Eli Zaretskii <eliz@gnu.org>
13616
13617 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13618 that is not from display property, accept the row as a "cursor
13619 row" if one of the string's character has a non-nil `cursor'
13620 property. Fixes cursor positioning when there are newlines in
13621 overlay strings, e.g. in icomplete.el. (Bug#11035)
13622
13623 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13624
13625 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13626
13627 2012-03-12 Chong Yidong <cyd@gnu.org>
13628
13629 * eval.c (inhibit_lisp_code): Rename from
13630 inhibit_window_configuration_change_hook; move from window.c.
13631
13632 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13633 * window.c (run_window_configuration_change_hook)
13634 (syms_of_window): Callers changed.
13635
13636 2012-03-11 Chong Yidong <cyd@gnu.org>
13637
13638 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13639
13640 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13641
13642 2012-03-10 Chong Yidong <cyd@gnu.org>
13643
13644 * frame.c (other_visible_frames): Don't assume the selected frame
13645 is visible (Bug#10955).
13646
13647 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13648
13649 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13650
13651 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13652
13653 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13654 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13655 zero (Bug#10954).
13656
13657 2012-03-03 Glenn Morris <rgm@gnu.org>
13658
13659 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13660
13661 2012-03-02 Eli Zaretskii <eliz@gnu.org>
13662
13663 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13664 position past the first glyph_row that ends at ZV. (Bug#10902)
13665 (redisplay_window, next_element_from_string): Fix typos in
13666 comments.
13667 (redisplay_window): Pass to move_it_vertically the margin in
13668 pixels, not in screen lines.
13669
13670 2012-03-02 Glenn Morris <rgm@gnu.org>
13671
13672 * buffer.c (buffer-list-update-hook): Doc fix.
13673
13674 2012-02-29 Eli Zaretskii <eliz@gnu.org>
13675
13676 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13677 push_it before setting up the iterator for the first overlay
13678 string, even if we have an empty string loaded.
13679 (next_overlay_string): If there's an empty string on the iterator
13680 stack, pop the stack. (Bug#10903)
13681
13682 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13683
13684 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13685 Suggested by Stefan Monnier in
13686 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13687 * alloc.c (widen_to_Lisp_Object): New static function.
13688 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13689 and widening them to Lisp_Objects. This would work even if
13690 USE_LSB_TAG is defined and wide integers are used, which might
13691 happen in a future version of Emacs.
13692
13693 2012-02-25 Chong Yidong <cyd@gnu.org>
13694
13695 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13696 Doc fix.
13697
13698 * xselect.c (Fx_selection_exists_p): Doc fix.
13699 (x_clipboard_manager_save_all): Print an informative message
13700 before saving to clipboard manager.
13701
13702 2012-02-24 Chong Yidong <cyd@gnu.org>
13703
13704 * keyboard.c (process_special_events): Handle all X selection
13705 requests in kbd_buffer, not just the next one (Bug#8869).
13706
13707 2012-02-23 Chong Yidong <cyd@gnu.org>
13708
13709 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13710 call when setting menu-bar-lines and tool-bar-lines parameters.
13711 (unwind_create_frame_1): New helper function.
13712
13713 * window.c (inhibit_window_configuration_change_hook): New var.
13714 (run_window_configuration_change_hook): Obey it.
13715 (syms_of_window): Initialize it.
13716
13717 2012-02-22 Chong Yidong <cyd@gnu.org>
13718
13719 * xterm.c (x_draw_image_relief): Add missing type check for
13720 Vtool_bar_button_margin (Bug#10743).
13721
13722 2012-02-21 Chong Yidong <cyd@gnu.org>
13723
13724 * fileio.c (Vfile_name_handler_alist): Doc fix.
13725
13726 * buffer.c (Fget_file_buffer): Protect against invalid file
13727 handler return value.
13728
13729 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13730
13731 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13732 when computing $valmask.
13733
13734 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13735 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13736 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13737 It's useless in that case, and it can cause problems on hosts
13738 that allocate halves of EMACS_INT values separately.
13739 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13740 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13741 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13742 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13743 it avoids undefined behavior on hosts where shifting right by more
13744 than the word width has undefined behavior.
13745
13746 2012-02-19 Chong Yidong <cyd@gnu.org>
13747
13748 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13749 (Funhandled_file_name_directory, Ffile_name_as_directory)
13750 (Fdirectory_file_name, Fexpand_file_name)
13751 (Fsubstitute_in_file_name): Protect against invalid file handler
13752 return values (Bug#10845).
13753
13754 2012-02-18 Eli Zaretskii <eliz@gnu.org>
13755
13756 * .gdbinit (pitx): Fix incorrect references to fields of the
13757 iterator stack.
13758
13759 2012-02-17 Chong Yidong <cyd@gnu.org>
13760
13761 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13762
13763 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13764
13765 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13766 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13767
13768 2012-02-15 Chong Yidong <cyd@gnu.org>
13769
13770 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13771 marked as special. Also, starting docstrings with * is obsolete.
13772
13773 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13774
13775 * gnutls.c (emacs_gnutls_write): Fix last change.
13776
13777 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13778
13779 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13780 send_process.
13781
13782 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13783
13784 * keymap.c (Fsingle_key_description): Handle char ranges.
13785
13786 2012-02-12 Chong Yidong <cyd@gnu.org>
13787
13788 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13789 as that creates a dangerous corner case.
13790
13791 * window.c (Fdelete_window_internal): Invalidate the mouse
13792 highlight (Bug#9904).
13793
13794 2012-02-12 Glenn Morris <rgm@gnu.org>
13795
13796 * xselect.c (Fx_own_selection_internal)
13797 (Fx_get_selection_internal, Fx_disown_selection_internal)
13798 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13799 * nsselect.m (Fx_own_selection_internal)
13800 (Fx_disown_selection_internal, Fx_selection_exists_p)
13801 (Fx_selection_owner_p, Fx_get_selection_internal):
13802 Sync docs and argument specs with the xselect.c versions.
13803
13804 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13805
13806 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13807
13808 2012-02-11 Eli Zaretskii <eliz@gnu.org>
13809
13810 * w32select.c (Fx_selection_exists_p): Sync doc string and
13811 argument list with xselect.c. (Bug#10783)
13812
13813 * w16select.c (Fx_selection_exists_p): Sync doc string and
13814 argument list with xselect.c. (Bug#10783)
13815
13816 2012-02-10 Glenn Morris <rgm@gnu.org>
13817
13818 * fns.c (Fsecure_hash): Doc fix.
13819
13820 2012-02-09 Kenichi Handa <handa@m17n.org>
13821
13822 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13823
13824 2012-02-07 Chong Yidong <cyd@gnu.org>
13825
13826 * buffer.c (Fbuffer_local_variables)
13827 (buffer_lisp_local_variables): Handle unbound vars correctly;
13828 don't let Qunbound leak into Lisp.
13829
13830 2012-02-07 Glenn Morris <rgm@gnu.org>
13831
13832 * image.c (Fimagemagick_types): Doc fix.
13833
13834 * image.c (imagemagick-render-type): Change it from a lisp object
13835 to an integer. Move the doc here from the lisp manual.
13836 Treat all values not equal to 0 the same.
13837
13838 2012-02-06 Chong Yidong <cyd@gnu.org>
13839
13840 * doc.c (store_function_docstring): Avoid applying docstring of
13841 alias to base function (Bug#2603).
13842
13843 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13844
13845 * .gdbinit (pp1, pv1): Remove redundant defines.
13846 (pr): Use pp.
13847
13848 2012-02-04 Chong Yidong <cyd@gnu.org>
13849
13850 * nsterm.m: Declare a global (Bug#10694).
13851
13852 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13853
13854 * w32.c (get_emacs_configuration_options):
13855 Include --enable-checking, if specified, in the return value.
13856
13857 2012-02-04 Martin Rudalics <rudalics@gmx.at>
13858
13859 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13860 after rounding frame sizes. (Bug#9723)
13861
13862 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13863
13864 * keyboard.c (adjust_point_for_property): Don't position point
13865 before BEGV. (Bug#10696)
13866
13867 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13868
13869 Handle overflow when computing char display width (Bug#9496).
13870 * character.c (char_width): Return EMACS_INT, not int.
13871 (char_width, c_string_width): Check for overflow when
13872 computing the width; this is possible now that individual
13873 characters can have unbounded width. Problem introduced
13874 by merge from Emacs 23 on 2012-01-19.
13875
13876 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
13877
13878 * dbusbind.c (Fdbus_register_method): Mention the return value
13879 :ignore in the docstring.
13880
13881 2012-02-02 Glenn Morris <rgm@gnu.org>
13882
13883 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13884
13885 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13886 Unconditionally set to t. (Bug#10673)
13887 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13888 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13889 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13890
13891 2012-02-02 Kenichi Handa <handa@m17n.org>
13892
13893 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13894 0, do not call append_composite_glyph.
13895
13896 2012-02-02 Kenichi Handa <handa@m17n.org>
13897
13898 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13899 NULL (Bug#6988).
13900 (x_produce_glyphs): If the component of a composition is a null
13901 string, set it->pixel_width to 1 to avoid zero-width glyph.
13902
13903 2012-02-01 Eli Zaretskii <eliz@gnu.org>
13904
13905 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13906 first 2 arguments are identical. This makes inserting large
13907 output from a subprocess an order of magnitude faster on
13908 MS-Windows, where all sbrk'ed memory is always contiguous.
13909
13910 2012-01-31 Glenn Morris <rgm@gnu.org>
13911
13912 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13913 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13914 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13915
13916 2012-01-29 Glenn Morris <rgm@gnu.org>
13917
13918 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13919
13920 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13921
13922 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13923
13924 2012-01-28 Chong Yidong <cyd@gnu.org>
13925
13926 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13927
13928 2012-01-26 Chong Yidong <cyd@gnu.org>
13929
13930 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13931
13932 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13933 repeat counts (Bug#10507).
13934
13935 2012-01-26 Glenn Morris <rgm@gnu.org>
13936
13937 * lread.c (syms_of_lread): Doc fix.
13938
13939 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13940
13941 * coding.c (encode_designation_at_bol): Change return value to
13942 EMACS_INT.
13943
13944 2012-01-25 Chong Yidong <cyd@gnu.org>
13945
13946 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13947
13948 2012-01-21 Chong Yidong <cyd@gnu.org>
13949
13950 * floatfns.c (Fcopysign): Make the second argument non-optional,
13951 since nil is not allowed anyway.
13952
13953 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13954
13955 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13956 (send_process): Likewise.
13957
13958 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13959
13960 * window.c (save_window_save, Fcurrent_window_configuration)
13961 (Vwindow_persistent_parameters): Do not use Qstate.
13962 Rewrite doc-strings.
13963
13964 2012-01-19 Kenichi Handa <handa@m17n.org>
13965
13966 * character.c (char_width): New function.
13967 (Fchar_width, c_string_width, lisp_string_width):
13968 Use char_width (Bug#9496).
13969
13970 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13971
13972 * window.c (Vwindow_persistent_parameters): New variable.
13973 (Fset_window_configuration, save_window_save): Handle persistent
13974 window parameters.
13975
13976 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13977
13978 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13979 thrashing the stack of the thread. (Bug#9087)
13980
13981 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13982
13983 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13984
13985 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13986
13987 * xdisp.c (rows_from_pos_range): Handle the case where the
13988 highlight ends on a newline. (Bug#10464)
13989 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13990 he end column for display of highlight that ends on a newline
13991 before a R2L line.
13992
13993 2012-01-11 Glenn Morris <rgm@gnu.org>
13994
13995 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13996 from load-path also when installation-directory is nil. (Bug#10208)
13997
13998 2012-01-10 Glenn Morris <rgm@gnu.org>
13999
14000 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14001
14002 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14003 Update template values to be closer to their typical values these days.
14004
14005 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14006
14007 * xdisp.c (rows_from_pos_range): Accept additional argument
14008 DISP_STRING, and accept any glyph in a row whose object is that
14009 string as eligible for mouse highlight. Fixes mouse highlight of
14010 display strings from overlays. (Bug#10464)
14011
14012 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14013
14014 emacs: fix an auto-save permissions race condition (Bug#10400)
14015 * fileio.c (auto_saving_dir_umask): New static var.
14016 (Fmake_directory_internal): Use it.
14017 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14018 creating the directory. The old code temporarily assigns
14019 too-generous permissions to the directory.
14020 (do_auto_save_eh): Clear it.
14021 (Fdo_auto_save): Catch all errors, not just file errors, so
14022 that the var is always cleared.
14023
14024 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14025
14026 * search.c (scan_buffer): Pass character positions to
14027 know_region_cache, not byte positions. (Bug#6540)
14028
14029 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14030
14031 * w32.c (sys_rename): Report EXDEV when rename of a directory
14032 fails because the target is on another logical disk. (Bug#10284)
14033
14034 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14035
14036 * xterm.c (x_embed_request_focus): New function.
14037
14038 * xterm.h: Add prototype.
14039
14040 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14041
14042 2012-01-05 Glenn Morris <rgm@gnu.org>
14043
14044 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14045
14046 2012-01-01 Eli Zaretskii <eliz@gnu.org>
14047
14048 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14049 Load gnutls_transport_set_lowat only if GnuTLS version is below
14050 2.11.1.
14051 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14052 GnuTLS versions below 2.11.1.
14053
14054 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14055
14056 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14057 to the doc string advising against its use for altering the way
14058 windows are scrolled.
14059
14060 2011-12-28 Kenichi Handa <handa@m17n.org>
14061
14062 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14063 coding-system ASCII compatible only when it does not produce BOM
14064 on encoding (Bug#10383).
14065
14066 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14067
14068 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14069 can scroll.
14070 (create_and_show_popup_menu): Always use menu_position_func for
14071 Gtk3 (Bug#10361).
14072
14073 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14074
14075 * callint.c (Fcall_interactively): Don't truncate prompt string.
14076
14077 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14078
14079 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14080 property that ends at ZV, so that the bidi iteration could be
14081 resumed from there (after widening). (Bug#10360)
14082
14083 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14084
14085 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14086
14087 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14088
14089 * nsterm.m (x_free_frame_resources):
14090 Release f->output_data.ns->miniimage.
14091 (ns_index_color): Fix indentation. Do not retain
14092 color_table->colors[i].
14093
14094 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14095 before returning.
14096
14097 * nsfns.m (x_set_background_color): Assign return value from
14098 ns_index_color to face-background instead of NSColor*.
14099 (ns_implicitly_set_icon_type): Fix indentation.
14100 Change assignment in for loop to comparison.
14101
14102 * emacs.c (ns_pool): New variable.
14103 (main): Assign ns_pool.
14104 (Fkill_emacs): Call ns_release_autorelease_pool.
14105
14106 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14107 autorelease fdesc, release fdAttrs and tdict.
14108 (ns_get_covering_families): Release charset.
14109 (ns_findfonts): Release NSFontDescriptor created with new.
14110 (ns_uni_to_glyphs): Fix indentation.
14111 (setString): Release attrStr before assigning new value.
14112
14113 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14114
14115 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14116 and NS_IMPL_COCOA.
14117 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14118 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14119
14120 2011-12-18 David Reitter <reitter@cmu.edu>
14121
14122 * nsterm.m (ns_term_init): Subscribe for notifications
14123 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14124 to method trackingNotification in EmacsMenu.
14125
14126 * nsmenu.m (trackingMenu): New variable.
14127 (trackingNotification): New method (from Aquamacs).
14128 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14129 from Aquamacs (Bug#7030).
14130
14131 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14132
14133 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14134 (symbol_to_nsstring): Fix indentation.
14135 (ns_symbol_to_pb): New function.
14136 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14137 (Fns_rotate_cut_buffers_internal): Remove.
14138 (Fns_store_selection_internal): Rename from
14139 Fns_store_cut_buffer_internal.
14140 (ns_get_foreign_selection, Fx_own_selection_internal)
14141 (Fx_disown_selection_internal, Fx_selection_exists_p)
14142 (Fns_get_selection_internal, Fns_store_selection_internal):
14143 Use ns_symbol_to_pb and check if return value is nil.
14144 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14145 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14146 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14147 renamed to Sns_store_selection_internal.
14148 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14149 and remove this function.
14150 (ns_handle_selection_clear): Remove, never used.
14151 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14152 here.
14153
14154 2011-12-17 Ken Brown <kbrown@cornell.edu>
14155
14156 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14157 GID is unknown (Bug#10257).
14158
14159 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14160
14161 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14162 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14163 which caused a build failure on GNU/Linux IA-64. This problem was
14164 introduced by my 2011-10-07 patch.
14165
14166 2011-12-15 Juri Linkov <juri@jurta.org>
14167
14168 * image.c (imagemagick_error): New function. (Bug#10112)
14169 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14170 Use `imagemagick_error' where ImageMagick functions return
14171 `MagickFalse'.
14172 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14173 proper order.
14174
14175 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14176
14177 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14178 fill background (Bug#8992).
14179
14180 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14181
14182 * window.c (Vwindow_combination_resize)
14183 (Vwindow_combination_limit): Use t instead of non-nil in
14184 doc-strings.
14185 (Vrecenter_redisplay): Add first sentence of doc-string on
14186 separate line.
14187 (Frecenter): Fix doc-string typo.
14188
14189 2011-12-11 Kenichi Handa <handa@m17n.org>
14190
14191 * coding.c (Funencodable_char_position): Pay attention to the
14192 buffer text relocation (Bug#9389).
14193
14194 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14195
14196 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14197 gtk_init (Bug#10100).
14198
14199 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14200
14201 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14202 IT->string is nil. (Bug#10263)
14203
14204 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14205
14206 * nsterm.h (x_free_frame_resources): Declare.
14207
14208 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14209 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14210
14211 * nsterm.h (ns_get_defaults_value): Declare.
14212
14213 * nsterm.m (ns_default): Call ns_get_defaults_value.
14214
14215 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14216
14217 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14218 (Bug#10170)
14219
14220 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14221
14222 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14223 that where the value of an _OBJC_* symbol points to is in the .bss
14224 section (Bug#10240).
14225
14226 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14227
14228 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14229 after the loop to call ccl_driver at least once (Bug#8619).
14230
14231 2011-12-08 Kenichi Handa <handa@m17n.org>
14232
14233 * ftfont.c (get_adstyle_property): Fix previous change
14234 (Bug#10233).
14235
14236 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14237
14238 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14239 dirs from the default value of EMACSLOADPATH (bug#10208).
14240
14241 2011-12-07 Glenn Morris <rgm@gnu.org>
14242
14243 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14244 installation and source directories as well. (Bug#10208)
14245
14246 2011-12-06 Chong Yidong <cyd@gnu.org>
14247
14248 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14249
14250 2011-12-06 Glenn Morris <rgm@gnu.org>
14251
14252 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14253 as an error, not just -1. (Bug#10217)
14254
14255 2011-12-05 Chong Yidong <cyd@gnu.org>
14256
14257 * keyboard.c (process_special_events): New function.
14258 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14259
14260 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14261
14262 * coding.c (encode_designation_at_bol): Don't use uninitialized
14263 local variable (Bug#9318).
14264
14265 2011-12-05 Kenichi Handa <handa@m17n.org>
14266
14267 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14268 return Qnil (Bug#8046, Bug#10193).
14269
14270 2011-12-05 Kenichi Handa <handa@m17n.org>
14271
14272 * coding.c (encode_designation_at_bol): New args charbuf_end and
14273 dst. Return the number of produced bytes. Callers changed.
14274 (coding_set_source): Return how many bytes coding->source was
14275 relocated.
14276 (coding_set_destination): Return how many bytes
14277 coding->destination was relocated.
14278 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14279 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14280
14281 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14282
14283 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14284 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14285 macro (Bug#9318).
14286
14287 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14288
14289 The following changes are to fix Bug#9318.
14290
14291 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14292 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14293 (encode_coding_iso_2022, encode_coding_sjis)
14294 (encode_coding_big5, encode_coding_charset): Use the above macros.
14295
14296 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14297
14298 * lisp.h (process_quit_flag): Fix external declaration.
14299
14300 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14301
14302 Don't macro-inline non-performance-critical code.
14303 * eval.c (process_quit_flag): New function.
14304 * lisp.h (QUIT): Use it.
14305
14306 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14307
14308 * nsfns.m (get_geometry_from_preferences): New function.
14309 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14310
14311 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14312
14313 * emacs.c (Qkill_emacs): Define.
14314 (syms_of_emacs): Initialize it.
14315 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14316 Qquit_flag to `kill-emacs' instead.
14317 (quit_throw_to_read_char): Add parameter `from_signal'.
14318 All callers changed. Call Fkill_emacs if requested and safe.
14319 * lisp.h (QUIT): Call Fkill_emacs if requested.
14320
14321 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14322
14323 * widget.c (update_wm_hints): Return if wmshell is null.
14324 (widget_update_wm_size_hints): New function.
14325
14326 * widget.h (widget_update_wm_size_hints): Declare.
14327
14328 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14329 widget_update_wm_size_hints (Bug#10104).
14330
14331 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14332
14333 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14334 before a newline, prepare the bidi iterator for consuming the
14335 newline, and keep the current paragraph direction. (Bug#10183)
14336 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14337
14338 2011-12-02 Juri Linkov <juri@jurta.org>
14339
14340 * search.c (Fword_search_regexp): New Lisp function created from
14341 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14342 (Fword_search_backward, Fword_search_forward)
14343 (Fword_search_backward_lax, Fword_search_forward_lax):
14344 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14345 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14346
14347 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14348
14349 * fileio.c (Finsert_file_contents): Move after-change-function call
14350 to before the "handled:" label, since all "goto handled" appear in
14351 cases where the *-change-functions have already been properly called
14352 (bug#10117).
14353
14354 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14355
14356 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14357 waiting for input. (Bug#10169)
14358
14359 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14360
14361 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14362 verifies glyph row's hash code--we have just reallocated the
14363 glyphs, so their contents can be complete garbage. (Bug#10164)
14364
14365 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
14366
14367 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14368
14369 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14370
14371 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14372 attributes are tested _before_ calling verify_row_hash, to protect
14373 against GCC re-ordering of the tests. (Bug#10164)
14374
14375 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14376
14377 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14378
14379 * xterm.c (handle_one_xevent): Only set async_visible and friends
14380 if net_wm_state_hidden_seen is non-zero (Bug#10002)
14381 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14382 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14383
14384 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14385
14386 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14387 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14388 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14389 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14390 All uses changed to use GCPRO1 etc.
14391 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14392 Revert to old implementation (i.e., before 2011-03-11).
14393
14394 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14395
14396 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14397 of scroll runs so as to avoid assigning disabled bogus rows and
14398 unnecessary graphics copy operations.
14399
14400 2011-11-27 Eli Zaretskii <eliz@gnu.org>
14401
14402 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14403 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14404 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14405 (malloc, free, realloc, calloc): Redirect to e_* only when
14406 compiling Emacs.
14407
14408 * lisp.h (GCTYPEBITS): Move before first use.
14409 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14410 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14411 this macro definition.
14412
14413 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14414 _MSC_VER.
14415
14416 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14417
14418 * gtkutil.c (xg_create_frame_widgets):
14419 Call gtk_window_set_has_resize_grip (FALSE) if that function is
14420 present with Gtk+ 2.0.
14421
14422 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14423
14424 * fileio.c (Finsert_file_contents): Undo previous change; see
14425 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14426
14427 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14428
14429 Rename locals to avoid shadowing.
14430 * fileio.c (Finsert_file_contents):
14431 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14432 * process.c (wait_reading_process_output):
14433 Rename inner 'proc' to 'p' to avoid shadowing.
14434 Indent for consistency with usual Emacs style.
14435
14436 2011-11-25 Eli Zaretskii <eliz@gnu.org>
14437
14438 * xdisp.c (redisplay_window): If cursor row is not fully visible
14439 after recentering, and scroll-conservatively is set to a large
14440 number, scroll window by a few more lines to make the cursor fully
14441 visible and out of scroll-margin. (Bug#10105)
14442 (start_display): Don't move to the next line if the display should
14443 start at a newline that is part of a display vector or an overlay
14444 string. (Bug#10119)
14445
14446 2011-11-24 Juri Linkov <juri@jurta.org>
14447
14448 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14449 after the `MagickPingImage' call. (Bug#10112)
14450
14451 2011-11-23 Chong Yidong <cyd@gnu.org>
14452
14453 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14454
14455 2011-11-23 Martin Rudalics <rudalics@gmx.at>
14456
14457 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14458 making another buffer current. (Bug#10114)
14459
14460 2011-11-23 Glenn Morris <rgm@gnu.org>
14461
14462 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14463
14464 2011-11-23 Chong Yidong <cyd@gnu.org>
14465
14466 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14467 using it (Bug#5984).
14468
14469 2011-11-22 Eli Zaretskii <eliz@gnu.org>
14470
14471 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14472 and header-lines, as they don't have one computed for them.
14473 (Bug#10098)
14474
14475 * .gdbinit (prow): Make displayed values more self-explaining.
14476 Add row's hash code.
14477
14478 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14479
14480 * process.c (wait_reading_process_output): Fix asynchrounous
14481 GnuTLS socket handling on some versions of the GnuTLS library.
14482 (wait_reading_process_output): Add comment and URL.
14483
14484 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14485
14486 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14487
14488 2011-11-21 Chong Yidong <cyd@gnu.org>
14489
14490 * window.c (Fnext_window, Fprevious_window): Doc fix.
14491
14492 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14493
14494 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14495
14496 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14497
14498 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14499
14500 2011-11-20 Martin Rudalics <rudalics@gmx.at>
14501
14502 * window.c (Fset_window_combination_limit): Rename argument
14503 STATUS to LIMIT.
14504 (Vwindow_combination_limit): Remove "status" from doc-string.
14505
14506 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14507
14508 * m/ibms390.h: Remove.
14509 * m/ibms390x.h: Don't include "ibms390.h".
14510
14511 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14512
14513 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14514 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14515
14516 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14517
14518 * casetab.c (Fset_case_table):
14519 * charset.c (Fcharset_after): Fix typos.
14520
14521 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
14522
14523 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14524 Otherwise, valgrind does not work on some platforms.
14525 Problem reported by Andreas Schwab in
14526 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14527 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14528 is set, removing the need for VIRT_ADDRESS_VARIES.
14529 (PURE_P): Use a more-efficient implementation that needs just one
14530 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14531 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14532 to 4 (xorl, subq, cmpq, setbe).
14533 * alloc.c (pure): Always extern now, since that's the
14534 VIRT_ADDR_VARIES behavior.
14535 (PURE_POINTER_P): Use a single comparison, not two, for
14536 consistency with the new puresize.h.
14537 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14538 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14539 Remove VIRT_ADDR_VARIES no longer needed.
14540
14541 2011-11-19 Eli Zaretskii <eliz@gnu.org>
14542
14543 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14544 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14545 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14546 behave as if the cursor position were at the window margin.
14547
14548 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14549 and the cursor position is out of bounds, behave as if the cursor
14550 position were at the window margin. (Bug#10075)
14551
14552 2011-11-18 Chong Yidong <cyd@gnu.org>
14553
14554 * window.c (Fwindow_combination_limit): Make first argument
14555 non-optional, since it is meaningless for live windows like the
14556 selected window.
14557
14558 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14559
14560 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14561
14562 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14563
14564 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14565 (graft_intervals_into_buffer): Simplify.
14566
14567 2011-11-18 Eli Zaretskii <eliz@gnu.org>
14568
14569 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14570 hash values of the two rows.
14571 (copy_row_except_pointers): Preserve the used[] arrays and the
14572 hash values of the two rows. (Bug#10035)
14573 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14574
14575 * xdisp.c (row_hash): New function, body extracted from
14576 compute_line_metrics.
14577 (compute_line_metrics): Call row_hash, instead of computing the
14578 hash code inline.
14579
14580 * dispnew.c (verify_row_hash): Call row_hash for computing the
14581 hash code of a row, instead of duplicating code from xdisp.c.
14582
14583 * dispextern.h (row_hash): Add prototype.
14584
14585 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14586
14587 * frame.c (delete_frame): Don't delete the terminal when the last
14588 X frame is closed if emacs is built with GTK toolkit.
14589
14590 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
14591
14592 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14593
14594 2011-11-17 Martin Rudalics <rudalics@gmx.at>
14595
14596 * window.c (Vwindow_splits): Rename to
14597 Vwindow_combination_resize. Suggested by Juri Linkov.
14598 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14599 of Vwindow_splits.
14600
14601 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
14602
14603 * nsfns.m (Fns_font_name):
14604 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14605
14606 2011-11-16 Martin Rudalics <rudalics@gmx.at>
14607
14608 * window.h (window): Rename slot "nest" to "combination_limit".
14609 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14610 (Fset_window_nest): Rename to Fset_window_combination_limit.
14611 (Vwindow_nest): Rename to Vwindow_combination_limit.
14612 (recombine_windows, make_parent_window, make_window)
14613 (Fsplit_window_internal, saved_window)
14614 (Fset_window_configuration, save_window_save): Rename all
14615 occurrences of window_nest to window_combination_limit.
14616
14617 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
14618
14619 * image.c (imagemagick_load_image): Fix typo.
14620
14621 2011-11-14 Eli Zaretskii <eliz@gnu.org>
14622
14623 * xdisp.c (display_line): Move the call to
14624 highlight_trailing_whitespace before the call to
14625 compute_line_metrics, since the latter needs to see the final
14626 faces of all the glyphs to compute ROW's hash value.
14627 Fixes assertion violations in row_equal_p. (Bug#10035)
14628
14629 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
14630
14631 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14632 just return (bug#10044).
14633
14634 2011-11-12 Eli Zaretskii <eliz@gnu.org>
14635
14636 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14637 with user-defined heap size. Bump the default size of the temacs
14638 heap to 27MB, to avoid memory warning when running temacs.
14639 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14640
14641 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14642 current_matrix and desired_matrix. (Bug#9990)
14643 (verify_row_hash) [XASSERTS]: New function.
14644 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14645 that the hash value of glyph rows is correct.
14646
14647 2011-11-12 Martin Rudalics <rudalics@gmx.at>
14648
14649 * window.h (window): Remove splits slot.
14650 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14651 (Fdelete_other_windows_internal, make_parent_window)
14652 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14653 (Fset_window_configuration, save_window_save): Don't deal with
14654 split status of windows.
14655 (saved_window): Remove splits slot.
14656 (Vwindow_splits): Rewrite doc-string.
14657
14658 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14659
14660 * xfns.c (unwind_create_frame):
14661 * nsfns.m (unwind_create_frame):
14662 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14663 Vframe_list (Bug#9999).
14664
14665 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14666
14667 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14668
14669 2011-11-11 Kenichi Handa <handa@m17n.org>
14670
14671 * callproc.c (Fcall_process): Set the member dst_multibyte of
14672 process_coding.
14673
14674 2011-11-11 Johan Bockgård <bojohan@gnu.org>
14675
14676 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14677 avoid a crash (bug#9496).
14678
14679 2011-11-09 Chong Yidong <cyd@gnu.org>
14680
14681 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14682 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14683
14684 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14685
14686 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14687
14688 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14689
14690 Avoid some portability problems by eschewing 'extern inline' functions.
14691 The trivial performance wins aren't worth the portability hassles; see
14692 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14693 et seq.
14694 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14695 (window_box_width, window_box_left, window_box_left_offset)
14696 (window_box_right, window_box_right_offset): Undo previous change,
14697 by removing the "extern"s.
14698 * intervals.c (adjust_intervals_for_insertion)
14699 (adjust_intervals_for_deletion): Undo previous change,
14700 making these static again.
14701 (offset_intervals, temp_set_point_both, temp_set_point)
14702 (copy_intervals_to_string): No longer inline.
14703 * xdisp.c (window_text_bottom_y, window_box_width)
14704 (window_box_height, window_box_left_offset)
14705 (window_box_right_offset, window_box_left, window_box_right)
14706 (window_box): No longer inline.
14707
14708 2011-11-08 Chong Yidong <cyd@gnu.org>
14709
14710 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14711 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14712 Signal an error if not a live window.
14713 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14714 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14715
14716 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
14717
14718 * lisp.h (syms_of_abbrev): Remove declaration.
14719 Reported by CHENG Gao <chenggao@royau.me>.
14720
14721 2011-11-07 Eli Zaretskii <eliz@gnu.org>
14722
14723 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14724 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14725 of temacs in GUI mode.
14726
14727 2011-11-07 Martin Rudalics <rudalics@gmx.at>
14728
14729 * window.h: Declare delete_all_child_windows instead of
14730 delete_all_subwindows.
14731 * window.c (Fwindow_nest, Fset_window_nest)
14732 (Fset_window_new_total, Fset_window_new_normal)
14733 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14734 (delete_all_subwindows): Rename to delete_all_child_windows.
14735 (Fdelete_other_windows_internal, Fset_window_configuration):
14736 Call delete_all_child_windows instead of delete_all_subwindows.
14737 * frame.c (delete_frame): Call delete_all_child_windows instead
14738 of delete_all_subwindows.
14739
14740 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14741
14742 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14743 This is also needed for porting to any host where GC_MARK_STACK is
14744 not GC_MAKE_GCPROS_NOOPS.
14745 (which_symbols): Use it.
14746
14747 2011-11-07 Kenichi Handa <handa@m17n.org>
14748
14749 * coding.c (coding_set_destination): Check coding->src_pos only
14750 when coding->src_object is a buffer (bug#9910).
14751
14752 * process.c (send_process): Set the member src_multibyte of coding
14753 to 0 (bug#9911) when sending a unibyte text.
14754
14755 * callproc.c (Fcall_process): Set the member src_multibyte of
14756 process_coding to 0 (bug#9912).
14757
14758 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14759
14760 * xmenu.c (cleanup_widget_value_tree): New function.
14761 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14762 calling free_menubar_widget_value_tree directly (Bug#9830).
14763
14764 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14765
14766 Fix some portability problems with 'inline'.
14767 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14768 (window_box_width, window_box_left, window_box_left_offset)
14769 (window_box_right, window_box_right_offset): Declare extern.
14770 Otherwise, these inline functions do not conform to C99 and
14771 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14772 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14773 * intervals.c (adjust_intervals_for_insertion)
14774 (adjust_intervals_for_deletion): Now extern, because otherwise the
14775 extern inline functions 'offset_intervals' couldn't refer to it.
14776 (static_offset_intervals): Remove.
14777 (offset_intervals): Rewrite using the old contents of
14778 static_offset_intervals. The old version didn't conform to C99
14779 because an extern inline function contained a reference to an
14780 identifier with static linkage.
14781
14782 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14783
14784 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14785 GC.
14786
14787 2011-11-06 Eli Zaretskii <eliz@gnu.org>
14788
14789 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14790 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14791 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14792 return Qleft_to_right.
14793
14794 2011-11-06 Chong Yidong <cyd@gnu.org>
14795
14796 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14797 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14798 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14799 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14800 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14801 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14802 (Fwindow_vscroll): Doc fix.
14803 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14804 argument, since it makes no sense to pass a live window and for
14805 consistency with window-child.
14806
14807 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14808
14809 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14810 support MSVC.
14811
14812 2011-11-05 Jason Rumney <jasonr@gnu.org>
14813
14814 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14815 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14816 fonts (Bug#6029).
14817 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14818 bitwise arithmetic preventing use of unicode-sip and non-truetype
14819 opentype fonts.
14820
14821 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14822
14823 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14824 "emacs"-only part.
14825
14826 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14827 initialization code to keep similarity to xfns.c after changes
14828 from 2011-11-05.
14829
14830 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14831
14832 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14833 (unwind_create_frame): New function (Bug#9943).
14834 (Fx_create_frame): Restructure code to be more similar to the one in
14835 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14836 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14837 Move terminal->reference_count++ just before making the frame official
14838 (Bug#9943).
14839
14840 * nsterm.m (x_free_frame_resources): New function.
14841 (x_destroy_window): Move code to x_free_frame_resources.
14842
14843 * xfns.c (unwind_create_frame): Fix comment.
14844 (Fx_create_frame, x_create_tip_frame):
14845 Move terminal->reference_count++ just before making the frame
14846 official. Move initialization of image_cache_refcount and
14847 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14848
14849 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14850
14851 Support MSVC build with newer versions of Visual Studio.
14852 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14853 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14854 nt/gmake.defs.
14855
14856 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14857 which are not supported by MSVC.
14858 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14859 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14860 bitfields.
14861 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14862 types in bitfields.
14863 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14864
14865 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14866
14867 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
14868
14869 Support MSVC build with newer versions of Visual Studio.
14870 * w32.c: Don't include w32api.h for MSVC.
14871 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14872
14873 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14874 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14875 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14876 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14877 e_* cousins.
14878 (alloca) [_MSC_VER]: Define to _alloca.
14879
14880 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14881
14882 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14883
14884 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14885
14886 * xdisp.c (note_mouse_highlight): If either of
14887 previous/next-single-property-change returns nil, treat that as
14888 the beginning or the end of the buffer. (Bug#9955)
14889
14890 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14891
14892 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14893 label is not null (Bug#9951).
14894 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14895 may be NULL.
14896
14897 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14898
14899 * window.c (Fwindow_body_size): Mention in the doc string that the
14900 return value is in frame's canonical units. (Bug#9949)
14901
14902 2011-11-03 Eli Zaretskii <eliz@gnu.org>
14903
14904 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14905
14906 * w32fns.c (unwind_create_frame): If needed, free the glyph
14907 matrices of the partially constructed frame. (Bug#9943)
14908 * xfns.c (unwind_create_frame): Likewise.
14909
14910 2011-11-01 Eli Zaretskii <eliz@gnu.org>
14911
14912 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14913 Don't stop backward scan on the continuation glyph, even though
14914 its CHARPOS is positive.
14915 (mouse_face_from_buffer_pos, note_mouse_highlight):
14916 Rename cover_string to disp_string.
14917
14918 2011-11-01 Martin Rudalics <rudalics@gmx.at>
14919
14920 * window.c (temp_output_buffer_show): Don't use
14921 Vtemp_buffer_show_specifiers.
14922 (Vtemp_buffer_show_specifiers): Remove unused variable.
14923
14924 2011-10-30 Eli Zaretskii <eliz@gnu.org>
14925
14926 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14927 past the beginning of the current glyph matrix.
14928
14929 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
14930
14931 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14932 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14933 HAVE_GTK3 (Bug#9869).
14934
14935 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14936 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14937
14938 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14939
14940 * xterm.c: Declare x_handle_net_wm_state to return int.
14941 (handle_one_xevent): Check if we are iconified but don't have
14942 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14943 (get_current_wm_state): Return non-zero if not hidden,
14944 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14945 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14946 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14947 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14948
14949 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14950
14951 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14952 so that this new function doesn't get optimized away by a
14953 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14954
14955 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14956
14957 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14958
14959 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14960
14961 Fix the `xbytecode' command.
14962 * .gdbinit (xprintbytestr): New command.
14963 (xwhichsymbols): Rename from `which'; all callers changed.
14964 (xbytecode): Print the byte-code string as well.
14965
14966 2011-10-29 Kim Storm <storm@cua.dk>
14967
14968 * alloc.c (which_symbols): New function.
14969
14970 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14971
14972 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14973 line. (Bug#9903)
14974
14975 2011-10-29 Glenn Morris <rgm@gnu.org>
14976
14977 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14978 Not clear what it was for, and it causes various bugs. (Bug#9839)
14979
14980 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14981
14982 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14983 possible random value that matches one of those tested as
14984 condition to clear the mouse face.
14985
14986 2011-10-28 Chong Yidong <cyd@gnu.org>
14987
14988 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14989
14990 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14991
14992 * window.c (make_window): Initialize phys_cursor_on_p.
14993
14994 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14995
14996 * lisp.h (struct Lisp_Symbol): Update comments.
14997
14998 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14999
15000 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15001
15002 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15003
15004 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15005 <oslsachem@gmail.com> for helping to debug this.
15006
15007 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15008 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15009 (g_b_init_get_glyph_outline_w): New static variables.
15010 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15011 (GetGlyphOutlineW_Proc): New typedefs.
15012 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15013 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15014 New functions.
15015 (w32font_open_internal, compute_metrics):
15016 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15017 instead of calling the "wide" APIs directly.
15018
15019 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15020
15021 * w32.h (syms_of_w32font): Add prototype.
15022
15023 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15024
15025 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15026 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15027 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15028 (Fmove_to_window_line): Doc fix.
15029
15030 2011-10-27 Chong Yidong <cyd@gnu.org>
15031
15032 * process.c (make_process): Set gnutls_state to NULL.
15033
15034 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15035 non-NULL, regardless of GNUTLS_INITSTAGE.
15036 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15037 an error. Set process slots as soon as we allocate them.
15038
15039 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15040
15041 2011-10-27 Chong Yidong <cyd@gnu.org>
15042
15043 * gnutls.c (emacs_gnutls_deinit): New function.
15044 Deallocate credentials structures as well as calling gnutls_deinit.
15045 (Fgnutls_deinit, Fgnutls_boot): Use it.
15046
15047 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15048 (deactivate_process): Call emacs_gnutls_deinit.
15049
15050 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15051
15052 * image.c (x_create_x_image_and_pixmap):
15053 * w32.c (sys_rename, w32_delayed_load):
15054 * w32font.c (fill_in_logfont):
15055 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15056
15057 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
15058
15059 * w32fns.c (w32_default_color_map): New function,
15060 extracted from Fw32_default_color_map.
15061 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
15062
15063 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15064
15065 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15066
15067 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15068
15069 * keyboard.c (test_undefined): New function (bug#9751).
15070 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15071
15072 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15073
15074 * sysdep.c (init_sys_modes): Fix the check for the controlling
15075 terminal (Bug#6649).
15076
15077 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15078
15079 * dispextern.h (struct bidi_it): New member next_en_type.
15080
15081 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15082 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15083 current character, check also for next_en_type being WEAK_EN.
15084 (bidi_resolve_weak): Don't enter the expensive loop if the current
15085 position is before next_en_pos. Record the bidi type of the first
15086 non-ET, non-BN character we find, in addition to its position.
15087 (bidi_level_of_next_char): Invalidate next_en_type when
15088 next_en_pos is over-stepped.
15089
15090 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15091
15092 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15093 * editfns.c: Rewrite current-time-zone so that it invokes
15094 the equivalent of (format-time-string "%Z") to get the time zone name.
15095 This fixes a bug when the time zone name contains characters that
15096 need converting from the system time locale to Emacs internal format.
15097 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15098 that patch fixed format-time-string to do the conversion, but
15099 I forgot to fix current-time-zone.
15100 (format_time_string): New function, containing most of
15101 what Fformat_time_string used to contain.
15102 (Fformat_time_string): Rewrite in terms of format_time_string.
15103 This doesn't change this function's behavior.
15104 (current-time-zone): Rewrite to use format_time_string.
15105 This fixes the bug reported by Michael Schierl in
15106 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15107 Jason Rumney's 2007-06-07 change worked around this bug, but
15108 didn't fix it.
15109 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15110
15111 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15112
15113 * xdisp.c (start_display): If the character at POS is displayed
15114 via a display vector, reset IT->current.dpvec_index to zero.
15115 (try_window_reusing_current_matrix): If a line ends in a display
15116 vector or the next line starts in a display vector, continue
15117 redrawing the window even though the character position of
15118 start_row was reached.
15119 (Bug#9771, part 2)
15120
15121 2011-10-18 Chong Yidong <cyd@gnu.org>
15122
15123 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15124 with nobreak-char-display too.
15125
15126 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15127
15128 Fix part 3 of bug#9771.
15129 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15130 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15131 non-neutral characters if the current character is a paragraph
15132 separator (a.k.a. Newline). This avoids running the same
15133 expensive loop twice, once when we consume the preceding newline
15134 and the other time when the line actually needs to be displayed.
15135 Avoid the loop when we see neutrals on the base embedding level
15136 following a character whose directionality is the same as the
15137 paragraph's. This avoids running the expensive loop when a line
15138 ends in a long sequence of neutrals, like control characters.
15139 Add assertion against STRONG_AL type. Slightly rearrange code
15140 that determines the type of a neutral given the first non-neutral
15141 that follows it.
15142 (bidi_level_of_next_char): Set next_en_pos to zero when
15143 invalidating its info.
15144
15145 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15146
15147 * xdisp.c (push_display_prop): Determine whether to record string
15148 or buffer position by IT->string, not by IT->method. Allow
15149 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15150 (move_it_vertically_backward): Don't look for character position
15151 immediately after the newline when in a continuation line.
15152 (Bug#9771, part 1)
15153
15154 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15155
15156 * window.c (coordinates_in_window): Rewrite and delabelize
15157 vertical border check. (Bug#5357) (Bug#9618)
15158
15159 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15160
15161 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15162 errors in XSetWindowBorder (bug#9310).
15163
15164 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15165
15166 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15167 avoid crash when xmalloc overrun checking is enabled.
15168
15169 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15170
15171 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15172 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15173 cursor motion with <left> and <right> arrow keys.
15174
15175 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15176 some callers set that themselves.
15177
15178 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15179
15180 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15181 display string and the previous row comes from the same string and
15182 is empty. (Bug#9739) (Bug#9738)
15183
15184 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15185
15186 * doc.c (get_doc_string): Encode file name (bug#9735).
15187
15188 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15189
15190 * bidi.c (bidi_level_of_next_char):
15191 * xdisp.c (get_visually_first_element): Remove old incorrect
15192 comments regarding the Unicode Line Separator character.
15193
15194 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15195
15196 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15197
15198 * alloc.c (Fgc_status): Do not access beyond zombies array
15199 boundary if nzombies > MAX_ZOMBIES.
15200 * alloc.c (dump_zombies): Add missing format specifier.
15201
15202 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15203
15204 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15205 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15206
15207 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15208 Some packages use them to denote characters with modifiers.
15209
15210 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15211
15212 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15213 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15214 matching a pp-number. Rename parameter var to var1.
15215
15216 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15217
15218 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15219
15220 2011-10-08 Glenn Morris <rgm@gnu.org>
15221
15222 * callint.c (Fcall_interactively): Give a more explicit error for the
15223 'c' case with a non-character input. (Bug#8479)
15224
15225 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15226
15227 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15228 lines.
15229 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15230 lines that are hscrolled on the left.
15231
15232 * dispnew.c (buffer_posn_from_coords): Account for a possible
15233 presence of header-line. (Bug#4426)
15234
15235 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15236
15237 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15238 Don't advertise functionality which we discourage or doesn't work.
15239
15240 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15241
15242 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15243 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15244 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15245 this makes Emacs dump core during garbage collection on rare
15246 occasions. sizeof is obviously inferior to offsetof here, so
15247 stick with offsetof.
15248 (GC_POINTER_ALIGNMENT): New macro.
15249 (mark_memory): Omit 3rd (offset) arg; caller changed.
15250 Don't assume EMACS_INT alignment is the same as pointer alignment.
15251
15252 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15253
15254 * keyboard.c (read_key_sequence_remapped): New var.
15255 (read_key_sequence): Compute remapping in the right buffer.
15256 (command_loop_1): Use read_key_sequence's remapping directly.
15257
15258 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15259
15260 * dired.c (file_name_completion): Don't expand file name.
15261 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15262 before checking file name handler.
15263
15264 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15265 they've been requested explicitly (bug#9591).
15266
15267 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
15268
15269 * keymap.c (Fsingle_key_description): Use make_specified_string
15270 instead of build_string to build string from push_key_description.
15271 (Bug#5193)
15272
15273 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15274
15275 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15276 This fixes a Y2038 bug on 64-bit hosts.
15277 * buffer.c (reset_buffer):
15278 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15279 (Fclear_buffer_auto_save_failure):
15280 Use 0, not -1, to represent an unset failure time, since time_t
15281 might not be signed.
15282
15283 Remove dependency on glibc malloc internals.
15284 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15285 Move back here from lisp.h, but with their new implementations.
15286 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15287 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15288 * charset.c (charset_table_init): New static var.
15289 (syms_of_charset): Use it instead of xmalloc. This removes a
15290 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15291 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15292 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15293 Move back to alloc.c.
15294 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15295 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15296
15297 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15298
15299 * nsterm.m (windowDidResize): Call x_set_window_size only when
15300 ns_in_resize is true. Otherwise set pixelwidth/height and
15301 call change_frame_size (Bug#9628).
15302
15303 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15304
15305 Port --enable-checking=all to Fedora 14 x86-64.
15306 * charset.c (syms_of_charset): Also account for glibc malloc's
15307 internal overhead when calculating the initial malloc maximum.
15308
15309 Port --enable-checking=all to Fedora 14 x86.
15310 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15311 Move to lisp.h.
15312 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15313 (overrun_check_realloc, overrun_check_free):
15314 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15315 That way, xmalloc returns a properly-aligned pointer even if
15316 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15317 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15318 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15319 into account when calculating the initial malloc maximum.
15320 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15321 Move here from alloc.c, so that charset.c can use it too.
15322 Properly align; the old code wasn't right for common 32-bit hosts
15323 when configured with --enable-checking=all.
15324 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15325 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15326
15327 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15328
15329 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15330 use EDOM.
15331
15332 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15333
15334 * xdisp.c (compute_display_string_end): If there's no display
15335 string at CHARPOS, return -1.
15336
15337 * bidi.c (bidi_fetch_char): When compute_display_string_end
15338 returns a negative value, treat the character as a normal
15339 character not covered by a display string. (Bug#9624)
15340
15341 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15342
15343 * lread.c (Fread_from_string): Fix typo in docstring.
15344
15345 2011-09-27 Eli Zaretskii <eliz@gnu.org>
15346
15347 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15348 newline, reseat the iterator instead of bidi-iterating there one
15349 character at a time. (Bug#9610)
15350 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15351 TO_CHARPOS if the bidi iterator is at base embedding level.
15352
15353 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15354
15355 * lread.c (readevalloop): Use correct code for NBSP.
15356 (read1): Likewise. (Bug#9608)
15357
15358 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
15359
15360 * dbusbind.c (Fdbus_register_signal): When service is not
15361 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15362
15363 2011-09-25 Glenn Morris <rgm@gnu.org>
15364
15365 * buffer.c (truncate-lines): Doc fix.
15366
15367 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
15368
15369 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15370 (Fset_window_next_buffers): Doc fix.
15371
15372 2011-09-24 Glenn Morris <rgm@gnu.org>
15373
15374 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15375
15376 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15377
15378 Fix minor problems found by static checking.
15379 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15380 * indent.c (Fvertical_motion): Fix == vs = typo.
15381
15382 2011-09-24 Eli Zaretskii <eliz@gnu.org>
15383
15384 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15385 Default value is now t. Doc fix.
15386
15387 * indent.c (Fvertical_motion): Compute and apply the overshoot
15388 logic when moving up, not only when moving down. Fix the
15389 confusing name and values of the it_overshoot_expected variable;
15390 logic changes accordingly. (Bug#9254) (Bug#9549)
15391
15392 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15393 CHARPOS is covered by a display string which includes newlines.
15394 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15395 is covered by a display string with embedded newlines.
15396
15397 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
15398
15399 * dbusbind.c (Fdbus_register_signal): Add match rule to
15400 Vdbus_registered_objects_table. (Bug#9581)
15401 (Fdbus_register_method, Vdbus_registered_objects_table):
15402 Fix docstring.
15403
15404 2011-09-24 Jim Meyering <meyering@redhat.com>
15405
15406 do not ignore write error for any output size
15407 The previous change was incomplete.
15408 While it makes emacs --batch detect the vast majority of stdout
15409 write failures, errors were still ignored whenever the output size is
15410 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15411 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15412 && echo FAIL: ignored write error
15413 FAIL: ignored write error
15414 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15415 && echo FAIL: ignored write error
15416 FAIL: ignored write error
15417 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15418
15419 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15420
15421 * emacs.c (Fkill_emacs): In noninteractive mode exit
15422 non-successfully if a write error occurred on stdout. (Bug#9574)
15423
15424 2011-09-21 Eli Zaretskii <eliz@gnu.org>
15425
15426 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15427 the xassert test.
15428
15429 * dispextern.h (struct it): Update the comment documenting what
15430 can it->OBJECT be.
15431
15432 2011-09-20 Eli Zaretskii <eliz@gnu.org>
15433
15434 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15435 a display string, extend search for cursor position to end of row.
15436 (find_row_edges): If the row ends in a newline from a display
15437 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15438 Handle the case of a display string with multiple newlines.
15439 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15440 non-empty line. Fixes confusing cursor motion with arrow keys at
15441 the beginning of a line that starts with whitespace.
15442
15443 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15444
15445 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15446 (bug#9493).
15447
15448 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
15449
15450 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15451 boolean (Bug#9154).
15452
15453 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15454
15455 * xdisp.c (display_line): Record maximum and minimum buffer
15456 positions even if no glyphs were produced (e.g., by a zero-width
15457 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15458 buffer positions that will be removed from the glyph row because
15459 they don't fit.
15460 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15461 column is beyond frame width: don't subtract 1 "pixel" when
15462 computing width of the stretch.
15463 (reseat_at_next_visible_line_start): Undo the change made on
15464 2011-09-17 that saved paragraph information and restored it after
15465 the call to `reseat'. (Bug#9545)
15466
15467 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15468
15469 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15470 and turn window cursor on if cleared (Bug#9415).
15471
15472 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
15473
15474 * search.c (boyer_moore): Take unibyte characters from pattern
15475 literally. (Bug#9458)
15476
15477 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15478
15479 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15480
15481 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15482
15483 Fix minor problem found by static checking.
15484 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15485 initialized, to pacify gcc -Wuninitialized.
15486
15487 * fileio.c: Report proper errno when syscall falls.
15488 (Finsert_file_contents): Save and restore errno,
15489 so that report_file_error outputs the correct diagnostic.
15490 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15491
15492 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15493
15494 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15495
15496 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15497
15498 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15499 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15500
15501 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15502
15503 * xdisp.c (reseat_at_next_visible_line_start): Keep information
15504 about the current paragraph and restore it after the call to reseat.
15505
15506 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15507 (bidi_find_paragraph_start): Search back for paragraph beginning
15508 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15509 (bidi_move_to_visually_next): Only trigger paragraph-related
15510 computations when the last character is a newline or at EOB, not
15511 just any NEUTRAL_B. (Bug#9470)
15512
15513 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15514 truncated lines if point is covered by a display string. (Bug#9524)
15515
15516 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15517
15518 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15519 (cons_to_x_long): New function.
15520 (lisp_data_to_selection_data): Use it. Correct the test for
15521 short-versus-long data; it was negated. Break out of vector
15522 loop, for efficiency, when a long datum is discovered.
15523
15524 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15525
15526 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15527
15528 2011-09-16 Eli Zaretskii <eliz@gnu.org>
15529
15530 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15531 GCC PR/17406) by declaring this function with external scope.
15532
15533 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15534
15535 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15536 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15537
15538 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15539
15540 * editfns.c (Fformat): Correctly handle text properties on "%%".
15541
15542 2011-09-15 Eli Zaretskii <eliz@gnu.org>
15543
15544 * xterm.c (x_draw_composite_glyph_string_foreground):
15545 * w32term.c (x_draw_composite_glyph_string_foreground):
15546 * term.c (encode_terminal_code):
15547 * composite.c (composition_update_it, get_composition_id):
15548 * xdisp.c (get_next_display_element)
15549 (fill_composite_glyph_string): Add comments about special meaning
15550 of TAB characters in a composition.
15551
15552 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15553
15554 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15555 This occurs when processing a multibyte format.
15556 Problem reported by Wolfgang Jenker.
15557
15558 2011-09-15 Johan Bockgård <bojohan@gnu.org>
15559
15560 * xdisp.c (try_cursor_movement): Only check for exact match if
15561 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15562
15563 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15564
15565 Remove unused external symbols.
15566 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15567 * xdisp.c (calc_pixel_width_or_height): Now static.
15568 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15569 * indent.c (check_display_width):
15570 * w32term.c: Fix comment to match code.
15571 * xterm.c, xterm.h (x_catching_errors): Remove.
15572
15573 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15574
15575 * xselect.c: Use signed conversions more consistently (Bug#9498).
15576 (selection_data_to_lisp_data): Assume incoming selection data are
15577 signed integers, not unsigned. This is to be consistent with
15578 outgoing selection data, which was modified to use signed integers
15579 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15580 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15581 expects long, not unsigned long.
15582
15583 2011-09-14 Eli Zaretskii <eliz@gnu.org>
15584
15585 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15586 computation of loop end. Reported by Johan Bockgård
15587 <bojohan@gnu.org>.
15588
15589 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
15590
15591 * frame.c (Fother_visible_frames_p): Function deleted.
15592
15593 2011-09-12 Eli Zaretskii <eliz@gnu.org>
15594
15595 * indent.c (compute_motion): Process display vector front to back
15596 rather than the other way around. (Bug#2496)
15597
15598 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15599
15600 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15601
15602 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
15603
15604 * minibuf.c (Fread_from_minibuffer): Doc fix.
15605
15606 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15607
15608 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15609 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15610
15611 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15612
15613 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15614 value for non-existent files.
15615
15616 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15617
15618 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15619 set its "size" to -1. This will set the modtime_size field of
15620 the corresponding buffer to -1, which is what
15621 verify-visited-file-modtime expects for files that do not exist.
15622 (Bug#9139)
15623
15624 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15625
15626 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15627 here ...
15628 * lisp.h: ... from here. push_key_description is no longer
15629 defined in keyboard.c, so its declaration should not be in
15630 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15631 logically belongs with push_key_description.
15632
15633 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15634
15635 * buffer.h: Include <sys/types.h> instead of <time.h>.
15636 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15637 Problem reported by Herbert J. Skuhra.
15638
15639 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15640
15641 * xml.c (parse_region): Make the parsing work for
15642 non-comment-starting XML files again (bug#9144).
15643
15644 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15645
15646 * image.c (gif_load): Fix calculation of bottom and right corner.
15647 (Bug#9468)
15648
15649 2011-09-10 Eli Zaretskii <eliz@gnu.org>
15650
15651 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15652 redisplay in small windows.
15653
15654 2011-09-09 Eli Zaretskii <eliz@gnu.org>
15655
15656 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15657
15658 2011-09-08 Martin Rudalics <rudalics@gmx.at>
15659
15660 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15661 Operate on live windows only.
15662
15663 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
15664
15665 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15666
15667 2011-09-07 Eli Zaretskii <eliz@gnu.org>
15668
15669 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15670 only under bidi iteration.
15671
15672 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15673
15674 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15675
15676 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15677
15678 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15679 Without this fix, the command to link temacs failed due to an
15680 undefined symbol __builtin_isnan. This is because
15681 /usr/include/iso/math_c99.h #defines isnan(x) to
15682 __builtin_isnan(x), but the bundled gcc, which identifies itself
15683 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15684 a __builtin_isnan.
15685 * floatfns.c (isnan): #undef, and then #define to a clone of
15686 what's in data.c.
15687 (Fisnan): Always define, since it's always available now.
15688 (syms_of_floatfns): Always define isnan at the Lisp level.
15689
15690 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15691
15692 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15693
15694 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15695
15696 * fileio.c: Fix bugs with large file offsets (Bug#9428).
15697 The previous code assumed that file offsets (off_t values) fit in
15698 EMACS_INT variables, which is not true on typical 32-bit hosts.
15699 The code messed up by falsely reporting buffer overflow in cases
15700 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15701 when "big" contains more than 2**29 bytes, even though this
15702 inserts just one byte and does not overflow the buffer.
15703 (Finsert_file_contents): Store file offsets as off_t
15704 values, not as EMACS_INT values. Check for overflow when
15705 converting between EMACS_INT and off_t. When checking for
15706 buffer overflow or for overlap, take the offsets into account.
15707 Don't use EMACS_INT for small values where int suffices.
15708 When checking for overlap, fix a typo: ZV was used where
15709 ZV_BYTE was intended.
15710 (Fwrite_region): Don't assume off_t fits into 'long'.
15711 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15712
15713 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
15714
15715 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15716
15717 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15718
15719 sprintf-related integer and memory overflow issues (Bug#9412).
15720
15721 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15722 (esprintf, exprintf, evxprintf): New functions.
15723 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15724 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15725 (modify_event_symbol): Do not assume that the length of
15726 name_alist_or_stem is safe to alloca and fits in int.
15727 (Fexecute_extended_command): Likewise for function name and binding.
15728 (Frecursion_depth): Wrap around reliably on integer overflow.
15729 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15730 since some callers pass EMACS_INT values.
15731 (Fsingle_key_description): Don't crash if symbol name contains more
15732 than MAX_ALLOCA bytes.
15733 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15734 (get_minibuffer): Arg is now EMACS_INT, not int.
15735 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15736 (esprintf, exprintf, evxprintf): New decls.
15737 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15738
15739 * dbusbind.c (signature_cat): New function.
15740 (xd_signature, Fdbus_register_signal):
15741 Do not overrun buffer; instead, report string overflow.
15742
15743 * dispnew.c (add_window_display_history): Don't overrun buffer.
15744 Truncate instead; this is OK since it's just a log.
15745
15746 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15747 even if the time zone offset is outlandishly large.
15748 Don't mishandle offset == INT_MIN.
15749
15750 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15751 when creating daemon; the previous buffer-overflow check was incorrect.
15752
15753 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15754 which has the guts of the old verror function.
15755
15756 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15757 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15758
15759 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15760 (font_unparse_xlfd): Don't blindly alloca long strings.
15761 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15762 fits in int, when using sprintf. Use single snprintf to count
15763 length of string rather than counting it via multiple sprintfs;
15764 that's simpler and more reliable.
15765 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15766 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15767 sprintf, in case result does not fit in int.
15768
15769 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15770 (fontset_from_font): Print it.
15771
15772 * frame.c (tty_frame_count): Now printmax_t, not int.
15773 (make_terminal_frame, set_term_frame_name): Print it.
15774 (x_report_frame_params): In X, window IDs are unsigned long,
15775 not signed long, so print them as unsigned.
15776 (validate_x_resource_name): Check for implausibly long names,
15777 and don't assume name length fits in 'int'.
15778 (x_get_resource_string): Don't blindly alloca invocation name;
15779 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15780 not fit in int.
15781
15782 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15783 (xg_check_special_colors, xg_set_geometry):
15784 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15785
15786 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15787 Use esprintf, not sprintf, in case result does not fit in int.
15788
15789 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15790 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15791 it as a large positive number.
15792 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15793 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15794
15795 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15796 in case result does not fit in int.
15797
15798 * print.c (float_to_string): Detect width overflow more reliably.
15799 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15800 buffer overrun. Don't assume list length fits in 'int'. Treat
15801 print length of 0 as 0, not as infinity; to be consistent with other
15802 uses of print length in this function. Don't overflow print length
15803 index. Don't assume hash table size fits in 'long', or that
15804 vectorlike size fits in 'unsigned long'.
15805
15806 * process.c (make_process): Use printmax_t, not int, to format
15807 process-name gensyms.
15808
15809 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15810
15811 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15812 to avoid potential buffer overrun.
15813
15814 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15815 if X resource line is longer than 512 bytes.
15816
15817 * xfns.c (x_window): Make sprintf buffer a bit bigger
15818 to avoid potential buffer overrun.
15819
15820 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15821
15822 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15823
15824 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15825
15826 Integer overflow fixes for scrolling, etc.
15827 Without these, Emacs silently mishandles large integers sometimes.
15828 For example, "C-u 4294967297 M-x recenter" was treated as if
15829 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15830
15831 * xdisp.c (try_window_id): Check Emacs fixnum range before
15832 converting to 'int'.
15833
15834 * window.c (window_scroll_line_based, Frecenter):
15835 Check that an Emacs fixnum is in range before assigning it to 'int'.
15836 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15837 values converted from Emacs fixnums.
15838 (Frecenter): Don't wrap around a line count if it is out of 'int'
15839 range; instead, treat it as an extreme value.
15840 (Fset_window_configuration, compare_window_configurations):
15841 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15842
15843 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15844 that can exceed INT_MAX. Check that EMACS_INT value is in range
15845 before assigning it to the (possibly-narrower) index.
15846 (match_limit): Don't assume that a fixnum can fit in 'int'.
15847
15848 * print.c (print_object): Use ptrdiff_t, not int, for index that can
15849 exceed INT_MAX.
15850
15851 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
15852 (Fvertical_motion): Don't wrap around LINES values that don't fit
15853 in 'int'. Instead, treat them as extreme values. This is good
15854 enough for windows, which can't have more than INT_MAX lines anyway.
15855
15856 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15857
15858 * Require libxml/parser.h to avoid compilation warning.
15859
15860 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15861
15862 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15863 since this reportedly can destroy thread storage.
15864
15865 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
15866
15867 * syntax.c (find_defun_start): Update all cache variables if
15868 exiting early (Bug#9401).
15869
15870 2011-08-30 Eli Zaretskii <eliz@gnu.org>
15871
15872 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15873
15874 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15875 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15876 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15877
15878 * term.c (tty_append_glyph): New function.
15879 (produce_stretch_glyph): Static function and its prototype deleted.
15880
15881 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15882 Add prototypes.
15883
15884 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15885
15886 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15887 when checking :margin (Bug#9390).
15888 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15889 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15890 so that the name doesn't mislead. All uses changed.
15891
15892 2011-08-28 Johan Bockgård <bojohan@gnu.org>
15893
15894 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15895 set_tty_hooks.
15896
15897 2011-08-27 Eli Zaretskii <eliz@gnu.org>
15898
15899 * xdisp.c (move_it_to): Don't bail out early when reaching
15900 position beyond to_charpos, if we are scanning backwards.
15901 (move_it_vertically_backward): When DY == 0, make sure we get to
15902 the first character in the line after the newline.
15903
15904 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15905
15906 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15907 (ccl_driver): Do not generate an out-of-range pointer.
15908 (Fccl_execute_on_string): Remove unnecessary check for
15909 integer overflow, noted by Stefan Monnier in
15910 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15911 Remove a FIXME that didn't need fixing.
15912 Simplify the newly-introduced buffer reallocation code.
15913
15914 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
15915
15916 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15917
15918 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
15919
15920 Integer and memory overflow issues (Bug#9196).
15921
15922 * doc.c (get_doc_string): Rework so that
15923 get_doc_string_buffer_size is the actual buffer size, rather than
15924 being 1 less than the actual buffer size; this makes xpalloc more
15925 convenient.
15926
15927 * image.c (x_allocate_bitmap_record, cache_image):
15928 * xselect.c (Fx_register_dnd_atom):
15929 Simplify previous changes by using xpalloc.
15930
15931 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15932 since either will do and ptrdiff_t is convenient with xpalloc.
15933
15934 * charset.c (charset_table_size)
15935 (struct charset_sort_data.priority): Now ptrdiff_t.
15936 (charset_compare): Don't overflow if priorities differ greatly.
15937 (Fsort_charsets): Don't assume list length fits in int.
15938 Check for size-calculation overflow when allocating sort data.
15939 (syms_of_charset): Allocate an initial charset table that is
15940 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15941
15942 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15943
15944 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15945 The actual value is always <= INT_MAX, and leaving it unsigned made
15946 overflow checking harder.
15947
15948 * dispextern.h (struct glyph_matrix.rows_allocated)
15949 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15950 with xpalloc. The values are still always <= INT_MAX.
15951
15952 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15953
15954 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15955 (SAFE_NALLOCA): New macro.
15956
15957 * region-cache.c (struct boundary.pos, find_cache_boundary)
15958 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15959 (set_cache_region, invalidate_region_cache)
15960 (revalidate_region_cache, know_region_cache, region_cache_forward)
15961 (region_cache_backward, pp_cache):
15962 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15963 so that ptrdiff_t * can be passed to xpalloc.
15964 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15965 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15966 (pp_cache): Don't assume cache_len fits in int.
15967 * region-cache.h: Adjust extern decls to match.
15968
15969 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15970 EMACS_INT, since either will do, for xpalloc.
15971
15972 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15973 (xnmalloc, xnrealloc, xpalloc): New functions.
15974
15975 * bidi.c (bidi_shelve_header_size): New constant.
15976 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15977 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15978
15979 * bidi.c (bidi_cache_shrink):
15980 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15981 (overlay_strings):
15982 Don't update size of array until after memory allocation succeeds,
15983 because xmalloc/xrealloc may not return.
15984 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15985 now that we have proper integer overflow checking.
15986 (record_overlay_string, overlay_strings): Catch overflows when
15987 calculating size of overlay_str_buf.
15988
15989 * callproc.c (Fcall_process): Check for size overflow when
15990 calculating size of args2.
15991 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15992 Normally we prefer signed values, but sticking with ptrdiff_t would
15993 require adding more-complicated checks.
15994
15995 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15996 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15997 Redo buffer-overflow calculations to avoid integer overflow.
15998 Add a FIXME comment where memory seems to be over-allocated.
15999
16000 * character.c (Fstring): Check for size-calculation overflow.
16001
16002 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16003 unnecessary integer overflow. Check for size overflow.
16004 (encode_coding_object): Don't update size until xmalloc succeeds.
16005
16006 * composite.c (get_composition_id): Check for overflow in glyph
16007 length calculations.
16008
16009 Integer and memory overflow fixes for display code.
16010 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16011 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16012 (scrolling_window): Check for overflow in size calculations.
16013 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16014 Don't assume glyph table len fits in int.
16015 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16016 (row_table_size): Now ptrdiff_t, not int.
16017 (scrolling_window): Avoid overflow in size calculations.
16018 Don't update size until allocation succeeds.
16019 * fns.c (concat): Check for overflow in size calculations.
16020 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16021 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16022 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16023
16024 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16025 (get_doc_string): Check for size calculation overflow.
16026 Don't update size until allocation succeeds.
16027 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16028 EMACS_INT, where ptrdiff_t will do.
16029 (Fsubstitute_command_keys): Check for string overflow.
16030
16031 * editfns.c (set_time_zone_rule): Don't assume environment length
16032 fits in int.
16033 (message_length): Now ptrdiff_t, not int.
16034 (Fmessage_box): Don't update size until allocation succeeds.
16035 Don't assume message length fits in int.
16036 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16037
16038 * emacs.c (main): Do not reallocate argv, since there is a null at
16039 the end that can be overwritten, and this way there's no need to
16040 worry about size-calculation overflow.
16041 (sort_args): Check for size-calculation overflow.
16042
16043 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16044 alloc succeeds.
16045 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16046
16047 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16048 (x_set_scroll_bar_width, x_figure_window_size):
16049 Check for integer overflow.
16050 (x_set_alpha): Do not assume XINT fits in int.
16051
16052 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16053 This is for the members text_lines, text_cols, total_lines, total_cols,
16054 where the system imposes an 'int' limit.
16055
16056 * fringe.c (Fdefine_fringe_bitmap):
16057 Don't update size until alloc works.
16058
16059 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16060 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16061
16062 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16063 Check for size-calculation overflow.
16064 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16065 do, as we prefer signed integers.
16066 (id_to_widget.max_size, id_to_widget.used)
16067 (xg_store_widget_in_map, xg_remove_widget_from_map)
16068 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16069 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16070 Use and return ptrdiff_t, not int.
16071 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16072 * gtkutil.h: Change prototypes to match the above.
16073
16074 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16075 are duplicate now that they've been promoted to lisp.h.
16076 (x_allocate_bitmap_record, x_alloc_image_color)
16077 (make_image_cache, cache_image, xpm_load):
16078 Don't update size until alloc is done.
16079 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16080 (x_detect_edges):
16081 Check for size calculation overflow.
16082 (ct_colors_allocated_max): New constant.
16083 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16084 overflow.
16085
16086 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16087 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16088 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16089 Use ptrdiff_t, not int, to count maps.
16090 (read_char_minibuf_menu_prompt): Check for overflow in size
16091 calculations. Don't update size until allocation succeeds.
16092 Redo calculations to avoid overflow.
16093 * keyboard.h: Change prototypes to match the above.
16094
16095 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16096 to count maps.
16097 (current_minor_maps): Check for size calculation overflow.
16098 * keymap.h: Change prototypes to match the above.
16099
16100 * lread.c (read1, init_obarray): Don't update size until alloc done.
16101
16102 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16103 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16104
16105 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16106 Now ptrdiff_t, not int.
16107 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16108 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16109
16110 * process.c (Fnetwork_interface_list): Check for overflow
16111 in size calculation.
16112
16113 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16114
16115 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16116 overflow. Don't bother calling xmalloc when xrealloc will do.
16117
16118 * search.c (Freplace_match): Check for size calculation overflow.
16119 (Fset_match_data): Don't assume list lengths fit in 'int'.
16120
16121 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16122 for command line length. Do not attempt to address one before the
16123 beginning of an array, as that's not portable.
16124
16125 * term.c (max_frame_lines): Remove; unused.
16126 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16127 not int.
16128 (encode_terminal_code, calculate_costs): Check for size
16129 calculation overflow.
16130 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16131 table lengths and related sizes. Don't update size until alloc
16132 done. Redo calculations to avoid overflow.
16133 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16134
16135 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16136 subtracting pointers.
16137 (gobble_line): Check for overflow more carefully. Don't update size
16138 until alloc done.
16139
16140 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16141 Don't update size until alloc done.
16142 Redo size calculations to avoid overflow.
16143 Check for size calculation overflow.
16144 (main) [DEBUG]: Fix typo in invoking tparam1.
16145
16146 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16147 Use ptrdiff_t, not int, for sizes.
16148 (store_mode_line_noprop_char): Don't update size until alloc done.
16149
16150 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16151 Use ptrdiff_t, not int, for sizes.
16152 (Finternal_make_lisp_face, cache_face):
16153 Check for size calculation overflow.
16154 (cache_face): Treat size calculation overflows as if they were
16155 memory exhaustion (the usual treatment), rather than aborting.
16156
16157 * xfns.c (x_encode_text, x_set_name_internal)
16158 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16159 sizes, since they can exceed INT_MAX in size. Check for size
16160 calculation overflow.
16161
16162 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16163 (xg_select): Check for size calculation overflow.
16164 Don't update size until alloc done.
16165
16166 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16167 as sprintf is limited to int lengths.
16168
16169 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16170 (X_LONG_MIN): New macros.
16171 Use them to make the following changes clearer.
16172 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16173 This change doesn't affect the value now, but it may help remind
16174 future maintainers not to raise the value too much later.
16175 (SELECTION_QUANTUM): Remove, replacing with ...
16176 (selection_quantum): ... new function, which avoids overflow.
16177 All uses changed.
16178 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16179 assumption that selection length fits in 'int'.
16180 (x_reply_selection_request, x_handle_selection_request)
16181 (x_get_window_property, receive_incremental_selection)
16182 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16183 (lisp_data_to_selection_data, clean_local_selection_data):
16184 Use ptrdiff_t, not int, to record length of selection.
16185 (x_reply_selection_request, x_get_window_property)
16186 (receive_incremental_selection, x_property_data_to_lisp):
16187 Redo calculations to avoid overflow.
16188 (x_reply_selection_request): When sending hint, ceiling it at
16189 X_LONG_MAX rather than relying on wraparound overflow to send
16190 something.
16191 (x_get_window_property, receive_incremental_selection)
16192 (lisp_data_to_selection_data, x_property_data_to_lisp):
16193 Check for size-calculation overflow.
16194 (x_get_window_property, receive_incremental_selection)
16195 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16196 Don't store size until memory allocation succeeds.
16197 (x_get_window_property): Plug memory leak on memory exhaustion.
16198 Don't double-block input; malloc is safe here. Don't assume 2**34
16199 - 4 fits in unsigned long. Add an xassert to check
16200 XGetWindowProperty overflow. Be more careful about overflow
16201 calculations, and distinguish size from memory overflow better.
16202 (receive_incremental_selection): When tracing, don't assume
16203 unsigned int is less than INT_MAX.
16204 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16205 harmful) conversions of unsigned short to int.
16206 (lisp_data_to_selection_data): Don't assume that integers
16207 in the range -65535 through -1 fit in an X unsigned short.
16208 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16209 result parameters unless successful. Rely on cons_to_unsigned
16210 to report problems with elements; the old code wasn't right anyway.
16211 (x_check_property_data): Check for int overflow; we cannot use
16212 a wider type due to X limits.
16213 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16214
16215 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16216
16217 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16218 (x_term_init): Check for size calculation overflow.
16219 (x_color_cells): Don't store size until memory allocation succeeds.
16220 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16221 Don't assume alloca size is less than MAX_ALLOCA.
16222 (x_term_init): Don't assume length fits in int (sprintf is limited
16223 to int size).
16224
16225 Use ptrdiff_t for composition IDs.
16226 * character.c (lisp_string_width):
16227 * composite.c (composition_table_size, n_compositions)
16228 (get_composition_id, composition_gstring_from_id):
16229 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16230 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16231 * window.c (Frecenter):
16232 Use ptrdiff_t, not int, for composition IDs.
16233 * composite.c (get_composition_id): Check for integer overflow.
16234 * composite.h: Adjust prototypes to match the above changes.
16235
16236 Use ptrdiff_t for hash table indexes.
16237 * category.c (hash_get_category_set):
16238 * ccl.c (ccl_driver):
16239 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16240 * coding.c (coding_system_charset_list, detect_coding_system):
16241 * coding.h (struct coding_system.id):
16242 * composite.c (get_composition_id, gstring_lookup_cache):
16243 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16244 * image.c (xpm_get_color_table_h):
16245 * lisp.h (hash_lookup, hash_put):
16246 * minibuf.c (Ftest_completion):
16247 Use ptrdiff_t for hash table indexes, not int (which is too
16248 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16249 32-bit --with-wide-int hosts).
16250
16251 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16252 Add a FIXME comment about memory leaks.
16253 (syms_of_charset): Don't assume xmalloc returns.
16254
16255 Don't assume that stated character widths fit in int.
16256 * character.c (Fchar_width, c_string_width, lisp_string_width):
16257 * character.h (CHAR_WIDTH):
16258 * indent.c (MULTIBYTE_BYTES_WIDTH):
16259 Use sanitize_char_width to avoid undefined and/or bad behavior
16260 with outlandish widths.
16261 * character.h (sanitize_tab_width): Rename from sanitize_width,
16262 now that we have two such functions. All uses changed.
16263 (sanitize_char_width): New inline function.
16264
16265 Don't assume that tab-width fits in int.
16266 * character.h (sanitize_width): New inline function.
16267 (SANE_TAB_WIDTH): New macro.
16268 (ASCII_CHAR_WIDTH): Use it.
16269 * indent.c (sane_tab_width): Remove. All uses replaced by
16270 SANE_TAB_WIDTH (current_buffer).
16271 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16272
16273 * fileio.c: Integer overflow issues with file modes.
16274 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16275
16276 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16277 Remove unreachable code.
16278 (read_hex, load_charset_map_from_file): Check for integer overflow.
16279
16280 * xterm.c: Don't go over XClientMessageEvent limit.
16281 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16282 (x_send_scroll_bar_event): Likewise. Check that the size does not
16283 exceed limits imposed by XClientMessageEvent, as well as the usual
16284 ptrdiff_t and size_t limits.
16285
16286 * keyboard.c: Overflow, signedness and related fixes.
16287 (make_lispy_movement): Use same integer type in forward decl
16288 that is used in the definition.
16289 (read_key_sequence, keyremap_step):
16290 Change bufsize argument back to int, undoing my 2011-03-30 change.
16291 We prefer signed types, and int is wide enough here.
16292 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16293 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16294 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16295 length, not size_t. Use ptrdiff_t for index, not int.
16296 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16297 possibility of integer overflow.
16298
16299 Overflow, signedness and related fixes for images.
16300
16301 * dispextern.h (struct it.stack[0].u.image.image_id)
16302 (struct_it.image_id, struct image.id, struct image_cache.size)
16303 (struct image_cache.used, struct image_cache.ref_count):
16304 * gtkutil.c (update_frame_tool_bar):
16305 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16306 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16307 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16308 * nsmenu.m (update_frame_tool_bar):
16309 * xdisp.c (calc_pixel_width_or_height):
16310 * xfns.c (image_cache_refcount):
16311 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16312 on typical 64-bit hosts.
16313
16314 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16315 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16316 Omit unnecessary casts to int.
16317 (parse_image_spec): Check that integers fall into 'int' range
16318 when the callers expect that.
16319 (image_ascent): Redo ascent calculation to avoid int overflow.
16320 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16321 (lookup_image): Remove unnecessary tests.
16322 (xbm_image_p): Locals are now of int, not EMACS_INT,
16323 since parse_image_check makes sure they fit into int.
16324 (png_load, gif_load, svg_load_image):
16325 Prefer int to unsigned where either will do.
16326 (tiff_handler): New function, combining the cores of the
16327 old tiff_error_handler and tiff_warning_handler.
16328 This function is rewritten to use vsnprintf and thereby avoid
16329 stack buffer overflows. It uses only the features of vsnprintf
16330 that are common to both POSIX and native Microsoft.
16331 (tiff_error_handler, tiff_warning_handler): Use it.
16332 (tiff_load, gif_load, imagemagick_load_image):
16333 Don't assume :index value fits in 'int'.
16334 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16335 (imagemagick_load_image): Check that crop parameters fit into
16336 the integer types that MagickCropImage accepts. Don't assume
16337 Vimagemagick_render_type has a nonnegative value. Don't assume
16338 size_t fits in 'long'.
16339 (gs_load): Use printmax_t to print the widest integers possible.
16340 Check for integer overflow when computing image height and width.
16341
16342 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16343
16344 * xdisp.c (redisplay_window): Don't force window start if point
16345 will be invisible in the resulting window. (Bug#9324)
16346
16347 2011-08-25 Eli Zaretskii <eliz@gnu.org>
16348
16349 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16350 the display spec is of the form `(space ...)'.
16351 (handle_display_spec): Return the value returned by
16352 handle_single_display_spec, not just 1 or zero.
16353 (handle_single_display_spec): If the display spec is of the form
16354 `(space ...)', and specifies display in the text area, return 2
16355 rather than 1.
16356 (try_cursor_movement): Check for the need to scroll more
16357 accurately, and prefer exact match for point under bidi.
16358 Don't advance `row' beyond the last row of the window.
16359
16360 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16361 into disp_prop; all users changed.
16362
16363 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16364 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16365 for the text covered by the display property.
16366
16367 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
16368
16369 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16370 Change return value to nil.
16371 (Frecord_buffer): Delete unused function.
16372
16373 2011-08-24 Eli Zaretskii <eliz@gnu.org>
16374
16375 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16376 buffers, return left-to-right.
16377 (set_cursor_from_row): Consider candidate row a win if its glyph
16378 represents a newline and point is on that newline. Fixes cursor
16379 positioning on the newline at EOL of R2L text within L2R
16380 paragraph, and vice versa.
16381 (try_cursor_movement): Check continued rows, in addition to
16382 continuation rows. Fixes unwarranted scroll when point enters a
16383 continued line of R2L text within an L2R paragraph, or vice versa.
16384 (cursor_row_p): Consider the case of point being equal to
16385 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16386 from the end of a short line to the beginning of a continued line
16387 of R2L text within L2R paragraph.
16388 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16389 composed characters.
16390
16391 * bidi.c (bidi_check_type): Use xassert.
16392 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16393 members.
16394
16395 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16396
16397 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16398 a character.
16399
16400 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
16401
16402 * nsfont.m (ns_otf_to_script): Fix typo.
16403
16404 2011-08-22 Kenichi Handa <handa@m17n.org>
16405
16406 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16407 extra slot even if the purpose is char-code-property-table.
16408
16409 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16410
16411 * xdisp.c (redisplay_window): When computing centering_position,
16412 account for the height of the header line. (Bug#8874)
16413
16414 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16415 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16416 candidate is selected by the mouse, and that candidate has a
16417 composed character under the mouse.
16418
16419 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16420 coordinates reported by pos-visible-in-window-p for a composed
16421 character in column zero.
16422
16423 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16424
16425 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16426
16427 2011-08-22 Eli Zaretskii <eliz@gnu.org>
16428
16429 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16430 consider it a hit if to_charpos is anywhere in the range of the
16431 composed buffer positions.
16432
16433 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
16434
16435 * image.c (gif_load): Don't assume that each subimage has the same
16436 dimensions as the base image. Handle disposal method that is
16437 "undefined" by the gif spec (Bug#9335).
16438
16439 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
16440
16441 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16442 (Fcondition_case): Document `debug' symbol in error handler.
16443
16444 2011-08-19 Eli Zaretskii <eliz@gnu.org>
16445
16446 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16447 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16448 from an Org mode buffer to a Speedbar frame.
16449
16450 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16451 a composition, take its buffer position from IT->cmp_it.charpos.
16452 Fixes cursor positioning at the beginning of a line that begins
16453 with a composed character.
16454
16455 2011-08-18 Eli Zaretskii <eliz@gnu.org>
16456
16457 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16458 character bidirectional type, use STRONG_L instead. Fixes crashes
16459 in a buffer produced by `describe-categories'.
16460
16461 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16462 members before the level stack, so they would be saved and
16463 restored when copying iterator state. Fixes incorrect reordering
16464 around TABs covered by display properties.
16465
16466 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16467
16468 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16469
16470 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
16471
16472 * eval.c (internal_condition_case, internal_condition_case_1)
16473 (internal_condition_case_2, internal_condition_case_n):
16474 Remove unnecessary aborts (Bug#9081).
16475
16476 2011-08-17 Eli Zaretskii <eliz@gnu.org>
16477
16478 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16479 has no `load' handler, try opening the file locally. (Bug#9311)
16480
16481 2011-08-16 Ken Brown <kbrown@cornell.edu>
16482
16483 * gmalloc.c: Expand comment.
16484
16485 2011-08-16 Eli Zaretskii <eliz@gnu.org>
16486
16487 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16488 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16489
16490 2011-08-16 Ken Brown <kbrown@cornell.edu>
16491
16492 Fix memory allocation problems in Cygwin build (Bug#9273).
16493
16494 * unexcw.c ( __malloc_initialized): Declare external variable.
16495 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16496
16497 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16498 New variables.
16499 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16500 dumped emacs.
16501 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16502 in the static heap.
16503 [CYGWIN] (special_realloc): New function.
16504 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16505 requests to realloc storage in the static heap.
16506
16507 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16508
16509 * bidi.c (bidi_initialize): Remove unused local.
16510
16511 2011-08-15 Eli Zaretskii <eliz@gnu.org>
16512
16513 * bidimirror.h:
16514 * biditype.h: Remove file.
16515 * makefile.w32-in ($(BLD)/bidi.$(O)):
16516 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16517
16518 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16519
16520 * chartab.c: Improve commentary for the uniprop_table API.
16521
16522 * bidi.c (bidi_paragraph_init): Support zero value of
16523 bidi_ignore_explicit_marks_for_paragraph_level.
16524 (bidi_initialize): Use uniprop_table instead of including
16525 biditype.h and bidimirror.h.
16526
16527 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16528 coordinates of the iterator when restoring from ppos_it.
16529 (Bug#9296)
16530
16531 2011-08-14 Kenichi Handa <handa@m17n.org>
16532
16533 * process.c (create_process): Call setup_process_coding_systems
16534 after the pid of the process is set to -1 (Bug#8162).
16535
16536 2011-08-14 Eli Zaretskii <eliz@gnu.org>
16537
16538 * xdisp.c (move_it_in_display_line_to): Don't invoke
16539 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16540 ppos_it. Fixes vertical cursor motion when line beginning is
16541 covered by an image. (Bug#9296)
16542
16543 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16544
16545 * nsterm.h (ns_run_ascript): Declare.
16546 (NSAPP_DATA2_RUNASSCRIPT): Define.
16547
16548 * nsfns.m (as_script, as_result, as_status): New static variables.
16549 (ns_run_ascript): New function.
16550 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
16551 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16552 the event loop. Get status from as_status (Bug#7276).
16553
16554 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16555 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16556 the event loop (Bug#7276).
16557
16558 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16559
16560 * gnutls.c (QCgnutls_bootprop_priority)
16561 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16562 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16563 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16564 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16565 (QCgnutls_bootprop_verify_hostname_error)
16566 (QCgnutls_bootprop_callbacks_verify): Rename from
16567 Qgnutls_bootprop_..., all uses changed.
16568
16569 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16570 uses changed.
16571
16572 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16573
16574 * xfaces.c (Qframe_set_background_mode): Now static.
16575 * dispextern.h (Qframe_set_background_mode): Remove decl.
16576
16577 * process.c (Fnetwork_interface_info): Declare local only if needed.
16578
16579 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16580
16581 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16582 (Fnetwork_interface_list): Allocate in increments of bytes instead
16583 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16584 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16585 sockaddr.
16586 (struct ifflag_def): notrailers is smart on OSX.
16587 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16588 Get hardware address with getifaddrs if available.
16589
16590 2011-08-12 Eli Zaretskii <eliz@gnu.org>
16591
16592 * xdisp.c (iterate_out_of_display_property): xassert that
16593 IT->position is set to within IT->object's boundaries. Break from
16594 the loop as soon as EOB is reached; avoids infloops in redisplay
16595 when IT->position is set up wrongly due to some bug.
16596 Set IT->current to match the bidi iterator unconditionally.
16597 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16598 entry. Force push_it to save on the stack the current
16599 buffer/string position, to be restored by pop_it. Fix flags in
16600 the iterator structure wrt the object coming from a display
16601 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16602 properties. (Bug#9284)
16603
16604 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
16605
16606 * fontset.c (fontset_get_font_group): Add proper type checks.
16607 (Bug#9172)
16608
16609 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16610
16611 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16612 and LC_VERSION_MIN_MACOSX.
16613 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16614 (dump_it) [LC_FUNCTION_STARTS]: Use it.
16615
16616 2011-08-08 Eli Zaretskii <eliz@gnu.org>
16617
16618 * xdisp.c (forward_to_next_line_start): Allow to use the
16619 no-display-properties-and-no-overlays under bidi display.
16620 Set disp_pos in the bidi iterator to avoid searches for display
16621 properties and overlays.
16622
16623 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
16624
16625 * editfns.c (Fset_time_zone_rule): Document relationship with the
16626 setenv function.
16627
16628 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16629 the font entity extracted from the cache (Bug#8109).
16630
16631 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
16632
16633 * composite.c (autocmp_chars): Don't reset point. That is done by
16634 restore_point_unwind (Bug#5984).
16635
16636 2011-08-07 Juri Linkov <juri@jurta.org>
16637
16638 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16639 to show the arg `TIME' instead of `TIMEVAL'.
16640
16641 2011-08-06 Eli Zaretskii <eliz@gnu.org>
16642
16643 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16644 display property strides EOL and includes a newline, as in
16645 longlines-mode. (Bug#9254)
16646 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16647 word-wrap under bidirectional display. (Bug#9224)
16648
16649 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16650 is non-zero, even if the data buffer is NULL. Fixes a crash in
16651 vertical-motion with longlines-mode. (Bug#9254)
16652
16653 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16654
16655 * bidi.c <bidi_cache_total_alloc>: Now static.
16656 (bidi_initialize): Initialize bidi_cache_total_alloc.
16657
16658 * xdisp.c (display_line): Release buffer allocated for shelved bidi
16659 cache. (Bug#9221)
16660
16661 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16662 amount allocated this far in `bidi_cache_total_alloc'.
16663 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16664 non-zero, only free the data buffer without restoring the cache
16665 contents. All callers changed.
16666
16667 * dispextern.h (bidi_unshelve_cache): Update prototype.
16668
16669 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16670 (move_it_in_display_line, move_it_to)
16671 (move_it_vertically_backward, move_it_by_lines): Replace the call
16672 to xfree to an equivalent call to bidi_unshelve_cache.
16673 (move_it_in_display_line_to): Fix logic of returning
16674 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
16675
16676 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16677
16678 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16679 came from a string character with a `cursor' property. (Bug#9229)
16680
16681 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16682
16683 * Makefile.in (LIB_PTHREAD): New variable.
16684 (LIBES): Add LIB_PTHREAD (Bug#9216).
16685
16686 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16687 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16688
16689 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16690
16691 * regex.c (re_iswctype): Remove some redundant boolean conversions.
16692
16693 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16694
16695 * xterm.c (x_find_topmost_parent): New function.
16696 (x_set_frame_alpha): Find topmost parent window with
16697 x_find_topmost_parent and set the property there also (bug#9181).
16698 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16699
16700 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16701
16702 * callproc.c (Fcall_process): Avoid vfork clobbering
16703 the local vars buffer, coding_systems, current_dir.
16704
16705 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16706
16707 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16708
16709 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16710
16711 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16712 so that it is not optimized away.
16713
16714 * xdisp.c (compute_display_string_pos): Remove unused local.
16715
16716 2011-08-02 Eli Zaretskii <eliz@gnu.org>
16717
16718 Fix slow cursor motion and scrolling in large buffers with
16719 selective display, like Org Mode buffers. (Bug#9218)
16720
16721 * dispextern.h (struct bidi_it): New member disp_prop_p.
16722
16723 * xdisp.c: Remove one-slot cache of display string positions.
16724 (compute_display_string_pos): Accept an additional argument
16725 DISP_PROP_P; callers changed. Scan at most 5K characters forward
16726 for a display string or property. If found, set DISP_PROP_P
16727 non-zero.
16728
16729 * bidi.c (bidi_fetch_char): Accept an additional argument
16730 DISP_PROP_P, and pass it to compute_display_string_pos.
16731 Only handle text covered by a display string if DISP_PROP_P is returned
16732 non-zero. All callers of bidi_fetch_char changed.
16733
16734 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16735
16736 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16737
16738 2010-12-03 Don March <don@ohspite.net>
16739
16740 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16741 last character M-[char] is translated to ESC [char] (bug#7541).
16742
16743 2011-08-02 Kenichi Handa <handa@m17n.org>
16744
16745 * lisp.h (uniprop_table): Extern it.
16746
16747 * chartab.c (uniprop_table): Make it non-static.
16748
16749 2011-08-01 Eli Zaretskii <eliz@gnu.org>
16750
16751 * xdisp.c (forward_to_next_line_start): Accept additional argument
16752 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16753 on the newline.
16754 (reseat_at_next_visible_line_start): Use the bidi iterator state
16755 returned by forward_to_next_line_start to restore the state of
16756 it->bidi_it after backing up to previous newline. (Bug#9212)
16757
16758 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16759
16760 * regex.c (re_comp): Protoize.
16761 (re_exec): Fix return type.
16762 (regexec): Fix type of `ret'. (Bug#9203)
16763
16764 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16765
16766 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16767 This is needed if max-image-size is a floating-point number.
16768
16769 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16770
16771 * print.c (print_object): Print empty symbol as ##.
16772
16773 * lread.c (read1): Read ## as empty symbol.
16774
16775 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16776
16777 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16778 setting frame foreground color (Bug#9175).
16779 (x_set_background_color): Likewise.
16780
16781 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16782 contents (Bug#9176).
16783 (EmacsTooltip -init): Remove bezels and add shadows to
16784 tooltip windows.
16785
16786 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16787 or scroll bar (Bug#8470).
16788
16789 * nsfont.m (nsfont_open): Remove assignment to voffset and
16790 unnecessary vars hshink, expand, hd, full_height, min_height.
16791 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16792
16793 * nsterm.h (nsfont_info): Remove voffset field.
16794
16795 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16796
16797 Implement strike-through and overline on NextStep (Bug#8863).
16798
16799 * nsfont.m (nsfont_open): Use underline position provided by font,
16800 instead of hard-coded value of 2.
16801 (nsfont_draw): Call ns_draw_text_decoration instead.
16802
16803 * nsterm.h: Add declaration for ns_draw_text_decoration.
16804
16805 * nsterm.m (ns_draw_text_decoration): New function for drawing
16806 underline, overline, and strike-through.
16807 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16808 ns_draw_text_decoration. Change treatment of cursor drawing to
16809 accommodate underlining, etc.
16810
16811 2011-07-28 Eli Zaretskii <eliz@gnu.org>
16812
16813 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16814 default.
16815
16816 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16817
16818 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16819 Without this fix, if a signal arrives just after memory fills up,
16820 'malloc' might be invoked reentrantly.
16821
16822 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16823 In other words, assume that every image size is allowed, on non-X
16824 hosts. This assumption is probably wrong, but it lets Emacs compile.
16825
16826 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16827
16828 * regex.c (re_iswctype): Convert return values to boolean.
16829
16830 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16831
16832 * xdisp.c (compute_display_string_pos): Don't use cached display
16833 string position if the buffer had its restriction changed.
16834 (Bug#9184)
16835
16836 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16837
16838 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16839
16840 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16841
16842 Integer signedness and overflow and related fixes. (Bug#9079)
16843
16844 * bidi.c: Integer size and overflow fixes.
16845 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16846 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16847 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16848 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16849 (bidi_find_other_level_edge):
16850 Use ptrdiff_t instead of EMACS_INT where either will do.
16851 This works better on 32-bit hosts configured --with-wide-int.
16852 (bidi_cache_ensure_space): Check for size-calculation overflow.
16853 Use % rather than repeated addition, for better worst-case speed.
16854 Don't set bidi_cache_size until after xrealloc returns, because it
16855 might not return.
16856 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
16857 (bidi_cache_ensure_space): Also check that the bidi cache size
16858 does not exceed that of the largest Lisp string or buffer. See Eli
16859 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
16860
16861 * alloc.c (__malloc_size_t): Remove.
16862 All uses replaced by size_t. See Andreas Schwab's note
16863 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16864
16865 * image.c: Improve checking for integer overflow.
16866 (check_image_size): Assume that f is nonnull, since
16867 it is always nonnull in practice. This is one less thing to
16868 worry about when checking for integer overflow later.
16869 (x_check_image_size): New function, which checks for integer
16870 overflow issues inside X.
16871 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16872 This removes the need for a memory_full check.
16873 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16874 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16875 (xbm_read_bitmap_data): Change locals back to 'int', since
16876 their values must fit in 'int'.
16877 (xpm_load_image, png_load, tiff_load):
16878 Invoke x_create_x_image_and_pixmap earlier,
16879 to avoid much needless work if the image is too large.
16880 (tiff_load): Treat overly large images as if
16881 x_create_x_image_and_pixmap failed, not as malloc failures.
16882 (gs_load): Use x_check_image_size.
16883
16884 * gtkutil.c: Omit integer casts.
16885 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16886 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16887
16888 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16889
16890 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16891 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16892 would wrongly return t on a 64-bit host.
16893
16894 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16895 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16896 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16897 and therefore cause GCC to emit a bogus diagnostic in some cases.
16898
16899 * image.c: Integer signedness and overflow and related fixes.
16900 This is not an exhaustive set of fixes, but it's time to
16901 record what I've got.
16902 (lookup_pixel_color, check_image_size): Remove redundant decls.
16903 (check_image_size): Don't assume that arbitrary EMACS_INT values
16904 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16905 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16906 (tiff_load, imagemagick_load_image):
16907 Check for overflow in size calculations.
16908 (x_create_x_image_and_pixmap): Remove unnecessary test for
16909 xmalloc returning NULL; that can't happen.
16910 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16911 (xpm_color_bucket): Use better integer hashing function.
16912 (xpm_cache_color): Don't possibly over-allocate memory.
16913 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16914 (gif_memory_source):
16915 Use ptrdiff_t, not int or size_t, to record sizes.
16916 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16917 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16918 either works, as we prefer signed integers.
16919 (tiff_read_from_memory, tiff_write_from_memory):
16920 Return tsize_t, not size_t, since that's what the TIFF API wants.
16921 (tiff_read_from_memory): Don't fail simply because the read would
16922 go past EOF; instead, return a short read.
16923 (tiff_load): Omit no-longer-needed casts.
16924 (Fimagemagick_types): Don't assume size fits into 'int'.
16925
16926 Improve hashing quality when configured --with-wide-int.
16927 * fns.c (hash_string): New function, taken from sxhash_string.
16928 Do not discard information about ASCII character case; this
16929 discarding is no longer needed.
16930 (sxhash-string): Use it. Change sig to match it. Caller changed.
16931 * lisp.h: Declare it.
16932 * lread.c (hash_string): Remove, since we now use fns.c's version.
16933 The fns.c version returns a wider integer if --with-wide-int is
16934 specified, so this should help the quality of the hashing a bit.
16935
16936 * emacs.c: Integer overflow minor fix.
16937 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16938 Define only if GNU_LINUX.
16939 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16940
16941 * dispnew.c: Integer signedness and overflow fixes.
16942 Remove unnecessary forward decls, that were a maintenance hassle.
16943 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16944 All uses changed.
16945 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16946 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16947 (prepare_desired_row, line_draw_cost):
16948 Use int, not unsigned, where either works.
16949 (save_current_matrix, restore_current_matrix):
16950 Use ptrdiff_t, not size_t, where either works.
16951 (init_display): Check for overflow more accurately, and without
16952 relying on undefined behavior.
16953
16954 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16955 Remove, replacing with the new symbols in lisp.h. All uses changed.
16956 * fileio.c (make_temp_name):
16957 * filelock.c (lock_file_1, lock_file):
16958 * xdisp.c (message_dolog):
16959 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16960 Use pMd etc. instead.
16961 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16962 replacing the pWIDE etc. symbols removed from editfns.c.
16963
16964 * keyboard.h (num_input_events): Now uintmax_t.
16965 This is (very slightly) less likely to mess up due to wraparound.
16966 All uses changed.
16967
16968 * buffer.c: Integer signedness fixes.
16969 (alloc_buffer_text, enlarge_buffer_text):
16970 Use ptrdiff_t rather than size_t when either will do, as we prefer
16971 signed integers.
16972
16973 * alloc.c: Integer signedness and overflow fixes.
16974 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16975 (__malloc_size_t): Default to size_t, not to int.
16976 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16977 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16978 Prefer ptrdiff_t to size_t when either would do, as we prefer
16979 signed integers.
16980 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16981 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16982 Now const. Initialize with values that are in range even if char
16983 is signed.
16984 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16985 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16986 These functions do the right thing with sizes > 2**32.
16987 (check_depth): Now ptrdiff_t, not int.
16988 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16989 Adjust to new way of storing sizes. Check for size overflow bugs
16990 in rest of code.
16991 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16992 slightly wrong anyway, as it missed one instance of
16993 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16994 (refill_memory_reserve): Omit needless cast to size_t.
16995 (mark_object_loop_halt): Mark as externally visible.
16996
16997 * xselect.c: Integer signedness and overflow fixes.
16998 (Fx_register_dnd_atom, x_handle_dnd_message):
16999 Use ptrdiff_t, not size_t, since we prefer signed.
17000 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17001 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17002 x_dnd_atoms_size and x_dnd_atoms_length.
17003
17004 * doprnt.c: Prefer signed to unsigned when either works.
17005 * eval.c (verror):
17006 * doprnt.c (doprnt):
17007 * lisp.h (doprnt):
17008 * xdisp.c (vmessage):
17009 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17010 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17011 prefer signed arithmetic to avoid comparison confusion.
17012 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17013 but is a bit tricky.
17014
17015 Assume freestanding C89 headers, string.h, stdlib.h.
17016 * data.c, doprnt.c, floatfns.c, print.c:
17017 Include float.h unconditionally.
17018 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17019 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17020 * regex.c: Likewise for stddef.h, string.h.
17021 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17022 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17023 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17024 (STDC_HEADERS): Remove obsolete defines.
17025 * sysdep.c: Include limits.h unconditionally.
17026
17027 Assume support for memcmp, memcpy, memmove, memset.
17028 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17029 * regex.c (memcmp, memcpy):
17030 Remove; we assume C89 now.
17031
17032 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17033 (__malloc_safe_bcopy): Remove; no longer needed.
17034
17035 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17036 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17037 well either way, and we prefer signed to unsigned.
17038
17039 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17040
17041 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17042 closes the connection while we're reading (bug#9182).
17043
17044 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
17045
17046 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17047 are specified (Bug#9168).
17048
17049 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17050
17051 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17052 Found by GCC static checking and --with-wide-int on a 32-bit host.
17053
17054 2011-07-25 Eli Zaretskii <eliz@gnu.org>
17055
17056 * xdisp.c (compute_display_string_pos): Fix logic of caching
17057 previous display string position. Initialize cached_prev_pos to
17058 -1. Fixes slow-down at the beginning of a buffer.
17059
17060 2011-07-24 Eli Zaretskii <eliz@gnu.org>
17061
17062 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17063 for attrs[LFACE_FONTSET_INDEX].
17064
17065 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17066
17067 * xml.c (parse_region): Remove unused local
17068 that was recently introduced.
17069
17070 2011-07-23 Eli Zaretskii <eliz@gnu.org>
17071
17072 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17073 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17074
17075 * xdisp.c (move_it_in_display_line_to): Record the best matching
17076 position for TO_CHARPOS while scanning the line, and restore it on
17077 exit if none of the characters scanned was an exact match.
17078 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17079 when exact match is impossible due to invisible text, and the
17080 lines are truncated.
17081
17082 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17083
17084 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17085 for OSX >= 10.7.
17086
17087 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17088
17089 Fix a significant slow-down of cursor motion with C-n, C-p,
17090 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17091 auto-repeat under bidi redisplay in fontified buffers.
17092 * xdisp.c (compute_stop_pos_backwards): New function.
17093 (next_element_from_buffer): Call compute_stop_pos_backwards to
17094 find a suitable prev_stop when we find ourselves before
17095 base_level_stop.
17096 (reseat): Don't look for prev_stop, as that could mean a very long
17097 run.
17098 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17099 <cached_disp_overlay_modiff>: Cache for last found display string
17100 position.
17101 (compute_display_string_pos): Return the cached position if asked
17102 about the same buffer in the same area of character positions, and
17103 the buffer wasn't changed since the time the display string
17104 position was cached.
17105
17106 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17107
17108 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17109 is an integer, which is important for empty lines. (Bug#9149)
17110
17111 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17112
17113 * frame.c (Fmodify_frame_parameters): In tty case, update the
17114 default face if necessary (Bug#4238).
17115
17116 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17117
17118 * editfns.c (Fstring_to_char): No need to explain what a character
17119 is in the docstring (Bug#6576).
17120
17121 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17122
17123 * xml.c (parse_region): Make sure we always return a tree.
17124
17125 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17126
17127 * xml.c (parse_region): If a document contains only comments,
17128 return that, too.
17129
17130 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17131
17132 * xml.c (make_dom): Return comments, too.
17133
17134 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17135
17136 Port to OpenBSD.
17137 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17138 and the surrounding thread.
17139 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17140 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17141 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17142 timer goes off.
17143 * s/openbsd.h (BROKEN_SIGIO): Define.
17144 * unexelf.c (unexec) [__OpenBSD__]:
17145 Don't update the .mdebug section of the Alpha COFF symbol table.
17146
17147 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17148
17149 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17150 (bug#8460).
17151
17152 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17153
17154 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17155 This fixes some race conditions on the permissions of any newly
17156 created file.
17157
17158 * alloc.c (valid_pointer_p): Use pipe, not open.
17159 This fixes some permissions issues when debugging.
17160
17161 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17162 If fchown fails to set both uid and gid, try to set just gid,
17163 as that is sometimes allowed. Adjust the file's mode to eliminate
17164 setuid or setgid bits that are inappropriate if fchown fails.
17165
17166 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17167
17168 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17169 to compare Lisp_Objects.
17170 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17171 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17172 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17173
17174 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17175
17176 * lread.c (read_integer): Unread even EOF character.
17177 (read1): Likewise. Properly record start position of symbol.
17178
17179 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17180 symbol character follows.
17181
17182 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17183
17184 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17185 This works around a problem with the previous change to Fcopy_file.
17186 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17187 and without this change, GCC might complain about discarding
17188 fchown's return value.
17189
17190 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17191
17192 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17193
17194 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17195
17196 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17197
17198 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17199
17200 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17201 it's used from the C level.
17202
17203 * process.c: Use the same condition for POLL_FOR_INPUT in both
17204 keyboard.c and process.c (bug#1858).
17205
17206 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17207
17208 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17209 (Fgnutls_boot): Use it.
17210
17211 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17212
17213 * doc.c (Fsubstitute_command_keys): Revert last change.
17214
17215 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17216
17217 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17218 quotes the next character, and doesn't affect other longer
17219 sequences (bug#8935).
17220
17221 * lread.c (syms_of_lread): Clarify that is isn't only
17222 `eval-buffer' and `eval-defun' that's affected by
17223 `lexical-binding' (bug#8460).
17224
17225 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17226
17227 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17228 bidi redisplay when a line includes both an image and is truncated.
17229
17230 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17231
17232 Fix minor problems found by static checking.
17233 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17234 (elsz): Now a signed constant, not a size_t var. We prefer signed
17235 types to unsigned, to avoid integer comparison confusion. Without
17236 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17237 "cannot optimize loop, the loop counter may overflow", a symptom
17238 of the confusion.
17239 * indent.c (Fvertical_motion): Mark locals as initialized.
17240 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17241
17242 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17243
17244 * search.c (Fre_search_backward): Mention `case-fold-search' in
17245 all the re_search_* functions (bug#8138).
17246
17247 * keyboard.c (Fopen_dribble_file): Document when the file is
17248 closed (bug#8056).
17249
17250 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17251
17252 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17253 bidi_cache_idx.
17254
17255 Support bidi reordering of display and overlay strings.
17256 * xdisp.c (compute_display_string_pos)
17257 (compute_display_string_end): Accept additional argument STRING.
17258 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17259 (reseat_to_string): Initialize bidi_it->string.s and
17260 bidi_it->string.schars.
17261 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17262 NULL (avoids a crash in bidi_paragraph_init).
17263 Initialize itb.string.lstring.
17264 (init_iterator): Call bidi_init_it only of a valid
17265 buffer position was specified. Initialize paragraph_embedding to
17266 L2R.
17267 (reseat_to_string): Initialize the bidi iterator.
17268 (display_string): If we need to ignore text properties of
17269 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17270 original value of -1 will not work with bidi.)
17271 (compute_display_string_pos): First arg is now struct
17272 `text_pos *'; all callers changed. Support display properties on
17273 Lisp strings.
17274 (compute_display_string_end): Support display properties on Lisp
17275 strings.
17276 (init_iterator, reseat_1, reseat_to_string): Initialize the
17277 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17278 when iterating on a string not from display properties).
17279 (compute_display_string_pos, compute_display_string_end):
17280 Fix calculation of the object to scan. Fixes an error when using
17281 arrow keys.
17282 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17283 base_level_stop; instead, set base_level_stop to BEGV.
17284 Fixes crashes in vertical-motion.
17285 (next_element_from_buffer): Improve commentary for when
17286 the iterator is before prev_stop.
17287 (init_iterator): Initialize bidi_p from the default value of
17288 bidi-display-reordering, not from buffer-local value. Use the
17289 buffer-local value only if initializing for buffer iteration.
17290 (handle_invisible_prop): Support invisible properties on strings
17291 that are being bidi-reordered.
17292 (set_iterator_to_next): Support bidi reordering of C strings and
17293 Lisp strings.
17294 (next_element_from_string): Support bidi reordering of Lisp
17295 strings.
17296 (handle_stop_backwards): Support Lisp strings as well.
17297 (display_string): Support display of R2L glyph rows.
17298 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17299 (init_iterator): Don't initialize it->bidi_p for strings
17300 here.
17301 (reseat_to_string): Initialize it->bidi_p for strings here.
17302 (next_element_from_string, next_element_from_c_string)
17303 (next_element_from_buffer): Add xassert's for correspondence
17304 between IT's object being iterated and it->bidi_it.string
17305 structure.
17306 (face_before_or_after_it_pos): Support bidi iteration.
17307 (next_element_from_c_string): Handle the case of the first string
17308 character that is not the first one in the visual order.
17309 (get_visually_first_element): New function, refactored from common
17310 parts of next_element_from_buffer, next_element_from_string, and
17311 next_element_from_c_string.
17312 (tool_bar_lines_needed, redisplay_tool_bar)
17313 (display_menu_bar): Force left-to-right direction. Add a FIXME
17314 comment for making that be controlled by a user option.
17315 (push_it, pop_it): Save and restore the state of the
17316 bidi iterator. Save and restore the bidi_p flag.
17317 (pop_it): Iterate out of display property for string iteration as
17318 well.
17319 (iterate_out_of_display_property): Support iteration over strings.
17320 (handle_single_display_spec): Set up it->bidi_it for iteration
17321 over a display string, and call bidi_init_it.
17322 (handle_single_display_spec, next_overlay_string)
17323 (get_overlay_strings_1, push_display_prop): Set up the bidi
17324 iterator for displaying display or overlay strings.
17325 (forward_to_next_line_start): Don't use the shortcut if
17326 bidi-iterating.
17327 (back_to_previous_visible_line_start): If handle_display_prop
17328 pushed the iterator stack, restore the internal state of the bidi
17329 iterator by calling bidi_pop_it same number of times.
17330 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17331 and we are bidi-iterating, don't decrement the iterator position;
17332 instead, set the first_elt flag in the bidi iterator, to produce
17333 the same effect.
17334 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17335 (push_display_prop): xassert that we are iterating a buffer.
17336 (push_it, pop_it): Save and restore paragraph_embedding member.
17337 (handle_single_display_spec, next_overlay_string)
17338 (get_overlay_strings_1, reseat_1, reseat_to_string)
17339 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17340 correctly. Don't assume unibyte strings are not bidi-reordered.
17341 (compute_display_string_pos)
17342 (compute_display_string_end): Fix handling the case of C string.
17343 (push_it, pop_it): Save and restore from_disp_prop_p.
17344 (handle_single_display_spec, push_display_prop): Set the
17345 from_disp_prop_p flag.
17346 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17347 (pop_it): Call iterate_out_of_display_property only if we are
17348 popping after iteration over a string that came from a display
17349 property. Fix a typo in popping stretch info. Add an assertion
17350 for verifying that the iterator position is in sync with the bidi
17351 iterator.
17352 (handle_single_display_spec, get_overlay_strings_1)
17353 (push_display_prop): Fix initialization of paragraph direction for
17354 string when that of the parent object is not yet determined.
17355 (reseat_1): Call bidi_init_it to resync the bidi
17356 iterator with IT's position. (Bug#7616)
17357 (find_row_edges): If ROW->start.pos gives position
17358 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17359 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17360 Reset the from_disp_prop_p flag.
17361 (SAVE_IT, RESTORE_IT): New macros.
17362 (pos_visible_p, face_before_or_after_it_pos)
17363 (back_to_previous_visible_line_start)
17364 (move_it_in_display_line_to, move_it_in_display_line)
17365 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17366 (try_scrolling, redisplay_window, display_line): Use them when
17367 saving a temporary copy of the iterator and restoring it back.
17368 (back_to_previous_visible_line_start, reseat_1)
17369 (init_iterator): Empty the bidi cache "stack".
17370 (move_it_in_display_line_to): If iterator ended up at
17371 EOL, but we never saw any buffer positions smaller than
17372 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17373 motion in bidi-reordered lines.
17374 (move_it_in_display_line_to): Record prev_method and prev_pos
17375 immediately before the call to set_iterator_to_next. Fixes cursor
17376 motion in bidi-reordered lines with stretch glyphs and strings
17377 displayed in margins. (Bug#8133) (Bug#8867)
17378 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17379 TO_CHARPOS.
17380 (pos_visible_p): Support positions in bidi-reordered lines.
17381 Save and restore bidi cache.
17382
17383 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17384 (bidi_paragraph_info): Delete unused struct.
17385 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17386 (bidi_cache_start): New variable.
17387 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17388 to zero.
17389 (bidi_cache_fetch_state, bidi_cache_search)
17390 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17391 (bidi_cache_find, bidi_peek_at_next_level)
17392 (bidi_level_of_next_char, bidi_find_other_level_edge)
17393 (bidi_move_to_visually_next): Compare cache index with
17394 bidi_cache_start rather than with zero.
17395 (bidi_fetch_char): Accept new argument STRING; all callers
17396 changed. Support iteration over a string. Support strings with
17397 display properties. Support unibyte strings. Fix the type of
17398 `len' according to what STRING_CHAR_AND_LENGTH expects.
17399 (bidi_paragraph_init, bidi_resolve_explicit_1)
17400 (bidi_resolve_explicit, bidi_resolve_weak)
17401 (bidi_level_of_next_char, bidi_move_to_visually_next):
17402 Support iteration over a string.
17403 (bidi_set_sor_type, bidi_resolve_explicit_1)
17404 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17405 can now be zero (for strings); special values 0 and -1 were
17406 changed to -1 and -2, respectively.
17407 (bidi_char_at_pos): New function.
17408 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17409 Call it instead of FETCH_MULTIBYTE_CHAR.
17410 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17411 initialized to valid values.
17412 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17413 values.
17414 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17415 the test for valid cached positions. Fix the logic for looking up
17416 the sentinel state in the cache. GCPRO the Lisp string we are
17417 iterating.
17418 (bidi_push_it, bidi_pop_it): New functions.
17419 (bidi_initialize): Initialize the bidi cache start stack pointer.
17420 (bidi_cache_ensure_space): New function, refactored from part of
17421 bidi_cache_iterator_state. Don't assume the required size is just
17422 one BIDI_CACHE_CHUNK away.
17423 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17424 (bidi_count_bytes, bidi_char_at_pos): New functions.
17425 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17426 always valid if bidi_cache_idx is valid.
17427 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17428 is valid if it's going to be used.
17429 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17430 (bidi_cache_fetch_state, bidi_cache_search)
17431 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17432 (bidi_cache_iterator_state, bidi_cache_find)
17433 (bidi_find_other_level_edge, bidi_cache_start_stack):
17434 All variables related to cache indices are now EMACS_INT.
17435
17436 * dispextern.h (struct bidi_string_data): New structure.
17437 (struct bidi_it): New member `string'. Make flag members be 1-bit
17438 fields, and put them last in the struct.
17439 (compute_display_string_pos, compute_display_string_end):
17440 Update prototypes.
17441 (bidi_push_it, bidi_pop_it): Add prototypes.
17442 (struct iterator_stack_entry): New members bidi_p,
17443 paragraph_embedding, and from_disp_prop_p.
17444 (struct it): Member bidi_p is now a bit field 1 bit wide.
17445 (bidi_shelve_cache, bidi_unshelve_cache):
17446 Declare prototypes.
17447
17448 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17449 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17450 and vector-like objects.
17451
17452 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17453 cache around display iteration.
17454
17455 * window.c (Fwindow_end, window_scroll_pixel_based)
17456 (displayed_window_lines, Frecenter): Save and restore the bidi
17457 cache around display iteration.
17458
17459 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17460
17461 * editfns.c (Fdelete_region): Clarify the use of the named
17462 parameters (bug#6788).
17463
17464 2011-07-14 Martin Rudalics <rudalics@gmx.at>
17465
17466 * indent.c (Fvertical_motion): Set and restore w->pointm when
17467 saving and restoring the window's buffer (Bug#9006).
17468
17469 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17470
17471 * editfns.c (Fstring_to_char): Clarify just what is returned
17472 (bug#6576). Text by Eli Zaretskii.
17473
17474 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
17475
17476 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17477
17478 2011-07-13 Eli Zaretskii <eliz@gnu.org>
17479
17480 * buffer.c (mmap_find): Fix a typo.
17481
17482 2011-07-13 Johan Bockgård <bojohan@gnu.org>
17483
17484 Fix execution of x selection hooks.
17485 * xselect.c (Qx_lost_selection_functions)
17486 (Qx_sent_selection_functions): New vars.
17487 (syms_of_xselect): DEFSYM them.
17488 (x_handle_selection_request): Pass Qx_sent_selection_functions
17489 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17490 (x_handle_selection_clear,x_clear_frame_selections):
17491 Pass Qx_lost_selection_functions rather than
17492 Vx_lost_selection_functions to Frun_hook_with_args.
17493
17494 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17495
17496 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17497 The old code sometimes used this field without initializing it.
17498
17499 * alloc.c (gc_sweep): Don't read past end of array.
17500 In theory, the old code could also have corrupted Emacs internals,
17501 though it'd be very unlikely.
17502
17503 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17504
17505 * character.c (Fcharacterp): Don't advertise optional ignored
17506 argument. (Bug#4026)
17507
17508 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17509
17510 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17511 key" (bug#4257).
17512
17513 * window.c (Fset_window_start): Doc fix (bug#4199).
17514 (Fset_window_hscroll): Ditto.
17515
17516 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17517
17518 Fix minor new problems caught by GCC 4.6.1.
17519 * term.c (init_tty): Remove unused local.
17520 * xsettings.c (store_monospaced_changed): Define this function only
17521 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17522 not used otherwise.
17523
17524 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
17525
17526 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17527
17528 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17529
17530 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17531 are the mini-buffer and the echo area (bug#3320).
17532
17533 * term.c (init_tty): Remove support for supdup, c10 and perq
17534 terminals, which are no longer supported (bug#1482).
17535
17536 2011-07-10 Johan Bockgård <bojohan@gnu.org>
17537
17538 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17539
17540 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17541
17542 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17543 for non-popups (Bug#3642).
17544
17545 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17546
17547 * alloc.c (reset_malloc_hooks): Protoize.
17548 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17549 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17550 * cm.c (losecursor): Likewise.
17551 * data.c (fmod): Likewise.
17552 * dispnew.c (swap_glyphs_in_rows): Likewise.
17553 * emacs.c (memory_warning_signal): Likewise.
17554 * floatfns.c (float_error): Likewise.
17555 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17556 (otf_open, font_otf_capability, generate_otf_features)
17557 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17558 Likewise.
17559 * image.c (pbm_read_file): Likewise.
17560 * indent.c (string_display_width): Likewise.
17561 * intervals.c (check_for_interval, search_for_interval)
17562 (inc_interval_count, count_intervals, root_interval)
17563 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17564 * lread.c (defalias): Likewise.
17565 * ralloc.c (r_alloc_check): Likewise.
17566 * regex.c (set_image_of_range_1, set_image_of_range)
17567 (regex_grow_registers): Likewise.
17568 * sysdep.c (strerror): Likewise.
17569 * termcap.c (valid_filename_p, tprint, main): Likewise.
17570 * tparam.c (main): Likewise.
17571 * unexhp9k800.c (run_time_remap, save_data_space)
17572 (update_file_ptrs, read_header, write_header, calculate_checksum)
17573 (copy_file, copy_rest, display_header): Likewise.
17574 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17575 Likewise.
17576 * xdisp.c (check_it): Likewise.
17577 * xfaces.c (register_color, unregister_color, unregister_colors):
17578 Likewise.
17579 * xfns.c (print_fontset_result): Likewise.
17580 * xrdb.c (member, fatal, main): Likewise.
17581
17582 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17583
17584 Fix minor problems found by static checking (Bug#9031).
17585 * chartab.c (char_table_set_range, map_sub_char_table):
17586 Remove unused locals.
17587 (uniprop_table): Now static.
17588 * composite.c (_work_char): Remove unused static var.
17589
17590 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
17591
17592 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17593
17594 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17595
17596 * gtkutil.c (qttip_cb): Remove code without function.
17597
17598 2011-07-09 Eli Zaretskii <eliz@gnu.org>
17599
17600 * w32.c (pthread_sigmask): New stub.
17601
17602 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
17603
17604 Use pthread_sigmask, not sigprocmask (Bug#9010).
17605 sigprocmask is portable only for single-threaded applications, and
17606 Emacs can be multi-threaded when it uses GTK.
17607 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17608 (LIBES): Use it.
17609 * callproc.c (Fcall_process):
17610 * process.c (create_process):
17611 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17612 Use pthread_sigmask, not sigprocmask.
17613
17614 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17615
17616 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17617 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17618 wrong (Bug#8591).
17619
17620 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17621
17622 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17623 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17624 (xg_hide_tooltip): Fix comment.
17625
17626 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17627 in registerServicesMenuSendTypes.
17628 (validRequestorForSendType): Don't check ns_return_types.
17629
17630 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17631 ns_return_type.
17632
17633 2011-07-08 Jason Rumney <jasonr@gnu.org>
17634
17635 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17636 SH_SHOW for hidden windows (Bug#5482).
17637
17638 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17639 frame struct members of non-existent frames (Bug#6284).
17640
17641 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17642
17643 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17644 variable firstTime not needed on OSX >= 10.6.
17645 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17646 >= 10.5. Use setKnobProportion, setDoubleValue.
17647
17648 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17649 (MAC_OS_X_VERSION_10_5): Define if not defined.
17650 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17651 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17652 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17653
17654 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17655 cString and lossyCString on OSX >= 10.4.
17656
17657 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17658 sizeToFit on OSX >= 10.2.
17659
17660 * nsimage.m (allocInitFromFile): Don't use deprecated method
17661 bestRepresentationForDevice on OSX >= 10.6.
17662
17663 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17664 to avoid warning.
17665
17666 * emacs.c: Declare unexec_init_emacs_zone.
17667
17668 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17669
17670 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17671
17672 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17673 on svcsMenu (Bug#8842).
17674
17675 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17676 ns_return_types.
17677 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17678
17679 * nsterm.m (QUTF8_STRING): Declare.
17680 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17681 (validRequestorForSendType): Return type is (id).
17682 Change indexOfObjectIdenticalTo to indexOfObject.
17683 Check if we have local selection before returning self (Bug#8842).
17684 (writeSelectionToPasteboard): Put local selection into paste board
17685 if we have a local selection (Bug#8842).
17686 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17687
17688 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17689 (ns_get_local_selection): Declare.
17690
17691 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17692
17693 * keymap.c (describe_map_tree): Don't insert a double newline at
17694 the end of the buffer (bug#1169) and return whether we inserted
17695 something.
17696
17697 * callint.c (Fcall_interactively): Change "reading args" to
17698 "providing args" to try to clarify what it does (bug#1010).
17699
17700 2011-07-07 Kenichi Handa <handa@m17n.org>
17701
17702 * composite.c (composition_compute_stop_pos): Ignore a static
17703 composition starting before CHARPOS (Bug#8915).
17704
17705 * xdisp.c (handle_composition_prop): Likewise.
17706
17707 2011-07-07 Eli Zaretskii <eliz@gnu.org>
17708
17709 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17710 (Bug#9015)
17711
17712 2011-07-07 Kenichi Handa <handa@m17n.org>
17713
17714 * character.h (unicode_category_t): New enum type.
17715
17716 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17717 (Qchar_code_property_table): New variable.
17718 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17719 (UNIPROP_COMPRESSED_FORM_P): New macros.
17720 (char_table_ascii): Uncompress the compressed values.
17721 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17722 Uncompress the compressed values.
17723 (sub_char_table_ref_and_range): Likewise.
17724 (char_table_ref_and_range): Uncompress the compressed values.
17725 (sub_char_table_set): New arg is_uniprop. Callers changed.
17726 Uncompress the compressed values.
17727 (sub_char_table_set_range): Args changed. Callers changed.
17728 (char_table_set_range): Adjuted for the above change.
17729 (map_sub_char_table): Delete args default_val and parent. Add arg
17730 top. Give decoded values to a Lisp function.
17731 (map_char_table): Adjust for the above change. Give decoded
17732 values to a Lisp function. Gcpro more variables.
17733 (uniprop_table_uncompress)
17734 (uniprop_decode_value_run_length): New functions.
17735 (uniprop_decoder, uniprop_decoder_count): New variables.
17736 (uniprop_get_decoder, uniprop_encode_value_character)
17737 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17738 New functions.
17739 (uniprop_encoder, uniprop_encoder_count): New variables.
17740 (uniprop_get_encoder, uniprop_table)
17741 (Funicode_property_table_internal, Fget_unicode_property_internal)
17742 (Fput_unicode_property_internal): New functions.
17743 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17744 Sunicode_property_table_internal, Sget_unicode_property_internal,
17745 and Sput_unicode_property_internal. Defvar_lisp
17746 char-code-property-alist.
17747
17748 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17749 Vunicode_category_table.
17750
17751 * font.c (font_range): Adjust for the change of
17752 Vunicode_category_table.
17753
17754 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17755
17756 * m/iris4d.h: Remove file, move contents ...
17757 * s/irix6-5.h: ... here.
17758
17759 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17760
17761 Remove unportable assumption about struct layout (Bug#8884).
17762 * alloc.c (mark_buffer):
17763 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17764 (clone_per_buffer_values): Don't assume that
17765 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17766 This isn't true in general, and it's particularly not true
17767 if Emacs is configured with --with-wide-int.
17768 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17769 New macros, used in the buffer.c change.
17770
17771 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17772
17773 * xsettings.c: Use both GConf and GSettings if both are available.
17774 (store_config_changed_event): Add comment.
17775 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17776 (store_tool_bar_style_changed): New functions.
17777 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
17778 (struct xsettings): Move font inside HAVE_XFT.
17779 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17780 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17781 Move inside HAVE_XFT.
17782 (something_changed_gsettingsCB): Rename from something_changedCB.
17783 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17784 also.
17785 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17786 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
17787 (something_changed_gconfCB): Rename from something_changedCB.
17788 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17789 (parse_settings): Move check for font inside HAVE_XFT.
17790 (read_settings, apply_xft_settings): Add comment.
17791 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17792 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17793 call store_font_name_changed.
17794 (xft_settings_event): Add comment.
17795 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17796 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17797 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17798 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17799 (xsettings_initialize): Call init_gsettings last.
17800 (xsettings_get_system_font, xsettings_get_system_normal_font):
17801 Add comment.
17802
17803 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17804
17805 Random fixes. E.g., (random) never returned negative values.
17806 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17807 subseconds part to the entropy, as that's a bit more random.
17808 Prefer signed to unsigned, since the signedness doesn't matter and
17809 in general we prefer signed. When given a limit, use a
17810 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17811 latter isn't right if USE_2_TAGS_FOR_INTS.
17812 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17813 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17814
17815 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17816
17817 * textprop.c (text_property_stickiness):
17818 Obey Vtext_property_default_nonsticky.
17819 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17820 * w32fns.c (syms_of_w32fns):
17821 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17822
17823 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17824
17825 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17826 This is more efficient than Ffile_directory_p and avoids a minor race.
17827
17828 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17829
17830 * buffer.c (Foverlay_put): Say what the return value is
17831 (bug#7835).
17832
17833 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17834 is a directory before asking whether to use the file name
17835 (bug#7564).
17836 (barf_or_query_if_file_exists): Make the "File is a directory"
17837 error be more correct.
17838
17839 * fns.c (Frequire): Remove the mention of the .gz files, since
17840 that's installation-specific, but keep the mention of
17841 `get-load-suffixes'.
17842
17843 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17844
17845 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17846 Report string overflow if the output is too long.
17847
17848 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
17849
17850 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17851 (syms_of_gnutls): Remove duplicate DEFSYM for
17852 Qgnutls_bootprop_verify_hostname_error, an error for
17853 Qgnutls_bootprop_verify_error (which is no longer used).
17854
17855 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17856 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17857 Also (re)move comments that are misplaced or no longer relevant.
17858
17859 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17860
17861 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17862
17863 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
17864
17865 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17866 and background color parameters if they have been changed.
17867
17868 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17869
17870 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17871
17872 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17873
17874 * xsettings.c (SYSTEM_FONT): Define only when used.
17875 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17876
17877 * keymap.c (access_keymap_1): Now static.
17878
17879 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
17880
17881 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17882 leave any prefix arg for the up event (Bug#1586).
17883
17884 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17885
17886 * lread.c (syms_of_lread): Mention single symbols defined by
17887 `defvar' or `defconst' (bug#7154).
17888
17889 * fns.c (Frequire): Mention .el.gz files (bug#7314).
17890 (Frequire): Mention get-load-suffixes.
17891
17892 2011-07-02 Martin Rudalics <rudalics@gmx.at>
17893
17894 * window.h (window): Remove clone_number slot.
17895 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17896 Remove.
17897 (make_parent_window, make_window, saved_window)
17898 (Fset_window_configuration, save_window_save): Don't deal with
17899 clone numbers.
17900 * buffer.c (Qclone_number): Remove declaration.
17901 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17902
17903 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17904
17905 Add multiple inheritance to keymaps.
17906 * keymap.c (Fmake_composed_keymap): New function.
17907 (Fset_keymap_parent): Simplify.
17908 (fix_submap_inheritance): Remove.
17909 (access_keymap_1): New function extracted from access_keymap to handle
17910 embedded parents and handle lists of maps.
17911 (access_keymap): Use it.
17912 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17913 (Fcopy_keymap): Handle embedded parents.
17914 (Fcommand_remapping, define_as_prefix): Simplify.
17915 (Fkey_binding): Simplify.
17916 (syms_of_keymap): Move minibuffer-local-completion-map,
17917 minibuffer-local-filename-completion-map,
17918 minibuffer-local-must-match-map, and
17919 minibuffer-local-filename-must-match-map to Elisp.
17920 (syms_of_keymap): Defsubr make-composed-keymap.
17921 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17922 (parse_menu_item): Trivial simplification.
17923
17924 2011-07-01 Glenn Morris <rgm@gnu.org>
17925
17926 * Makefile.in (SETTINGS_LIBS): Fix typo.
17927
17928 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
17929
17930 * coding.c (Fencode_coding_string): Record the last coding system
17931 used, as the function doc string says (bug#8738).
17932
17933 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17934
17935 * xsettings.c (store_monospaced_changed): Take new font as arg and
17936 check for change against current_mono_font.
17937 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17938 (emacs_settings_constructor, emacs_settings_get_property)
17939 (emacs_settings_set_property, emacs_settings_class_init)
17940 (emacs_settings_init, gsettings_obj): Remove.
17941 (something_changedCB): New function for HAVE_GSETTINGS.
17942 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17943 with value as argument.
17944 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17945 g_settings_new (Bug#8967). Do not create gsettings_obj.
17946 Remove calls to g_settings_bind. Connect something_changedCB to
17947 "changed".
17948
17949 * xgselect.c: Add defined (HAVE_GSETTINGS).
17950 (xgselect_initialize): Ditto.
17951
17952 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17953 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17954 xg_select.
17955
17956 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17957
17958 * eval.c (struct backtrace): Simplify and port the data structure.
17959 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17960 signed bit field, as this assumption is not portable and it makes
17961 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17962 "char debug_on_exit : 1" as this is not portable either; instead,
17963 use the portable "unsigned int debug_on_exit : 1". Remove unused
17964 member evalargs. Remove obsolete comments about cc bombing out.
17965
17966 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17967
17968 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17969 Let HAVE_GSETTINGS override HAVE_GCONF.
17970 (store_monospaced_changed): New function.
17971 (EMACS_SETTINGS): A new type derived from GObject to handle
17972 GSettings notifications.
17973 (emacs_settings_constructor, emacs_settings_get_property)
17974 (emacs_settings_set_property, emacs_settings_class_init):
17975 New functions.
17976 (gsettings_client, gsettings_obj): New variables.
17977 (GSETTINGS_SCHEMA): New define.
17978 (something_changedCB): Call store_monospaced_changed.
17979 (init_gsettings): New function.
17980 (xsettings_initialize): Call init_gsettings.
17981 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17982 to NULL.
17983
17984 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17985 GCONF_CFLAGS/LIBS.
17986
17987 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17988
17989 * window.c (resize_root_window, grow_mini_window)
17990 (shrink_mini_window): Rename Qresize_root_window to
17991 Qwindow_resize_root_window and Qresize_root_window_vertically to
17992 Qwindow_resize_root_window_vertically.
17993
17994 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17995
17996 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17997
17998 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17999
18000 * makefile.w32-in: Redesign dependencies so they reflect more
18001 clearly which files are directly included by each source file,
18002 and not through other includes.
18003
18004 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18005
18006 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18007 (sort_overlays, overlay_strings): When an overlay's clone number
18008 matches the window's clone number process the overlay even if
18009 the overlay's window property doesn't match the current window.
18010
18011 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18012 (Fwindow_hchild): Rename to Fwindow_left_child.
18013 (Fwindow_next): Rename to Fwindow_next_sibling.
18014 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18015 (resize_window_check): Rename to window_resize_check.
18016 (resize_window_apply): Rename to window_resize_apply.
18017 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18018 (Fdelete_other_windows_internal, resize_frame_windows)
18019 (Fsplit_window_internal, Fdelete_window_internal)
18020 (grow_mini_window, shrink_mini_window)
18021 (Fresize_mini_window_internal): Fix callers accordingly.
18022
18023 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18024
18025 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18026 (emacs_fixed_set_min_size): Remove.
18027 (emacs_fixed_new): Take frame as argument.
18028
18029 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18030 (_EmacsFixedPrivate): Remove minwidth/height.
18031 Add struct frame *f.
18032 (emacs_fixed_init): Initialize priv->f.
18033 (get_parent_class, emacs_fixed_set_min_size): Remove.
18034 (emacs_fixed_new): Set priv->f to argument.
18035 (emacs_fixed_get_preferred_width)
18036 (emacs_fixed_get_preferred_height): Use min_width/height from
18037 frames size_hint to set minimum and natural (Bug#8919).
18038 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18039 and use min_width/height from frames size_hint to set
18040 min_width/height (Bug#8919).
18041
18042 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18043 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18044 Fix indentation.
18045
18046 2011-06-26 Eli Zaretskii <eliz@gnu.org>
18047
18048 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18049 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18050 called at ZV.
18051
18052 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
18053
18054 * process.c (wait_reading_process_output): Bypass select if
18055 waiting for a cell while ignoring keyboard input, and input is
18056 pending. Suggested by Jan Djärv (Bug#8869).
18057
18058 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18059
18060 Use gnulib's dup2 module instead of rolling our own.
18061 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18062
18063 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18064
18065 * dispnew.c (scrolling_window): Before scrolling, turn off a
18066 mouse-highlight in the window being scrolled.
18067
18068 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
18069
18070 Move DEFSYM to lisp.h and use everywhere.
18071
18072 * character.h (DEFSYM): Move declaration...
18073 * lisp.h (DEFSYM): ...here.
18074
18075 * gnutls.c:
18076 * minibuf.c:
18077 * w32menu.c:
18078 * w32proc.c:
18079 * w32select.c: Don't include character.h.
18080
18081 * alloc.c (syms_of_alloc):
18082 * buffer.c (syms_of_buffer):
18083 * bytecode.c (syms_of_bytecode):
18084 * callint.c (syms_of_callint):
18085 * casefiddle.c (syms_of_casefiddle):
18086 * casetab.c (init_casetab_once):
18087 * category.c (init_category_once, syms_of_category):
18088 * ccl.c (syms_of_ccl):
18089 * cmds.c (syms_of_cmds):
18090 * composite.c (syms_of_composite):
18091 * dbusbind.c (syms_of_dbusbind):
18092 * dired.c (syms_of_dired):
18093 * dispnew.c (syms_of_display):
18094 * doc.c (syms_of_doc):
18095 * editfns.c (syms_of_editfns):
18096 * emacs.c (syms_of_emacs):
18097 * eval.c (syms_of_eval):
18098 * fileio.c (syms_of_fileio):
18099 * fns.c (syms_of_fns):
18100 * frame.c (syms_of_frame):
18101 * fringe.c (syms_of_fringe):
18102 * insdel.c (syms_of_insdel):
18103 * keymap.c (syms_of_keymap):
18104 * lread.c (init_obarray, syms_of_lread):
18105 * macros.c (syms_of_macros):
18106 * msdos.c (syms_of_msdos):
18107 * print.c (syms_of_print):
18108 * process.c (syms_of_process):
18109 * search.c (syms_of_search):
18110 * sound.c (syms_of_sound):
18111 * syntax.c (init_syntax_once, syms_of_syntax):
18112 * terminal.c (syms_of_terminal):
18113 * textprop.c (syms_of_textprop):
18114 * undo.c (syms_of_undo):
18115 * w32.c (globals_of_w32):
18116 * window.c (syms_of_window):
18117 * xdisp.c (syms_of_xdisp):
18118 * xfaces.c (syms_of_xfaces):
18119 * xfns.c (syms_of_xfns):
18120 * xmenu.c (syms_of_xmenu):
18121 * xsettings.c (syms_of_xsettings):
18122 * xterm.c (syms_of_xterm): Use DEFSYM.
18123
18124 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18125
18126 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18127
18128 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18129
18130 Integer and buffer overflow fixes (Bug#8873).
18131
18132 * print.c (printchar, strout): Check for string overflow.
18133 (PRINTPREPARE, printchar, strout):
18134 Don't set size unless allocation succeeds.
18135
18136 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18137 for sizes. Check for string overflow more accurately.
18138 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18139
18140 * macros.c: Integer and buffer overflow fixes.
18141 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18142 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18143 Use ptrdiff_t, not int, for sizes.
18144 Don't increment bufsize until after realloc succeeds.
18145 Check for size-calculation overflow.
18146 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18147
18148 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18149
18150 * lread.c: Integer overflow fixes.
18151 (read_integer): Radix is now EMACS_INT, not int,
18152 to improve quality of diagnostics for out-of-range radices.
18153 Calculate buffer size correctly for out-of-range radices.
18154 (read1): Check for integer overflow in radices, and in
18155 read-circle numbers.
18156 (read_escape): Avoid int overflow.
18157 (Fload, openp, read_buffer_size, read1)
18158 (substitute_object_recurse, read_vector, read_list, map_obarray):
18159 Use ptrdiff_t, not int, for sizes.
18160 (read1): Use EMACS_INT, not int, for sizes.
18161 Check for size overflow.
18162
18163 * image.c (cache_image): Check for size arithmetic overflow.
18164
18165 * lread.c: Integer overflow issues.
18166 (saved_doc_string_size, saved_doc_string_length)
18167 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18168 Now ptrdiff_t, not int.
18169 (read1): Don't assume doc string length fits in int. Check for
18170 out-of-range doc string lengths.
18171 (read_list): Don't assume file position fits in int.
18172 (read_escape): Check for hex character overflow.
18173
18174 2011-06-22 Leo Liu <sdl.web@gmail.com>
18175
18176 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18177 Move to minibuffer.el.
18178
18179 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18180
18181 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18182 The following patches are for when GLYPH_DEBUG && !XASSERT.
18183 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18184 * dispnew.c (flush_stdout):
18185 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18186 Mark as externally visible.
18187 * dispnew.c (check_window_matrix_pointers): Now static.
18188 * dispnew.c (window_to_frame_vpos):
18189 * xfns.c (unwind_create_frame):
18190 * xterm.c (x_check_font): Remove unused local.
18191 * scroll.c (CHECK_BOUNDS):
18192 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18193 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18194 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18195 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18196 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18197 Now static.
18198 (debug_method_add): Use va_list and vsprintf rather than relying
18199 on undefined behavior with wrong number of arguments.
18200 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18201 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18202 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18203 since we're not interested in debugging glyphs with old libraries.
18204 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18205 GCC 4.6.0's static checking.
18206
18207 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18208
18209 Integer overflow and signedness fixes (Bug#8873).
18210 A few related buffer overrun fixes, too.
18211
18212 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18213
18214 * dispextern.h (struct face.stipple):
18215 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18216 (x_bitmap_mask, x_allocate_bitmap_record)
18217 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18218 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18219 (x_create_bitmap_from_xpm_data):
18220 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18221 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18222 (.bitmaps_last):
18223 * xfaces.c (load_pixmap):
18224 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18225 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18226 (.bitmaps_last, struct x_output.icon_bitmap):
18227 Use ptrdiff_t, not int, for bitmap indexes.
18228 (x_allocate_bitmap_record): Check for size overflow.
18229 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18230
18231 Use ptrdiff_t, not int, for overlay counts.
18232 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18233 * editfns.c (overlays_around, get_pos_property):
18234 * textprop.c (get_char_property_and_overlay):
18235 * xdisp.c (next_overlay_change, note_mouse_highlight):
18236 * xfaces.c (face_at_buffer_position):
18237 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18238 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18239 (Fnext_overlay_change, Fprevious_overlay_change)
18240 (mouse_face_overlay_overlaps, Foverlays_in):
18241 Use ptrdiff_t, not int, for sizes.
18242 (overlays_at, overlays_in): Check for size-calculation overflow.
18243
18244 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18245
18246 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18247 (x_session_initialize): Do not assume string length fits in int.
18248
18249 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18250 This is unlikely, but can occur if DPI is outlandish.
18251
18252 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18253 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18254
18255 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18256 * xrdb.c (magic_file_p, search_magic_path):
18257 Omit last arg SUFFIX; it was always 0. All callers changed.
18258 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18259
18260 * xfont.c (xfont_match): Avoid need for strlen.
18261
18262 * xfns.c: Don't assume strlen fits in int.
18263 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18264
18265 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18266 not unsigned long, as we prefer signed integers. All callers changed.
18267 Detect integer overflow in repeat count.
18268 (message_dolog): Don't assume print length fits in 39 bytes.
18269 (display_mode_element): Don't assume strlen fits in int.
18270
18271 * termcap.c: Don't assume sizes fit in int and never overflow.
18272 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18273 (gobble_line): Check for size-calculation overflow.
18274
18275 * minibuf.c (Fread_buffer):
18276 * lread.c (intern, intern_c_string):
18277 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18278 Don't assume string length fits in int.
18279
18280 * keyboard.c (parse_tool_bar_item):
18281 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18282
18283 * font.c: Don't assume string length fits in int.
18284 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18285 Use ptrdiff_t, not int.
18286 (font_intern_prop): Don't assume string length fits in int.
18287 Don't assume integer property fits in fixnum.
18288 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18289
18290 * filelock.c: Fix some buffer overrun and integer overflow issues.
18291 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18292 Reformulate so as not to need the command string.
18293 Invoke gzip -cd rather than gunzip, as it's more portable.
18294 (lock_info_type, lock_file_1, lock_file):
18295 Don't assume pid_t and time_t fit in unsigned long.
18296 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18297 (current_lock_owner): Prefer signed type for sizes.
18298 Use memcpy, not strncpy, where memcpy is what is really wanted.
18299 Don't assume (via atoi) that time_t and pid_t fit in int.
18300 Check for time_t and/or pid_t out of range, e.g., via a network share.
18301 Don't alloca where an auto var works fine.
18302
18303 * fileio.c: Fix some integer overflow issues.
18304 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18305 Don't assume string length fits in int.
18306 (directory_file_name): Don't assume string length fits in long.
18307 (make_temp_name): Don't assume pid fits in int, or that its print
18308 length is less than 20.
18309
18310 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18311
18312 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18313
18314 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18315
18316 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18317 We prefer signed integers, even for size calculations.
18318
18319 * emacs.c: Don't assume string length fits in 'int'.
18320 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18321 (main): Don't invoke strlen when not needed.
18322
18323 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18324 (XD_DEBUG_MESSAGE): Don't waste a byte.
18325
18326 * callproc.c (getenv_internal_1, getenv_internal)
18327 (Fgetenv_internal):
18328 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18329
18330 * lread.c (invalid_syntax): Omit length argument.
18331 All uses changed. This doesn't fix a bug, but it simplifies the
18332 code away from its former Hollerith-constant appearance, and it's
18333 one less 'int' to worry about when looking at integer-overflow issues.
18334 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18335
18336 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18337 This didn't break anything, but it didn't help either.
18338 It's confusing to put a bogus integer in a place where the actual
18339 value does not matter.
18340 (LIST_END_P): Remove unused macro and its bogus comment.
18341 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18342
18343 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18344 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18345 implementation.
18346 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18347 We prefer signed types, and the value cannot exceed the EMACS_INT
18348 range anyway (because otherwise the length would not be representable).
18349 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18350 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18351 This avoids a GCC warning when WIDE_EMACS_INT.
18352
18353 * indent.c (sane_tab_width): New function.
18354 (current_column, scan_for_column, Findent_to, position_indentation)
18355 (compute_motion): Use it. This is just for clarity.
18356 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18357
18358 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18359
18360 * lisp.h (lint_assume): New macro.
18361 * composite.c (composition_gstring_put_cache):
18362 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18363
18364 * editfns.c, insdel.c:
18365 Omit unnecessary forward decls, to simplify future changes.
18366
18367 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18368
18369 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18370
18371 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18372 Use much-faster test for byte-length change.
18373 Don't assume string byte-length fits in 'int'.
18374 Check that character arg fits in 'int'.
18375 (mapcar1): Declare byte as byte, for clarity.
18376
18377 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18378
18379 * fns.c (concat): Catch string overflow earlier.
18380 Do not rely on integer wraparound.
18381
18382 * dispextern.h (struct it.overlay_strings_charpos)
18383 (struct it.selective): Now EMACS_INT, not int.
18384 * xdisp.c (forward_to_next_line_start)
18385 (back_to_previous_visible_line_start)
18386 (reseat_at_next_visible_line_start, next_element_from_buffer):
18387 Don't arbitrarily truncate the value of 'selective' to int.
18388
18389 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18390
18391 * composite.c: Don't truncate sizes to 'int'.
18392 (composition_gstring_p, composition_reseat_it)
18393 (composition_adjust_point): Use EMACS_INT, not int.
18394 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18395 not EMACS_UINT, for indexes.
18396
18397 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18398
18399 * buffer.c: Include <verify.h>.
18400 (struct sortvec.priority, struct sortstr.priority):
18401 Now EMACS_INT, not int.
18402 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18403 (struct sortstr.size, record_overlay_string)
18404 (struct sortstrlist.size, struct sortlist.used):
18405 Don't truncate size to int.
18406 (record_overlay_string): Check for size-calculation overflow.
18407 (init_buffer_once): Check at compile-time, not run-time.
18408
18409 2011-06-22 Jim Meyering <meyering@redhat.com>
18410
18411 Don't leak an XBM-image-sized buffer
18412 * image.c (xbm_load): Free the image buffer after using it.
18413
18414 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18415
18416 Port to Sun C.
18417 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18418 that Sun C diagnosed.
18419 * fns.c (secure_hash): Fix pointer signedness issue.
18420 * intervals.c (static_offset_intervals): New function.
18421 (offset_intervals): Use it.
18422
18423 2011-06-21 Leo Liu <sdl.web@gmail.com>
18424
18425 * deps.mk (fns.o):
18426 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18427 sha512.h.
18428
18429 * fns.c (secure_hash): Rename from crypto_hash_function and change
18430 the first arg to accept symbols.
18431 (Fsecure_hash): New primitive.
18432 (syms_of_fns): New symbols.
18433
18434 2011-06-20 Deniz Dogan <deniz@dogan.se>
18435
18436 * process.c (Fset_process_buffer): Clarify return value in
18437 docstring.
18438
18439 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
18440
18441 * dispnew.c (add_window_display_history): Use BVAR.
18442
18443 * xdisp.c (debug_method_add): Use BVAR.
18444 (check_window_end, dump_glyph_matrix, dump_glyph)
18445 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18446
18447 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18448 Likewise.
18449
18450 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18451 check till after the cache is created in init_frame_faces.
18452
18453 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18454
18455 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18456
18457 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18458
18459 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18460 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18461 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18462
18463 Improve buffer-overflow checking (Bug#8873).
18464 * fileio.c (Finsert_file_contents):
18465 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18466 Remove the old (too-loose) buffer overflow checks.
18467 They weren't needed, since make_gap checks for buffer overflow.
18468 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18469 The old code merely checked for Emacs fixnum overflow, and relied
18470 on undefined (wraparound) behavior. The new code avoids undefined
18471 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18472
18473 * editfns.c (Finsert_char): Don't dump core with very negative counts.
18474 Tune. Don't use wider integers than needed. Don't use alloca.
18475 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
18476
18477 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18478
18479 * insdel.c, lisp.h (buffer_overflow): New function.
18480 (insert_from_buffer_1, replace_range, replace_range_2):
18481 * insdel.c (make_gap_larger):
18482 * editfns.c (Finsert_char):
18483 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18484
18485 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18486
18487 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18488
18489 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18490
18491 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18492 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18493
18494 * fileio.c: Don't assume EMACS_INT fits in off_t.
18495 (emacs_lseek): New static function.
18496 (Finsert_file_contents, Fwrite_region): Use it.
18497 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18498
18499 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18500
18501 * fns.c: Don't overflow int when computing a list length.
18502 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18503 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18504 truncation on 64-bit hosts. Check for QUIT every
18505 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18506 faster and is responsive enough.
18507 (Flength): Report an error instead of overflowing an integer.
18508 (Fsafe_length): Return a float if the value is not representable
18509 as a fixnum. This shouldn't happen except in contrived situations.
18510 (Fnthcdr, Fsort): Don't assume list length fits in int.
18511 (Fcopy_sequence): Don't assume vector length fits in int.
18512
18513 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18514 (header_size, word_size): New constants.
18515 (allocate_vectorlike): Don't check size overflow here.
18516 (allocate_vector): Check it here instead, since this is the only
18517 caller of allocate_vectorlike that could cause overflow.
18518 Check that the new vector's length is representable as a fixnum.
18519
18520 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18521 The previous code was bogus. For example, next_almost_prime (32)
18522 returned 39, which is undesirable as it is a multiple of 3; and
18523 next_almost_prime (24) returned 25, which is a multiple of 5 so
18524 why was the code bothering to check for multiples of 7?
18525
18526 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18527
18528 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18529
18530 Variadic C functions now count arguments with ptrdiff_t.
18531 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18532 Back then I didn't know that the Emacs coding style prefers signed int.
18533 Also, in the meantime I found a few more instances where arguments
18534 were being counted with int, which may truncate counts on 64-bit
18535 machines, or EMACS_INT, which may be unnecessarily wide.
18536 * lisp.h (struct Lisp_Subr.function.aMANY)
18537 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18538 Arg counts are now ptrdiff_t, not size_t.
18539 All variadic functions and their callers changed accordingly.
18540 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18541 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18542 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18543 * callint.c (Fcall_interactively): Check arg count for overflow,
18544 to avoid potential buffer overrun. Use signed char, not 'int',
18545 for 'varies' array, so that we needn't bother to check its size
18546 calculation for overflow.
18547 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18548 * eval.c (apply_lambda):
18549 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18550 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18551 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18552
18553 * callint.c (Fcall_interactively): Don't use index var as event count.
18554
18555 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18556 * mem-limits.h (SIZE): Remove; no longer used.
18557
18558 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18559
18560 Remove unnecessary casts.
18561 * xterm.c (x_term_init):
18562 * xfns.c (x_set_border_pixel):
18563 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18564 These aren't needed now that we assume ANSI C.
18565
18566 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18567 It's more likely to cause problems (due to unsigned overflow)
18568 than to cure them.
18569
18570 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18571
18572 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18573
18574 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18575
18576 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18577
18578 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18579
18580 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18581
18582 GLYPH_CODE_FACE returns EMACS_INT, not int.
18583 * dispextern.h (merge_faces):
18584 * xfaces.c (merge_faces):
18585 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18586 Don't assume EMACS_INT fits in int.
18587
18588 * character.h (CHAR_VALID_P): Remove unused parameter.
18589 * fontset.c, lisp.h, xdisp.c: All uses changed.
18590
18591 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18592
18593 * fns.c (concat): Minor tuning based on overflow analysis.
18594 This doesn't fix any bugs. Use int to hold character, instead
18595 of constantly refetching from Emacs object. Use XFASTINT, not
18596 XINT, for value known to be a character. Don't bother comparing
18597 a single byte to 0400, as it's always less.
18598
18599 * floatfns.c (Fexpt):
18600 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18601
18602 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18603 for characters.
18604
18605 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18606
18607 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18608 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18609 incorrectly succeed when S was a string, because 4294967386 was
18610 truncated before it was used.
18611
18612 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18613 Otherwise, an out-of-range integer could cause undefined behavior
18614 on a 64-bit host.
18615
18616 * composite.c: Use int, not EMACS_INT, for characters.
18617 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18618 EMACS_INT, for values that are known to be in character range.
18619 This doesn't fix any bugs but is the usual style inside Emacs and
18620 may generate better code on 32-bit machines.
18621
18622 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18623 This is for reasons similar to the recent CHAR_STRING fix.
18624 * charset.c (Fencode_char): Check that character arg is actually
18625 a character. Pass an int to ENCODE_CHAR.
18626 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18627 wider than 'int', as a compile-time check to prevent future regressions
18628 in this area.
18629
18630 * character.c (char_string): Remove unnecessary casts.
18631
18632 Make sure a 64-bit char is never passed to CHAR_STRING.
18633 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18634 by silently ignoring the top 32 bits, allowing some values
18635 that were far too large to be valid characters.
18636 * character.h: Include <verify.h>.
18637 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18638 arguments are no wider than unsigned, as a compile-time check
18639 to prevent future regressions in this area.
18640 * data.c (Faset):
18641 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18642 (Fsubst_char_in_region):
18643 * fns.c (concat):
18644 * xdisp.c (decode_mode_spec_coding):
18645 Adjust to CHAR_STRING's new requirement.
18646 * editfns.c (Finsert_char, Fsubst_char_in_region):
18647 * fns.c (concat): Check that character args are actually
18648 characters. Without this test, these functions did the wrong
18649 thing with wildly out-of-range values on 64-bit hosts.
18650
18651 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18652 These casts should not be needed on 32-bit hosts, either.
18653 * keyboard.c (read_char):
18654 * lread.c (Fload): Remove casts to unsigned.
18655
18656 * lisp.h (UNSIGNED_CMP): New macro.
18657 This fixes comparison bugs on 64-bit hosts.
18658 (ASCII_CHAR_P): Use it.
18659 * casefiddle.c (casify_object):
18660 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18661 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18662 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18663 * dispextern.h (FACE_FROM_ID):
18664 * keyboard.c (read_char): Use UNSIGNED_CMP.
18665
18666 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18667 not to EMACS_INT, to avoid GCC warning.
18668
18669 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18670
18671 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18672 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18673 isn't needed on 32-bit machines.
18674
18675 * buffer.c (Fgenerate_new_buffer_name):
18676 Use EMACS_INT for count, not int.
18677 (advance_to_char_boundary): Return EMACS_INT, not int.
18678
18679 * data.c (Qcompiled_function): Now static.
18680
18681 * window.c (window_body_lines): Now static.
18682
18683 * image.c (gif_load): Rename local to avoid shadowing.
18684
18685 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18686 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18687 * alloc.c (make_save_value): Integer argument is now of type
18688 ptrdiff_t, not int.
18689 (mark_object): Use ptrdiff_t, not int.
18690 * lisp.h (pD): New macro.
18691 * print.c (print_object): Use it.
18692
18693 * alloc.c: Use EMACS_INT, not int, to count objects.
18694 (total_conses, total_markers, total_symbols, total_vector_size)
18695 (total_free_conses, total_free_markers, total_free_symbols)
18696 (total_free_floats, total_floats, total_free_intervals)
18697 (total_intervals, total_strings, total_free_strings):
18698 Now EMACS_INT, not int. All uses changed.
18699 (Fgarbage_collect): Compute overall total using a double, so that
18700 integer overflow is less likely to be a problem. Check for overflow
18701 when converting back to an integer.
18702 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18703 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18704 These were 'int' variables that could overflow on 64-bit hosts;
18705 they were never used, so remove them instead of repairing them.
18706 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18707 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18708 Previously, this ceilinged at INT_MAX, but that doesn't work on
18709 64-bit machines.
18710 (allocate_pseudovector): Don't use EMACS_INT when int would do.
18711
18712 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18713 (allocate_vectorlike): Check for ptrdiff_t overflow.
18714 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18715 when a (possibly-narrower) signed value would do just as well.
18716 We prefer using signed arithmetic, to avoid comparison confusion.
18717
18718 * alloc.c: Catch some string size overflows that we were missing.
18719 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18720 for convenience in STRING_BYTES_MAX.
18721 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18722 The definition here is exact; the one in lisp.h was approximate.
18723 (allocate_string_data): Check for string overflow. This catches
18724 some instances we weren't catching before. Also, it catches
18725 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18726 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18727 and ptrdiff_t and EMACS_INT are both 64 bits.
18728
18729 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18730 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18731 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18732
18733 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18734
18735 * alloc.c (Fmake_string): Check for out-of-range init.
18736
18737 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18738
18739 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18740
18741 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18742
18743 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18744 xg_get_default_scrollbar_width.
18745
18746 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18747 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18748 (style_changed_cb): Call update_theme_scrollbar_width and call
18749 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18750 all frames (Bug#8505).
18751 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18752 Call gtk_window_set_resizable if HAVE_GTK3.
18753 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18754 and height if HAVE_GTK3 (Bug#8505).
18755 (scroll_bar_width_for_theme): New variable.
18756 (update_theme_scrollbar_width): New function.
18757 (xg_get_default_scrollbar_width): Move code to
18758 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18759 (xg_initialize): Call update_theme_scrollbar_width.
18760
18761 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18762
18763 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18764
18765 2011-06-12 Martin Rudalics <rudalics@gmx.at>
18766
18767 * frame.c (make_frame): Call other_buffer_safely instead of
18768 other_buffer.
18769
18770 * window.c (temp_output_buffer_show): Call display_buffer with
18771 second argument Vtemp_buffer_show_specifiers and reset latter
18772 immediately after the call.
18773 (Vtemp_buffer_show_specifiers): New variable.
18774 (auto_window_vscroll_p, next_screen_context_lines)
18775 (Vscroll_preserve_screen_position): Remove leading asterisks from
18776 doc-strings.
18777
18778 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
18779
18780 Fix minor problems found by GCC 4.6.0 static checking.
18781 * buffer.c (Qclone_number): Remove for now, as it's unused.
18782 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18783 (record_buffer): Remove unused local.
18784 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18785 (set_frame_buffer_list): Remove; unused.
18786 * frame.h (other_visible_frames): Remove decl.
18787 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18788 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18789 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18790 if HAVE_GPM.
18791 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18792 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18793 Define only if HAVE_GPM.
18794 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18795 (update_hints_inhibit): Remove; never set. All uses removed.
18796 * widgetprv.h (emacsFrameClassRec): Remove decl.
18797 * window.c (delete_deletable_window): Now returns void, since it
18798 wasn't returning anything.
18799 (compare_window_configurations): Remove unused locals.
18800 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18801 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
18802 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18803 the same widths as pointers. This follows up on the 2011-05-06 patch.
18804 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18805 * xterm.h: Likewise.
18806 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18807
18808 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
18809
18810 * makefile.w32-in: Update dependencies.
18811 (LISP_H): Add lib/intprops.h.
18812
18813 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18814
18815 * image.c (gif_load): Add animation frame delay to the metadata.
18816 (syms_of_image): Use DEFSYM. New symbol `delay'.
18817
18818 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18819
18820 * window.c (delete_deletable_window): Re-add.
18821 (Fset_window_configuration): Rewrite to handle dead buffers and
18822 consequently deletable windows.
18823 (window_tree, Fwindow_tree): Remove. Supply functionality in
18824 window.el.
18825 (compare_window_configurations): Simplify code.
18826
18827 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18828
18829 * image.c (imagemagick_load_image): Fix type mismatch.
18830 (Fimagemagick_types): Likewise.
18831
18832 * window.h (replace_buffer_in_windows): Declare.
18833
18834 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18835
18836 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18837 Qclone_number. Remove external declaration of Qdelete_window.
18838 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18839 code.
18840 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18841 Run Qbuffer_list_update_hook if allowed.
18842 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18843 buffer list implementation.
18844 (other_buffer_safely): New function.
18845 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18846 calls to replace_buffer_in_windows and
18847 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18848 if allowed.
18849 (record_buffer): Inhibit quitting and rewrite using quittable
18850 functions. Run Qbuffer_list_update_hook if allowed.
18851 (Frecord_buffer, Funrecord_buffer): New functions.
18852 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18853 Move switch-to-buffer to window.el.
18854 (bury-buffer): Move to window.el.
18855 (Vbuffer_list_update_hook): New variable.
18856
18857 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18858 section.
18859
18860 * window.h (resize_frame_windows): Move up in code.
18861 (Fwindow_frame): Remove EXFUN.
18862 (replace_buffer_in_all_windows): Remove prototype.
18863 (replace_buffer_in_windows_safely): Add prototype.
18864
18865 * window.c: Declare Qdelete_window static again. Move down
18866 declaration of select_count.
18867 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18868 (Fother_window): Move to window.el.
18869 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18870 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18871 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18872 window.el.
18873 (replace_buffer_in_windows): Implement by calling
18874 Qreplace_buffer_in_windows.
18875 (replace_buffer_in_all_windows): Remove with some functionality
18876 moved into replace_buffer_in_windows_safely.
18877 (replace_buffer_in_windows_safely): New function.
18878 (select_window_norecord, select_frame_norecord): Move in front
18879 of run_window_configuration_change_hook. Remove now obsolete
18880 declarations.
18881 (Fset_window_buffer): Rewrite doc-string.
18882 Call Qrecord_window_buffer.
18883 (keys_of_window): Move binding for other-window to window.el.
18884
18885 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18886
18887 * dispextern.h (struct image): Replace data member, whose int_val
18888 and ptr_val fields were not used by anything, with a single
18889 lisp_val object.
18890
18891 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18892 (gif_clear_image, gif_load, imagemagick_load_image)
18893 (gs_clear_image, gs_load): Callers changed.
18894
18895 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18896
18897 * buffer.h: Include <time.h>, for time_t.
18898 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18899
18900 Fix minor problems found by static checking.
18901
18902 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18903
18904 Make identifiers static if they are not used in other modules.
18905 * data.c (Qcompiled_function, Qframe, Qvector):
18906 * image.c (QimageMagick, Qsvg):
18907 * minibuf.c (Qmetadata):
18908 * window.c (resize_window_check, resize_root_window): Now static.
18909 * window.h (resize_window_check, resize_root_window): Remove decls.
18910
18911 * window.c (window_deletion_count, delete_deletable_window):
18912 Remove; unused.
18913 (window_body_lines): Now static.
18914 (Fdelete_other_windows_internal): Mark vars as initialized.
18915 Make sure 'resize_failed' is initialized.
18916 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18917 (resize_window_apply): Remove unused local.
18918 * window.h (delete_deletable_window): Remove decl.
18919
18920 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18921 (imagemagick_load_image): Fix pointer signedness problem by changing
18922 last arg from unsigned char * to char *. All uses changed.
18923 Also, fix a local for similar reasons.
18924 Remove unused locals. Remove locals to avoid shadowing.
18925 (fn_rsvg_handle_free): Remove; unused.
18926 (svg_load, svg_load_image): Fix pointer signedness problem.
18927 (imagemagick_load_image): Don't use garbage pointer image_wand.
18928
18929 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18930
18931 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
18932
18933 * image.c (gif_load): Fix omitted cast error introduced by
18934 2011-06-06 change.
18935
18936 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18937
18938 * window.h (resize_proportionally, orig_total_lines)
18939 (orig_top_line): Remove from window structure.
18940 (set_window_height, set_window_width, change_window_heights)
18941 (Fdelete_window): Remove prototypes.
18942 (resize_frame_windows): Remove duplicate declaration.
18943
18944 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18945
18946 * window.h (resize_frame_windows, resize_window_check)
18947 (delete_deletable_window, resize_root_window)
18948 (resize_frame_windows): Declare prototypes.
18949
18950 * window.c (resize_window_apply): Make definition be "static" to
18951 match the prototype.
18952
18953 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18954
18955 * window.c: Remove declarations of Qwindow_size_fixed,
18956 window_min_size_1, window_min_size_2, window_min_size,
18957 size_window, window_fixed_size_p, enlarge_window, delete_window.
18958 Remove static from declaration of Qdelete_window, it's
18959 temporarily needed by Fbury_buffer.
18960 (replace_window): Don't assign orig_top_line and
18961 orig_total_lines.
18962 (Fdelete_window, delete_window): Remove. Window deletion is
18963 handled by window.el.
18964 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18965 Replace Fdelete_window calls with calls to Qdelete_window.
18966 (Fdelete_other_windows): Remove. Deleting other windows is
18967 handled by window.el.
18968 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18969 handled in window.el.
18970 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18971 Window minimum sizes are handled in window.el.
18972 (shrink_windows, size_window, set_window_height)
18973 (set_window_width, change_window_heights, window_height)
18974 (window_width, CURBEG, CURSIZE, enlarge_window)
18975 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18976 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18977 handled in window.el.
18978 (make_dummy_parent): Rename to make_parent_window and give it a
18979 second argument horflag.
18980 (make_window): Don't set resize_proportionally any more.
18981 (Fsplit_window): Remove. Windows are split in window.el.
18982 (save_restore_action, save_restore_orig_size)
18983 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18984 Resize mini windows in window.el.
18985 (grow_mini_window, shrink_mini_window): Implement by calling
18986 Qresize_root_window_vertically, resize_window_check and
18987 resize_window_apply.
18988 (saved_window, Fset_window_configuration, save_window_save):
18989 Do not handle orig_top_line, orig_total_lines, and
18990 resize_proportionally.
18991 (window_min_height, window_min_width): Move to window.el.
18992 (keys_of_window): Move bindings for delete-other-windows,
18993 split-window, delete-window and enlarge-window to window.el.
18994
18995 * buffer.c: Temporarily extern Qdelete_window.
18996 (Fbury_buffer): Temporarily call Qdelete_window instead of
18997 Fdelete_window (Fbury_buffer will move to window.el soon).
18998
18999 * frame.c (set_menu_bar_lines_1): Remove code handling
19000 orig_top_line and orig_total_lines.
19001
19002 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19003 set_window_height but set heights directly.
19004 (change_frame_size_1): Use resize_frame_windows.
19005
19006 * xdisp.c (init_xdisp): Don't use set_window_height but set
19007 heights directly.
19008
19009 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19010 Use resize_frame_windows instead of change_window_heights and run
19011 run_window_configuration_change_hook.
19012
19013 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19014 instead of change_window_heights and run
19015 run_window_configuration_change_hook.
19016
19017 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19018
19019 * window.c (replace_window): Rename second argument REPLACEMENT to
19020 NEW. New third argument SETFLAG. Rewrite.
19021 (delete_window, make_dummy_parent): Call replace_window with
19022 third argument 1.
19023 (window_list_1): Move down in code.
19024 (run_window_configuration_change_hook): Move set_buffer part
19025 before select_frame_norecord part in order to unwind correctly.
19026 Rename count1 to count.
19027 (recombine_windows, delete_deletable_window, resize_root_window)
19028 (Fdelete_other_windows_internal)
19029 (Frun_window_configuration_change_hook, make_parent_window)
19030 (resize_window_check, resize_window_apply, Fresize_window_apply)
19031 (resize_frame_windows, Fsplit_window_internal)
19032 (Fdelete_window_internal, Fresize_mini_window_internal):
19033 New functions.
19034 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19035
19036 2011-06-08 Martin Rudalics <rudalics@gmx.at>
19037
19038 * window.h (window): Add some new members to window structure -
19039 normal_lines, normal_cols, new_total, new_normal, clone_number,
19040 splits, nest, prev_buffers, next_buffers.
19041 (WINDOW_TOTAL_SIZE): Move here from window.c.
19042 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19043
19044 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19045 Remove.
19046 (make_dummy_parent): Set new members of windows structure.
19047 (make_window): Move down in code. Handle new members of window
19048 structure.
19049 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19050 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19051 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19052 (Fset_window_prev_buffers, Fwindow_next_buffers)
19053 (Fset_window_next_buffers, Fset_window_clone_number):
19054 New functions.
19055 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19056 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19057 Doc-string fixes.
19058 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19059 Argument WINDOW can be now internal window too.
19060 (Fwindow_use_time): Move up in code.
19061 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19062 Rewrite doc-string.
19063 (Fset_window_configuration, saved_window)
19064 (Fcurrent_window_configuration, save_window_save): Handle new
19065 members of window structure.
19066 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19067 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19068 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19069 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19070 Qget_mru_window, Qresize_root_window,
19071 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19072 Qauto_buffer_name; staticpro them.
19073
19074 2011-06-07 Martin Rudalics <rudalics@gmx.at>
19075
19076 * window.c (Fwindow_total_size, Fwindow_left_column)
19077 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19078 (Fwindow_list_1): New functions.
19079 (window_box_text_cols): Replace with window_body_cols.
19080 (Fwindow_width, Fscroll_left, Fscroll_right):
19081 Use window_body_cols instead of window_box_text_cols.
19082 (delete_window, Fset_window_configuration):
19083 Call delete_all_subwindows with window as argument.
19084 (delete_all_subwindows): Take a window as argument and not a
19085 structure. Rewrite.
19086 (window_loop): Remove handling of GET_LRU_WINDOW and
19087 GET_LARGEST_WINDOW.
19088 (Fget_lru_window, Fget_largest_window): Move to window.el.
19089
19090 * window.h: Extern window_body_cols instead of
19091 window_box_text_cols. delete_all_subwindows now takes a
19092 Lisp_Object as argument.
19093
19094 * indent.c (compute_motion, Fcompute_motion):
19095 Use window_body_cols instead of window_box_text_cols.
19096
19097 * frame.c (delete_frame): Call delete_all_subwindows with root
19098 window as argument.
19099
19100 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19101
19102 * fns.c (Fputhash): Document return value.
19103
19104 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19105
19106 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19107
19108 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19109
19110 Cons<->int and similar integer overflow fixes (Bug#8794).
19111
19112 Check for overflow when converting integer to cons and back.
19113 * charset.c (Fdefine_charset_internal, Fdecode_char):
19114 Use cons_to_unsigned to catch overflow.
19115 (Fencode_char): Use INTEGER_TO_CONS.
19116 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19117 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19118 * data.c (long_to_cons, cons_to_long): Remove.
19119 (cons_to_unsigned, cons_to_signed): New functions.
19120 These signal an error for invalid or out-of-range values.
19121 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19122 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19123 * font.c (Ffont_variation_glyphs):
19124 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19125 * lisp.h: Include <intprops.h>.
19126 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19127 (cons_to_signed, cons_to_unsigned): New decls.
19128 (long_to_cons, cons_to_long): Remove decls.
19129 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19130 (Fprimitive_undo): Use CONS_TO_INTEGER.
19131 * xfns.c (Fx_window_property): Likewise.
19132 * xselect.c: Include <limits.h>.
19133 (x_own_selection, selection_data_to_lisp_data):
19134 Use INTEGER_TO_CONS.
19135 (x_handle_selection_request, x_handle_selection_clear)
19136 (x_get_foreign_selection, Fx_disown_selection_internal)
19137 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19138 (lisp_data_to_selection_data): Use cons_to_unsigned.
19139 (x_fill_property_data): Use cons_to_signed.
19140 Report values out of range.
19141
19142 Check for buffer and string overflow more precisely.
19143 * buffer.h (BUF_BYTES_MAX): New macro.
19144 * lisp.h (STRING_BYTES_MAX): New macro.
19145 * alloc.c (Fmake_string):
19146 * character.c (string_escape_byte8):
19147 * coding.c (coding_alloc_by_realloc):
19148 * doprnt.c (doprnt):
19149 * editfns.c (Fformat):
19150 * eval.c (verror):
19151 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19152 since they may not be the same number.
19153 * editfns.c (Finsert_char):
19154 * fileio.c (Finsert_file_contents):
19155 Likewise for BUF_BYTES_MAX.
19156
19157 * image.c: Use ptrdiff_t, not int, for sizes.
19158 (slurp_file): Switch from int to ptrdiff_t.
19159 All uses changed.
19160 (slurp_file): Check that file size fits in both size_t (for
19161 malloc) and ptrdiff_t (for sanity and safety).
19162
19163 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19164 if b->modtime has its maximal value.
19165
19166 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19167
19168 Don't assume time_t can fit into int.
19169 * buffer.h (struct buffer.modtime): Now time_t, not int.
19170 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19171 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19172
19173 Minor fixes for signed vs unsigned integers.
19174 * character.h (MAYBE_UNIFY_CHAR):
19175 * charset.c (maybe_unify_char):
19176 * keyboard.c (read_char, reorder_modifiers):
19177 XINT -> XFASTINT, since the integer must be nonnegative.
19178 * ftfont.c (ftfont_spec_pattern):
19179 * keymap.c (access_keymap, silly_event_symbol_error):
19180 XUINT -> XFASTINT, since the integer must be nonnegative.
19181 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19182 since it makes no difference and we prefer signed.
19183 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19184 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19185 nonnegative.
19186
19187 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19188
19189 * window.h (Fwindow_frame): Declare.
19190
19191 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19192
19193 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19194 (SPARE_MEMORY): Always define.
19195 (LARGE_REQUEST): Remove.
19196 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19197
19198 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19199
19200 * lisp.h: Move EXFUNS for Fframe_root_window,
19201 Fframe_first_window and Fset_frame_selected_window to window.h.
19202
19203 * window.h: Move EXFUNS for Fframe_root_window,
19204 Fframe_first_window and Fset_frame_selected_window here from
19205 lisp.h.
19206
19207 * frame.c (Fwindow_frame, Fframe_first_window)
19208 (Fframe_root_window, Fframe_selected_window)
19209 (Fset_frame_selected_window): Move to window.c.
19210 (Factive_minibuffer_window): Move to minibuf.c.
19211 (Fother_visible_frames_p): New function.
19212
19213 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19214
19215 * window.c (decode_window, decode_any_window): Move up in code.
19216 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19217 (inhibit_frame_unsplittable): Remove unused variable.
19218 (Fwindow_buffer): Move up and rewrite doc-string.
19219 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19220 (Fwindow_prev): New functions.
19221 (Fwindow_frame): Move here from frame.c. Accept any window as
19222 argument.
19223 (Fframe_root_window, Fframe_first_window)
19224 (Fframe_selected_window): Move here from frame.c. Accept frame
19225 or arbitrary window as argument. Update doc-strings.
19226 (Fminibuffer_window): Move up in code.
19227 (Fwindow_minibuffer_p): Move up in code and simplify.
19228 (Fset_frame_selected_window): Move here from frame.c.
19229 Marginal rewrite.
19230 (Fselected_window, select_window, Fselect_window): Move up in
19231 code. Minor doc-string fixes.
19232
19233 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19234
19235 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19236 Do not assume that spare memory exists; that assumption is valid
19237 only if SYSTEM_MALLOC.
19238 (LARGE_REQUEST): New macro, so that the issue of large requests
19239 is separated from the issue of spare memory.
19240
19241 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19242
19243 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19244 format. (Bug#8806)
19245
19246 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19247
19248 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19249 before statements.
19250
19251 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19252
19253 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19254
19255 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19256
19257 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19258 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19259
19260 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
19261
19262 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19263
19264 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
19265
19266 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19267 (x_clipboard_manager_save): Add return value.
19268 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19269 New error handlers.
19270 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19271 Obey Vx_select_enable_clipboard_manager. Catch errors in
19272 x_clipboard_manager_save (Bug#8779).
19273 (Vx_select_enable_clipboard_manager): New variable.
19274 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19275
19276 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19277
19278 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19279
19280 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19281
19282 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19283 in the current matrix if keep_current_p is non-zero.
19284
19285 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19286
19287 * bidi.c (bidi_level_of_next_char): Fix last change.
19288
19289 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19290
19291 Support bidi reordering of text covered by display properties.
19292
19293 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19294 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19295 (bidi_cache_search, bidi_cache_iterator_state)
19296 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19297 (bidi_level_of_next_char, bidi_move_to_visually_next):
19298 Support character positions inside a run of characters covered by a
19299 display string.
19300 (bidi_paragraph_init, bidi_resolve_explicit_1)
19301 (bidi_level_of_next_char): Call bidi_fetch_char and
19302 bidi_fetch_char_advance instead of FETCH_CHAR and
19303 FETCH_CHAR_ADVANCE.
19304 (bidi_init_it): Initialize new members.
19305 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19306 definitions.
19307 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19308 instead of using explicit *_CHAR codes.
19309 (bidi_resolve_explicit, bidi_resolve_weak):
19310 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19311 bidirectional text is supported only in multibyte buffers.
19312 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19313 it to initialize the frame_window_p member of struct bidi_it.
19314 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19315 (bidi_resolve_explicit, bidi_resolve_weak)
19316 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19317 bidi_it->nchars is non-positive.
19318 (bidi_level_of_next_char): Don't try to lookup the cache for the
19319 next/previous character if nothing is cached there yet, or if we
19320 were just reseat()'ed to a new position.
19321
19322 * xdisp.c (set_cursor_from_row): Set start and stop points
19323 according to the row's direction when priming the loop that looks
19324 for the glyph on which to display cursor.
19325 (single_display_spec_intangible_p): Function deleted.
19326 (display_prop_intangible_p): Reimplement to call
19327 handle_display_spec instead of single_display_spec_intangible_p.
19328 Accept 3 additional arguments needed by handle_display_spec.
19329 This fixes incorrect cursor motion across display property with complex
19330 values: lists, `(when COND...)' forms, etc.
19331 (single_display_spec_string_p): Support property values that are
19332 lists with the argument STRING its top-level element.
19333 (display_prop_string_p): Fix the condition for processing a
19334 property that is a list to be consistent with handle_display_spec.
19335 (handle_display_spec): New function, refactored from the
19336 last portion of handle_display_prop.
19337 (compute_display_string_pos): Accept additional argument
19338 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19339 value of a `display' property is a "replacing spec".
19340 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19341 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19342 the display property, but just return a value indicating whether
19343 the display property will replace the characters it covers.
19344 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19345 frame_window_p members of struct bidi_it.
19346 (compute_display_string_pos, compute_display_string_end):
19347 New functions.
19348 (push_it): Accept second argument POSITION, where pop_it should
19349 jump to continue iteration.
19350 (reseat_1): Initialize bidi_it.disp_pos.
19351
19352 * keyboard.c (adjust_point_for_property): Adjust the call to
19353 display_prop_intangible_p to its new signature.
19354
19355 * dispextern.h (struct bidi_it): New member frame_window_p.
19356 (bidi_init_it): Update prototypes.
19357 (display_prop_intangible_p): Update prototype.
19358 (compute_display_string_pos, compute_display_string_end):
19359 Declare prototypes.
19360 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19361 EMACS_INT.
19362
19363 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
19364
19365 Malloc failure behavior now depends on size of allocation.
19366 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19367 * lisp.h: Change signatures accordingly.
19368 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19369 All callers changed. (Bug#8762)
19370
19371 * gnutls.c: Use Emacs's memory allocators.
19372 Without this change, the gnutls library would invoke malloc etc.
19373 directly, which causes problems on non-SYNC_INPUT hosts, and which
19374 runs afoul of improving memory_full behavior. (Bug#8761)
19375 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19376 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19377 xfree instead of the default malloc, realloc, free.
19378 (Fgnutls_boot): No need to check for memory allocation failure,
19379 since xmalloc does that for us.
19380
19381 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
19382 * category.c (hash_get_category_set):
19383 * ccl.c (ccl_driver):
19384 * charset.c (Fdefine_charset_internal):
19385 * charset.h (struct charset.hash_index):
19386 * composite.c (get_composition_id, gstring_lookup_cache)
19387 (composition_gstring_put_cache):
19388 * composite.h (struct composition.hash_index):
19389 * dispextern.h (struct image.hash):
19390 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19391 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19392 (hashfn_equal, hashfn_user_defined, make_hash_table)
19393 (maybe_resize_hash_table, hash_lookup, hash_put)
19394 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19395 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19396 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19397 * image.c (make_image, search_image_cache, lookup_image)
19398 (xpm_put_color_table_h):
19399 * lisp.h (struct Lisp_Hash_Table):
19400 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19401 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19402 for hashes and hash indexes, instead of 'unsigned' and 'int'.
19403 * alloc.c (allocate_vectorlike):
19404 Check for overflow in vector size calculations.
19405 * ccl.c (ccl_driver):
19406 Check for overflow when converting EMACS_INT to int.
19407 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19408 need to be updated by these changes.
19409 * fns.c (make_hash_table, maybe_resize_hash_table):
19410 Check for integer overflow with large hash tables.
19411 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19412 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19413 (SXHASH_REDUCE): New macro.
19414 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19415 Use it instead of discarding useful hash info with large hash values.
19416 (sxhash_float): New function.
19417 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19418 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19419 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19420 Rewrite to use FIXNUM_BITS, as this simplifies things.
19421 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19422 Adjust signatures to match updated version of code.
19423 (consing_since_gc): Now EMACS_INT, since a single hash table can
19424 use more than INT_MAX bytes.
19425
19426 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19427
19428 Make it possible to build with GCC-4.6+ -O2 -flto.
19429
19430 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19431
19432 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19433
19434 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19435 Call minibuffer-inactive-mode.
19436
19437 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
19438
19439 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19440 Update dependencies.
19441
19442 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19443
19444 * data.c (init_data): Remove code for UTS, this system is not
19445 supported anymore.
19446
19447 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19448
19449 Don't force ./temacs to start in terminal mode.
19450
19451 * frame.c (make_initial_frame): Initialize faces in all cases, not
19452 only when CANNOT_DUMP is defined.
19453 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19454
19455 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19456
19457 * dispnew.c (add_window_display_history): Use const for the string
19458 pointer. Remove declaration, not needed.
19459
19460 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19461
19462 Use 'inline', not 'INLINE'.
19463 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19464 * alloc.c, fontset.c (INLINE): Remove.
19465 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19466 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19467 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19468 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19469 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19470
19471 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19472
19473 Make it possible to run ./temacs.
19474
19475 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19476 syms_of_callproc does the same thing. Remove test for
19477 "initialized", do it in the caller.
19478 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19479
19480 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19481
19482 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19483 (read_minibuf): Use get_minibuffer.
19484 (syms_of_minibuf): Use DEFSYM.
19485 (Qmetadata): New var.
19486 * data.c (Qbuffer): Don't make it static.
19487 (syms_of_data): Use DEFSYM.
19488
19489 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19490
19491 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19492 (CCL_CODE_MIN): New macro.
19493
19494 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19495
19496 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19497
19498 * eval.c (Qdebug): Now static.
19499 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19500 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19501 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19502
19503 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19504
19505 * image.c: Various fixes to ImageMagick code comments.
19506 (Fimagemagick_types): Doc fix.
19507
19508 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19509
19510 Minor fixes prompted by GCC 4.6.0 warnings.
19511
19512 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19513
19514 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19515 (x_clipboard_manager_save_all): Move extern decl to ...
19516 * xterm.h: ... here, so that it can be checked for consistency.
19517
19518 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19519
19520 * xselect.c (x_clipboard_manager_save_frame)
19521 (x_clipboard_manager_save_all): New functions.
19522 (Fx_clipboard_manager_save): Lisp function deleted.
19523
19524 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19525 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19526
19527 * xterm.h: Update prototype.
19528
19529 2011-05-28 William Xu <william.xwl@gmail.com>
19530
19531 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19532 exiting (Bug#8239).
19533
19534 2011-05-28 Jim Meyering <meyering@redhat.com>
19535
19536 Avoid a sign-extension bug in crypto_hash_function.
19537 * fns.c (to_uchar): Define.
19538 (crypto_hash_function): Use it to convert some newly-signed
19539 variables to unsigned, to avoid sign-extension bugs. For example,
19540 without this change, (md5 "truc") would evaluate to
19541 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19542 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
19543 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19544
19545 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19546
19547 Integer overflow fixes.
19548
19549 * dbusbind.c: Serial number integer overflow fixes.
19550 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19551 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19552 to hold a serial number that is too large for a fixnum.
19553 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19554 Check for serial numbers out of range. Decode any serial number
19555 that was so large that it became a float. (Bug#8722)
19556
19557 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19558 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19559 Use XFASTINT rather than XUINT when numbers are nonnegative.
19560 (xd_append_arg, Fdbus_method_return_internal):
19561 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19562 arguments, check that Lisp number is nonnegative, rather than
19563 silently wrapping negative numbers around. (Bug#8722)
19564 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19565 (Bug#8722)
19566
19567 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19568
19569 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19570
19571 ccl: Add integer overflow checks.
19572 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19573 (IN_INT_RANGE): New macros.
19574 (ccl_driver): Use them to check for integer overflow when
19575 decoding a CCL program. Many of the new checks are whether XINT (x)
19576 fits in int; it doesn't always, on 64-bit hosts. The new version
19577 doesn't catch all possible integer overflows, but it's an
19578 improvement. (Bug#8719)
19579
19580 * alloc.c (make_event_array): Use XINT, not XUINT.
19581 There's no need for unsigned here.
19582
19583 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19584 This follows up to the 2011-05-06 change that substituted uintptr_t
19585 for EMACS_INT. This case wasn't caught back then.
19586
19587 Rework Fformat to avoid integer overflow issues.
19588 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19589 now (part of C89). Include <verify.h>.
19590 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19591 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19592 (Fformat): Avoid the prepass trying to compute sizes; it was only
19593 approximate and thus did not catch overflow reliably. Instead, walk
19594 through the format just once, formatting and computing sizes as we go,
19595 checking for integer overflow at every step, and allocating a larger
19596 buffer as needed. Keep track separately whether the format is
19597 multibyte. Keep only the most-recently calculated precision, rather
19598 than them all. Record whether each argument has been converted to
19599 string. Use EMACS_INT, not int, for byte and char and arg counts.
19600 Support field widths and precisions larger than INT_MAX. Avoid
19601 sprintf's undefined behavior with conversion specifications such as %#d
19602 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19603 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19604 formatting out-of-range floating point numbers with int
19605 formats. (Bug#8668)
19606
19607 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19608
19609 * data.c: Avoid integer truncation in expressions involving floats.
19610 * data.c: Include <intprops.h>.
19611 (arith_driver): When there's an integer overflow in an expression
19612 involving floating point, convert the integers to floating point
19613 so that the resulting value does not suffer from catastrophic
19614 integer truncation. For example, on a 64-bit host (* 4
19615 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19616 Do not rely on undefined behavior after integer overflow.
19617
19618 merge count_size_as_multibyte, parse_str_to_multibyte
19619 * character.c, character.h (count_size_as_multibyte):
19620 Rename from parse_str_to_multibyte; all uses changed.
19621 Check for integer overflow.
19622 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19623 since it's now a duplicate of the other. This is more of
19624 a character than a buffer op, so better that it's in character.c.
19625 * fns.c, print.c: Adjust to above changes.
19626
19627 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19628
19629 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19630
19631 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19632
19633 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19634 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19635 (x_clipboard_manager_save): Now static.
19636 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19637
19638 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19639 (crypto_hash_function): Now static.
19640 Fix pointer signedness problems. Avoid unnecessary initializations.
19641
19642 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
19643
19644 * termhooks.h (Vselection_alist): Make it terminal-local.
19645
19646 * terminal.c (create_terminal): Initialize it.
19647
19648 * xselect.c: Support for clipboard managers.
19649 (Vselection_alist): Move to termhooks.h as terminal-local var.
19650 (LOCAL_SELECTION): New macro.
19651 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19652 (symbol_to_x_atom): Remove gratuitous arg.
19653 (x_handle_selection_request, lisp_data_to_selection_data)
19654 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19655 (x_own_selection, x_get_local_selection, x_convert_selection):
19656 New arg, specifying work frame. Use terminal-local Vselection_alist.
19657 (some_frame_on_display): Delete unused function.
19658 (Fx_own_selection_internal, Fx_get_selection_internal)
19659 (Fx_disown_selection_internal, Fx_selection_owner_p)
19660 (Fx_selection_exists_p): New optional frame arg.
19661 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19662 (x_handle_selection_clear): Don't treat other terminals with the
19663 same keyboard specially. Use the terminal-local Vselection_alist.
19664 (x_clear_frame_selections): Use Frun_hook_with_args.
19665
19666 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19667
19668 * xterm.h: Add support for those atoms.
19669
19670 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
19671
19672 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19673 (converted_selections, conversion_fail_tag): New global variables.
19674 (x_selection_request_lisp_error): Free the above.
19675 (x_get_local_selection): Remove unnecessary code.
19676 (x_reply_selection_request): Args changed; handle arbitrary array
19677 of converted selections stored in converted_selections.
19678 Separate the XChangeProperty and SelectionNotify steps.
19679 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19680 (x_convert_selection): New function.
19681 (x_handle_selection_event): Simplify.
19682 (x_get_foreign_selection): Don't ignore incoming requests while
19683 waiting for an answer; this will fail when we implement
19684 SAVE_TARGETS, and seems unnecessary anyway.
19685 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19686 (Vx_sent_selection_functions): Doc fix.
19687
19688 2011-05-26 Leo Liu <sdl.web@gmail.com>
19689
19690 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19691
19692 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19693
19694 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19695
19696 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19697 for fringe update if it has periodic bitmap.
19698 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19699 and fringe_bitmap_periodic_p.
19700
19701 * fringe.c (get_fringe_bitmap_data): New function.
19702 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19703 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19704 row. Mark glyph row for fringe update if periodicity changed.
19705
19706 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19707 for fringe update unless it has periodic bitmap.
19708
19709 2011-05-25 Kenichi Handa <handa@m17n.org>
19710
19711 * xdisp.c (get_next_display_element): Set correct it->face_id for
19712 a static composition.
19713
19714 2011-05-24 Leo Liu <sdl.web@gmail.com>
19715
19716 * deps.mk (fns.o):
19717 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19718
19719 * fns.c (crypto_hash_function, Fsha1): New function.
19720 (Fmd5): Use crypto_hash_function.
19721 (syms_of_fns): Add Ssha1.
19722
19723 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19724
19725 * gnutls.c: Remove unused macros.
19726 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19727 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19728 Remove macros that are defined and never used.
19729 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19730
19731 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19732
19733 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19734 (Fx_get_selection_internal): Minor cleanup.
19735 (Fx_own_selection_internal): Rename arguments for consistency with
19736 select.el.
19737
19738 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19739
19740 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19741
19742 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19743
19744 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19745
19746 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19747
19748 * dispnew.c (scrolling_window): Don't exclude the case that the
19749 last enabled row in the desired matrix touches the bottom boundary.
19750
19751 2011-05-21 Glenn Morris <rgm@gnu.org>
19752
19753 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19754 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19755 and add some more files.
19756
19757 2011-05-20 Eli Zaretskii <eliz@gnu.org>
19758
19759 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19760 report_file_error introduced by the change from 2011-05-07.
19761
19762 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19763
19764 * systime.h (Time): Define only if emacs is defined.
19765 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19766 where the include path doesn't have X11/X.h by default. See
19767 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19768
19769 2011-05-20 Kenichi Handa <handa@m17n.org>
19770
19771 * composite.c (find_automatic_composition): Fix previous change.
19772
19773 2011-05-20 Glenn Morris <rgm@gnu.org>
19774
19775 * lisp.mk: New file, split from Makefile.in.
19776 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19777 (shortlisp): Remove.
19778 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19779
19780 2011-05-19 Glenn Morris <rgm@gnu.org>
19781
19782 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19783 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19784 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19785 (lisp): Set the order to that of loadup.el.
19786 (shortlisp): Make it a copy of $lisp.
19787 (SOME_MACHINE_LISP): Remove.
19788 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19789 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19790
19791 2011-05-18 Kenichi Handa <handa@m17n.org>
19792
19793 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19794 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19795 (find_automatic_composition): Mostly rewrite for efficiency.
19796
19797 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
19798
19799 * makefile.w32-in: Update dependencies.
19800
19801 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19802
19803 * menu.c: Include limits.h (fixes the MS-Windows build broken by
19804 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
19805
19806 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
19807
19808 Fix some integer overflow issues, such as string length overflow.
19809
19810 * insdel.c (count_size_as_multibyte): Check for string overflow.
19811
19812 * character.c (lisp_string_width): Check for string overflow.
19813 Use EMACS_INT, not int, for string indexes and lengths; in
19814 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19815 the resulting string length overflows an EMACS_INT; instead,
19816 report a string overflow if no precision given. When checking for
19817 precision exhaustion, use a check that cannot possibly have
19818 integer overflow. (Bug#8675)
19819 * character.h (lisp_string_width): Adjust to new signature.
19820
19821 * alloc.c (string_overflow): New function.
19822 (Fmake_string): Use it. This doesn't change behavior, but saves
19823 a few bytes and will simplify future changes.
19824 * character.c (string_escape_byte8): Likewise.
19825 * lisp.h (string_overflow): New decl.
19826
19827 Fixups, following up to the user-interface timestamp change.
19828 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19829 for UI timestamps, instead of unsigned long.
19830 * msdos.c (mouse_get_pos): Likewise.
19831 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
19832 * w32gui.h (Time): Define by including "systime.h" rather than by
19833 declaring it ourselves. (Bug#8664)
19834
19835 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19836 * image.c (clear_image_cache): Likewise.
19837
19838 * term.c (term_mouse_position): Don't assume time_t wraparound.
19839
19840 Be more systematic about user-interface timestamps.
19841 Before, the code sometimes used 'Time', sometimes 'unsigned long',
19842 and sometimes 'EMACS_UINT', to represent these timestamps.
19843 This change causes it to use 'Time' uniformly, as that's what X uses.
19844 This makes the code easier to follow, and makes it easier to catch
19845 integer overflow bugs such as Bug#8664.
19846 * frame.c (Fmouse_position, Fmouse_pixel_position):
19847 Use Time, not unsigned long, for user-interface timestamps.
19848 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19849 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19850 * keyboard.h (last_event_timestamp): Likewise.
19851 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19852 * menu.h (xmenu_show): Likewise.
19853 * term.c (term_mouse_position): Likewise.
19854 * termhooks.h (struct input_event.timestamp): Likewise.
19855 (struct terminal.mouse_position_hook): Likewise.
19856 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19857 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19858 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19859 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19860 what it was before.
19861 * menu.h, termhooks.h: Include "systime.h", for Time.
19862
19863 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19864 Don't assume that the difference between two unsigned long values
19865 can fit into an integer. At this point, we know button_down_time
19866 <= event->timestamp, so the difference must be nonnegative, so
19867 there's no need to cast the result if double-click-time is
19868 nonnegative, as it should be; check that it's nonnegative, just in
19869 case. This bug is triggered when events are more than 2**31 ms
19870 apart (about 25 days). (Bug#8664)
19871
19872 * xselect.c (last_event_timestamp): Remove duplicate decl.
19873 (x_own_selection): Remove needless cast to unsigned long.
19874
19875 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19876 that always fit in int. Use a sentinel instead of a counter, to
19877 avoid a temp and to allay GCC's concerns about possible int overflow.
19878 * frame.h (struct frame): Use int for menu_bar_items_used
19879 instead of EMACS_INT, since it always fits in int.
19880
19881 * menu.c (grow_menu_items): Check for int overflow.
19882
19883 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19884
19885 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19886 Before, the code was not consistent. These values cannot exceed
19887 2**31 - 1 so there's no need to make them unsigned.
19888 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19889 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19890 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19891 as modifiers.
19892 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19893
19894 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19895 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19896 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19897 presumably because the widths might not match.
19898
19899 * window.c (size_window): Avoid needless test at loop start.
19900
19901 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19902
19903 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19904
19905 2011-05-12 Drew Adams <drew.adams@oracle.com>
19906
19907 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19908
19909 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19910
19911 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19912 `width' to `bar_area_x' and `bar_area_width', respectively.
19913 (x_scroll_run): Take account of fringe background extension.
19914
19915 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19916 Rename local vars `left' and `width' to `bar_area_x' and
19917 `bar_area_width', respectively.
19918 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19919 background extension.
19920
19921 2011-05-10 Jim Meyering <meyering@redhat.com>
19922
19923 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19924
19925 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
19926
19927 * image.c (Finit_image_library): Return t for built-in image types,
19928 like pbm and xbm. (Bug#8640)
19929
19930 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19931
19932 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19933
19934 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19935
19936 * w32console.c (Fset_screen_color): Doc fix.
19937 (Fget_screen_color): New function.
19938 (syms_of_ntterm): Defsubr it.
19939
19940 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19941 unlink the temporary file if Fcall_process didn't create it in the
19942 first place.
19943 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19944 child process will be redirected to a file specified with `:file'.
19945 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19946 cue to call_process_cleanup not to close that handle.
19947
19948 2011-05-07 Ben Key <bkey76@gmail.com>
19949
19950 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19951 one of two shell specific rules, either bootstrap-temacs-CMD or
19952 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19953 to the previous implementation of the bootstrap-temacs rule.
19954 The bootstrap-temacs-CMD rule is similar to the previous
19955 implementation of the bootstrap-temacs rule except that it
19956 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19957 variable.
19958
19959 These changes, along with some changes to nt/configure.bat,
19960 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19961 earlier fix to add support for --cflags and --ldflags options
19962 that include quotes so that it works whether make uses cmd or
19963 sh as the shell.
19964
19965 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19966
19967 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19968 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19969 is a constant.
19970 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19971 a string. Handle both cases.
19972 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19973 (Fdbus_register_method): Use Qinvalid_function.
19974
19975 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19976
19977 * makefile.w32-in: Update dependencies.
19978 (LISP_H): Add inttypes.h and stdin.h.
19979 (PROCESS_H): Add unistd.h.
19980
19981 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19982
19983 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19984 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19985
19986 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19987
19988 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19989
19990 * term.c (vfatal): Remove stray call to va_end.
19991 It's not needed and the C Standard doesn't allow it here anyway.
19992
19993 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19994 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19995
19996 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19997 bytes.
19998
19999 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20000
20001 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20002
20003 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20004
20005 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20006
20007 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20008
20009 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20010 * charset.c (Fdefine_charset_internal): Don't initialize
20011 charset.code_space[15]. The value was garbage, on hosts with
20012 32-bit int (Bug#8600).
20013
20014 * lread.c (read_integer): Be more consistent with string-to-number.
20015 Use string_to_number to do the actual conversion; this avoids
20016 rounding errors and fixes some other screwups. Without this fix,
20017 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20018 (digit_to_number): Move earlier, for benefit of read_integer.
20019 Return -1 if the digit is out of range for the base, -2 if it is
20020 not a digit in any supported base. (Bug#8602)
20021
20022 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20023
20024 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20025 to match comment at start of function. This also removes a
20026 GCC warning about overflow in a 32+64-bit port.
20027
20028 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20029
20030 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20031 Reported by Stefan Monnier in
20032 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20033 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20034 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20035
20036 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20037 (EMACS_UINTPTR): Likewise, with uintptr_t.
20038
20039 * lisp.h: Prefer 64-bit EMACS_INT if available.
20040 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20041 on 32-bit hosts that have 64-bit int, so that they can access
20042 large files.
20043 However, temporarily disable this change unless the temporary
20044 symbol WIDE_EMACS_INT is defined.
20045
20046 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20047
20048 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20049 This removes an assumption that EMACS_INT and long are the same
20050 width as pointers. The assumption is true for Emacs porting targets
20051 now, but we want to make other targets possible.
20052 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20053 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20054 In the rest of the code, change types of integers that hold casted
20055 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20056 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20057 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20058 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20059 No need to cast type when ORing.
20060 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20061 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20062 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20063 assume EMACS_INT is the same width as char *.
20064 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20065 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20066 Remove no-longer-needed casts.
20067 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20068 (xg_tool_bar_help_callback, xg_make_tool_item):
20069 Use EMACS_INTPTR to hold an integer
20070 that will be cast to void *; this can avoid a GCC warning
20071 if EMACS_INT is not the same width as void *.
20072 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20073 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20074 (current_message_1, set_message_1):
20075 Use a local to convert to proper width without a cast.
20076 * xmenu.c (dialog_selection_callback): Likewise.
20077
20078 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20079 Also, don't assume VALBITS / RAND_BITS is less than 5,
20080 and don't rely on undefined behavior when shifting a 1 left into
20081 the sign bit.
20082 * lisp.h (get_random): Change signature to match.
20083
20084 * lread.c (hash_string): Use size_t, not int, for hash computation.
20085 Normally we prefer signed values; but hashing is special, because
20086 it's better to use unsigned division on hash table sizes so that
20087 the remainder is nonnegative. Also, size_t is the natural width
20088 for hashing into memory. The previous code used 'int', which doesn't
20089 retain enough info to hash well into very large tables.
20090 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20091
20092 * dbusbind.c: Don't possibly lose pointer info when converting.
20093 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20094 Use XPNTR rather than XHASH, so that the high-order bits of
20095 the pointer aren't lost when converting through void *.
20096
20097 * eval.c (Fautoload): Don't double-shift a pointer.
20098
20099 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20100
20101 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20102
20103 * gnutls.c (DEF_GNUTLS_FN):
20104 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20105
20106 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20107
20108 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20109 marker. (Bug#8610)
20110
20111 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20112
20113 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20114 New version that can reserve upto 2GB of heap space.
20115
20116 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20117
20118 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20119
20120 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20121
20122 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20123 `gnutls_certificate_set_x509_key_file'.
20124
20125 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20126
20127 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20128 Update dependencies.
20129
20130 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20131
20132 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20133 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20134 Remove unused parameter `fildes'.
20135 * process.c (read_process_output, send_process): Don't pass it.
20136
20137 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20138
20139 Fix previous change: the library cache is defined in w32.c.
20140 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20141 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20142
20143 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20144
20145 Implement dynamic loading of GnuTLS on Windows.
20146
20147 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20148 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20149 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20150 Declare.
20151
20152 * gnutls.c (Qgnutls_dll): Define.
20153 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20154 (gnutls_*): Declare function pointers.
20155 (init_gnutls_functions): New function to initialize function pointers.
20156 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20157 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20158 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20159 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20160 (emacs_gnutls_write, emacs_gnutls_read)
20161 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20162 (Fgnutls_available_p): New function.
20163 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20164 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20165 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20166
20167 * image.c: Include w32.h.
20168 (Vimage_type_cache): Delete.
20169 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20170 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20171 (w32_delayed_load): Move to w32.c.
20172
20173 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20174
20175 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20176 (w32_delayed_load): Move from image.c. When loading a library, record
20177 its filename in the :loaded-from property of the library id.
20178 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20179 Initialize and staticpro them.
20180 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20181
20182 * process.c: Include lisp.h before w32.h, not after.
20183 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20184 instead of gnutls_record_check_pending.
20185
20186 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20187
20188 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20189
20190 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20191 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20192 as passed in.
20193
20194 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20195
20196 * xterm.c (x_set_frame_alpha): Do not set property on anything
20197 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20198
20199 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20200
20201 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20202
20203 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20204
20205 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20206 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20207 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20208 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20209 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20210 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20211 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20212 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20213 (Qgnutls_bootprop_callbacks_verify): Make static.
20214
20215 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20216
20217 * callproc.c: Indentation fixup.
20218
20219 * sysdep.c (wait_for_termination_1): Make static.
20220 (wait_for_termination, interruptible_wait_for_termination):
20221 Move after wait_for_termination_1.
20222
20223 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20224
20225 * sysdep.c (interruptible_wait_for_termination): New function
20226 which is like wait_for_termination, but allows keyboard
20227 interruptions.
20228
20229 * callproc.c (Fcall_process): Add (:file "file") as an option for
20230 the STDOUT buffer.
20231 (Fcall_process_region): Ditto.
20232
20233 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20234
20235 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20236 rather than `XVECTOR (FOO)->size'.
20237
20238 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20239 inttypes.h, as a gnulib replacement is used if it not available in
20240 system headers.
20241
20242 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20243
20244 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20245 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20246 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20247
20248 * coding.c (coding_alloc_by_realloc): Error out if destination
20249 will grow beyond MOST_POSITIVE_FIXNUM.
20250 (decode_coding_emacs_mule): Abort if there isn't enough place in
20251 charbuf for the composition carryover bytes. Reserve an extra
20252 space for up to 2 characters produced in a loop.
20253 (decode_coding_iso_2022): Abort if there isn't enough place in
20254 charbuf for the composition carryover bytes.
20255
20256 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20257
20258 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20259 aborting when %lld or %lll format is passed.
20260 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20261 %llo or %llx format is passed. (Bug#8545)
20262
20263 * window.c (window_scroll_line_based): Use a marker instead of
20264 simple variables to record original value of point. (Bug#7952)
20265
20266 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20267 produced by %s or %c overflows available buffer space. (Bug#8545)
20268
20269 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20270
20271 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20272 (SIZE_MAX): Move defn after all includes, as they might #define it.
20273
20274 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20275
20276 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20277
20278 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20279
20280 * keyboard.c (Qdelayed_warnings_hook): Define.
20281 (command_loop_1): Run `delayed-warnings-hook'
20282 if Vdelayed_warnings_list is non-nil.
20283 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20284 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20285
20286 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20287
20288 * doprnt.c (doprnt): Don't return value smaller than the buffer
20289 size if the message was truncated. (Bug#8545).
20290
20291 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20292
20293 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20294 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20295
20296 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20297
20298 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20299
20300 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20301
20302 * makefile.w32-in: Update dependencies.
20303
20304 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20305
20306 Improve `doprnt' and its usage. (Bug#8545)
20307 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20308 `format_end'. Remove support for %l as a conversion specifier.
20309 Don't use xrealloc. Improve diagnostics when the %l size modifier
20310 is used. Update the commentary.
20311
20312 * eval.c (verror): Simplify calculation of size_t.
20313
20314 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20315 messages.
20316
20317 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20318
20319 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20320 change.
20321
20322 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20323
20324 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20325 This makes this file independent of the recent pseudovector change.
20326
20327 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20328
20329 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20330
20331 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20332 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20333 Remove unused local.
20334 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20335
20336 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20337 GCC 4.6.0 optimizes based on type-based alias analysis.
20338 For example, if b is of type struct buffer * and v of type struct
20339 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20340 != &v->size, and therefore "v->size = 1; b->size = 2; return
20341 v->size;" must therefore return 1. This assumption is incorrect
20342 for Emacs, since it type-puns struct Lisp_Vector * with many other
20343 types. To fix this problem, this patch adds a new type struct
20344 vectorlike_header that documents the constraints on layout of vectors
20345 and pseudovectors, and helps optimizing compilers not get fooled
20346 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20347 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20348 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20349 the size member.
20350 (XSETPVECTYPE): Rewrite in terms of new macro.
20351 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20352 This is a bit clearer, and further avoids the possibility of
20353 undesirable aliasing.
20354 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20355 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20356 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20357 since Lisp_Subr is a special case (no "next" field).
20358 (ASIZE): Now uses header.size rather than size.
20359 All previous uses of XVECTOR (foo)->size replaced to use this macro,
20360 to avoid the hassle of writing XVECTOR (foo)->header.size.
20361 (struct vectorlike_header): New type.
20362 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20363 object, to help avoid aliasing.
20364 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20365 (SUBRP): Likewise, since Lisp_Subr is a special case.
20366 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20367 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20368 (struct Lisp_Hash_Table): Combine first two members into a single
20369 struct vectorlike_header member. All uses of "size" and "next" members
20370 changed to be "header.size" and "header.next".
20371 * buffer.h (struct buffer): Likewise.
20372 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20373 * frame.h (struct frame): Likewise.
20374 * process.h (struct Lisp_Process): Likewise.
20375 * termhooks.h (struct terminal): Likewise.
20376 * window.c (struct save_window_data, struct saved_window): Likewise.
20377 * window.h (struct window): Likewise.
20378 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20379 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20380 * buffer.c (init_buffer_once): Likewise.
20381 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20382 special case.
20383 * process.c (Fformat_network_address): Use local var for size,
20384 for brevity.
20385
20386 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20387
20388 Make the Lisp reader and string-to-float more consistent (Bug#8525)
20389 * data.c (atof): Remove decl; no longer used or needed.
20390 (digit_to_number): Move to lread.c.
20391 (Fstring_to_number): Use new string_to_number function, to be
20392 consistent with how the Lisp reader treats infinities and NaNs.
20393 Do not assume that floating-point numbers represent EMACS_INT
20394 without losing information; this is not true on most 64-bit hosts.
20395 Avoid double-rounding errors, by insisting on integers when
20396 parsing non-base-10 numbers, as the documentation specifies.
20397 * lisp.h (string_to_number): New decl, replacing ...
20398 (isfloat_string): Remove.
20399 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20400 (read1): Do not accept +. and -. as integers; this
20401 appears to have been a coding error. Similarly, do not accept
20402 strings like +-1e0 as floating point numbers. Do not report
20403 overflow for integer overflows unless the base is not 10 which
20404 means we have no simple and reliable way to continue.
20405 Break out the floating-point parsing into a new
20406 function string_to_number, so that Fstring_to_number parses
20407 floating point numbers consistently with the Lisp reader.
20408 (digit_to_number): Move here from data.c. Make it static inline.
20409 (E_CHAR, EXP_INT): Remove, replacing with ...
20410 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20411 (string_to_number): New function, replacing isfloat_string.
20412 This function checks for valid syntax and produces the resulting
20413 Lisp float number too. Rework it so that string-to-number
20414 no longer mishandles examples like "1.0e+". Use strtoumax,
20415 so that overflow for non-base-10 numbers is reported only when
20416 there's no portable and simple way to convert to floating point.
20417
20418 * textprop.c (set_text_properties_1): Rewrite for clarity,
20419 and to avoid GCC warning about integer overflow.
20420
20421 * intervals.h (struct interval): Use EMACS_INT for members
20422 where EMACS_UINT might cause problems. See
20423 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20424 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20425 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20426 All uses changed.
20427 (offset_intervals): Tell GCC not to worry about length overflow
20428 when negating a negative length.
20429
20430 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20431 (overrun_check_free): Likewise.
20432
20433 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20434 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20435 word size.
20436
20437 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20438 (gnutls_make_error): Rename local to avoid shadowing.
20439 (gnutls_emacs_global_deinit): ifdef out; not used.
20440 (Fgnutls_boot): Use const for pointer to readonly storage.
20441 Comment out unused local. Fix pointer signedness problems.
20442
20443 * lread.c (openp): Don't stuff size_t into an 'int'.
20444 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20445 about possible signed overflow.
20446
20447 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20448 (GDK_KEY_g): Don't define if already defined.
20449 (xg_prepare_tooltip): Avoid pointer signedness problem.
20450 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20451
20452 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20453 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20454
20455 * xfns.c (Fx_window_property): Simplify a bit,
20456 to make a bit faster and to avoid GCC 4.6.0 warning.
20457 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20458
20459 * fns.c (internal_equal): Don't assume size_t fits in int.
20460
20461 * alloc.c (compact_small_strings): Tighten assertion a little.
20462
20463 Replace pEd with more-general pI, and fix some printf arg casts.
20464 * lisp.h (pI): New macro, generalizing old pEd macro to other
20465 conversion specifiers. For example, use "...%"pI"d..." rather
20466 than "...%"pEd"...".
20467 (pEd): Remove. All uses replaced with similar uses of pI.
20468 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20469 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20470 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20471 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20472 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20473 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20474 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20475 64-bit hosts.
20476 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20477 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20478 * print.c (safe_debug_print, print_object): Likewise.
20479 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20480 to int.
20481 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20482 avoiding the 0 flag, which is not portable.
20483 * process.c (Fmake_network_process): Use pI to avoid cast.
20484 * region-cache.c (pp_cache): Likewise.
20485 * xdisp.c (decode_mode_spec): Likewise.
20486 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20487 behavior on 64-bit hosts with printf arg.
20488 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20489 (x_stop_queuing_selection_requests): Likewise.
20490 (x_get_window_property): Don't truncate byte count to an 'int'
20491 when tracing.
20492
20493 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20494 here, since it parses constructs like leading '-' and spaces,
20495 which are not wanted; and it overflows with large numbers.
20496 Instead, simply match F[0-9]+, which is what is wanted anyway.
20497
20498 * alloc.c: Remove unportable assumptions about struct layout.
20499 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20500 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20501 (allocate_vectorlike, make_pure_vector): Use the new macros,
20502 plus offsetof, to remove unportable assumptions about struct layout.
20503 These assumptions hold on all porting targets that I know of, but
20504 they are not guaranteed, they're easy to remove, and removing them
20505 makes further changes easier.
20506
20507 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20508 This doesn't fix a bug but makes the code clearer.
20509 (string_overrun_cookie): Now const. Use initializers that
20510 don't formally overflow signed char, to avoid warnings.
20511 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20512 can cause Emacs to crash when string overrun checking is enabled.
20513 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20514 multiple of sizeof (EMACS_INT); it need not be, if
20515 alignof(EMACS_INT) < sizeof (EMACS_INT).
20516 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20517
20518 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
20519
20520 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20521
20522 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20523
20524 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20525 supposed to be handshaking. (Bug#8556)
20526 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20527
20528 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
20529
20530 * lisp.h (Qdebug): List symbol.
20531 * eval.c (Qdebug): Restore global linkage.
20532 * keyboard.c (debug-on-event): New variable.
20533 (handle_user_signal): Break into debugger when debug-on-event
20534 matches the current signal symbol.
20535
20536 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20537
20538 * alloc.c (check_sblock, check_string_bytes)
20539 (check_string_free_list): Convert to standard C.
20540
20541 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20542
20543 * w32.c (emacs_gnutls_push): Fix typo.
20544
20545 2011-04-25 Eli Zaretskii <eliz@gnu.org>
20546
20547 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20548 "cast to pointer from integer of different size".
20549
20550 Improve doprnt and its use in verror. (Bug#8545)
20551 * doprnt.c (doprnt): Document the set of format control sequences
20552 supported by the function. Use SAFE_ALLOCA instead of always
20553 using `alloca'.
20554
20555 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20556 is one byte too soon. Don't use xrealloc; instead xfree and
20557 xmalloc anew.
20558
20559 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20560
20561 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20562 callbacks stage.
20563
20564 * gnutls.c: Renamed global_initialized to
20565 gnutls_global_initialized. Added internals for the
20566 :verify-hostname-error, :verify-error, and :verify-flags
20567 parameters of `gnutls-boot' and documented those parameters in the
20568 docstring. Start callback support.
20569 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20570 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20571 on error. Return error code.
20572 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20573 (emacs_gnutls_read): Likewise.
20574 (Fgnutls_boot): Return handshake error code.
20575 (emacs_gnutls_handle_error): New function.
20576 (wsaerror_to_errno): Likewise.
20577
20578 * w32.h (emacs_gnutls_pull): Add prototype.
20579 (emacs_gnutls_push): Likewise.
20580
20581 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20582 (emacs_gnutls_push): Likewise.
20583
20584 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20585
20586 * process.c (wait_reading_process_output): Check if GnuTLS
20587 buffered some data internally if no FDs are set for TLS
20588 connections.
20589
20590 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20591 (LIBS): Link to USER_LIBS.
20592 ($(BLD)/gnutls.$(0)): New target.
20593
20594 2011-04-24 Eli Zaretskii <eliz@gnu.org>
20595
20596 * xdisp.c (handle_single_display_spec): Rename the
20597 display_replaced_before_p argument into display_replaced_p, to
20598 make it consistent with the commentary. Fix typos in the
20599 commentary.
20600
20601 * textprop.c (syms_of_textprop): Remove dead code.
20602 (copy_text_properties): Delete obsolete commentary about an
20603 interface that was deleted long ago. Fix typos in the description
20604 of arguments.
20605
20606 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20607 to changes in oldXMenu/XMenu.h from 2011-04-16.
20608 <menu_help_message, prev_menu_help_message>: Constify.
20609 (IT_menu_make_room): menu->help_text is now `const char **';
20610 adjust.
20611
20612 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20613 to changes in oldXMenu/XMenu.h from 2011-04-16.
20614 (struct XMenu): Declare `help_text' `const char **'.
20615
20616 * xfaces.c <Qunspecified>: Make extern again.
20617
20618 * syntax.c: Include sys/types.h before including regex.h, as
20619 required by POSIX.
20620
20621 * doc.c (get_doc_string): Improve the format passed to `error'.
20622
20623 * doprnt.c (doprnt): Improve commentary.
20624
20625 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20626
20627 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20628 them with etags.
20629
20630 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20631 changes in globals.h immediately force recompilation.
20632 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20633 $(CURDIR)/s/ms-w32.h.
20634 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20635
20636 * character.c (Fchar_direction): Function deleted.
20637 (syms_of_character): Don't defsubr it.
20638 <char-direction-table>: Deleted.
20639
20640 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20641
20642 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20643 * doprnt.c: Include limits.h.
20644 (SIZE_MAX): New macro.
20645 (doprnt): Return a size_t value. 2nd arg is now size_t.
20646 Many local variables are now size_t instead of int or unsigned.
20647 Improve overflow protection. Support `l' modifier for integer
20648 conversions. Support %l conversion. Don't assume an EMACS_INT
20649 argument for integer conversions and for %c.
20650
20651 * lisp.h (doprnt): Restore prototype.
20652
20653 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20654 $(SRC)/character.h.
20655
20656 * Makefile.in (base_obj): Add back doprnt.o.
20657
20658 * deps.mk (doprnt.o): Add back prerequisites.
20659 (callint.o): Depend on character.h.
20660
20661 * eval.c (internal_lisp_condition_case): Include the handler
20662 representation in the error message.
20663 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20664 when breaking from the loop.
20665
20666 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20667
20668 * callint.c (Fcall_interactively): When displaying error message
20669 about invalid control letter, pass the character's codepoint, not
20670 a pointer to its multibyte form. Improve display of the character
20671 in octal and display also its hex code.
20672
20673 * character.c (char_string): Use %x to display the (unsigned)
20674 codepoint of an invalid character, to avoid displaying a bogus
20675 negative value.
20676
20677 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20678 `error', not SYMBOL_NAME itself.
20679
20680 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20681 character arguments to `error'.
20682
20683 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20684 to `error' in error message about FINAL_CHAR argument. Make sure
20685 FINAL_CHAR is a character, and use %c when it is passed as
20686 argument to `error'.
20687
20688 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20689
20690 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20691
20692 * w32.c: Include <time.h>.
20693 (sys_localtime): New function.
20694
20695 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
20696
20697 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20698
20699 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20700
20701 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
20702
20703 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20704 zombies (Bug#8467).
20705
20706 2011-04-19 Eli Zaretskii <eliz@gnu.org>
20707
20708 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20709 gl_state.e_property when gl_state.object is Qt.
20710
20711 * insdel.c (make_gap_larger): Remove limitation of buffer size
20712 to <= INT_MAX.
20713
20714 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
20715
20716 * xdisp.c (lookup_glyphless_char_display)
20717 (produce_glyphless_glyph): Handle cons cell entry in
20718 glyphless-char-display.
20719 (Vglyphless_char_display): Document it.
20720
20721 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20722 glyphless-char-display.
20723
20724 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
20725
20726 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20727
20728 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20729
20730 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20731 definition for no-X builds.
20732
20733 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
20734
20735 Static checks with GCC 4.6.0 and non-default toolkits.
20736
20737 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20738
20739 * process.c (keyboard_bit_set): Define only if SIGIO.
20740 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20741 (send_process): Repair possible setjmp clobbering.
20742
20743 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20744
20745 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20746
20747 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20748
20749 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20750 Define only if needed.
20751
20752 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20753 by pacifying GCC about it. Maybe it's time to retire it?
20754 * xfaces.c (USG, __TIMEVAL__): Likewise.
20755
20756 * dispextern.h (struct redisplay_interface): Rename param
20757 to avoid shadowing.
20758 * termhooks.h (struct terminal): Likewise.
20759 * xterm.c (xembed_send_message): Likewise.
20760
20761 * insdel.c (make_gap_smaller): Define only if
20762 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20763
20764 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20765 it.
20766
20767 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20768 so that we aren't warned about unused symbols.
20769
20770 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20771
20772 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20773
20774 * xfns.c (x_real_positions): Mark locals as initialized.
20775
20776 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20777
20778 * xterm.c: Fix problems found by static analysis with other toolkits.
20779 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20780 (x_dispatch_event): Declare static if USE_GTK, and
20781 define if USE_GTK || USE_X_TOOLKIT.
20782 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20783 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20784 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20785 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20786
20787 * xmenu.c (menu_help_callback): Pointer type fixes.
20788 Use const pointers when pointing at readonly data. Avoid pointer
20789 signedness clashes.
20790 (FALSE): Remove unused macro.
20791 (update_frame_menubar): Remove unused decl.
20792
20793 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20794
20795 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20796 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20797 (single_menu_item): Rename local to avoid shadowing.
20798
20799 * keyboard.c (make_lispy_event): Remove unused local var.
20800
20801 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20802 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20803
20804 * bitmaps: Change bitmaps from unsigned char back to the X11
20805 compatible char. Avoid the old compiler warnings about
20806 out-of-range initializers by using, for example, '\xab' rather
20807 than 0xab.
20808
20809 * xgselect.c (xgselect_initialize): Check vs interface
20810 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20811
20812 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20813
20814 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20815 to read-only memory.
20816
20817 * fns.c (vector): Remove; this old hack is no longer needed.
20818
20819 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
20820 Remove unused var.
20821 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
20822
20823 * xrdb.c (x_load_resources): Omit unused local.
20824
20825 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
20826 (x_window): Rename locals to avoid shadowing.
20827 (USG): Use the kludged USG macro, to pacify gcc.
20828
20829 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
20830 (x_term_init): Remove local to avoid shadowing.
20831
20832 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
20833
20834 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20835 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20836
20837 2011-04-16 Eli Zaretskii <eliz@gnu.org>
20838
20839 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20840
20841 Fix regex.c, syntax.c and friends for buffers > 2GB.
20842 * syntax.h (struct gl_state_s): Declare character position members
20843 EMACS_INT.
20844
20845 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20846
20847 * textprop.c (verify_interval_modification, interval_of):
20848 Declare arguments EMACS_INT.
20849
20850 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20851 EMACS_INT.
20852
20853 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20854
20855 * indent.c (Fvertical_motion): Local variable it_start is now
20856 EMACS_INT.
20857
20858 * regex.c (re_match, re_match_2, re_match_2_internal)
20859 (bcmp_translate, regcomp, regexec, print_double_string)
20860 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20861 (re_compile_pattern, re_exec): Declare arguments and local
20862 variables `size_t' and `ssize_t' and return values `regoff_t', as
20863 appropriate.
20864 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20865 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20866 <compile_stack_type>: `size' and `avail' are now `size_t'.
20867
20868 * regex.h <regoff_t>: Use ssize_t, not int.
20869 (re_search, re_search_2, re_match, re_match_2): Arguments that
20870 specify buffer/string position and length are now ssize_t and
20871 size_t. Return type is regoff_t.
20872
20873 2011-04-16 Ben Key <bkey76@gmail.com>
20874
20875 * nsfont.m: Fixed bugs in ns_get_family and
20876 ns_descriptor_to_entity that were caused by using free to
20877 deallocate memory blocks that were allocated by xmalloc (via
20878 xstrdup). This caused Emacs to crash when compiled with
20879 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20880 --enable-checking=xmallocoverrun). xfree is now used to
20881 deallocate these memory blocks.
20882
20883 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
20884
20885 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20886
20887 emacs_write: Accept and return EMACS_INT for sizes.
20888 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20889 et seq.
20890 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20891 Accept and return EMACS_INT.
20892 (emacs_gnutls_write): Return the number of bytes written on
20893 partial writes.
20894 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20895 (emacs_read, emacs_write): Remove check for negative size, as the
20896 Emacs source code has been audited now.
20897 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20898 (emacs_read, emacs_write): Use it.
20899 * process.c (send_process): Adjust to the new signatures of
20900 emacs_write and emacs_gnutls_write. Do not attempt to store
20901 a byte offset into an 'int'; it might overflow.
20902 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20903
20904 * sound.c: Don't assume sizes fit in 'int'.
20905 (struct sound_device.period_size, alsa_period_size):
20906 Return EMACS_INT, not int.
20907 (struct sound_device.write, vox_write, alsa_write):
20908 Accept EMACS_INT, not int.
20909 (wav_play, au_play): Use EMACS_INT to store sizes and to
20910 record read return values.
20911
20912 2011-04-15 Ben Key <bkey76@gmail.com>
20913
20914 * keyboard.c (Qundefined): Don't declare static since it is used
20915 in nsfns.m.
20916 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20917 static since they are used in nsfont.m.
20918
20919 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20920
20921 * process.c (Qprocessp): Don't declare static.
20922 * lisp.h (Qprocessp): Declare again.
20923
20924 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
20925
20926 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20927
20928 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20929
20930 Improve C-level modularity by making more things 'static'.
20931
20932 Don't publish debugger-only interfaces to other modules.
20933 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20934 (verify_bytepos, count_markers): Move decls to the only modules
20935 that need them.
20936 * region-cache.h (pp_cache): Likewise.
20937 * window.h (check_all_windows): Likewise.
20938 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20939
20940 * sysdep.c (croak): Now static, if
20941 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20942 * syssignal.h (croak): Declare only if not static.
20943
20944 * alloc.c (refill_memory_reserve): Now static if
20945 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20946 * lisp.h (refill_memory_reserve): Declare only if not static.
20947
20948 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20949 Define only if USE_LUCID.
20950
20951 * xrdb.c (x_customization_string, x_rm_string): Now static.
20952
20953 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20954 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20955
20956 * xdisp.c (draw_row_with_mouse_face): Now static.
20957 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20958
20959 * window.h (check_all_windows): Mark externally visible.
20960
20961 * window.c (window_deletion_count): Now static.
20962
20963 * undo.c: Make symbols static if they're not exported.
20964 (last_undo_buffer, last_boundary_position, pending_boundary):
20965 Now static.
20966
20967 * textprop.c (interval_insert_behind_hooks): Now static.
20968 (interval_insert_in_front_hooks): Likewise.
20969
20970 * term.c: Make symbols static if they're not exported.
20971 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20972 (max_frame_lines, tty_set_terminal_modes):
20973 (tty_reset_terminal_modes, tty_turn_off_highlight):
20974 (get_tty_terminal): Now static.
20975 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20976 * termhooks.h (term_mouse_moveto): Do not declare if
20977 HAVE_WINDOW_SYSTEM.
20978 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20979 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20980
20981 * sysdep.c: Make symbols static if they're not exported.
20982 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20983 Now static.
20984 (sigprocmask_set, full_mask): Remove; unused.
20985 (wait_debugging): Mark as visible.
20986 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20987 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20988
20989 * syntax.c (syntax_temp): Define only if !__GNUC__.
20990
20991 * sound.c (current_sound_device, current_sound): Now static.
20992
20993 * search.c (searchbufs, searchbuf_head): Now static.
20994
20995 * scroll.c (scroll_cost): Remove; unused.
20996 * dispextern.h (scroll_cost): Remove decl.
20997
20998 * region-cache.h (pp_cache): Mark as externally visible.
20999
21000 * process.c: Make symbols static if they're not exported.
21001 (process_tick, update_tick, create_process, chan_process):
21002 (Vprocess_alist, proc_buffered_char, datagram_access):
21003 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21004 (deactivate_process): Mark defn as static, as well as decl.
21005 * lisp.h (create_process): Remove decl.
21006 * process.h (chan_process, Vprocess_alist): Remove decls.
21007
21008 * print.c: Make symbols static if they're not exported.
21009 (print_depth, new_backquote_output, being_printed, print_buffer):
21010 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21011 (print_interval, print_number_index, initial_stderr_stream):
21012 Now static.
21013 * lisp.h (Fprinc): Remove decl.
21014 (debug_output_compilation_hack): Mark as externally visible.
21015
21016 * sysdep.c (croak): Move decl from here to syssignal.h.
21017 * syssignal.h (croak): Put it here, so the API can be checked when
21018 'croak' is called from dissociate_if_controlling_tty.
21019
21020 * minibuf.c: Make symbols static if they're not exported.
21021 (minibuf_save_list, choose_minibuf_frame): Now static.
21022 * lisp.h (choose_minibuf_frame): Remove decl.
21023
21024 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21025
21026 * lread.c: Make symbols static if they're not exported.
21027 (read_objects, initial_obarray, oblookup_last_bucket_number):
21028 Now static.
21029 (make_symbol): Remove; unused.
21030 * lisp.h (initial_obarray, make_symbol): Remove decls.
21031
21032 * keyboard.c: Make symbols static if they're not exported.
21033 (single_kboard, recent_keys_index, total_keys, recent_keys):
21034 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21035 (this_single_command_key_start, echoing, last_auto_save):
21036 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21037 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21038 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21039 (Vlispy_mouse_stem, double_click_count):
21040 Now static.
21041 (force_auto_save_soon): Define only if SIGDANGER.
21042 (ignore_mouse_drag_p): Now static if
21043 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21044 (print_help): Remove; unused.
21045 (stop_character, last_timer_event): Mark as externally visible.
21046 * keyboard.h (ignore_mouse_drag_p): Declare only if
21047 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21048 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21049 * lisp.h (echoing): Remove decl.
21050 (force_auto_save_soon): Declare only if SIGDANGER.
21051 * xdisp.c (redisplay_window): Simplify code, to make it more
21052 obvious that ignore_mouse_drag_p is not accessed if !defined
21053 USE_GTK && !defined HAVE_NS.
21054
21055 * intervals.c: Make symbols static if they're not exported.
21056 (merge_properties_sticky, merge_interval_right, delete_interval):
21057 Now static.
21058 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21059
21060 * insdel.c: Make symbols static if they're not exported.
21061 However, leave prepare_to_modify_buffer alone. It's never
21062 called from outside this function, but that appears to be a bug.
21063 (combine_after_change_list, combine_after_change_buffer):
21064 (adjust_after_replace, signal_before_change): Now static.
21065 (adjust_after_replace_noundo): Remove; unused.
21066 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21067 (signal_before_change): Remove decls.
21068
21069 * indent.c (val_compute_motion, val_vmotion): Now static.
21070
21071 * image.c: Make symbols static if they're not exported.
21072 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21073 if USE_GTK.
21074 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21075 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21076
21077 * fringe.c (standard_bitmaps): Now static.
21078 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21079
21080 * frame.c: Make symbols static if they're not exported.
21081 (x_report_frame_params, make_terminal_frame): Now static.
21082 (get_frame_param): Now static, unless HAVE_NS.
21083 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21084 (x_get_resource_string): Remove; not used.
21085 * frame.h (make_terminal_frame, x_report_frame_params):
21086 (x_get_resource_string); Remove decls.
21087 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21088 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21089
21090 * font.c, fontset.c: Make symbols static if they're not exported.
21091 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21092 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21093 * font.c (font_close_object): Now static.
21094 * font.h (font_close_object): Remove.
21095 * fontset.c (FONTSET_OBJLIST): Remove.
21096 (free_realized_fontset) #if-0 the body, which does nothing.
21097 (face_suitable_for_char_p): #if-0, as it's never called.
21098 * fontset.h (face_suitable_for_char_p): Remove decl.
21099 * xfaces.c (face_at_string_position):
21100 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21101 since 0 is always ASCII.
21102
21103 * fns.c (weak_hash_tables): Now static.
21104
21105 * fileio.c: Make symbols static if they're not exported.
21106 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21107 (Vwrite_region_annotation_buffers): Now static.
21108
21109 * eval.c: Make symbols static if they're not exported.
21110 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21111 * lisp.h (backtrace_list): Remove decl.
21112
21113 * emacs.c: Make symbols static if they're not exported.
21114 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21115 (fatal_error_code, fatal_error_signal_hook, standard_args):
21116 Now static.
21117 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21118 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21119 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21120 * lisp.h (fatal_error_signal_hook): Remove decl.
21121 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21122
21123 * editfns.c: Move a (normally-unused) function to its only use.
21124 * editfns.c, lisp.h (get_operating_system_release): Remove.
21125 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21126 worth the hassle of breaking this out.
21127
21128 * xterm.c: Make symbols static if they're not exported.
21129 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21130 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21131 (x_destroy_window, x_delete_display):
21132 Now static.
21133 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21134 (x_mouse_leave): Remove; unused.
21135 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21136 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21137 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21138 Remove decls.
21139 (x_mouse_leave): Declare only if WINDOWSNT.
21140 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21141 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21142 USE_X_TOOLKIT.
21143
21144 * ftxfont.c: Make symbols static if they're not exported.
21145 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21146 HAVE_FREETYPE.
21147 * font.h (ftxfont_driver): Likewise.
21148
21149 * xfns.c: Make symbols static if they're not exported.
21150 (x_last_font_name, x_display_info_for_name):
21151 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21152 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21153 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21154 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21155 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21156 (last_show_tip_args): Now static.
21157 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21158 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21159 (x_screen_planes): Remove; unused.
21160 * dispextern.h (x_screen_planes): Remove decl.
21161
21162 * dispnew.c: Make symbols static if they're not exported.
21163 * dispextern.h (redraw_garbaged_frames, scrolling):
21164 (increment_row_positions): Remove.
21165 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21166 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21167 Now static.
21168 (redraw_garbaged_frames): Remove; unused.
21169
21170 * xfaces.c: Make symbols static if they're not exported.
21171 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21172 Remove decls.
21173 * xterm.h (defined_color): Remove decls.
21174 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21175 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21176 (menu_face_changed_default, defined_color, free_realized_face):
21177 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21178 (ascii_face_of_lisp_face): Remove; unused.
21179
21180 * xdisp.c: Make symbols static if they're not exported.
21181 * dispextern.h (scratch_glyph_row, window_box_edges):
21182 (glyph_to_pixel_coords, set_cursor_from_row):
21183 (get_next_display_element, set_iterator_to_next):
21184 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21185 (show_mouse_face): Remove decls
21186 * frame.h (message_buf_print): Likewise.
21187 * lisp.h (pop_message, set_message, check_point_in_composition):
21188 Likewise.
21189 * xterm.h (set_vertical_scroll_bar): Likewise.
21190 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21191 (message_buf_print, scratch_glyph_row, displayed_buffer):
21192 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21193 (get_next_display_element, show_mouse_face, window_box_edges):
21194 (frame_to_window_pixel_xy, check_point_in_composition):
21195 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21196 (glyph_to_pixel_coords): Remove; unused.
21197
21198 * dired.c (file_name_completion): Now static.
21199
21200 * dbusbind.c (xd_in_read_queued_messages): Now static.
21201
21202 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21203 * data.c (circular_list_error): Remove.
21204
21205 * commands.h (last_point_position, last_point_position_buffer):
21206 (last_point_position_window): Remove decls.
21207 * keyboard.c: Make these variables static.
21208
21209 * coding.h (coding, code_convert_region, encode_coding_gap):
21210 Remove decls.
21211 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21212 (iso_code_class, detect_coding, code_convert_region): Now static.
21213 (encode_coding_gap): Remove; unused.
21214
21215 * chartab.c (chartab_chars, chartab_bits): Now static.
21216
21217 * charset.h (charset_iso_8859_1): Remove decl.
21218 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21219 Now static.
21220
21221 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21222 * ccl.c (Vccl_program_table): Now static.
21223 (check_ccl_update): Remove; unused.
21224
21225 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21226 * category.h: ... from here.
21227 * category.c (check_category_table, set_category_set): Now static.
21228
21229 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21230 * lisp.h: Remove these decls.
21231
21232 * buffer.c (buffer_count): Remove unused var.
21233
21234 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21235 so that it's not optimized away.
21236 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21237 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21238 exported only to the debugger.
21239
21240 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21241 * atimer.h (run_all_atimers): Remove; not exported.
21242
21243 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21244 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21245 was inaccessible from Lisp.
21246 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21247 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21248
21249 alloc.c: Import and export fewer symbols, and remove unused items.
21250 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21251 is defined.
21252 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21253 it's not optimized away by whole-program optimization.
21254 (message_enable_multibyte, free_misc): Remove.
21255 (catchlist, handlerlist, mark_backtrace):
21256 Declare only if BYTE_MARK_STACK.
21257 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21258 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21259 (message_enable_multibyte): Remove decl.
21260 (free_misc, interval_free_list, float_block, float_block_index):
21261 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21262 (cons_free_list, last_marked_index):
21263 Now static.
21264 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21265 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21266 (mark_backtrace): Define only if BYTE_MARK_STACK.
21267 * xdisp.c (message_enable_multibyte): Now static.
21268
21269 Declare Lisp_Object Q* variables to be 'static' if not exported.
21270 This makes it easier for human readers (and static analyzers)
21271 to see whether these variables are used from other modules.
21272 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21273 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21274 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21275 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21276 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21277 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21278 * xmenu.c, xselect.c:
21279 Declare Q* vars static if they are not used in other modules.
21280 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21281 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21282 Remove decls of unexported vars.
21283 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21284
21285 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21286
21287 Make Emacs functions such as Fatom 'static' by default.
21288 This makes it easier for human readers (and static analyzers)
21289 to see whether these functions can be called from other modules.
21290 DEFUN now defines a static function. To make the function external
21291 so that it can be used in other C modules, use the new macro DEFUE.
21292 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21293 (Finit_image_library):
21294 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21295 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21296 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21297 Remove decls, since these functions are now static.
21298 (Funintern, Fget_internal_run_time): New decls, since these functions
21299 were already external.
21300
21301 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21302 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21303 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21304 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21305 * keyboard.c, keymap.c, lread.c:
21306 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21307 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21308 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21309 Mark functions with DEFUE instead of DEFUN,
21310 if they are used in other modules.
21311 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21312 decls for now-static functions.
21313 * buffer.h (Fdelete_overlay): Remove decl.
21314 * callproc.c (Fgetenv_internal): Mark as internal.
21315 * composite.c (Fremove_list_of_text_properties): Remove decl.
21316 (Fcomposition_get_gstring): New forward static decl.
21317 * composite.h (Fcomposite_get_gstring): Remove decl.
21318 * dired.c (Ffile_attributes): New forward static decl.
21319 * doc.c (Fdocumntation_property): New forward static decl.
21320 * eval.c (Ffetch_bytecode): New forward static decl.
21321 (Funintern): Remove extern decl; now in .h file where it belongs.
21322 * fileio.c (Fmake_symbolic_link): New forward static decl.
21323 * image.c (Finit_image_library): New forward static decl.
21324 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21325 * intervals.h (Fprevious_property_change):
21326 (Fremove_list_of_text_properties): Remove decls.
21327 * keyboard.c (Fthis_command_keys): Remove decl.
21328 (Fcommand_execute): New forward static decl.
21329 * keymap.c (Flookup_key): New forward static decl.
21330 (Fcopy_keymap): Now static.
21331 * keymap.h (Flookup_key): Remove decl.
21332 * process.c (Fget_process): New forward static decl.
21333 (Fprocess_datagram_address): Mark as internal.
21334 * syntax.c (Fsyntax_table_p): New forward static decl.
21335 (skip_chars): Remove duplicate decl.
21336 * textprop.c (Fprevious_property_change): New forward static decl.
21337 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21338 Now internal.
21339 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21340 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21341
21342 * editfns.c (Fformat): Remove unreachable code.
21343
21344 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21345
21346 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21347 change. (Bug#8496)
21348
21349 2011-04-13 Eli Zaretskii <eliz@gnu.org>
21350
21351 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21352 when at ZV. (Bug#8487)
21353
21354 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21355
21356 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21357 (Bug#8437)
21358 * keyboard.c (parse_tool_bar_item): Likewise.
21359 * sound.c (sound_cleanup, alsa_close): Likewise.
21360 * termcap.c (tgetent): Likewise.
21361 * xfns.c (x_default_font_parameter): Likewise.
21362 * xsettings.c (read_and_apply_settings): Likewise.
21363
21364 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21365 (overrun_check_free): Protoize.
21366
21367 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21368
21369 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21370 since callers should never pass a negative size.
21371 Change the signature to match that of plain 'read' and 'write'; see
21372 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21373 * lisp.h: Update prototypes of emacs_write and emacs_read.
21374
21375 2011-04-11 Eli Zaretskii <eliz@gnu.org>
21376
21377 * xdisp.c (redisplay_window): Don't try to determine the character
21378 position of the scroll margin if the window start point w->startp
21379 is outside the buffer's accessible region. (Bug#8468)
21380
21381 2011-04-10 Eli Zaretskii <eliz@gnu.org>
21382
21383 Fix write-region and its subroutines for buffers > 2GB.
21384 * fileio.c (a_write, e_write): Modify declaration of arguments and
21385 local variables to support buffers larger than 2GB.
21386 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21387
21388 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21389 argument, local variables, and return value.
21390
21391 * lisp.h: Update prototypes of emacs_write and emacs_read.
21392
21393 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21394
21395 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
21396
21397 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21398
21399 Fix more problems found by GCC 4.6.0's static checks.
21400
21401 * xdisp.c (vmessage): Use a better test for character truncation.
21402
21403 * charset.c (load_charset_map): <, not <=, for optimization,
21404 and to avoid potential problems with integer overflow.
21405 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21406 * casetab.c (set_identity, shuffle): Likewise.
21407 * editfns.c (Fformat): Likewise.
21408 * syntax.c (skip_chars): Likewise.
21409
21410 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21411 This also lets GCC 4.6.0 generate slightly better loop code.
21412
21413 * callint.c (Fcall_interactively): <, not <=, for optimization.
21414 (Fcall_interactively): Count the number of arguments produced,
21415 not the number of arguments given. This is simpler and lets GCC
21416 4.6.0 generate slightly better code.
21417
21418 * ftfont.c: Distingish more carefully between FcChar8 and char.
21419 The previous code passed unsigned char * to a functions like
21420 strlen and xstrcasecmp that expect char *, which does not
21421 conform to the C standard.
21422 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21423 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21424 char * when the C standard requires it.
21425
21426 * keyboard.c (read_char): Remove unused var.
21427
21428 * eval.c: Port to Windows vsnprintf (Bug#8435).
21429 Include <limits.h>.
21430 (SIZE_MAX): Define if the headers do not.
21431 (verror): Do not give up if vsnprintf returns a negative count.
21432 Instead, grow the buffer. This ports to Windows vsnprintf, which
21433 does not conform to C99. Problem reported by Eli Zaretskii.
21434 Also, simplify the allocation scheme, by avoiding the need for
21435 calling realloc, and removing the ALLOCATED variable.
21436
21437 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21438
21439 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21440 But keep the doprint source code for now, as we might revamp it
21441 and use it again (Bug#8435).
21442 * lisp.h (doprnt): Remove.
21443 * Makefile.in (base_obj): Remove doprnt.o.
21444 * deps.mk (doprnt.o): Remove.
21445
21446 error: Print 32- and 64-bit integers portably (Bug#8435).
21447 Without this change, on typical 64-bit hosts error ("...%d...", N)
21448 was used to print both 32- and 64-bit integers N, which relied on
21449 undefined behavior.
21450 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21451 * lisp.h (error, verror): Mark as printf-like functions.
21452 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21453 Report overflow in size calculations when allocating printf buffer.
21454 Do not truncate output string at its first null byte.
21455 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21456 Truncate the output at a character boundary, since vsnprintf does not
21457 do that.
21458 * charset.c (check_iso_charset_parameter): Convert internal
21459 character to string before calling 'error', since %c now has the
21460 printf meaning.
21461 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21462 overflow when computing char to be passed to 'error'. Do not
21463 pass Lisp_Object to 'error'; pass the integer instead.
21464 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21465 formatted with plain %d.
21466
21467 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21468
21469 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21470
21471 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21472
21473 * xterm.c (x_catch_errors): Remove duplicate declaration.
21474
21475 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21476
21477 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21478
21479 2011-04-10 Jim Meyering <meyering@redhat.com>
21480
21481 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21482 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21483 return ssize_t not "int", and use size_t as the buffer length.
21484 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21485 * gnutls.h: Update declarations.
21486 * process.c (read_process_output): Use ssize_t, to match.
21487 (send_process): Likewise.
21488
21489 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21490
21491 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21492
21493 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21494
21495 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21496 Use unsigned char, to match FcChar8 type definition.
21497
21498 * xterm.c (handle_one_xevent):
21499 * xmenu.c (create_and_show_popup_menu):
21500 * xselect.c (x_decline_selection_request)
21501 (x_reply_selection_request): Avoid type-punned deref of X events.
21502
21503 2011-04-09 Eli Zaretskii <eliz@gnu.org>
21504
21505 Fix some uses of `int' instead of EMACS_INT.
21506 * search.c (string_match_1, fast_string_match)
21507 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21508 (scan_buffer, find_next_newline_no_quit)
21509 (find_before_next_newline, search_command, Freplace_match)
21510 (Fmatch_data): Make some `int' variables be EMACS_INT.
21511
21512 * xdisp.c (display_count_lines): 3rd argument and return value now
21513 EMACS_INT. All callers changed.
21514 (pint2hrstr): Last argument is now EMACS_INT.
21515
21516 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21517 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21518 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21519 (decode_coding_utf_16, decode_coding_emacs_mule)
21520 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21521 (decode_coding_ccl, decode_coding_charset)
21522 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21523 (decode_coding_iso_2022, decode_coding_emacs_mule)
21524 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21525 <char_offset, last_offset>: Declare EMACS_INT.
21526 (encode_coding_utf_8, encode_coding_utf_16)
21527 (encode_coding_emacs_mule, encode_invocation_designation)
21528 (encode_designation_at_bol, encode_coding_iso_2022)
21529 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21530 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21531 Declare EMACS_INT.
21532 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21533 (encode_invocation_designation): Last argument P_NCHARS is now
21534 EMACS_INT.
21535 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21536 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21537
21538 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21539 All users changed.
21540
21541 * ccl.c (Fccl_execute_on_string): Declare some variables
21542 EMACS_INT.
21543
21544 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
21545
21546 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21547
21548 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21549
21550 * process.c (Fformat_network_address): Doc fix.
21551
21552 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21553
21554 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21555
21556 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
21557
21558 * keyboard.c (read_char): Call Lisp function help-form-show,
21559 instead of using internal_with_output_to_temp_buffer.
21560 (Qhelp_form_show): New var.
21561 (syms_of_keyboard): Use DEFSYM macro.
21562
21563 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21564
21565 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21566
21567 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
21568
21569 * process.c (Flist_processes): Remove to Lisp.
21570 (list_processes_1): Delete.
21571
21572 2011-04-06 Eli Zaretskii <eliz@gnu.org>
21573
21574 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21575
21576 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21577
21578 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
21579
21580 Fix more problems found by GCC 4.6.0's static checks.
21581
21582 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21583
21584 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21585
21586 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21587
21588 * xdisp.c (vmessage): Mark as a printf-like function.
21589
21590 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21591
21592 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21593
21594 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21595 printf-like functions.
21596 (tiff_load): Add casts to remove these marks before passing them
21597 to system-supplied API.
21598
21599 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21600
21601 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21602 This avoids several warnings with gcc -Wstrict-overflow.
21603 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21604 directly, rather than having caller test rule sign. This avoids
21605 some unnecessary tests.
21606 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21607 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21608 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21609
21610 * xfont.c (xfont_text_extents): Remove var that was set but not used.
21611 (xfont_open): Avoid unnecessary tests.
21612
21613 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21614
21615 * composite.h, composite.c (composition_gstring_put_cache):
21616 Use EMACS_INT, not int, for length.
21617
21618 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21619 breaking out part of COMPOSITION_DECODE_RULE.
21620 (COMPOSITION_DECODE_RULE): Use it.
21621 * composite.c (get_composition_id): Remove unused local vars,
21622 by using the new macro.
21623
21624 * textprop.c (set_text_properties_1): Change while to do-while,
21625 since the condition is always true at first.
21626
21627 * intervals.c (graft_intervals_into_buffer): Mark var as used.
21628 (interval_deletion_adjustment): Return unsigned value.
21629 All uses changed.
21630
21631 * process.c (list_processes_1, create_pty, read_process_output):
21632 (exec_sentinel): Remove vars that were set but not used.
21633 (create_pty): Remove unnecessary "volatile"s.
21634 (Fnetwork_interface_info): Avoid possibility of int overflow.
21635 (read_process_output): Do adaptive read buffering even if carryover.
21636 (read_process_output): Simplify nbytes computation if buffered.
21637
21638 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21639
21640 * syntax.c (scan_words): Remove var that was set but not used.
21641 (update_syntax_table): Use unsigned instead of int.
21642
21643 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21644 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21645 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21646
21647 * print.c (print_error_message): Avoid int overflow.
21648
21649 * font.c (font_list_entities): Redo for clarity,
21650 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21651
21652 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21653 (font_score): Avoid potential overflow in diff calculation.
21654
21655 * fns.c (substring_both): Remove var that is set but not used.
21656 (sxhash): Redo loop for clarity and to avoid wraparound warning.
21657
21658 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21659
21660 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21661 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21662 can always succeed if overflow has undefined behavior.
21663
21664 * search.c (boyer_moore, wordify): Remove vars set but not used.
21665 (wordify): Omit three unnecessary tests.
21666
21667 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21668 All callers changed. This avoids the need for an unused var.
21669
21670 * casefiddle.c (casify_region): Remove var that is set but not used.
21671
21672 * dired.c (file_name_completion): Remove var that is set but not used.
21673
21674 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21675
21676 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21677 (Finsert_file_contents): Remove unnecessary code checking fd.
21678
21679 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21680 Check for integer overflow on size calculations.
21681
21682 * buffer.c (Fprevious_overlay_change): Remove var that is set
21683 but not used.
21684
21685 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21686 Remove vars that are set but not used.
21687 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21688 (timer_check_2): Mark vars as initialized.
21689
21690 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21691
21692 * image.c (lookup_image): Remove var that is set but not used.
21693 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21694
21695 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21696 that are set but not used.
21697
21698 * xfns.c (make_invisible_cursor): Don't return garbage
21699 if XCreateBitmapFromData fails (Bug#8410).
21700
21701 * xselect.c (x_get_local_selection, x_handle_property_notify):
21702 Remove vars that are set but not used.
21703
21704 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21705 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21706
21707 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21708 Remove var that is set but not used.
21709 (scroll_bar_windows_size): Now size_t, not int.
21710 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21711 Check for overflow.
21712
21713 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21714 (map_tty_color) [!defined MSDOS]: Likewise.
21715
21716 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21717
21718 * coding.c: Remove vars that are set but not used.
21719 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21720 All callers changed.
21721 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21722 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21723 (decode_coding_charset): Remove vars that are set but not used.
21724
21725 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21726 that is set but not used.
21727
21728 * print.c (print_object): Remove var that is set but not used.
21729
21730 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21731 The gnulib version avoids calling malloc in the usual case,
21732 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21733 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21734 * filelock.c (current_lock_owner): Likewise.
21735 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21736 * sysdep.c: Include allocator.h, careadlinkat.h.
21737 (emacs_no_realloc_allocator): New static constant.
21738 (emacs_readlink): New function.
21739 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21740 ../lib/careadlinkat.h.
21741
21742 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21743
21744 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21745 first non-nil return value).
21746
21747 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21748
21749 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21750 if not defined (Bug#8403).
21751
21752 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21753
21754 * xdisp.c (display_count_lines): Remove parameter `start',
21755 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21756 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21757 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21758 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21759 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21760 and thereabouts. All callers changed.
21761 (get_per_char_metric): Remove parameter `f', unused since
21762 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21763
21764 2011-04-02 Jim Meyering <meyering@redhat.com>
21765
21766 do not dereference NULL upon failed strdup
21767 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21768 (ns_get_family): Likewise.
21769
21770 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21771
21772 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21773
21774 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21775
21776 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21777 later (Bug#8403).
21778
21779 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21780
21781 Add lexical binding.
21782
21783 * window.c (Ftemp_output_buffer_show): New fun.
21784 (Fsave_window_excursion):
21785 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21786
21787 * lread.c (lisp_file_lexically_bound_p): New function.
21788 (Fload): Bind Qlexical_binding.
21789 (readevalloop): Remove `evalfun' arg.
21790 Bind Qinternal_interpreter_environment.
21791 (Feval_buffer): Bind Qlexical_binding.
21792 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21793 Mark as dynamic.
21794 (syms_of_lread): Declare `lexical-binding'.
21795
21796 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21797
21798 * keyboard.c (eval_dyn): New fun.
21799 (menu_item_eval_property): Use it.
21800
21801 * image.c (parse_image_spec): Use Ffunctionp.
21802
21803 * fns.c (concat, mapcar1): Accept byte-code-functions.
21804
21805 * eval.c (Fsetq): Handle lexical vars.
21806 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21807 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21808 (FletX, Flet): Obey lexical binding.
21809 (Fcommandp): Handle closures.
21810 (Feval): New `lexical' arg.
21811 (eval_sub): New function extracted from Feval. Use it almost
21812 everywhere where Feval was used. Look up vars in lexical env.
21813 Handle closures.
21814 (Ffunctionp): Move from subr.el.
21815 (Ffuncall): Handle closures.
21816 (apply_lambda): Remove `eval_flags'.
21817 (funcall_lambda): Handle closures and new byte-code-functions.
21818 (Fspecial_variable_p): New function.
21819 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21820 but without exporting it to Lisp.
21821
21822 * doc.c (Fdocumentation, store_function_docstring):
21823 * data.c (Finteractive_form): Handle closures.
21824
21825 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21826 interactive spec.
21827
21828 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21829 New byte-codes.
21830 (exec_byte_code): New function extracted from Fbyte_code to handle new
21831 calling convention for byte-code-functions. Add new byte-codes.
21832
21833 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
21834
21835 * alloc.c (Fmake_symbol): Init new `declared_special' field.
21836
21837 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21838
21839 * xdisp.c (redisplay_internal): Fix prototype.
21840
21841 2011-03-31 Eli Zaretskii <eliz@gnu.org>
21842
21843 * xdisp.c (SCROLL_LIMIT): New macro.
21844 (try_scrolling): Use it when setting scroll_limit.
21845 Limit scrolling to 100 screen lines.
21846 (redisplay_window): Even when falling back on "recentering",
21847 position point in the window according to scroll-conservatively,
21848 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21849
21850 (try_scrolling): When point is above the window, allow searching
21851 as far as scroll_max, or one screenful, to compute vertical
21852 distance from PT to the scroll margin position. This prevents
21853 try_scrolling from unnecessarily failing when
21854 scroll-conservatively is set to a value slightly larger than the
21855 window height. Clean up the case of PT below the margin at bottom
21856 of window: scroll_max can no longer be INT_MAX. When aggressive
21857 scrolling is in use, don't let point enter the opposite scroll
21858 margin as result of the scroll.
21859 (syms_of_xdisp) <scroll-conservatively>: Document the
21860 threshold of 100 lines for never-recentering scrolling.
21861
21862 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21863
21864 * dispextern.h (move_it_by_lines):
21865 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21866 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21867 (message_log_check_duplicate): Remove parameters `prev_bol' and
21868 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21869 (redisplay_internal): Remove parameter `preserve_echo_area',
21870 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21871
21872 * indent.c (Fvertical_motion):
21873 * window.c (window_scroll_pixel_based, Frecenter):
21874 Don't pass `need_y_p' to `move_it_by_lines'.
21875
21876 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21877
21878 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21879 steal a few bits to be more compact.
21880 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21881 Remove unneeded casts.
21882
21883 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21884
21885 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21886
21887 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21888 binding" message (bug#7967).
21889
21890 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21891
21892 Fix more problems found by GCC 4.6.0's static checks.
21893
21894 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21895 Remove unused local var.
21896
21897 * editfns.c (Fmessage_box): Remove unused local var.
21898
21899 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21900 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21901 Omit unused local vars.
21902 * window.c (shrink_windows): Omit unused local var.
21903 * menu.c (digest_single_submenu): Omit unused local var.
21904 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21905 Omit unused local var.
21906
21907 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21908 Don't assume string length fits in int.
21909 (keyremap_step, read_key_sequence): Use size_t for sizes.
21910 (read_key_sequence): Don't check last_real_key_start redundantly.
21911
21912 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21913 instead of alloca (Bug#8344).
21914
21915 * eval.c (Fbacktrace): Don't assume nargs fits in int.
21916 (Fbacktrace_frame): Don't assume nframes fits in int.
21917
21918 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21919
21920 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21921 concerns.
21922
21923 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21924
21925 * cm.c (calccost): Turn while-do into do-while, for clarity.
21926
21927 * keyboard.c (syms_of_keyboard): Use the same style as later
21928 in this function when indexing through an array. This also
21929 works around GCC bug 48267.
21930
21931 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21932
21933 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21934
21935 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21936 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21937
21938 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21939 This avoids undefined behavior on integer overflow, and is a bit
21940 more convenient anyway since it is compared to a size_t variable.
21941
21942 Variadic C functions now count arguments with size_t, not int.
21943 This avoids an unnecessary limitation on 64-bit machines, which
21944 caused (substring ...) to crash on large vectors (Bug#8344).
21945 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21946 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21947 All variadic functions and their callers changed accordingly.
21948 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21949 * data.c (arith_driver, float_arith_driver): Likewise.
21950 * editfns.c (general_insert_function): Likewise.
21951 * eval.c (struct backtrace.nargs, interactive_p)
21952 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21953 (funcall_lambda, mark_backtrace): Likewise.
21954 * fns.c (concat): Likewise.
21955 * frame.c (x_set_frame_parameters): Likewise.
21956 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21957 0 if not found, not -1. All callers changed.
21958
21959 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21960 (stack_copy_size): Now size_t, not int.
21961 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21962
21963 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21964
21965 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21966 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21967 All callers changed.
21968
21969 * lisp.h (multibyte_char_to_unibyte):
21970 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21971 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21972 * character.h (CHAR_TO_BYTE8):
21973 * cmds.c (internal_self_insert):
21974 * editfns.c (general_insert_function):
21975 * keymap.c (push_key_description):
21976 * search.c (Freplace_match):
21977 * xdisp.c (message_dolog, set_message_1): All callers changed.
21978
21979 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21980
21981 * keyboard.c (safe_run_hook_funcall): New function.
21982 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21983 don't set the hook to nil, but remove the offending function instead.
21984 (Qcommand_hook_internal): Remove, unused.
21985 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21986 Vcommand_hook_internal.
21987
21988 * eval.c (enum run_hooks_condition): Remove.
21989 (funcall_nil, funcall_not): New functions.
21990 (run_hook_with_args): Call each function through a `funcall' argument.
21991 Remove `cond' argument, now redundant.
21992 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21993 (Frun_hook_with_args_until_failure): Adjust accordingly.
21994 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21995
21996 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21997
21998 * dispextern.h (string_buffer_position): Remove declaration.
21999
22000 * print.c (strout): Remove parameter `multibyte', unused since
22001 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22002
22003 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22004 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22005 All callers changed.
22006
22007 * w32.c (_wsa_errlist): Use braces for struct initializers.
22008
22009 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22010 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22011 All callers changed.
22012 (string_buffer_position): Likewise. Also, make static (it's never
22013 used outside xdisp.c).
22014 (cursor_row_p): Remove parameter `w', unused since
22015 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22016 (decode_mode_spec): Remove parameter `precision', introduced during
22017 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22018 All callers changed.
22019
22020 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22021
22022 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22023
22024 2011-03-27 Anders Lindgren <andlind@gmail.com>
22025
22026 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22027 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22028 (ns_update_auto_hide_menu_bar): New functions.
22029 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22030 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22031 ns_constrain_all_frames.
22032 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22033 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22034
22035 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22036
22037 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22038
22039 2011-03-27 Glenn Morris <rgm@gnu.org>
22040
22041 * syssignal.h: Replace RETSIGTYPE with void.
22042 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22043 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22044 Replace SIGTYPE with void everywhere.
22045 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22046 * s/template.h (SIGTYPE): Remove commented out definition.
22047
22048 2011-03-26 Eli Zaretskii <eliz@gnu.org>
22049
22050 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22051 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22052
22053 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
22054
22055 * w32.c (read_unc_volume): Use parameter `henum', instead of
22056 global variable `wget_enum_handle'.
22057
22058 * keymap.c (describe_vector): Remove parameters `indices' and
22059 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22060 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22061
22062 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22063
22064 * keyboard.c (timer_check): Remove parameter `do_it_now',
22065 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22066 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22067 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22068
22069 * keyboard.c (read_char):
22070 * w32menu.c (w32_menu_display_help):
22071 * xmenu.c (show_help_event, menu_help_callback):
22072 Adjust calls to `show_help_echo'.
22073
22074 * gtkutil.c (xg_maybe_add_timer):
22075 * keyboard.c (readable_events):
22076 * process.c (wait_reading_process_output):
22077 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22078
22079 * insdel.c (adjust_markers_gap_motion):
22080 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22081 (gap_left, gap_right): Don't call it.
22082
22083 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22084
22085 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22086 incurred during fontification.
22087
22088 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22089
22090 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22091 (DEFVAR_PER_BUFFER): Don't pass it.
22092
22093 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22094 (scrolling_window): Don't pass it.
22095
22096 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22097
22098 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22099
22100 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22101 and `suffix'.
22102 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22103 of variables specific to SELinux and computation of `encoded_absname'.
22104
22105 * image.c (XPutPixel): Remove unused variable `height'.
22106
22107 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22108
22109 * unexw32.c (get_section_info): Remove unused variable `section'.
22110
22111 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22112 (system_process_attributes): Remove unused variable `sess'.
22113 (sys_read): Remove unused variable `err'.
22114
22115 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22116 (w32_wnd_proc): Remove unused variable `isdead'.
22117 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22118 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22119 (x_create_tip_frame): Remove unused variable `tem'.
22120
22121 * w32inevt.c (w32_console_read_socket):
22122 Remove unused variable `no_events'.
22123
22124 * w32term.c (x_draw_composite_glyph_string_foreground):
22125 Remove unused variable `width'.
22126
22127 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22128
22129 * w32term.c (x_set_glyph_string_clipping):
22130 Don't pass uninitialized region to CombineRgn.
22131
22132 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22133
22134 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22135 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22136 (Fx_close_connection): Remove unused variable `i'.
22137
22138 * w32font.c (w32font_draw): Return number of glyphs.
22139 (w32font_open_internal): Remove unused variable `i'.
22140 (w32font_driver): Add missing initializer.
22141
22142 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22143 (fill_in_menu): Remove unused variable `items_added'.
22144
22145 * w32term.c (last_mouse_press_frame): Remove static global variable.
22146 (w32_clip_to_row): Remove unused variable `f'.
22147 (x_delete_terminal): Remove unused variable `i'.
22148
22149 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22150 (NOTHING): Remove unused static global variable.
22151 (uniscribe_check_otf): Remove unused variable `table'.
22152 (uniscribe_font_driver): Add missing initializers.
22153
22154 2011-03-23 Julien Danjou <julien@danjou.info>
22155
22156 * term.c (Fsuspend_tty, Fresume_tty):
22157 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22158 * window.c (temp_output_buffer_show):
22159 * insdel.c (signal_before_change):
22160 * frame.c (Fhandle_switch_frame):
22161 * fileio.c (Fdo_auto_save):
22162 * emacs.c (Fkill_emacs):
22163 * editfns.c (save_excursion_restore):
22164 * cmds.c (internal_self_insert):
22165 * callint.c (Fcall_interactively):
22166 * buffer.c (Fkill_all_local_variables):
22167 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22168 Use Frun_hooks.
22169 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22170 unconditionally since it does the check itself.
22171
22172 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22173
22174 Fix more problems found by GCC 4.5.2's static checks.
22175
22176 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22177 the first time through the loop, since we know p0 < p1 then.
22178 This also avoids a gcc -Wstrict-overflow warning.
22179
22180 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22181 leading to a memory leak, possible in functions like
22182 load_charset_map_from_file that can allocate an unbounded number
22183 of objects (Bug#8318).
22184
22185 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22186 that could (at least in theory) be that large.
22187
22188 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22189 This is less likely to overflow, and avoids undefined behavior if
22190 overflow does occur. All callers changed. Use strtoul to scan
22191 for the unsigned long integer.
22192 (pint2hrstr): Simplify and tune code slightly.
22193 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22194
22195 * scroll.c (do_scrolling): Work around GCC bug 48228.
22196 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22197
22198 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22199 This also avoids a warning with gcc -Wstrict-overflow.
22200 (validate_x_resource_name): Simplify count usage.
22201 This also avoids a warning with gcc -Wstrict-overflow.
22202
22203 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22204 fail (Bug#8306).
22205
22206 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22207
22208 * process.c (Fmake_network_process): Use socklen_t, not int,
22209 where POSIX says socklen_t is required in portable programs.
22210 This fixes a porting bug on hosts like 64-bit HP-UX, where
22211 socklen_t is wider than int (Bug#8277).
22212 (Fmake_network_process, server_accept_connection):
22213 (wait_reading_process_output, read_process_output):
22214 Likewise.
22215
22216 * process.c: Rename or move locals to avoid shadowing.
22217 (list_processes_1, Fmake_network_process):
22218 (read_process_output_error_handler, exec_sentinel_error_handler):
22219 Rename or move locals.
22220 (Fmake_network_process): Define label "retry_connect" only if needed.
22221 (Fnetwork_interface_info): Fix pointer signedness.
22222 (process_send_signal): Add cast to avoid pointer signedness problem.
22223 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22224 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22225
22226 Make tparam.h and terminfo.c consistent.
22227 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22228 Include tparam.h instead, since it declares them.
22229 * cm.h (PC): Remove extern decl; tparam.h now does this.
22230 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22231 * terminfo.c: Include tparam.h, to check interfaces.
22232 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22233 (tparam): Adjust signature to match interface in tparam.h;
22234 this removes some undefined behavior. Check that outstring and len
22235 are zero, which they always are with Emacs.
22236 * tparam.h (PC, BC, UP): New extern decls.
22237
22238 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22239 (xftfont_open): Rename locals to avoid shadowing.
22240
22241 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22242 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22243 (OTF_TAG_SYM): Omit macro if not needed.
22244 (ftfont_list): Remove unused local.
22245 (get_adstyle_property, ftfont_pattern_entity):
22246 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22247 Rename locals to avoid shadowing.
22248
22249 * xfont.c (xfont_list_family): Mark var as initialized.
22250
22251 * xml.c (make_dom): Now static.
22252
22253 * composite.c (composition_compute_stop_pos): Rename local to
22254 avoid shadowing.
22255 (composition_reseat_it): Remove unused locals.
22256 (find_automatic_composition, composition_adjust_point): Likewise.
22257 (composition_update_it): Mark var as initialized.
22258 (find_automatic_composition): Mark vars as initialized,
22259 with a FIXME (Bug#8290).
22260
22261 character.h: Rename locals to avoid shadowing.
22262 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22263 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22264 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22265 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22266 to avoid shadowing.
22267
22268 * textprop.c (property_change_between_p): Remove; unused.
22269
22270 * intervals.c (interval_start_pos): Now static.
22271
22272 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22273
22274 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22275 Rename locals to avoid shadowing.
22276
22277 * sound.c (wav_play, au_play, Fplay_sound_internal):
22278 Fix pointer signedness.
22279 (alsa_choose_format): Remove unused local var.
22280 (wav_play): Initialize a variable to 0, to prevent undefined
22281 behavior (Bug#8278).
22282
22283 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22284
22285 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22286
22287 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22288 clobbering (Bug#8298).
22289 * sysdep.c (sys_subshell): Likewise.
22290 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22291
22292 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22293 This should get cleaned up, so that child_setup has the
22294 same signature on all platforms.
22295
22296 * callproc.c (call_process_cleanup): Now static.
22297 (relocate_fd): Rename locals to avoid shadowing.
22298
22299 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22300
22301 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22302 not to be necessary, and produces flickering.
22303
22304 2011-03-20 Glenn Morris <rgm@gnu.org>
22305
22306 * config.in: Remove file.
22307
22308 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22309
22310 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22311 are now in src/globals.h.
22312 (syms_of_minibuf): Remove spurious & from previous change.
22313
22314 2011-03-20 Leo Liu <sdl.web@gmail.com>
22315
22316 * minibuf.c (completing-read-function): New variable.
22317 (completing-read-default): Rename from completing-read.
22318 (completing-read): Call completing-read-function.
22319
22320 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22321
22322 * xfaces.c (Fx_load_color_file):
22323 Read color file from absolute filename (bug#8250).
22324
22325 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22326
22327 * makefile.w32-in: Update dependencies.
22328
22329 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22330
22331 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22332
22333 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22334
22335 Fix more problems found by GCC 4.5.2's static checks.
22336
22337 * process.c (make_serial_process_unwind, send_process_trap):
22338 (sigchld_handler): Now static.
22339
22340 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22341 That way, the code declares only the vars that it needs.
22342 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22343 * s/cygwin.h (PTY_ITERATION): Likewise.
22344 * s/darwin.h (PTY_ITERATION): Likewise.
22345 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22346
22347 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22348 * process.c (allocate_pty): Don't declare stb unless it's needed.
22349
22350 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22351 (CONSTANTLIM): Remove; unused.
22352 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22353 Define only if needed.
22354
22355 * unexelf.c (unexec): Name an expression,
22356 to avoid gcc -Wbad-function-cast warning.
22357 Use a different way to cause a compilation error if anyone uses
22358 n rather than nn, a way that does not involve shadowing.
22359 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22360
22361 * deps.mk (unexalpha.o): Remove; unused.
22362
22363 New file unexec.h, the (simple) interface for unexec (Bug#8267).
22364 * unexec.h: New file.
22365 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22366 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22367 Depend on unexec.h.
22368 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22369 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22370 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22371 Change as necessary to match prototype in unexec.h.
22372
22373 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22374 shadowing.
22375 (back_comment, skip_chars): Mark vars as initialized.
22376
22377 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22378 Rename locals to avoid shadowing.
22379
22380 * lread.c (read1): Rewrite so as not to use empty "else".
22381 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22382
22383 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22384
22385 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22386 warning when compiling print.c.
22387
22388 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22389 instead of using an uninitialized var.
22390 (font_sort_entities): Mark var as initialized.
22391
22392 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22393
22394 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22395 pointers to constants.
22396 (font_parse_fcname): Remove unused vars.
22397 (font_delete_unmatched): Now static.
22398 (font_get_spec): Remove; unused.
22399 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22400 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22401 Rename or move locals to avoid shadowing.
22402
22403 * fns.c (require_nesting_list, require_unwind): Now static.
22404 (Ffillarray): Rename locals to avoid shadowing.
22405
22406 * floatfns.c (domain_error2): Define only if needed.
22407 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22408
22409 * alloc.c (mark_backtrace): Move decl from here ...
22410 * lisp.h: ... to here, so that it can be checked.
22411
22412 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22413 (Fdefvar): Rewrite so as not to use empty "else".
22414 (lisp_indirect_variable): Name an expression,
22415 to avoid gcc -Wbad-function-cast warning.
22416 (Fdefvar): Rename locals to avoid shadowing.
22417
22418 * callint.c (quotify_arg, quotify_args): Now static.
22419 (Fcall_interactively): Rename locals to avoid shadowing.
22420 Use const pointer when appropriate.
22421
22422 * lisp.h (get_system_name, get_operating_system_release):
22423 Move decls here, to check interfaces.
22424 * process.c (get_operating_system_release): Move decl to lisp.h.
22425 * xrdb.c (get_system_name): Likewise.
22426 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22427 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22428 some of which prompt warnings from gcc -Wbad-function-cast.
22429 (Fformat_time_string, Fencode_time, Finsert_char):
22430 (Ftranslate_region_internal, Fformat):
22431 Rename or remove local vars to avoid shadowing.
22432 (Ftranslate_region_internal): Mark var as initialized.
22433
22434 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22435 avoid shadowing.
22436
22437 * lisp.h (eassert): Check that the argument compiles, even if
22438 ENABLE_CHECKING is not defined.
22439
22440 * data.c (Findirect_variable): Name an expression, to avoid
22441 gcc -Wbad-function-cast warning.
22442 (default_value, arithcompare, arith_driver, arith_error): Now static.
22443 (store_symval_forwarding): Rename local to avoid shadowing.
22444 (Fmake_variable_buffer_local, Fmake_local_variable):
22445 Mark variables as initialized.
22446 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22447
22448 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22449 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22450 Rename locals to avoid shadowing.
22451 (mark_stack): Move local variables into the #ifdef region where
22452 they're used.
22453 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22454 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22455 needed otherwise.
22456 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22457 (GC_STRING_CHARS): Remove; not used.
22458 (Fmemory_limit): Cast sbrk's returned value to char *.
22459
22460 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22461 avoids undefined behavior in theory.
22462
22463 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22464
22465 Use functions, not macros, for up- and down-casing (Bug#8254).
22466 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22467 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22468 to use the following functions instead of these macros.
22469 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22470 EMACS_INT, since callers assume the returned value fits in int.
22471 (upcase1): Likewise, for UPCASE_TABLE.
22472 (uppercasep, lowercasep, upcase): New static inline functions.
22473 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22474 the race-condition problem in the old DOWNCASE.
22475
22476 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22477 Rename locals to avoid shadowing.
22478 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22479 (regex_compile, re_search_2, re_match_2_internal):
22480 Remove unused local vars.
22481 (FREE_VAR): Rewrite so as not to use empty "else",
22482 which gcc can warn about.
22483 (regex_compile, re_match_2_internal): Mark locals as initialized.
22484 (RETALLOC_IF): Define only if needed.
22485 (WORDCHAR_P): Likewise. This one is never needed, but is used
22486 only in a comment talking about a compiler bug, so put inside
22487 the #if 0 of that comment.
22488 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22489 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22490 Remove; unused.
22491
22492 * search.c (boyer_moore): Rename locals to avoid shadowing.
22493 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22494 (PREV_CHAR_BOUNDARY): Likewise.
22495
22496 * search.c (simple_search): Remove unused var.
22497
22498 * dired.c (compile_pattern): Move decl from here ...
22499 * lisp.h: ... to here, so that it can be checked.
22500 (struct re_registers): New forward decl.
22501
22502 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22503
22504 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22505 All uses changed.
22506 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22507 Rename locals to avoid shadowing.
22508 (Fvertical_motion): Mark locals as initialized.
22509
22510 * casefiddle.c (casify_object, casify_region): Now static.
22511 (casify_region): Mark local as initialized.
22512
22513 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22514
22515 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22516 New macros, so that the caller can use some names other than
22517 gcpro1, gcpro2, etc.
22518 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22519 of the new macros.
22520 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22521 argument, for consistency with GCPRO2_VAR, etc: it is now the
22522 prefix of the variable, not the variable itself. All uses
22523 changed.
22524 * dired.c (directory_files_internal, file_name_completion):
22525 Rename locals to avoid shadowing.
22526
22527 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22528 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22529 dired.c's scmp function, had undefined behavior.
22530 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22531 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22532 * buffer.h: ... to here, because these macros use current_buffer,
22533 and the new implementation with inline functions needs to have
22534 current_buffer in scope now, rather than later when the macros
22535 are used.
22536 (downcase, upcase1): New static inline functions.
22537 (DOWNCASE, UPCASE1): Reimplement using these functions.
22538 This avoids undefined behavior in expressions like
22539 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22540 from race conditions in accessing the global variables
22541 case_temp1 and case_temp2.
22542 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22543 * lisp.h (case_temp1, case_temp2): Remove their decls.
22544 * character.h (ASCII_CHAR_P): Move from here ...
22545 * lisp.h: ... to here, so that the inline functions mentioned
22546 above can use them.
22547
22548 * dired.c (directory_files_internal_unwind): Now static.
22549
22550 * fileio.c (file_name_as_directory, directory_file_name):
22551 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22552 Now static.
22553 (file_name_as_directory): Use const pointers when appropriate.
22554 (Fexpand_file_name): Likewise. In particular, newdir might
22555 point at constant storage, so make it a const pointer.
22556 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22557 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22558 signedness issues.
22559 (Fset_file_times, Finsert_file_contents, auto_save_error):
22560 Rename locals to avoid shadowing.
22561
22562 * minibuf.c (choose_minibuf_frame_1): Now static.
22563 (Ftry_completion, Fall_completions): Rename or remove locals
22564 to avoid shadowing.
22565
22566 * marker.c (bytepos_to_charpos): Remove; unused.
22567
22568 * lisp.h (verify_bytepos, count_markers): New decls,
22569 so that gcc does not warn that these functions aren't declared.
22570
22571 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22572 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22573 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22574 (copy_text): Remove unused local var.
22575
22576 * filelock.c (within_one_second): Now static.
22577 (lock_file_1): Rename local to avoid shadowing.
22578
22579 * buffer.c (fix_overlays_before): Mark locals as initialized.
22580 (fix_start_end_in_overlays): Likewise. This function should be
22581 simplified by using pointers-to-pointers, but that's a different
22582 matter.
22583 (switch_to_buffer_1): Now static.
22584 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22585 (report_overlay_modification): Rename locals to avoid shadowing.
22586
22587 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22588 Fix pointer signedness issue.
22589 (sys_subshell): Mark local as volatile if checking for lint,
22590 to suppress a gcc -Wclobbered warning that does not seem to be right.
22591 (MAXPATHLEN): Define only if needed.
22592
22593 * process.c (serial_open, serial_configure): Move decls from here ...
22594 * systty.h: ... to here, so that they can be checked.
22595
22596 * fns.c (get_random, seed_random): Move extern decls from here ...
22597 * lisp.h: ... to here, so that they can be checked.
22598
22599 * sysdep.c (reset_io): Now static.
22600 (wait_for_termination_signal): Remove; unused.
22601
22602 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22603 (copy_keymap_item, append_key, push_text_char_description):
22604 Now static.
22605 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22606 (DENSE_TABLE_SIZE): Remove; unused.
22607 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22608 (describe_map_tree):
22609 Rename locals to avoid shadowing.
22610
22611 * keyboard.c: Declare functions static if they are not used elsewhere.
22612 (echo_char, echo_dash, cmd_error, top_level_2):
22613 (poll_for_input, handle_async_input): Now static.
22614 (read_char, kbd_buffer_get_event, make_lispy_position):
22615 (make_lispy_event, make_lispy_movement, apply_modifiers):
22616 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22617 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22618 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22619 (read_key_sequence, read_char): Mark locals as initialized.
22620 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22621
22622 * keyboard.h (make_ctrl_char): New decl.
22623 (mark_kboards): Move decl here ...
22624 * alloc.c (mark_kboards): ... from here.
22625
22626 * lisp.h (force_auto_save_soon): New decl.
22627
22628 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22629 (DEFINE_DUMMY_FUNCTION): New macro.
22630 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22631 Use it.
22632 (main): Add casts to avoid warnings
22633 if GCC considers string literals to be constants.
22634
22635 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22636
22637 * dbusbind.c: Pointer signedness fixes.
22638 (xd_signature, xd_append_arg, xd_initialize):
22639 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22640 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22641 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22642 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22643
22644 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22645 if GCC considers string literals to be constants.
22646 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22647
22648 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22649
22650 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22651 (print_preprocess, print_object): New macro to fix last change.
22652
22653 * print.c (print_preprocess): Don't forget font objects.
22654
22655 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
22656
22657 * emacs.c (USAGE3): Doc fixes.
22658
22659 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22660
22661 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22662 structure.
22663
22664 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
22665
22666 * lisp.h (VWindow_system, Qfile_name_history):
22667 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22668 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22669 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22670
22671 * w32select.c: Don't #include "keyboard.h".
22672 (run_protected): Add extern declaration for waiting_for_input.
22673
22674 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22675 * w32console.c (detect_input_pending, read_input_pending)
22676 (encode_terminal_code):
22677 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22678 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22679 (w32_system_caret_y, Qfile_name_history):
22680 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22681 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22682 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22683 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22684 * w32proc.c (Qlocal, report_file_error):
22685 * w32term.c (Vwindow_system, updating_frame):
22686 * w32uniscribe.c (initialized, uniscribe_font_driver):
22687 Remove unneeded extern declarations.
22688
22689 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
22690
22691 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22692
22693 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
22694
22695 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22696 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22697 These macros can no longer be used for assignment.
22698
22699 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22700 Assign struct members directly, instead of using BUF_BEGV etc.
22701 (record_buffer_markers, fetch_buffer_markers): New functions for
22702 recording and fetching special buffer markers.
22703 (set_buffer_internal_1, set_buffer_temp): Use them.
22704
22705 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22706
22707 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22708
22709 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22710 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22711
22712 * xdisp.c (hscroll_window_tree):
22713 (reconsider_clip_changes): Use PT instead of BUF_PT.
22714
22715 2011-03-13 Eli Zaretskii <eliz@gnu.org>
22716
22717 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22718 $(EMACS_ROOT)/lib/intprops.h.
22719
22720 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22721
22722 Fix more problems found by GCC 4.5.2's static checks.
22723
22724 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22725 to unsigned char * to avoid compiler diagnostic.
22726 (xg_free_frame_widgets): Make it clear that a local variable is
22727 needed only if USE_GTK_TOOLTIP.
22728 (gdk_window_get_screen): Make it clear that this macro is needed
22729 only if USE_GTK_TOOLTIP.
22730 (int_gtk_range_get_value): New function, which avoids a diagnostic
22731 from gcc -Wbad-function-cast.
22732 (xg_set_toolkit_scroll_bar_thumb): Use it.
22733 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22734 diagnostic from gcc -Wbad-function-cast.
22735 (get_utf8_string, xg_get_file_with_chooser):
22736 Rename locals to avoid shadowing.
22737 (create_dialog): Move locals to avoid shadowing.
22738
22739 * xgselect.c (xg_select): Remove unused var.
22740
22741 * image.c (four_corners_best): Mark locals as initialized.
22742 (gif_load): Initialize transparent_p to zero (Bug#8238).
22743 Mark another local as initialized.
22744 (my_png_error, my_error_exit): Mark with NO_RETURN.
22745
22746 * image.c (clear_image_cache): Now static.
22747 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22748 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22749 (x_edge_detection): Remove unnecessary cast that
22750 gcc -Wbad-function-cast diagnoses.
22751 (gif_load): Fix pointer signedness.
22752 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22753 (jpeg_load, gif_load): Rename locals to avoid shadowing.
22754
22755 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
22756
22757 Improve quality of tests for time stamp overflow.
22758 For example, without this patch (encode-time 0 0 0 1 1
22759 1152921504606846976) returns the obviously-bogus value (-948597
22760 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22761 reports time overflow. See
22762 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22763 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22764 * editfns.c: Include limits.h and intprops.h.
22765 (TIME_T_MIN, TIME_T_MAX): New macros.
22766 (time_overflow): Move earlier, to before first use.
22767 (hi_time, lo_time): New functions, for an accurate test for
22768 out-of-range times.
22769 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22770 (Fget_internal_run_time): Don't assume time_t fits in int.
22771 (make_time): Use list2 instead of Fcons twice.
22772 (Fdecode_time): More accurate test for out-of-range times.
22773 (check_tm_member): New function.
22774 (Fencode_time): Use it, to test for out-of-range times.
22775 (lisp_time_argument): Don't rely on undefined left-shift and
22776 right-shift behavior when checking for time stamp overflow.
22777
22778 * editfns.c (time_overflow): New function, refactoring common code.
22779 (Fformat_time_string, Fdecode_time, Fencode_time):
22780 (Fcurrent_time_string): Use it.
22781
22782 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22783 * dired.c (make_time): Move to ...
22784 * editfns.c (make_time): ... here.
22785 * systime.h: Note the move.
22786
22787 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22788
22789 * fringe.c (update_window_fringes): Remove unused variables.
22790
22791 * unexmacosx.c (copy_data_segment): Also copy __got section.
22792 (Bug#8223)
22793
22794 2011-03-12 Eli Zaretskii <eliz@gnu.org>
22795
22796 * termcap.c [MSDOS]: Include "msdos.h".
22797 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22798 Constify `char *' arguments and their references according to
22799 prototypes in tparam.h.
22800
22801 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
22802
22803 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22804 Adapt all references accordingly.
22805
22806 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22807
22808 2011-03-11 Tom Tromey <tromey@redhat.com>
22809
22810 * buffer.c (syms_of_buffer): Remove obsolete comment.
22811
22812 2011-03-11 Eli Zaretskii <eliz@gnu.org>
22813
22814 * termhooks.h (encode_terminal_code): Declare prototype.
22815
22816 * msdos.c (encode_terminal_code): Don't declare prototype.
22817
22818 * term.c (encode_terminal_code): Now external again, used by
22819 w32console.c and msdos.c.
22820
22821 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22822 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
22823
22824 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
22825
22826 Fix some minor problems found by GCC 4.5.2's static checks.
22827
22828 * fringe.c (update_window_fringes): Mark locals as initialized
22829 (Bug#8227).
22830 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
22831
22832 * alloc.c (mark_fringe_data): Move decl from here ...
22833 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22834 to check its interface.
22835 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22836
22837 * fontset.c (free_realized_fontset): Now static.
22838 (Fset_fontset_font): Rename local to avoid shadowing.
22839 (fontset_font): Mark local as initialized.
22840 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
22841
22842 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22843
22844 * xselect.c (x_disown_buffer_selections): Remove; not used.
22845 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
22846 (x_own_selection, Fx_disown_selection_internal): Rename locals
22847 to avoid shadowing.
22848 (x_handle_dnd_message): Remove local to avoid shadowing.
22849
22850 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22851 so that the caller can use some name other than gcpro1.
22852 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
22853 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22854 (Fx_backspace_delete_keys_p):
22855 Use them to avoid shadowing, and rename vars to avoid shadowing.
22856 (x_decode_color, x_set_name, x_window): Now static.
22857 (Fx_create_frame): Add braces to silence GCC warning.
22858 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
22859 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22860 Remove unused locals.
22861 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22862 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22863 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22864 macros.
22865
22866 * xterm.h (x_mouse_leave): New decl.
22867
22868 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22869 Remove unused functions.
22870 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22871 (x_calc_absolute_position): Now static.
22872 (XTread_socket): Don't define label "out" unless it's used.
22873 Don't declare local "event" unless it's used.
22874 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22875 unless they are used.
22876 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22877 (x_fatal_error_signal): Remove; not used.
22878 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22879 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22880 (x_error_catcher, x_connection_closed, x_error_handler):
22881 (x_error_quitter, xembed_send_message, x_iconify_frame):
22882 (my_log_handler): Rename locals to avoid shadowing.
22883 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22884 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22885
22886 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22887 Rename or move locals to avoid shadowing.
22888 (tty_defined_color, merge_face_heights): Now static.
22889 (free_realized_faces_for_fontset): Remove; not used.
22890 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22891 does not deduce is never used uninitialized.
22892 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22893 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22894
22895 * terminal.c (store_terminal_param): Now static.
22896
22897 * xmenu.c (menu_highlight_callback): Now static.
22898 (set_frame_menubar): Remove unused local.
22899 (xmenu_show): Rename parameter to avoid shadowing.
22900 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22901 since they might point to immutable storage.
22902 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22903 since it's unused otherwise.
22904
22905 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22906 Add a FIXME, since the code still doesn't look right. (Bug#8215)
22907 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22908 avoids a gcc -Wuninitialized diagnostic.
22909 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22910 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22911 does not deduce are never used uninitialized.
22912
22913 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22914
22915 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22916 * window.c (window_loop, size_window):
22917 (run_window_configuration_change_hook, enlarge_window): Likewise.
22918
22919 * window.c (display_buffer): Now static.
22920 (size_window): Mark variables that gcc -Wuninitialized
22921 does not deduce are never used uninitialized.
22922 * window.h (check_all_windows): New decl, to forestall
22923 gcc -Wmissing-prototypes diagnostic.
22924 * dispextern.h (bidi_dump_cached_states): Likewise.
22925
22926 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22927 shadowing.
22928 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22929 Include <limits.h>.
22930 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22931 and to avoid gcc -Wuninitialized warning.
22932 (load_charset_map): Mark variables that gcc -Wuninitialized
22933 does not deduce are never used uninitialized.
22934 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22935
22936 * coding.c (coding_set_source, coding_set_destination):
22937 Use "else { /* comment */ }" rather than "else /* comment */;"
22938 for clarity, and to avoid gcc -Wempty-body warning.
22939 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22940 a block, when the outer 'i' will do.
22941 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22942 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22943 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22944 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22945 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22946 Rename locals to avoid shadowing.
22947 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22948 * coding.c (emacs_mule_char, encode_invocation_designation):
22949 Now static, since they're not used elsewhere.
22950 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22951 (decode_coding_object, encode_coding_object, detect_coding_system):
22952 (decode_coding_emacs_mule): Mark variables that gcc
22953 -Wuninitialized does not deduce are never used uninitialized.
22954 (detect_coding_iso_2022): Initialize a local variable that might
22955 be used uninitialized. Leave a FIXME because it's not clear that
22956 this initialization is needed. (Bug#8211)
22957 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22958 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22959 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22960 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22961 Remove unused macros.
22962
22963 * category.c (hash_get_category_set): Remove unused local var.
22964 (copy_category_table): Now static, since it's not used elsewhere.
22965 * character.c (string_count_byte8): Likewise.
22966
22967 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22968 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22969
22970 * chartab.c (copy_sub_char_table): Now static, since it's not used
22971 elsewhere.
22972 (sub_char_table_ref_and_range, char_table_ref_and_range):
22973 Rename locals to avoid shadowing.
22974 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22975
22976 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22977 (BIDI_BOB): Remove unused macro.
22978
22979 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22980 deduce are never used uninitialized.
22981 * term.c (encode_terminal_code): Likewise.
22982
22983 * term.c (encode_terminal_code): Now static. Remove unused local.
22984
22985 * tparam.h: New file.
22986 * term.c, tparam.h: Include it.
22987 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22988 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22989 Move these decls to tparam.h, and make them agree with what
22990 is actually in tparam.c. The previous trick of using incompatible
22991 decls in different modules does not conform to the C standard.
22992 All callers of tparam changed to use tparam's actual API.
22993 * tparam.c (tparam1, tparam, tgoto):
22994 Use const pointers where appropriate.
22995
22996 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22997 * cm.h (struct cm): Likewise.
22998 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22999 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23000 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23001 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23002 (turn_on_face, init_tty): Likewise.
23003 * termchar.h (struct tty_display_info): Likewise.
23004
23005 * term.c (term_mouse_position): Rename local to avoid shadowing.
23006
23007 * alloc.c (mark_ttys): Move decl from here ...
23008 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23009
23010 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23011
23012 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23013
23014 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23015
23016 * search.c (compile_pattern_1): Remove argument regp, unused since
23017 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23018 (compile_pattern): Don't pass it.
23019
23020 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23021
23022 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23023 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23024 for ! HAVE_GTK3.
23025 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23026
23027 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23028
23029 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23030 gdk_window_get_screen, gdk_window_get_geometry,
23031 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23032 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23033 (xg_get_pixbuf_from_pixmap): New function.
23034 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23035 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23036 Call xg_get_pixbuf_from_pixmap instead of
23037 gdk_pixbuf_get_from_drawable.
23038 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23039 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23040 (xg_check_special_colors): Use GtkStyleContext and its functions
23041 for HAVE_GTK3.
23042 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23043 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23044 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23045 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23046 Call gtk_widget_get_preferred_size.
23047 (xg_frame_resized): gdk_window_get_geometry only takes 5
23048 parameters.
23049 (xg_win_to_widget, xg_event_is_for_menubar):
23050 Call gdk_x11_window_lookup_for_display.
23051 (xg_set_widget_bg): New function.
23052 (delete_cb): New function.
23053 (xg_create_frame_widgets): Connect delete-event to delete_cb.
23054 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
23055 (xg_set_background_color): Call xg_set_widget_bg.
23056 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23057 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23058 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23059 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23060 if ! HAVE_GTK3.
23061 (update_frame_tool_bar): Call gtk_widget_hide.
23062 (xg_initialize): Use GDK_KEY_g.
23063
23064 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23065 if ! HAVE_GTK3
23066 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23067
23068 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23069 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23070 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23071
23072 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
23073
23074 * w32xfns.c (select_palette): Check success of RealizePalette against
23075 GDI_ERROR, not zero.
23076
23077 See ChangeLog.11 for earlier changes.
23078
23079 ;; Local Variables:
23080 ;; coding: utf-8
23081 ;; End:
23082
23083 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23084
23085 This file is part of GNU Emacs.
23086
23087 GNU Emacs is free software: you can redistribute it and/or modify
23088 it under the terms of the GNU General Public License as published by
23089 the Free Software Foundation, either version 3 of the License, or
23090 (at your option) any later version.
23091
23092 GNU Emacs is distributed in the hope that it will be useful,
23093 but WITHOUT ANY WARRANTY; without even the implied warranty of
23094 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23095 GNU General Public License for more details.
23096
23097 You should have received a copy of the GNU General Public License
23098 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.