* marker.c (set_marker_internal): If desired position is passed
[bpt/emacs.git] / src / ChangeLog
1 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * marker.c (set_marker_internal): If desired position is passed
4 as a marker, avoid call to buf_charpos_to_bytepos.
5 * window.c (Fset_window_point): Omit redundant type checking.
6 (Fset_window_start): Likewise. Format comment.
7 (window_scroll_pixel_based): Use set_marker_restricted_both
8 with character and byte positions obtained from an iterator.
9 (Fset_window_configuration): Use set_marker_restricted_both.
10 * xdisp.c (message_dolog): Likewise.
11
12 2013-02-10 Eli Zaretskii <eliz@gnu.org>
13
14 * xdisp.c (move_it_vertically_backward, move_it_by_lines): When
15 text lines are longer than window's screen lines, don't move back
16 too far. This speeds up some redisplay operations. (Bug#13675)
17
18 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
19
20 * syntax.c (scan_sexps_forward): Fix byte position calculation
21 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
22
23 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
24
25 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
26 that was not needed.
27
28 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
29
30 Minor hashing refactoring.
31 * fns.c (SXHASH_REDUCE): Move to lisp.h.
32 (sxhash_float): Return EMACS_UINT, for consistency with the other
33 hash functions.
34 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
35 non-static inline function and therefore can't use static vars.
36 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
37 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
38 with the other hash functions.
39
40 2013-02-09 Eli Zaretskii <eliz@gnu.org>
41
42 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
43 XXXXXX part of the temporary file pattern is not downcased even
44 when w32-downcase-file-names is non-nil. (Bug#13661)
45
46 * xdisp.c (decode_mode_spec): Remove handling of %t.
47
48 * msdos.c (careadlinkatcwd): Remove.
49
50 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
51
52 * lread.c (skip_dyn_bytes): New function (bug#12598).
53 (read1): Use it. Use getc instead of READCHAR to read bytes.
54 (load_each_byte): Remove. Update users.
55
56 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
57
58 * search.c (scan_buffer): Calculate end byte position just once.
59 (scan_newline): Do not recalculate start_byte.
60 (search_command): Use eassert.
61 * syntax.c (struct lisp_parse_state): New member location_byte.
62 (scan_sexps_forward): Record from_byte and avoid redundant
63 character to byte position calculation ...
64 (Fparse_partial_sexp): ... here. Break too long line.
65
66 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
67
68 * lisp.h (make_uninit_vector): New function.
69 * alloc.c (Fvector, Fmake_byte_code):
70 * ccl.c (Fregister_ccl_program):
71 * charset.c (Fdefine_charset_internal, define_charset_internal):
72 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
73 * composite.c (syms_of_composite):
74 * font.c (Fquery_font, Ffont_info, syms_of_font):
75 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
76 * ftfont.c (ftfont_shape_by_flt):
77 * indent.c (recompute_width_table):
78 * nsselect.m (clean_local_selection_data):
79 * syntax.c (init_syntax_once):
80 * w32unsubscribe.c (uniscribe_shape):
81 * window.c (Fcurrent_window_configuration):
82 * xfaces.c (Fx_family_fonts):
83 * xselect.c (selection_data_to_lisp_data): Use it.
84
85 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
86
87 * coding.c (Fdefine_coding_system_internal): Use AREF where
88 argument is known to be a vector.
89 * fns.c (Flocale_info): Likewise for ASET.
90 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
91 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
92
93 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
94
95 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
96 height.
97
98 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
99 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
100 updateCollectionBehaviour.
101
102 * nsterm.m (NEW_STYLE_FS): Remove.
103 (ns_last_use_native_fullscreen): New variable.
104 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
105 (x_set_window_size): Do not take title bar and tool bar into account
106 if isFullscreen returns YES.
107 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
108 (check_native_fs): New function.
109 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
110 (ns_term_init): Remove NEW_STYLE_FS.
111 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
112 and tool bar if isFullscreen returns NO.
113 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
114 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
115 with HAVE_NATIVE_FS.
116 (window:willUseFullScreenPresentationOptions:): New method.
117 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
118 Hide toolbar if not enabled (Bug#13444).
119 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
120 Restore tool bar if enabled, hide it otherwise (Bug#13444).
121 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
122 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
123 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
124 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
125 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
126 (syms_of_nsterm): Add ns-use-native-fullscreen.
127
128 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
129
130 * fileio.c (Qchoose_write_coding_system): Now static.
131
132 2013-02-04 Eli Zaretskii <eliz@gnu.org>
133
134 * xdisp.c (window_buffer_changed): region_showing can be negative,
135 which still means region is being displayed.
136 (redisplay_internal): Resurrect code that forced redisplay of the
137 whole window when showing region and the mark has changed. Record
138 the new mark position to allow redisplay optimizations.
139 (display_line): If it->region_beg_charpos is non-zero, set the
140 window's region_showing member to -1. (Bug#13623) (Bug#13626)
141
142 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
143 not bitfield of 1 bit.
144
145 2013-02-03 Daniel Colascione <dancol@dancol.org>
146
147 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
148 daemon mode works on cygw32 when Emacs is installed and not just
149 during development.
150
151 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
152
153 Avoid file time stamp bug on MS-Windows (Bug#13149).
154 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
155 as FAT32 doesn't update time stamps when truncating them.
156 Also, check that a file time stamp is not a multiple of 100 ns;
157 this should catch all instances of the problem on MS-Windows,
158 as its native file system resolution is 100 ns or worse, and
159 checking for a non-multiple of 100 ns should impose only a small
160 overhead on systems with ns resolution.
161
162 2013-02-02 Eli Zaretskii <eliz@gnu.org>
163
164 Avoid encoding file names on MS-Windows when they need to be run
165 through dostounix_filename.
166 * w32.c (normalize_filename): Accept an additional argument
167 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
168 downcase it even if w32-downcase-file-names is non-nil.
169 (dostounix_filename): Accept an additional argument MULTIBYTE and
170 pass it to normalize_filename.
171 (emacs_root_dir): Adjust.
172
173 * msdos.h (dostounix_filename): Adjust prototype.
174
175 * w32.h (dostounix_filename): Adjust prototype.
176
177 * msdos.c (dostounix_filename): Accept an additional argument and
178 ignore it.
179 (init_environment): Adjust callers of dostounix_filename.
180
181 * fileio.c (Ffile_name_directory, file_name_as_directory)
182 (directory_file_name, Fexpand_file_name)
183 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
184 dostounix_filename.
185 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
186 non-nil.
187 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
188 variables, as egetenv is case-insensitive for DOS_NT.
189
190 * dired.c (file_name_completion): Don't call Fdirectory_file_name
191 with an encoded file name.
192
193 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust
194 calls to dostounix_filename.
195
196 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
197
198 * unexw32.c (unexec): Adjust call to dostounix_filename.
199
200 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
201
202 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
203 dostounix_filename.
204
205 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
206 dostounix_filename.
207
208 * callproc.c (Fcall_process): Make sure program name in PATH and
209 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
210 is passed to exec/spawnve, which fails unless the file-name
211 encoding is UTF-8.
212
213 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
214 even if w32-quote-process-args is nil.
215
216 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
217
218 Fix timestamp bug when write-region appends nothing (Bug#13149).
219 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
220 the file's time stamp doesn't change if Emacs happens to write nothing
221 to the file, and on a buggy file system this could cause Emacs to
222 incorrectly infer that the file system doesn't have the bug.
223 Avoid this problem by inhibiting the inference in this case.
224
225 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
226
227 * window.h (struct window): Convert base_line_number, base_line_pos
228 and column_number_displayed members from Lisp_Object to ptrdiff_t.
229 Convert region_showing member from Lisp_Object to bitfield.
230 Remove sequence_number member. Adjust comments.
231 * window.c (sequence_number): Remove.
232 (make_window): Initialize column_number_displayed.
233 * print.c (print_object): Follow the printed representation of
234 frames and print window pointer to distinguish between windows.
235 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
236 * xdisp.c (wset_base_line_number, wset_base_line_pos)
237 (wset_column_number_displayed, wset_region_showing): Remove.
238 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
239 (try_scrolling, try_cursor_movement, redisplay_window)
240 (try_window_reusing_current_matrix, try_window_id, display_line)
241 (display_mode_lines, decode_mode_spec): Adjust users.
242 * .gdbinit (pwinx): Do not print sequence_number.
243
244 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
245
246 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
247 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
248 * dired.c: Include <fcntl.h>.
249 (open_directory): New function, which uses open and fdopendir
250 rather than opendir. DOS_NT platforms still use opendir, though.
251 (directory_files_internal, file_name_completion): Use it.
252 (file_attributes): New function, with most of the old Ffile_attributes.
253 (directory_files_internal, Ffile_attributes): Use it.
254 (file_attributes, file_name_completion_stat): First arg is now fd,
255 not dir name. All uses changed. Use fstatat rather than lstat +
256 stat.
257 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
258 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
259 (emacs_readlinkat): New function, with much of the old
260 Ffile_symlink_p, but with an fd argument for speed.
261 It uses readlinkat rather than careadlinkatcwd, so that it
262 need not assume the working directory.
263 (Ffile_symlink_p): Use it.
264 * filelock.c (current_lock_owner): Use emacs_readlinkat
265 rather than emacs_readlink.
266 * lisp.h (emacs_readlinkat): New decl.
267 (READLINK_BUFSIZE, emacs_readlink): Remove.
268 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
269 (emacs_norealloc_allocator, emacs_readlink): Remove.
270 This stuff is moved to fileio.c.
271 * w32.c (fstatat, readlinkat): New functions.
272 (careadlinkat): Don't check that fd == AT_FDCWD.
273 (careadlinkatcwd): Remove; no longer needed.
274
275 2013-01-31 Glenn Morris <rgm@gnu.org>
276
277 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
278 (Fwrite_region): Update for new choose_write_coding_system args.
279 Move the last piece of choose_write_coding_system here. (Bug#13522)
280 (syms_of_fileio): Add choose-write-coding-system.
281
282 2013-01-30 Eli Zaretskii <eliz@gnu.org>
283
284 * w32.c (sys_open): Zero out the flags for the new file descriptor.
285 (sys_close): Zero out the flags for the file descriptor before
286 closing it. (Bug#13546)
287
288 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
289 (logon_network_drive, stat_worker, symlink, chase_symlinks): Use
290 CharNextExA and CharPrevExA to iterate over file names encoded in
291 DBCS. (Bug#13553)
292
293 * w32.c (w32_get_long_filename, init_environment, readlink):
294 Support file names encoded in DBCS codepages.
295 (readlink): Use the current file-name-coding-system, not the ANSI
296 codepage, to decode and handle targets of symlinks.
297
298 2013-01-28 Eli Zaretskii <eliz@gnu.org>
299
300 * w32.c (opendir): Now accepts a 'const char *'.
301
302 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
303
304 Remove obsolete redisplay code. See the discussion at
305 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
306 * dispnew.c (preemption_period, preemption_next_check): Remove.
307 (Vredisplay_preemption_period): Likewise.
308 (update_frame, update_single_window, update_window, update_frame_1):
309 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
310 used, following the 2012-06-22 change.
311
312 2013-01-25 Eli Zaretskii <eliz@gnu.org>
313
314 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
315
316 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
317
318 * font.c (num_fonts): Remove the leftover from old
319 debugging code. Adjust comment style here and there.
320 * insdel.c (insert_1): Remove.
321 * lisp.h (insert_1): Remove prototype.
322 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
323
324 2013-01-25 Eli Zaretskii <eliz@gnu.org>
325
326 * w32.c (max_filename_mbslen): New function.
327 (normalize_filename, readdir): Use it to detect locales where ANSI
328 encoding of file names uses a double-byte character set (DBCS).
329 If a DBCS encoding is used, advance by characters using
330 CharNextExA, instead of incrementing a 'char *' pointer. Use
331 _mbslwr instead of _strlwr. (Bug#13515)
332
333 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
334 request of memory reservation to 1.7GB. (Bug#13065)
335
336 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
337
338 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
339 at check_extra_latin label. (Bug#13505)
340
341 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
342
343 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
344 Avoid redundant calls to strlen.
345
346 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
347
348 Drop async_visible and async_iconified fields of struct frame.
349 This is possible because async input is gone; for details, see
350 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
351 * frame.h (struct frame): Remove async_visible and async_iconified
352 members, convert garbaged to unsigned bitfield. Adjust comments.
353 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
354 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
355 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
356 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
357 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
358 * w32term.c: Ditto.
359 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
360 properly. Likewise for obscured.
361 * xterm.c: Ditto.
362 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
363 properly.
364 * nsterm.m: Ditto.
365 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
366
367 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
368
369 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
370 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
371
372 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
373
374 * xdisp.c (message2, message2_nolog): Remove functions.
375 (message3, message3_nolog): Extract nbytes and multibyteness directly
376 from the string. Change all callers.
377 (message3_nolog): Don't set message_enable_multibyte since set_message
378 will reset it anyway.
379 (message1, message1_nolog): Use message3.
380 (vmessage): Use a stack allocated buffer rather than f->message_buf.
381 (with_echo_area_buffer): Remove last two arguments. Update all callers.
382 (set_message): Drop all but the second arg, which has to be a string.
383 (set_message_1): Simplify now that we know that a1 is NULL and the
384 second arg is a string.
385 * frame.h (struct frame): Remove `message_buf' field.
386 Use glyphs_initialized_p instead.
387 (FRAME_MESSAGE_BUF): Remove macro.
388 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
389 * lisp.h (message2, message2_nolog): Remove declarations.
390 (message3, message3_nolog): Update declarations.
391 * keyboard.c (read_char_minibuf_menu_text)
392 (read_char_minibuf_menu_width): Remove vars.
393 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
394 to correctly handle multibyte strings.
395 * frame.c (delete_frame): Don't free message_buf any more.
396 * editfns.c (message_text, message_length): Remove vars.
397 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
398 * fileio.c (auto_save_error): Use message3 instead of message2.
399 * dispnew.c (adjust_frame_message_buffer): Remove function.
400
401 2013-01-23 Eli Zaretskii <eliz@gnu.org>
402
403 * w32term.c (w32fullscreen_hook): Account correctly for the screen
404 real estate used for the tool bar and the menu bar.
405
406 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
407
408 * insdel.c (prepare_to_modify_buffer): Force redisplay if
409 hidden buffer is prepared to modification (Bug#13164).
410
411 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
412
413 * window.h (struct window): Change window_end_valid member from
414 Lisp_Object to a bitfield. Adjust comments.
415 (wset_window_end_valid): Remove.
416 * window.c (adjust_window_count): Clear window_end_valid.
417 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
418 (Fwindow_line_height, set_window_buffer, Frecenter)
419 (Fsplit_window_internal, Fdelete_other_windows_internal)
420 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
421 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
422 * xdisp.c (check_window_end, reconsider_clip_changes)
423 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
424 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
425 (find_first_unchanged_at_end_row, try_window_id): Likewise.
426
427 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
428
429 * xdisp.c (mark_window_display_accurate): Simplify the loop
430 assuming that the only one of vchild, hchild or buffer window
431 slots is non-nil. Call mark_window_display_accurate_1 for
432 the leaf windows only.
433 (mark_window_display_accurate_1): Always assume leaf window.
434 Adjust comment.
435
436 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
437
438 * emacs.c (Qkill_emacs_hook): Now static.
439
440 * fileio.c (Finsert_file_contents): Simplify.
441 Remove unnecessary assignments and tests.
442
443 2013-01-21 Eli Zaretskii <eliz@gnu.org>
444
445 * w32.c (acl_set_file): Don't test for errors unless
446 set_file_security returns FALSE. Avoids spurious errors when
447 saving files.
448
449 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
450
451 * fileio.c (Finsert_file_contents): Revert code introduced at
452 2013-01-18 in favor of the simpler and generally better fix.
453 Save stack space by removing 'buffer' and reusing 'read_buf'
454 where appropriate.
455
456 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
457
458 * lisp.h (eabs): Define unconditionally (Bug#13419).
459 The old "#if !defined (eabs)" was an unnecessary revenant of back
460 when this macro was called "abs". Document 'eabs' better.
461
462 2013-01-19 Glenn Morris <rgm@gnu.org>
463
464 * fns.c (Frandom): Doc fix.
465
466 2013-01-19 Eli Zaretskii <eliz@gnu.org>
467
468 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
469 segfault when there are lots of overlays.
470
471 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
472 when there are lots of overlays. See
473 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
474 for the details and a way to reproduce.
475
476 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
477
478 * fileio.c: Use O_APPEND to append.
479 This corresponds better to the natural interpretation of "append",
480 and avoids the need to open the output file twice, or to invoke
481 lseek when APPEND is neither nil nor a number.
482 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
483 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
484 file possibly twice, and lseeking to its end; this avoids the
485 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
486 at the same time: the combination is never needed and apparently
487 it doesn't work with DOS_NT.
488
489 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
490 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
491
492 Allow floating-point file offsets.
493 Problem reported by Vitalie Spinu in
494 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
495 * fileio.c (emacs_lseek): Remove.
496 (file_offset): New function.
497 (Finsert_file_contents, Fwrite_region): Use it.
498
499 2013-01-19 Chong Yidong <cyd@gnu.org>
500
501 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
502 aborting on Fsignal (Bug#13289).
503
504 2013-01-19 Eli Zaretskii <eliz@gnu.org>
505
506 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
507 set_file_security as failure due to insufficient privileges.
508 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
509 (fstat): Return owner and group like 'stat' and 'lstat' do.
510
511 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
512
513 Work around bug in CIFS and vboxsf file systems (Bug#13149).
514 The bug was observed on Ubuntu operating inside a virtual machine,
515 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
516 The workaround introduces a race condition on non-buggy hosts,
517 but it's an unlikely race and anyway there's a nearly identical
518 nearby race that can't be fixed.
519 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
520 New static vars.
521 (Fwrite_region): Test for file system time stamp bug.
522 (init_fileio): New function.
523 * lisp.h (init_fileio): Declare it.
524 * emacs.c (main): Call it.
525
526 * fileio.c (Finsert_file_contents): Simplify new diagnostic
527 and make it more consistent with other stat-failure diagnostics.
528
529 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
530
531 Fix crash when inserting data from non-regular files. See
532 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
533 for the error description produced by valgrind.
534 * fileio.c (read_non_regular): Rename to read_contents.
535 Free Lisp_Save_Value object used to pass parameters.
536 (read_non_regular_quit): Rename to read_contents_quit.
537 (Finsert_file_contents): Redesign internal file reading loop to adjust
538 gap and end positions after each read and so help make_gap to work
539 properly. Do not signal an I/O error too early and so do not leave
540 not yet decoded characters in a buffer, which was the reason of
541 redisplay crash. Use list2 to build return value. Adjust comments.
542
543 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
544
545 Close a race when statting and reading files (Bug#13149).
546 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
547 This avoids a race if the file is renamed between stat and open.
548 This race is not the problem originally noted in Bug#13149;
549 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
550
551 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
552
553 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
554 objects, related functions and macros.
555 (make_save_value): Adjust prototype.
556 (make_save_pointer): New prototype.
557 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
558 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
559 * alloc.c (format_save_value): Rename to make_save_value.
560 (make_save_pointer): New function.
561 (record_xmalloc): Use make_save_pointer.
562 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
563 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
564 Change users of make_save_value to make_save_pointer.
565 Likewise for format_save_value and make_save_value.
566
567 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
568
569 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
570 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
571 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
572 debugging stubs.
573
574 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
575
576 * alloc.c (free_save_value): Now static.
577
578 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
579
580 * keymap.c (map_keymap_internal): Use format_save_value.
581 (map_keymap_char_table_item): Adjust accordingly.
582 * fileio.c (non_regular_fd, non_regular_inserted)
583 (non_regular_nbytes): Remove.
584 (Finsert_file_contents): Convert trytry to ptrdiff_t. Use
585 format_save_value to pass parameters to read_non_regular.
586 (read_non_regular): Use XSAVE_ macros to extract parameters.
587 Adjust comment.
588 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
589 format_save_value.
590 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
591
592 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
593
594 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
595 extraction from any Lisp_Save_Value slot. Add type checking.
596 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
597 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
598 * xselect.c: All users changed.
599
600 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
601
602 Some convenient bits to deal with Lisp_Save_Values.
603 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
604 (allocate_misc): Remove prototype.
605 (format_save_value): New prototype.
606 * alloc.c (allocate_misc): Revert back to static.
607 (format_save_value): New function to build Lisp_Save_Value
608 object with the specified internal structure.
609 (make_save_value): Reimplement using format_save_value.
610 * editfns.c (save_excursion_save): Use format_save_value.
611 (save_excursion_restore): Use XSAVE_OBJECT.
612
613 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
614
615 Avoid needless casts with XSAVE_POINTER.
616 * alloc.c (mark_object) [GC_MARK_STACK]:
617 * dired.c (directory_files_internal_unwind):
618 * fileio.c (do_auto_save_unwind):
619 * gtkutil.c (pop_down_dialog):
620 * keymap.c (map_keymap_char_table_item):
621 * lread.c (load_unwind):
622 * nsmenu.m (pop_down_menu):
623 * print.c (print_object) [GC_MARK_STACK]:
624 * xfns.c (clean_up_file_dialog):
625 * xmenu.c (cleanup_widget_value_tree):
626 Omit casts between XSAVE_POINTER and a pointer type.
627
628 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
629
630 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
631 * eval.c (eval_sub): Protect `form' from being GCed before its
632 car and cdr becomes protected with the backtrace entry.
633
634 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
635
636 Make Lisp_Save_Value more versatile storage for up to four objects.
637 * lisp.h (toplevel): Enumeration to describe types of saved objects.
638 (struct Lisp_Save_Value): New layout. Adjust comments.
639 (XSAVE_POINTER): New macro.
640 (XSAVE_INTEGER): Likewise.
641 (allocate_misc): Add prototype.
642 (free_misc): Likewise.
643 * alloc.c (allocate_misc): Now global.
644 (free_misc): Likewise. Adjust comment.
645 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
646 (free_save_value): Likewise.
647 (mark_object): Likewise.
648 * editfns.c (save_excursion_save): Pack everything within
649 Lisp_Save_Value and so avoid xmalloc.
650 (save_excursion_restore): Adjust to match new layout. Use free_misc
651 because we do not allocate extra memory any more. Add eassert.
652 * print.c (print_object): New code to print Lisp_Save_Value. Do not
653 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
654 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
655 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
656 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
657
658 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
659
660 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
661 (nsfont_draw): Remove disabling of LCD smoothing.
662 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
663 Bug#11484 with LCD smoothing on.
664
665 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
666
667 Fix SIGDANGER handlers, for AIX (Bug#13408).
668 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
669 Move handlers here from emacs.c; they were out of place.
670
671 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
672
673 * xterm.c (syms_of_xterm): Adjust documentation for
674 scroll-bar-adjust-thumb-portion.
675
676 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
677
678 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
679 determine whether scroll bar thumb size should be adjusted or
680 not. Use variable for MOTIF.
681
682 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
683 GTK.
684
685 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
686
687 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
688 event is generated.
689 (doCommandBySelector:): Set processingCompose to NO.
690
691 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
692 Remove check for fkeys count > zero, block/unblock fixes the real bug.
693 (nsfont_list_family): Add block/unblock_input calls.
694 (nsfont_open): Move block_input earlier. Add unblock_input before early
695 return.
696 (nsfont_draw): Add block/unblock_input calls.
697
698 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
699
700 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
701 for old_charpos and old_bytepos.
702
703 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
704
705 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
706 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
707 Clear tzvalbuf_in_environ if this workaround is in effect.
708 Problem and fix reported by Kazuhiro Ito.
709
710 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
711
712 * insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
713 ambiguous doc string cross-reference(s).
714
715 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
716 doc string cross-reference(s).
717
718 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
719 string cross-reference(s).
720
721 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
722
723 Avoid unnecessary byte position calculation for the gap movement.
724 Since all users of move_gap do CHAR_TO_BYTE for other purposes
725 anyway, all of them should use move_gap_both instead.
726 * lisp.h (move_gap): Remove prototype.
727 * insdel.c (move_gap): Remove.
728 (move_gap_both): Add eassert.
729 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
730 * xml.c (parse_region): Likewise.
731
732 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
733
734 emacsclient -t should not suspend Emacs server (Bug#13387)
735 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
736 New functions.
737 * term.c (init_tty): Use them instead of rolling our own code.
738 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
739 switches from 'signal' to 'pthread_sigmask', which is safer in
740 multithreaded applications.
741 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
742 which has already arranged for that.
743 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
744 This is the main part of the bug fix.
745
746 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
747
748 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
749 x_last_font_name (Bug#13403).
750
751 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
752
753 Omit buffer_slot_type_mismatch and use generic predicates to enforce
754 the type of per-buffer values where appropriate.
755 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
756 predicate, which is how it's really used now. Adjust comment.
757 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
758 * buffer.c (buffer_slot_type_mismatch): Remove.
759 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
760 predicate. Adjust comment.
761 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
762 fill-column, left-margin, tab-width, buffer-saved-size,
763 left-margin-width, right-margin-width, left-fringe-width,
764 right-fringe-width, scroll-bar-width and buffer-display-count.
765 Use Qstringp for default-directory, buffer-file-name,
766 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
767 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
768 line-spacing.
769 * data.c (store_symval_forwarding): Adjust to call the predicate.
770
771 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
772
773 * w32.c (get_name_and_id, acl_set_file):
774 * w32term.c (w32fullscreen_hook): Remove unused local variables.
775
776 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
777
778 * lisp.h (make_gap_1): New prototype.
779 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
780 gap size values.
781 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
782 naming convention.
783 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
784 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
785 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
786 (make_gap_1): New function to adjust the gap of any buffer.
787 * coding.c (coding_alloc_by_making_gap): Use it.
788 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
789 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
790
791 2013-01-08 Juri Linkov <juri@jurta.org>
792
793 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
794 of (supports :underline (:style wave)). (Bug#13000)
795
796 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
797
798 * undo.c (Fprimitive_undo): Move to simple.el.
799 (syms_of_undo): Remove declarations for Sprimitive_undo.
800
801 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
802
803 * keyboard.c (echo_add_key): Rename from echo_add_char.
804
805 2013-01-06 Chong Yidong <cyd@gnu.org>
806
807 * keyboard.c (echo_add_char): New function, factored out from
808 echo_char. Don't add a space if the previous echo string was
809 empty (Bug#13255).
810 (echo_char): Use it.
811 (read_key_sequence): When echoing mock input, ensure that the
812 trailing dash is properly added.
813
814 2013-01-05 Eli Zaretskii <eliz@gnu.org>
815
816 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
817 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
818 digits for buffer positions, before misalignment starts.
819 Display "0" for integer "object" field.
820 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
821 Display the newline glyph more unambiguously.
822
823 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
824
825 * nsterm.m (ns_draw_underwave):
826 * w32term.c (w32_draw_underwave):
827 * xterm.c (x_draw_underwave): Make underwave look more triangular
828 and also degrade gracefully for small fonts. (Bug#13000)
829
830 * nsterm.m (ns_draw_text_decoration):
831 * w32term.c (x_draw_glyph_string):
832 * xterm.c (x_draw_glyph_string): Don't use previous underline
833 thickness and position if previous underline type is underwave.
834
835 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
836
837 * fileio.c (Ffile_acl): Undocument return format.
838
839 2013-01-02 Glenn Morris <rgm@gnu.org>
840
841 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
842
843 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
844
845 Simplify via eabs.
846 * dired.c (file_name_completion):
847 * doc.c (get_doc_string):
848 * floatfns.c (round2):
849 * font.c (font_score, font_delete_unmatched):
850 * fringe.c (compute_fringe_widths):
851 * lread.c (read_list):
852 * minibuf.c (Ftry_completion):
853 * term.c (tty_ins_del_lines):
854 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
855 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
856
857 2012-12-31 Eli Zaretskii <eliz@gnu.org>
858
859 * w32.c (unsetenv): Set up the string passed to _putenv
860 correctly.
861 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
862 for the bug this caused.
863
864 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
865
866 * coding.c (Qmac): Now static.
867
868 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
869
870 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
871 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
872 handlebox_widget. Set toolbar_in_hbox to false/true, set
873 toolbar_is_packed to true.
874 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
875 (update_frame_tool_bar): Check toolbar_is_packed for packing.
876 Show all on TOOLBAR_TOP_WIDGET.
877 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
878 by TOOLBAR_TOP_WIDGET.
879 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
880 Check toolbar_is_packed.
881 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
882 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
883 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
884 false.
885 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
886 (xg_update_menubar): Update title only if
887 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
888 (xg_update_submenu): Skip tearoff only if
889 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
890 (xg_initialize): Initialize xg_detached_menus only if
891 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
892
893 * xterm.h (struct x_output): Surround handlebox_widget with
894 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
895 toolbar_in_hbox is bool.
896
897 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
898
899 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
900 (LIBS_GNUSTEP): Define.
901 (LIBES): Add $(LIBS_GNUSTEP).
902 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
903
904 2012-12-30 Eli Zaretskii <eliz@gnu.org>
905
906 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
907 continuation glyph on a TTY with an indication of an empty line.
908 (Bug#13277)
909
910 2012-12-29 Eli Zaretskii <eliz@gnu.org>
911
912 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
913 file's SELinux context or ACLs successfully set, nil otherwise.
914 (Bug#13298)
915 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
916
917 * w32proc.c (reader_thread): Avoid passing NULL handles to
918 SetEvent and WaitForSingleObject.
919
920 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
921
922 Port EXTERNALLY_VISIBLE to Clang 3.2.
923 * conf_post.h (__has_attribute): New macro.
924 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
925
926 2012-12-27 Glenn Morris <rgm@gnu.org>
927
928 * cygw32.c (Fcygwin_convert_file_name_to_windows)
929 (Fcygwin_convert_file_name_from_windows): Doc fixes.
930
931 2012-12-27 Eli Zaretskii <eliz@gnu.org>
932
933 * fileio.c (file_name_as_directory, directory_file_name):
934 Accept an additional argument MULTIBYTE to indicate whether the input C
935 came from a multibyte or a unibyte Lisp string; all callers
936 adjusted. Don't assume the input string is always multibyte.
937 (Bug#13262)
938 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
939 don't ENCODE_FILE them, and return a unibyte string if the input
940 was unibyte.
941 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
942 don't assume the input strings will always be multibyte. If the
943 input strings are multibyte, decode strings obtained from C
944 library functions.
945
946 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
947
948 * lisp.h (toplevel): Add two notices to the comment about
949 defining a new Lisp data type.
950 * print.c (print_object): If Lisp_Save_Value object's pointer
951 is the address of a memory area containing Lisp_Objects, try
952 to print them.
953 * alloc.c (valid_lisp_object_p): Adjust comment.
954
955 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
956
957 * keyboard.c (record_asynch_buffer_change): Initialize an event
958 only if it's really needed.
959 * frame.h (enum output_method): Remove output_mac member since
960 it's a leftover from the deleted code.
961 * frame.c (Fframep): Adjust user here ...
962 * terminal.c (Fterminal_live_p): ... and here.
963 * coding.c (Qmac): Now here because it's only used to denote
964 end-of-line encoding type.
965 (syms_of_coding): DEFSYM it.
966 * frame.h (Qmac): Remove duplicated declaration.
967
968 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
969
970 * window.c (select_window_1): Now static, since it's used only here.
971
972 2012-12-25 Eli Zaretskii <eliz@gnu.org>
973
974 * window.c (window_body_cols): Subtract display margins from the
975 window body width on TTYs as well. See
976 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
977 for the original report.
978
979 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
980
981 * xdisp.c (redisplay_window): Remove inner local variable
982 because the outer shadowed one has the same meaning.
983 * xterm.h (struct x_output): Remove toolbar_detached member since it's
984 set but never used.
985 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
986 (xg_create_tool_bar): Adjust users.
987
988 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
989
990 * buffer.h (BUF_COMPACT): New macro to follow the common style.
991 * buffer.c (Fget_buffer_create): Use it to set compact field of
992 struct buffer_text to avoid accessing an uninitialized value
993 when compact_buffer is called for the first time.
994 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
995 (Fset_buffer_modified_p): Use buffer_window_count to check
996 whether the buffer is displayed in some window.
997 * xdisp.c (message_dolog): Likewise.
998
999 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1000
1001 * w32.c (acl_set_file): If setting the file security descriptor
1002 fails, and the new DACL is identical to the existing one, silently
1003 return success. This fixes problems for users backing up their
1004 own files without having the necessary privileges for setting
1005 security descriptors.
1006
1007 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1008 values.
1009 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1010 after WaitForSingleObject returns normally. This expedites reader
1011 thread shutdown when delete_child triggers it.
1012 (reap_subprocess): More accurate commentary for why we call
1013 delete_child only when cp->fd is negative.
1014
1015 * w32.c (sys_close): Do not call delete_child on a subprocess
1016 whose handle is not yet closed. Instead, set its file descriptor
1017 to a negative value, so that reap_subprocess will call
1018 delete_child on that subprocess when its SIGCHLD arrives.
1019 This avoids closing handles used for communications between sys_select
1020 and reader_thread, which doesn't give sys_select a chance to
1021 notice that the process exited and invoke the SIGCHLD handler for
1022 it.
1023
1024 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1025
1026 * nsfns.m (Fns_do_applescript): Run event loop until script has
1027 been executed (Bug#12969).
1028 (ns_run_ascript): Chech as_script for nil, set to nil after
1029 executing script.
1030
1031 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1032
1033 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1034
1035 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1036
1037 * w32term.c (w32fullscreen_hook): New function.
1038 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1039
1040 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1041
1042 * fileio.c (Finsert_file_contents): Doc fix.
1043
1044 * w32proc.c (new_child, delete_child, find_child_pid): For a
1045 subprocess, consider its slot being in use as long as its process
1046 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1047 slot when a new process is started immediately after killing
1048 another one, without waiting enough time for the first process to
1049 be reaped and resources allocated for it be orderly freed.
1050 (Bug#13086)
1051 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1052
1053 2012-12-21 Chong Yidong <cyd@gnu.org>
1054
1055 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1056
1057 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1058
1059 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1060
1061 * w32.c (get_name_and_id): Always pass NULL as the first argument
1062 of lookup_account_sid. Avoids crashes with UNC file names that
1063 refer to DFS domains, not to specific machine names. (Bug#12621)
1064 Remove now unused argument FNAME; all callers changed.
1065 (get_file_owner_and_group): Remove now unused argument FNAME; all
1066 callers changed.
1067
1068 2012-12-21 Chong Yidong <cyd@gnu.org>
1069
1070 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1071 error for invalid chars, don't check for a nil return value.
1072
1073 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1074
1075 Avoid calls to CHAR_TO_BYTE if byte position is known.
1076 * editfns.c (make_buffer_string_both): Use move_gap_both.
1077 (Fbuffer_string): Use make_buffer_string_both.
1078 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1079 Adjust comment.
1080 (buf_bytepos_to_charpos): Likewise.
1081 (charpos_to_bytepos): Remove.
1082 * fileio.c (Finsert_file_contents): Use move_gap_both.
1083 * search.c (Freplace_match): Likewise.
1084 * process.c (process_send_region): Likewise. Use convenient
1085 names for byte positions.
1086 * lisp.h (charpos_to_bytepos): Remove prototype.
1087 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1088 * insdel.c (move_gap): Likewise.
1089
1090 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1091
1092 * xdisp.c (redisplay_internal): Remove now-unused local.
1093
1094 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1095
1096 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1097 (redisplay_internal): Don't bother selecting the frame to get the
1098 proper value of frame-local variables (bug#13225).
1099
1100 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1101
1102 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1103 Rename 4th argument since it may be buffer or string. Adjust comment.
1104 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1105
1106 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1107
1108 * coding.c (Fdetect_coding_region): Do not check start and end with
1109 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1110 (code_convert_region): Likewise.
1111
1112 2012-12-18 Eli Zaretskii <eliz@gnu.org>
1113
1114 * w32.c (acl_get_file, acl_set_file): Run the file name through
1115 map_w32_filename, and resolve any symlinks in the file name, like
1116 Posix platforms do.
1117 (acl_set_file): Call revert_to_self, if any privileges were
1118 enabled.
1119
1120 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
1121
1122 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1123 ($(BLD)/w32.$(O)): Update dependencies.
1124
1125 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1126
1127 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1128 propagate redisplay's scrolling (if any) to the right window.
1129 (redisplay_internal): Use ensure_selected_frame.
1130 (display_mode_lines): Complete last fix.
1131 * window.c (select_window_1): New func, extracted from select_window.
1132 (select_window): Use it.
1133 * window.h (select_window_1): Declare.
1134
1135 2012-12-17 Eli Zaretskii <eliz@gnu.org>
1136
1137 Emulate Posix ACL APIs on MS-Windows.
1138 * w32.c: Include sddl.h and sys/acl.h.
1139 (SDDL_REVISION_1): Define if not already defined.
1140 (g_b_init_get_security_descriptor_dacl)
1141 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1142 (g_b_init_is_valid_security_descriptor)
1143 (g_b_init_set_file_security): New static flags.
1144 (globals_of_w32): Initialize them to zero.
1145 (SetFileSecurity_Name): New string constant.
1146 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1147 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1148 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1149 (IsValidSecurityDescriptor_Proc): New typedefs.
1150 (get_file_security, get_security_descriptor_owner)
1151 (get_security_descriptor_group): Set errno to ENOTSUP.
1152 (set_file_security, get_security_descriptor_dacl)
1153 (is_valid_security_descriptor, convert_sd_to_sddl)
1154 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1155 (acl_free, acl_get_file, acl_set_file): New functions.
1156
1157 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1158
1159 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1160
1161 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1162 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1163 for some of that bug's symptoms can now cause Emacs to abort.
1164 Remove the workaround.
1165 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1166 The bug that caused SIGCHLD to get lost has been fixed, and the
1167 workaround for it can now cause Emacs to abort.
1168
1169 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1170
1171 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1172 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1173 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1174
1175 2012-12-16 Romain Francoise <romain@orebokech.com>
1176
1177 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1178 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1179 and copy ACL entries of file in addition to SELinux context if set.
1180 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1181
1182 * Makefile.in (LIBACL_LIBS): New macro.
1183 (LIBES): Use it.
1184
1185 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1186
1187 * fileio.c (internal_delete_file): Use bool for boolean.
1188
1189 2012-12-15 Eli Zaretskii <eliz@gnu.org>
1190
1191 Fix bug #13079 on MS-Windows with temp files not being deleted.
1192 * w32.h (_child_process): New members input_file and
1193 pending_deletion.
1194 (register_child): First argument is now pid_t.
1195 (record_infile, record_pending_deletion): New prototypes.
1196
1197 * w32proc.c (new_child): Initialize input_file and
1198 pending_deletion members of the child.
1199 (delete_child): Delete the child's temporary input file, if any,
1200 that is pending deletion.
1201 (register_child): First argument is now pid_t.
1202 (record_infile, record_pending_deletion): New functions.
1203 (reap_subprocess): Fix a typo in DebPrint string.
1204 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1205
1206 * fileio.c (internal_delete_file): Return an int again: non-zero
1207 if delete-file succeeds, zero otherwise.
1208
1209 * lisp.h (internal_delete_file): Adjust prototype.
1210
1211 * callproc.c (Fcall_process): Don't overwrite infile with result
1212 of DECODE_FILE.
1213 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1214 asynchronous subprocess, record the name of the input file name,
1215 if any.
1216 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1217 delete the file, record it as pending deletion when the subprocess
1218 exits.
1219
1220 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1221
1222 * editfns.c [HAVE_PWD_H]: Include grp.h.
1223
1224 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1225
1226 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1227
1228 Fix permissions bugs with setgid directories etc. (Bug#13125)
1229 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1230 to mark it as a placeholder. The old value was often wrong.
1231 The only user of this attribute has been changed to use
1232 file-ownership-preserved-p instead, with its new group arg.
1233 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1234
1235 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1236
1237 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1238 Keep selected_window and selected_frame in sync.
1239
1240 2012-12-14 Eli Zaretskii <eliz@gnu.org>
1241
1242 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1243 try to get accurate owner and group information from NT file
1244 security APIs. This is to make most callers of 'stat' and
1245 'lstat', which don't need that information, much faster.
1246
1247 * dired.c (Ffile_attributes) [WINDOWSNT]:
1248 Set w32_stat_get_owner_group to a non-zero value, to request accurate
1249 owner and group information from 'lstat'.
1250
1251 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1252
1253 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1254 as that confuses set-auto-coding, so insist on the head-read
1255 returning the full 1024 bytes. Let lseek compute the tail offset;
1256 less work for us. Do not ignore I/O errors when reading the tail.
1257
1258 * xdisp.c: Minor style fixes.
1259 (init_iterator): Hoist assignment out of if-expression.
1260 (markpos_of_region): Callers now test for sign, not for -1.
1261
1262 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1263
1264 Minor redisplay optimization when the region length is zero.
1265 * xdisp.c (markpos_of_region): New function.
1266 (init_iterator): Do not highlight the region of zero length.
1267 (redisplay_window): Check whether the region is of non-zero length.
1268 (try_cursor_movement): Allow if the region length is zero.
1269 (try_window_reusing_current_matrix, try_window_id): Likewise.
1270
1271 2012-12-13 Eli Zaretskii <eliz@gnu.org>
1272
1273 * search.c (search_buffer): Check the inverse translations of each
1274 character in pattern when the buffer being searched is unibyte.
1275 (Bug#13084)
1276
1277 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1278
1279 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1280 files, fixing a regression from 24.2.
1281 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
1282
1283 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1284
1285 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1286 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1287 Remove unnecessary S_ISLNK test, as (contra the comments) this
1288 function can't copy symlinks. Improve quality of error message
1289 when attempting to copy files that are neither regular files nor
1290 directories.
1291
1292 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1293
1294 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1295 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1296 * window.c (Frecenter):
1297 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1298 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1299
1300 2012-12-12 Daniel Colascione <dancol@dancol.org>
1301
1302 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
1303 the dumped Emacs is not a sparse file, greatly improving Cygwin
1304 "make bootstrap" performance.
1305
1306 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
1307
1308 * inotify.c (inotify_callback): Generate an Emacs event for every
1309 incoming inotify event.
1310
1311 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1312
1313 * xdisp.c (handle_face_prop): Fix logic of computing
1314 it->start_of_box_run_p.
1315 (append_space_for_newline): If the glyph row is R2L, reset the
1316 iterator's end_of_box_run_p flag before prepending the space glyph.
1317 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1318 iterator's start_of_box_run_p flag before prepending the stretch.
1319 (append_glyph, produce_image_glyph, append_composite_glyph)
1320 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1321 left_box_line_p and right_box_line_p flags of the glyph for R2L
1322 glyph rows. (Bug#13011)
1323
1324 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1325
1326 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1327 if changed buffer is not shown in a window.
1328 * insdel.c (prepare_to_modify_buffer): Likewise.
1329 * window.c (replace_buffer_in_windows_safely): Do nothing
1330 if buffer is not shown in a window.
1331 (Fforce_window_update): Likewise if string or buffer argument
1332 is passed.
1333
1334 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1335
1336 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1337 encoded_file_name, which is what it is.
1338
1339 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1340
1341 Consistently use marker_position and marker_byte_position.
1342 * fringe.c (Ffringe_bitmaps_at_pos):
1343 * indent.c (Fvertical_motion):
1344 * insdel.c (prepare_to_modify_buffer):
1345 * keyboard.c (make_lispy_position):
1346 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1347 (window_scroll_pixel_based, displayed_window_lines)
1348 (Fset_window_configuration):
1349 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1350 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1351 Replace direct access to marker fields with calls
1352 to marker_position and/or marker_byte_position.
1353
1354 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
1355
1356 * makefile.w32-in (SIG2STR_H): New macro.
1357 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1358 ($(BLD)/w32notify.$(O)): Update dependencies.
1359
1360 2012-12-10 Daniel Colascione <dancol@dancol.org>
1361
1362 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1363 Windows file notification functionality unless WINDOWSNT.
1364
1365 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1366 declarations.
1367
1368 * w32fns.c (cache_system_info): Initialize the global hinst
1369 variable here so various initialization calls DTRT.
1370
1371 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1372 (hinst): Remove unneeded extern declaration.
1373 (_start): Remove initialization of above variables; remove
1374 initialization of hinst, as cache_system_info now does that.
1375
1376 * emacs.c (main): Call cache_system_info early in startup; we
1377 previously weren't calling it in Cygwin builds.
1378
1379 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1380 Teach the autoconf build system how to compile a Windows resource file
1381 and link it to Emacs.
1382
1383 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1384
1385 Per-buffer window counters.
1386 * buffer.h (struct buffer): New member window_count.
1387 (buffer_window_count): New function.
1388 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1389 Initialize window_count.
1390 (Fkill_buffer): Verify window_count for the buffer being killed.
1391 (modify_overlay): Do not force redisplay if buffer is not shown
1392 in any window.
1393 (init_buffer_once): Initialize window_count for buffer_defaults
1394 and buffer_local_symbols.
1395 * window.h (buffer_shared): Remove declaration.
1396 (wset_buffer): Convert from inline ...
1397 * window.c (wset_buffer): ... to an ordinary function.
1398 (adjust_window_count): New function.
1399 (make_parent_window): Use it.
1400 * xdisp.c (buffer_shared): Remove.
1401 (redisplay_internal, redisplay_window): Adjust users.
1402 (buffer_shared_and_changed): Use per-buffer window counter.
1403
1404 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1405
1406 Support for filesystem notifications on MS-Windows.
1407 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1408 and this is a TTY frame, signal the caller that keyboard input is
1409 available.
1410
1411 * w32xfns.c (drain_message_queue): Now returns an int: an
1412 indication whether any WM_EMACS_FILENOTIFY messages were found in
1413 the queue.
1414
1415 * w32inevt.c (handle_file_notifications): New function.
1416 (w32_console_read_socket): Call it to process file notifications.
1417
1418 * w32console.c (initialize_w32_display): Record the main thread ID
1419 in dwMainThreadId.
1420
1421 * deps.mk (inotify.o): New dependency list.
1422
1423 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1424
1425 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1426 (WM_EMACS_END): Bump value by 1.
1427 (notification_buffer_in_use, file_notifications)
1428 (notifications_size, notifications_desc): Declare.
1429 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1430 Add prototypes.
1431
1432 * w32term.c (lispy_file_action, queue_notifications): New functions.
1433 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1434 <Qrenamed_to>: New symbols.
1435 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1436
1437 * w32notify.c: New file, implements file event notifications for
1438 MS-Windows.
1439
1440 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1441 by posting it to the w32_read_socket queue.
1442
1443 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
1444
1445 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1446 (GLOBAL_SOURCES): Add w32notify.c
1447 ($(BLD)/w32notify.$(O)): New set of dependencies.
1448
1449 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1450
1451 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1452 Handle FILE_NOTIFY_EVENT.
1453 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1454 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1455 w32notify-handle-event by default.
1456
1457 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1458 syms_of_w32notify.
1459
1460 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1461
1462 Support for filesystem notifications on GNU/Linux via inotify.
1463 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
1464
1465 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1466
1467 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1468 (syms_of_keyboard): DEFSYM it.
1469 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1470 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1471 Qfile_inotify events.
1472 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1473 special-event-map to inotify-handle-event.
1474
1475 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1476
1477 * Makefile.in (base_obj): Add inotify.o.
1478
1479 * inotify.c: New file.
1480
1481 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
1482
1483 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1484
1485 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
1486
1487 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1488 DWORD_PTR, for compatibility with 64-bit builds.
1489
1490 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
1491 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1492 (system_process_attributes): Use SIZE_T rather than DWORD, for
1493 compatibility with 64-bit builds.
1494
1495 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
1496
1497 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1498
1499 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1500
1501 * indent.c (Fvertical_motion): If a display string will be
1502 displayed on the left or the right margin, don't consider it as a
1503 factor in cursor positioning. (Bug#13108)
1504
1505 2012-12-10 Martin Rudalics <rudalics@gmx.at>
1506
1507 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1508
1509 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1510
1511 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1512 for string length.
1513
1514 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1515
1516 * w32.c (unsetenv): Return 0 if the input string is too long.
1517
1518 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1519
1520 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1521 * alloc.c (xputenv): New function.
1522 * dbusbind.c (Fdbus_init_bus):
1523 * emacs.c (main):
1524 * xterm.c (x_term_init):
1525 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
1526 * editfns.c (initial_tz): Move static var decl up.
1527 (tzvalbuf_in_environ): New static var.
1528 (init_editfns): Initialize these two static vars.
1529 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
1530 Save old TZ value on stack, if it's small.
1531 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
1532 instead, use xputenv+unsetenv to set and restore TZ.
1533 (environbuf): Remove static var. All uses removed.
1534 (Fset_time_zone_rule): Do not save TZ and environ;
1535 no longer needed here.
1536 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
1537 Move to inside set_time_zone_rule; they don't need file scope any more.
1538 (set_time_zone_rule): Maintain the TZ=value string separately.
1539 (syms_of_editfns): Don't initialize initial_tz;
1540 init_editfns now does it.
1541 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
1542 * lisp.h (xputenv): New decl.
1543
1544 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
1545
1546 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
1547
1548 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1549
1550 * w32.c (unsetenv, sys_putenv): New functions.
1551
1552 2012-12-08 Chong Yidong <cyd@gnu.org>
1553
1554 * editfns.c (Finsert_char): Make the error message more
1555 informative (Bug#12992).
1556
1557 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 Simplify get_lim_data.
1560 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1561 Remove USG and vlimit methods; no longer used these days.
1562 Add #error catchall just in case.
1563
1564 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1565 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1566 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1567 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1568 (deleted_pid_list, Fdelete_process, create_process)
1569 (record_child_status_change, handle_child_signal, deliver_child_signal)
1570 (init_process_emacs, syms_of_process):
1571 Assume SIGCHLD is defined.
1572 (parse_signal): Remove. All uses removed.
1573 (abbr_to_signal): New static function.
1574 (Fsignal_process): Use it to convert signal names to ints.
1575 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1576 kill (getpgrp (), ...).
1577 (emacs_sigaction_init): Assume SIGCHLD is defined.
1578 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1579 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
1580 * syssignal.h (EMACS_KILLPG): Remove.
1581 All uses replaced by 'kill' with a negative pid.
1582 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
1583 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
1584
1585 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
1586
1587 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
1588 This will cause a production Emacs to dump core instead of
1589 infinite-looping.
1590
1591 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1592
1593 * frame.c (make_frame): Do not set window's buffer to t.
1594 * window.c (Fsplit_window_internal): Likewise. Previously it was
1595 used to indicate that the window is being set up. Now we use
1596 set_window_buffer for all new windows, so the condition in ...
1597 (Fset_window_buffer): ... is always true and can be removed.
1598
1599 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1600
1601 Convenient macro to check whether the buffer is hidden.
1602 * buffer.h (BUFFER_HIDDEN_P): New macro.
1603 * frame.c (make_frame): Use it. Adjust comment.
1604 * buffer.c (candidate_buffer): New function.
1605 (Fother_buffer, other_buffer_safely): Use it.
1606
1607 2012-12-06 Eli Zaretskii <eliz@gnu.org>
1608
1609 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
1610 if the child process is still running. Instead, exit the wait
1611 loop and return zero. (Bug#13086)
1612
1613 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1614
1615 * frame.h (x_char_width, x_char_height): Remove prototypes.
1616 * w32term.h (x_char_width, x_char_height): Likewise.
1617 * xfns.c (x_char_width, x_char_height): Remove.
1618 * w32fns.c (x_char_width, x_char_height): Likewise.
1619 * nsfns.c (x_char_width, x_char_height): Likewise.
1620 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
1621 all window frames.
1622 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
1623 * keyboard.c (command_loop_1): Remove prototype.
1624 (command_loop_2, top_level_1): Add static to match prototype.
1625
1626 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
1627
1628 Fix a recently-introduced delete-process race condition.
1629 * callproc.c, process.h (record_kill_process):
1630 New function, containing part of the old call_process_kill.
1631 (call_process_kill): Use it.
1632 This does not change call_process_kill's behavior.
1633 * process.c (Fdelete_process): Use record_kill_process to fix a
1634 race condition that could cause Emacs to lose track of a child.
1635
1636 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1637
1638 Avoid code duplication between prev_frame and next_frame.
1639 * frame.c (candidate_frame): New function. Add comment.
1640 (prev_frame, next_frame): Use it. Adjust comment.
1641
1642 2012-12-06 Eli Zaretskii <eliz@gnu.org>
1643
1644 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
1645 fails, signal an error instead of continuing with an empty
1646 string. (Bug#13079)
1647 Encode expanded temp file pattern before passing it to mkstemp or
1648 mktemp.
1649
1650 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
1651 Encode the file name before passing it to dostounix_filename, in
1652 case it will downcase it (under w32-downcase-file-names).
1653 (Bug#12933)
1654
1655 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
1656
1657 Minor call-process cleanups.
1658 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
1659 at the same time as other platforms, to simplify analysis.
1660 No need for fd0_volatile since we have synch_process_fd.
1661 Avoid needless emacs_close; arg is always negative.
1662
1663 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
1664
1665 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
1666 processes.
1667
1668 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
1669
1670 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
1671 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
1672 and mouse_face_hidden members to a bitfields.
1673 * frame.h (struct frame): Remove set-but-not-used space_width member.
1674 (FRAME_SPACE_WIDTH): Remove.
1675 * nsterm.m, w32term.c, xterm.c: Adjust users.
1676 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
1677 member. Adjust users. Convert term_initted, delete_in_insert_mode,
1678 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
1679 members to a bitfields.
1680
1681 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
1682
1683 Don't let call-process be a zombie factory (Bug#12980).
1684 Fixing this bug required some cleanup of the signal-handling code.
1685 As a side effect, this change also fixes a longstanding rare race
1686 condition whereby Emacs could mistakenly kill unrelated processes,
1687 and it fixes a bug where a second C-g does not kill a recalcitrant
1688 synchronous process in GNU/Linux and similar platforms.
1689 The patch should also fix the last vestiges of Bug#9488,
1690 a bug which has mostly been fixed on the trunk by other changes.
1691 * callproc.c, process.h (synch_process_alive, synch_process_death)
1692 (synch_process_termsig, sync_process_retcode):
1693 Remove. All uses removed, to simplify analysis and so that
1694 less consing is done inside critical sections.
1695 * callproc.c (call_process_exited): Remove. All uses replaced
1696 with !synch_process_pid.
1697 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
1698 These take the role of what used to be in unwind-protect arg.
1699 All uses changed.
1700 (block_child_signal, unblock_child_signal):
1701 New functions, to avoid races that could kill innocent-victim processes.
1702 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
1703 (call_process_kill): Record killed processes as deleted, so that
1704 zombies do not clutter up the system. Do this inside a critical
1705 section, to avoid a race that would allow the clutter.
1706 (call_process_cleanup): Fix code so that the second C-g works again
1707 on common platforms such as GNU/Linux.
1708 (Fcall_process): Create the child process in a critical section,
1709 to fix a race condition. If creating an asynchronous process,
1710 record it as deleted so that zombies do not clutter up the system.
1711 Do unwind-protect for WINDOWSNT too, as that's simpler in the
1712 light of these changes. Omit unnecessary call to emacs_close
1713 before failure, as the unwind-protect code does that.
1714 * callproc.c (call_process_cleanup):
1715 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
1716 * process.c (record_deleted_pid): New function, containing
1717 code refactored out of Fdelete_process.
1718 (Fdelete_process): Use it.
1719 (process_status_retrieved): Remove. All callers changed to use
1720 child_status_change.
1721 (record_child_status_change): Remove, folding its contents into ...
1722 (handle_child_signal): ... this signal handler. Now, this
1723 function is purely a handler for SIGCHLD, and is not called after
1724 a synchronous waitpid returns; the synchronous code is moved to
1725 wait_for_termination. There is no need to worry about reaping
1726 more than one child now.
1727 * sysdep.c (get_child_status, child_status_changed): New functions.
1728 (wait_for_termination): Now takes int * status and bool
1729 interruptible arguments, too. Do not record child status change;
1730 that's now the caller's responsibility. All callers changed.
1731 Reimplement in terms of get_child_status.
1732 (wait_for_termination_1, interruptible_wait_for_termination):
1733 Remove. All callers changed to use wait_for_termination.
1734 * syswait.h: Include <stdbool.h>, for bool.
1735 (record_child_status_change, interruptible_wait_for_termination):
1736 Remove decls.
1737 (record_deleted_pid, child_status_changed): New decls.
1738 (wait_for_termination): Adjust to API changes noted above.
1739
1740 * bytecode.c, lisp.h (Qbytecode): Remove.
1741 No longer needed after 2012-11-20 interactive-p changes.
1742
1743 2012-12-03 Eli Zaretskii <eliz@gnu.org>
1744
1745 * xdisp.c (redisplay_window): If the cursor is visible, but inside
1746 the scroll margin, move point outside the margin. (Bug#13055)
1747
1748 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
1749
1750 * gtkutil.c (my_log_handler): New function.
1751 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
1752
1753 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1754
1755 * lisp.h (modify_region): Rename to...
1756 (modify_region_1): ...new prototype.
1757 * textprop.c (modify_region): Now static. Adjust users.
1758 * insdel.c (modify_region): Rename to...
1759 (modify_region_1): ...new function to work with current buffer.
1760 Adjust comment and users. Use true and false for booleans.
1761
1762 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1763
1764 * alloc.c (free_save_value): New function.
1765 (safe_alloca_unwind): Use it.
1766 * lisp.h (free_save_value): New prototype.
1767 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
1768 Add comment.
1769 (save_excursion_restore): Adjust to match saved data structure.
1770 Use free_save_value to offload some work from GC. Drop obsolete
1771 #if 0 code.
1772
1773 2012-12-03 Chong Yidong <cyd@gnu.org>
1774
1775 * fileio.c (Vauto_save_list_file_name): Doc fix.
1776
1777 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
1778
1779 * w32fns.c: Remove prototype of atof.
1780 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
1781 builds.
1782 (file_dialog_callback): Make it UINT_PTR.
1783
1784 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
1785 with 64-bit builds.
1786
1787 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1788 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
1789 defined.
1790
1791 2012-12-03 Glenn Morris <rgm@gnu.org>
1792
1793 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
1794
1795 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
1796
1797 Fix xpalloc confusion after memory is exhausted.
1798 * alloc.c (xpalloc): Comment fix.
1799 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
1800 and signals an error, do not clear charset_table_size, as
1801 charset_table is still valid.
1802 * doprnt.c (evxprintf): Clear *BUF after freeing it.
1803
1804 Use execve to avoid need to munge environ (Bug#13054).
1805 * callproc.c (Fcall_process):
1806 * process.c (create_process):
1807 Don't save and restore environ; no longer needed.
1808 * callproc.c (child_setup):
1809 Use execve, not execvp, to preserve environ.
1810
1811 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
1812
1813 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
1814
1815 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1816
1817 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
1818 display for sliced images (Bug#10500).
1819
1820 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
1821
1822 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
1823
1824 * doc.c (Fdocumentation): Re-add handling of function-documentation,
1825 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
1826
1827 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
1828
1829 * xdisp.c (window_outdated): Remove eassert since it hits
1830 some suspicious corner cases (see Bug#13007 and Bug#13012).
1831 (mode_line_update_needed): New function.
1832 (redisplay_internal, redisplay_window): Use it.
1833 (ensure_selected_frame): New function.
1834 (redisplay_internal, unwind_redisplay): Use it.
1835 (redisplay_internal): Move comment about buffer_shared...
1836 (buffer_shared_and_changed): ...near to its real use.
1837
1838 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
1839
1840 * callproc.c (Fcall_process): Don't misreport vfork failure.
1841
1842 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
1843
1844 * callproc.c (Fcall_process): Fix vfork portability problems.
1845 Do not assume that fd[0], count, filefd, and save_environ survive
1846 vfork. Fix bug whereby wrong errno value could be reported for
1847 pipe failure. Some minor cleanups, too, as follows. Move buf and
1848 bufsize to the context where they're needed. Change new_argv to
1849 be of type char **, as this is more convenient and avoids casts.
1850 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
1851 Now local constants, not macros.
1852
1853 2012-11-18 Kenichi Handa <handa@gnu.org>
1854
1855 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
1856 for the variable "f".
1857
1858 2012-11-13 Kenichi Handa <handa@gnu.org>
1859
1860 * font.c (font_unparse_xlfd): Exclude special characters from the
1861 generating XLFD name.
1862
1863 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
1866 * dired.c (stat_uname, stat_gname):
1867 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
1868
1869 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
1870 * dired.c (directory_files_internal, file_name_completion):
1871 Assume EAGAIN and EINTR are defined.
1872
1873 * fileio.c (Fcopy_file): Assume EISDIR is defined.
1874 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
1875 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
1876 * lread.c (readbyte_from_file): Assume EINTR is defined.
1877 * process.c (wait_reading_process_output, send_process) [subprocesses]:
1878 Assume EIO and EAGAIN are defined.
1879 * unexcoff.c (write_segment): Assume EFAULT is defined.
1880
1881 2012-11-27 Eli Zaretskii <eliz@gnu.org>
1882
1883 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
1884 (Bug#11964)
1885
1886 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
1887 highlighting on the frame was cleared. Prevents assertion
1888 violations when repeatedly clicking on the "Top" link of the
1889 "bread-crumbs" in Info buffers.
1890
1891 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
1892
1893 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
1894
1895 2012-11-24 Ken Brown <kbrown@cornell.edu>
1896
1897 * keyboard.c (HAVE_MOUSE):
1898 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
1899 were always defined.
1900
1901 2012-11-24 Eli Zaretskii <eliz@gnu.org>
1902
1903 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
1904 between bpos_covered and bpos_max. This fixes cursor display when
1905 several display strings follow each other.
1906
1907 * .gdbinit (pgx): If the glyph's object is a string, display the
1908 pointer to string data, rather than the value of the string object
1909 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1910
1911 * indent.c (Fvertical_motion): If the starting position is covered
1912 by a display string, return to one position before that, to avoid
1913 overshooting it inside move_it_to. (Bug#12930)
1914
1915 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1916
1917 * frame.h (struct frame): Remove display_preempted member
1918 since all users are dead long ago.
1919 * nsterm.h (struct x_output): Use the only dummy member.
1920 * w32menu.c (pending_menu_activation): Remove since not
1921 really used.
1922 (set_frame_menubar): Adjust user.
1923 * w32term.h (struct x_output): Drop outdated #if 0 code.
1924 (struct w32_output): Use bitfields for explicit_parent,
1925 asked_for_visible and menubar_active members.
1926 Drop unused pending_menu_activation member.
1927 * xterm.h (struct x_output): Drop outdated #if 0 code.
1928 Use bitfields for explicit_parent, asked_for_visible,
1929 has_been_visible and net_wm_state_hidden_seen members.
1930
1931 2012-11-23 Eli Zaretskii <eliz@gnu.org>
1932
1933 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
1934 of a literal "/". (Bug#12955)
1935 (gl-stamp): Invoke fc.exe directly, not through cmd.
1936
1937 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
1940 * dired.c: Assume HAVE_DIRENT_H.
1941 (NAMLEN): Remove, replacing with ...
1942 (dirent_namelen): New function. All uses changed. Use the GNU macro
1943 _D_EXACT_NAMELEN if available, as it's faster than strlen.
1944 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
1945 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
1946 * makefile.w32-in (DIR_H): Remove. All uses replaced with
1947 $(NT_INC)/dirent.h.
1948 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
1949 * ndir.h: Rename to ../nt/inc/dirent.h.
1950 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
1951 Do not include <dirent.h>; no longer needed.
1952 * w32.c: Include <dirent.h> rather than "ndir.h".
1953
1954 2012-11-23 Chong Yidong <cyd@gnu.org>
1955
1956 * xftfont.c (xftfont_open): Remove duplicate assignment.
1957
1958 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1959
1960 * alloc.c (Fgarbage_collect): Unblock input after clearing
1961 gc_in_progress to avoid note_mouse_highlight glitch with GC.
1962 * frame.h (FRAME_MOUSE_UPDATE): New macro.
1963 * msdos.c (IT_frame_up_to_date): Use it here...
1964 * w32term.c (w32_frame_up_to_date): ...here...
1965 * xterm.c (XTframe_up_to_date): ...and here...
1966 * nsterm.m (ns_frame_up_to_date): ...but not here.
1967 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
1968 Adjust users.
1969 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
1970 Do not check whether GC is in progress.
1971
1972 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1973
1974 * xdisp.c (window_buffer_changed): New function.
1975 (update_menu_bar, update_tool_bar): Use it to
1976 simplify large 'if' statements.
1977 (redisplay_internal): Generalize commonly used
1978 'tail' and 'frame' local variables.
1979
1980 2012-11-22 Eli Zaretskii <eliz@gnu.org>
1981
1982 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
1983 with Windows system header.
1984
1985 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
1988 * alloc.c: Assume unistd.h exists.
1989 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
1990 * sysdep.c (get_current_dir_name): Assume getcwd exists.
1991 (getwd) [USG]: Remove; no longer needed.
1992 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
1993 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
1994 * w32.h (getcwd): Remove decl.
1995
1996 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
1997
1998 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
1999 Make it set selected_window as well.
2000 (update_tool_bar): Use it.
2001
2002 2012-11-21 Ken Brown <kbrown@cornell.edu>
2003
2004 * emacs.c (main): Set the G_SLICE environment variable for all
2005 Cygwin builds, not just GTK builds. See
2006 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2007
2008 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2009
2010 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2011 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2012 Define for the MSVC compiler.
2013
2014 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2015
2016 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2017 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2018 dostounix_filename. Prevents crashes down the road, because
2019 dostounix_filename assumes it gets a unibyte string.
2020 Reported by Michel de Ruiter <michel@sentient.nl>, see
2021 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2022
2023 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2024
2025 Conflate Qnil and Qunbound for `symbol-function'.
2026 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2027 * lread.c (init_obarray): Set `function' fields to Qnil.
2028 * eval.c (Fcommandp): Ignore Qunbound.
2029 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2030 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2031 Test NILP rather than Qunbound.
2032 (Ffmakunbound): Set to Qnil.
2033 (Fsymbol_function): Never signal an error.
2034 (Finteractive_form): Ignore Qunbound.
2035
2036 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2037
2038 * eval.c (interactive_p): Remove no-longer-used decl.
2039
2040 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2041
2042 * xdisp.c (buffer_shared): Adjust comment.
2043 (buffer_shared_and_changed): New function.
2044 (prepare_menu_bars, redisplay_internal): Use it to
2045 decide whether all windows or frames should be updated.
2046 (window_outdated): New function.
2047 (text_outside_line_unchanged_p, redisplay_window): Use it.
2048 (redisplay_internal): Likewise. Fix indentation.
2049
2050 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2051
2052 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2053 (syms_of_eval): Remove corresponding defsubr.
2054 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2055
2056 2012-11-19 Daniel Colascione <dancol@dancol.org>
2057
2058 * w32fns.c (Fx_file_dialog):
2059 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2060 cygwin_convert_file_name*.
2061
2062 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2063 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2064
2065 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2066
2067 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2068
2069 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2070
2071 * w32select.c: Include w32common.h before w32term.h, so that
2072 windows.h gets included before w32term.h uses some of its
2073 features, see below.
2074
2075 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2076 New typedefs.
2077 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2078 New prototypes.
2079 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2080
2081 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
2082
2083 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2084 (ns_select): Return at once if events are held (Bug#12834).
2085
2086 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
2087
2088 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2089 Needed following 2012-10-20 change. (Bug#12902)
2090
2091 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2092
2093 * w32proc.c (waitpid): Remove unused label get_result.
2094
2095 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
2096
2097 * makefile.w32-in (SYSWAIT_H): New macro.
2098 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2099 ($(BLD)/sysdep.$(O)): Update dependencies.
2100
2101 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2102
2103 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2104 * callproc.c (relocate_fd): Assume F_DUPFD.
2105 * emacs.c, term.c (O_RDWR): Remove.
2106 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2107 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2108 * nsterm.m: Assume <fcntl.h> exists.
2109 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2110 (create_pty, Fmake_network_process, server_accept_connection)
2111 (wait_reading_process_output, init_process_emacs):
2112 Assume O_NONBLOCK.
2113 (wait_reading_process_output): Put in a special case for WINDOWSNT
2114 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2115 It's not clear this is needed, but it's a more-conservative change.
2116 (create_process): Assume FD_CLOEXEC.
2117 (create_process, create_pty): Assume O_NOCTTY.
2118 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2119 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2120 Omit if not DOS_NT, since F_GETFL is not defined there.
2121 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2122 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2123 (O_NOCTTY): Remove.
2124 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2125 lack it, since gnulib guarantees this.
2126 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2127
2128 2012-11-17 Eli Zaretskii <eliz@gnu.org>
2129
2130 * w32.c (faccessat): Pretend that directories have the execute bit
2131 set. Emacs expects that, e.g., in files.el:cd-absolute.
2132
2133 * w32proc.c (create_child): Don't clip the PID of the child
2134 process to fit into an Emacs integer, as this is no longer a
2135 restriction.
2136 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2137 reaping only the process specified by PID argument, if that is
2138 positive. Use PID instead of dead_child to know which process to
2139 reap. Wait for the child to die only if WNOHANG is not in
2140 OPTIONS.
2141 (sys_select): Don't set dead_child.
2142
2143 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2144 as it is no longer needed.
2145
2146 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2147 no longer needed.
2148 (record_child_status_change): Remove the setting of
2149 record_at_most_one_child for the !WNOHANG case.
2150
2151 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2152
2153 Fix problems in ns port found by static checking.
2154 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2155 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2156 not to process group.
2157 (ns_select): Use emacs_write, not write, as that's more robust
2158 in the presence of signals.
2159 (fd_handler:): Check for read errors.
2160
2161 2012-11-16 Glenn Morris <rgm@gnu.org>
2162
2163 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2164
2165 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
2166
2167 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2168
2169 2012-11-16 Eli Zaretskii <eliz@gnu.org>
2170
2171 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2172 use the same value of thread handle.
2173 (start_timer_thread): If the timer thread exited (due to error),
2174 clean up by closing the two handles it used. Duplicate the caller
2175 thread's handle here, so it gets duplicated only once, when
2176 launching the timer thread. Set priority of the timer thread, not
2177 the caller thread.
2178 (getitimer): Don't duplicate the caller thread's handle here.
2179 (Bug#12832)
2180
2181 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
2182
2183 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2184 called (Bug#12834).
2185
2186 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2187
2188 Remove no-longer-used pty_max_bytes variable.
2189 * process.c (pty_max_bytes): Remove; unused.
2190 (send_process): Do not set it.
2191
2192 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
2193
2194 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2195 Update dependencies.
2196
2197 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2200 This follows up on the 2012-09-29 patch that removed indirection
2201 for the 'function' field. Reported by Sergey Vinokurov in
2202 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2203
2204 2012-11-14 Eli Zaretskii <eliz@gnu.org>
2205
2206 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2207 different name, as the MS runtime does not have such a function,
2208 and probably never will.) All callers changed. Ignore DIRFD
2209 value if PATH is an absolute file name, to match Posix spec
2210 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2211 symlinks.
2212
2213 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2214
2215 * xdisp.c (echo_area_display, redisplay_internal):
2216 Omit redundant check whether frame_garbaged is set.
2217
2218 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2219
2220 Use faccessat, not access, when checking file permissions (Bug#12632).
2221 This fixes a bug that has been present in Emacs since its creation.
2222 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2223 which must set some sort of record. (Torek's bug report was against
2224 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2225 same common flaw.) See Torek's Usenet posting
2226 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2227 Posted: Fri Apr 8 14:18:56 1983.
2228 * Makefile.in (LIB_EACCESS): New macro.
2229 (LIBES): Use it.
2230 * callproc.c (init_callproc):
2231 * charset.c (init_charset):
2232 * fileio.c (check_existing, check_executable, check_writable)
2233 (Ffile_readable_p):
2234 * lread.c (openp, load_path_check):
2235 * process.c (allocate_pty):
2236 * xrdb.c (file_p):
2237 Use effective UID when checking permissions, not real UID.
2238 * callproc.c (init_callproc):
2239 * charset.c (init_charset):
2240 * lread.c (load_path_check, init_lread):
2241 Test whether directories are accessible, not merely whether they exist.
2242 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2243 * fileio.c (check_existing, check_executable, check_writable)
2244 (Ffile_readable_p):
2245 Use symbolic names instead of integers for the flags, as they're
2246 portable now.
2247 (check_writable): New arg AMODE. All uses changed.
2248 Set errno on failure.
2249 (Ffile_readable_p): Use faccessat, not stat + open + close.
2250 (Ffile_writable_p): No need to call check_existing + check_writable.
2251 Just call check_writable and then look at errno. This saves a syscall.
2252 dir should never be nil; replace an unnecessary runtime check
2253 with an eassert. When checking the parent directory of a nonexistent
2254 file, check that the directory is searchable as well as writable, as
2255 we can't create files in unsearchable directories.
2256 (file_directory_p): New function, which uses 'stat' on most platforms
2257 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2258 (Ffile_directory_p, Fset_file_times): Use it.
2259 (file_accessible_directory_p): New function, which uses a single
2260 syscall for efficiency.
2261 (Ffile_accessible_directory_p): Use it.
2262 * xrdb.c (file_p): Use file_directory_p.
2263 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2264 * lread.c (openp): When opening a file, use fstat rather than
2265 stat, as that avoids a permissions race. When not opening a file,
2266 use file_directory_p rather than stat.
2267 (dir_warning): First arg is now a usage string, not a format.
2268 Use errno. All uses changed.
2269 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2270 that merely introduced a race.
2271 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2272 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2273 and similarly for the other O_* flags.
2274 * w32.c (sys_faccessat): Rename from sys_access and switch to
2275 faccessat's API. All uses changed.
2276 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2277 (magic_db): Rename from magic_file_p.
2278 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2279 char *, so that we don't have to test for file existence
2280 separately from opening the file for reading. This removes a race
2281 fixes a permission-checking problem, and simplifies the code.
2282 All uses changed.
2283 (file_p): Remove; no longer needed.
2284
2285 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2286
2287 Omit glyphs initialization at startup.
2288 * dispnew.c (glyphs_initialized_initially_p): Remove.
2289 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2290 (Fredraw_frame): Move actual code from here...
2291 (redraw_frame): ...to here. Add eassert. Adjust comment.
2292 (Fredraw_display): Use redraw_frame.
2293 * xdisp.c (clear_garbaged_frames): Likewise.
2294
2295 2012-11-13 Eli Zaretskii <eliz@gnu.org>
2296
2297 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2298 passed to pint2str and pint2hrstr to be at most the size of the
2299 frame's decode_mode_spec_buffer. This avoids crashes with very
2300 large values of FIELD_WIDTH argument to decode_mode_spec.
2301 (Bug#12867)
2302
2303 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2304
2305 Fix a race with verify-visited-file-modtime (Bug#12863).
2306 Since at least 1991 Emacs has ignored an mtime difference of no
2307 more than one second, but my guess is that this was to work around
2308 file system bugs that were fixed long ago. Since the race is
2309 causing problems now, let's remove that code.
2310 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2311 whose time stamp is off by no more than a second. Insist that the
2312 file time stamps match exactly.
2313
2314 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2315
2316 * frame.h (struct frame): Convert external_tool_bar member to
2317 1-bit unsigned bitfield.
2318 * termhooks.h (struct terminal): Remove mouse_moved member since
2319 all users are long dead. Adjust comment on mouse_position_hook.
2320
2321 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2322
2323 Simplify by using FOR_EACH_FRAME here and there.
2324 * frame.c (next_frame, prev_frame, other_visible_frames)
2325 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2326 * w32term.c (x_window_to_scroll_bar): Likewise.
2327 * window.c (window_list): Likewise.
2328 * xdisp.c (x_consider_frame_title): Likewise.
2329 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2330 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2331 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2332 * xmenu.c (menubar_id_to_frame): Likewise.
2333 * xselect.c (frame_for_x_selection): Likewise.
2334 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2335 (x_window_to_menu_bar): Likewise.
2336 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2337
2338 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2339
2340 * data.c (Qdefalias_fset_function): Now static.
2341
2342 Another tweak to vectorlike_header change.
2343 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2344 Remove, and replace all uses with ...
2345 (next_in_free_list, set_next_in_free_list):
2346 New functions, which respect C's aliasing rules better.
2347
2348 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2349
2350 * window.c (list4i): Rename from 'quad'. All uses changed.
2351 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2352
2353 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
2354
2355 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2356 warning about mixing declarations and code in ISO C90.
2357
2358 2012-11-10 Martin Rudalics <rudalics@gmx.at>
2359
2360 * window.c (Fsplit_window_internal): Set combination limit of
2361 new parent window to t iff Vwindow_combination_limit is t;
2362 fixing a regression introduced with the change from 2012-09-22.
2363 (Fset_window_combination_limit): Fix doc-string.
2364
2365 2012-11-10 Eli Zaretskii <eliz@gnu.org>
2366
2367 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2368 amount when the scroll margins are too large. When scrolling
2369 backwards in the buffer, give up if cannot reach point or the
2370 scroll margin within a reasonable number of screen lines.
2371 Fixes point position in window under scroll-up/down-aggressively when
2372 point is positioned many lines beyond the window top/bottom.
2373 (Bug#12811)
2374
2375 * ralloc.c (relinquish): If real_morecore fails to return memory
2376 to the system, don't crash; instead, leave the last heap
2377 unchanged and return. (Bug#12774)
2378
2379 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2380
2381 * lisp.h (AUTOLOADP): New macro.
2382 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2383 * data.c (Ffset): Remove special ad-advice-info handling.
2384 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2385 (Fsubr_arity): CSE.
2386 (Finteractive_form): Simplify.
2387 (Fquo): Don't insist on having at least 2 arguments.
2388 (Qdefalias_fset_function): New var.
2389
2390 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2391
2392 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2393
2394 * nsfont.m (Qcondensed, Qexpanded): New variables.
2395 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2396 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2397
2398 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2399
2400 Fix recently introduced crash on MS-Windows (Bug#12839).
2401 * w32term.h (struct scroll_bar): Use convenient header.
2402 (SCROLL_BAR_VEC_SIZE): Remove.
2403 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2404
2405 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2406
2407 Tweak last vectorlike_header change.
2408 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2409 vectorlike object on the free list. This is introduced to avoid
2410 some (but not all) pointer casting and aliasing problems, see
2411 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2412 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2413 objects.
2414 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2415
2416 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2417
2418 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
2419 been removed, so remove them here also.
2420
2421 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2422
2423 * doc.c (Fdocumentation): Handle new property
2424 dynamic-docstring-function to replace the old ad-advice-info.
2425
2426 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2427
2428 * fns.c (Qeql, hashtest_eq): Now static.
2429
2430 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2431
2432 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2433 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2434 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2435 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2436
2437 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2438
2439 Use same hash function for hashfn_profiler as for hash_string etc.
2440 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2441 * lisp.h (sxhash_combine): New inline function, with the contents
2442 of the old SXHASH_COMBINE.
2443 * profiler.c (hashfn_profiler): Use it, instead of having a
2444 special hash function containing a comparison that always yields 1.
2445
2446 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2447
2448 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2449 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2450 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2451 Remove unused vars.
2452
2453 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2454
2455 * image.c (xpm_make_color_table_h): Fix compiler error because
2456 make_hash_table changed.
2457
2458 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
2459
2460 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2461
2462 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2463
2464 Use ad-hoc comparison function for the profiler's hash-tables.
2465 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2466 (make_log): Use them.
2467 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2468 call Fequal any more.
2469 (Ffunction_equal): New function.
2470 (cmpfn_profiler, hashfn_profiler): New functions.
2471 (syms_of_profiler): Initialize them.
2472 * lisp.h (struct hash_table_test): New struct.
2473 (struct Lisp_Hash_Table): Use it.
2474 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2475 * fns.c (make_hash_table): Take a struct to describe the test.
2476 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2477 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2478 (hash_lookup, hash_remove_from_table): Move assertion checking of
2479 hashfn result here. Check hash-equality before calling cmpfn.
2480 (Fmake_hash_table): Adjust call to make_hash_table.
2481 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2482 (syms_of_fns): Initialize them.
2483 * emacs.c (main): Move syms_of_fns earlier.
2484 * xterm.c (syms_of_xterm):
2485 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2486 * print.c (print_object): Adjust to new hash-table struct.
2487 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2488
2489 2012-11-08 Eli Zaretskii <eliz@gnu.org>
2490
2491 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2492 value of w32-scroll-lock-modifier is neither nil nor one of the
2493 known key modifiers. (Bug#12806)
2494
2495 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2496
2497 Shrink struct vectorlike_header to the only size field.
2498 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2499 Adjust comment.
2500 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2501 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2502 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2503 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2504 information from the vector header. Adjust comment.
2505 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2506 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2507 layout.
2508 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2509 (struct vectorlike_header): Remove next member. Adjust comment.
2510 (struct Lisp_Subr): Add convenient header. Adjust comment.
2511 (allocate_pseudovector): Adjust prototype.
2512 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2513 (sweep_string, lisp_malloc): Remove useless prototypes.
2514 (enum mem_type): Adjust comment.
2515 (NEXT_IN_FREE_LIST): New macro.
2516 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2517 (Fmake_bool_vector): Likewise.
2518 (struct large_vector): New type to represent allocation unit for
2519 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2520 (large_vectors): Change type to struct large_vector.
2521 (allocate_vector_from_block): Simplify.
2522 (PSEUDOVECTOR_NBYTES): Replace with...
2523 (vector_nbytes): ...new function. Adjust users.
2524 (sweep_vectors): Adjust processing of large vectors.
2525 (allocate_vectorlike): Likewise.
2526 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
2527 Add easserts. Adjust XSETPVECTYPESIZE usage.
2528 (allocate_buffer): Use BUFFER_PVEC_INIT.
2529 (live_vector_p): Adjust to match large vector.
2530 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
2531 * buffer.h (struct buffer): Add next member.
2532 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
2533 New macros.
2534 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
2535 * fns.c (internal_equal): Adjust to match enum pvec_type change.
2536 (copy_hash_table): Adjust to match vector header change.
2537 * lread.c (defsubr): Use XSETPVECTYPE.
2538 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
2539 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
2540 (xvecsize): New command.
2541
2542 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 * keyboard.c (event_to_kboard): Do not dereference
2545 frame_or_window field of SELECTION_REQUEST_EVENT
2546 and SELECTION_CLEAR_EVENT events (Bug#12814).
2547 * xterm.h (struct selection_input_event): Adjust comment.
2548
2549 2012-11-07 Eli Zaretskii <eliz@gnu.org>
2550
2551 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2552 such as Scroll Lock, if the respective keys are treated as
2553 function keys, not as modifiers. This avoids destroying non-ASCII
2554 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
2555
2556 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2557
2558 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2559
2560 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 Restore some duplicate definitions (Bug#12814).
2563 This undoes part of the 2012-11-03 changes. Some people build
2564 with plain -g rather than with -g3, and they need the duplicate
2565 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2566 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2567 Define as macros, as well as as enums or as constants.
2568
2569 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2570
2571 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2572 to keypad keys (Bug#12816).
2573
2574 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2575
2576 Minor adjustments of recently-changed frame functions.
2577 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2578 known to be a frame (we're in the FRAMEP branch).
2579 * lisp.h (Qframep): Remove decl. frame.h declares this.
2580 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
2581 since they're meant for Lisp fixnum values.
2582
2583 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2584
2585 * window.c (Fwindow_combination_limit): Revert to the only
2586 required argument and adjust docstring as suggested in
2587 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
2588 by Martin Rudalics <rudalics@gmx.at>.
2589
2590 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2591
2592 Widely used frame validity and checking functions.
2593 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
2594 * frame.c (decode_live_frame, decode_any_frame): New functions.
2595 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
2596 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
2597 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
2598 (Fframe_pointer_visible_p): Use decode_any_frame.
2599 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
2600 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
2601 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
2602 (Fframe_focus): Likewise. Allow zero number of arguments.
2603 Adjust docstring.
2604 (frame_buffer_list, frame_buffer_predicate): Remove.
2605 * lisp.h (frame_buffer_predicate): Remove prototype.
2606 * buffer.c (Fother_buffer): Use decode_any_frame.
2607 * xdisp.c (Ftool_bar_lines_needed): Likewise.
2608 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
2609 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
2610 (Fclose_font, Ffont_info): Use decode_live_frame.
2611 * fontset.c (check_fontset_name): Likewise.
2612 * terminal.c (Fframe_terminal): Likewise.
2613 * w32fns.c (check_x_frame): Likewise.
2614 * window.c (Fminibuffer_window, Fwindow_at)
2615 (Fcurrent_window_configuration): Likewise.
2616 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
2617 Likewise. Allow zero number of arguments. Adjust docstring.
2618 * dispnew.c (Fredraw_frame): Likewise.
2619 * xfaces.c (frame_or_selected_frame): Remove.
2620 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
2621 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
2622 (Fframe_face_alist): Use decode_live_frame.
2623 * xfns.c (check_x_frame): Likewise.
2624
2625 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2626
2627 * window.c (quad): New function.
2628 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
2629 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
2630 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
2631 (Fwindow_line_height): Use it.
2632 (Fwindow_fringes): Use list3.
2633 (Fwindow_scroll_bars): Use list4.
2634 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
2635 (Fwindow_combination_limit): Allow zero number of arguments.
2636
2637 2012-11-05 Eli Zaretskii <eliz@gnu.org>
2638
2639 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
2640
2641 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
2642 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
2643 file descriptor 2 for standard error. (Bug#12805)
2644
2645 2012-11-05 Chong Yidong <cyd@gnu.org>
2646
2647 * process.c (wait_reading_process_output): Revert previous change.
2648
2649 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2650
2651 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
2652 This removes code that has been obsolete since around 1990.
2653 * callproc.c (Fcall_process):
2654 * emacs.c (main):
2655 * process.c (create_process):
2656 * term.c (dissociate_if_controlling_tty):
2657 Assume setsid exists.
2658 * callproc.c (child_setup): Assume setpgid exists and behaves as
2659 per POSIX.1-1988 or later.
2660 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
2661 * emacs.c (shut_down_emacs):
2662 * sysdep.c (sys_suspend, init_foreground_group):
2663 Assume getpgrp behaves as per POSIX.1-1998 or later.
2664 * msdos.c (setpgrp): Remove.
2665 (tcgetpgrp, setpgid, setsid): New functions.
2666 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
2667 * term.c (no_controlling_tty): Remove; unused.
2668 * w32proc.c (setpgrp): Remove.
2669 (setsid, tcgetpgrp): New functions.
2670
2671 Simplify by assuming __fpending.
2672 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
2673 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
2674 Do not assume that __fpending's result fits in int.
2675
2676 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 Remove EMACS_OUTQSIZE+sleep hack.
2679 * dispnew.c (update_frame_1): Remove hack for terminals slower
2680 than 2400 bps, which throttled Emacs by having it sleep.
2681 This code hasn't worked since at least 2007, when the multi-tty stuff
2682 was added, and anyway those old terminals are long dead.
2683 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
2684 without the dispnew.c change, as dispnew.c doesn't include systty.h.
2685
2686 Fix data-loss with --version (Bug#9574).
2687 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
2688 as we can't assume that emacs_strerror is initialized, and strerror
2689 is good enough here.
2690 (main): Invoke atexit earlier, to catch earlier instances of
2691 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2692
2693 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2694
2695 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
2696 (keyDown): Remap keypad keys to X11 virtual key codes.
2697
2698 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 Fix data-loss with --batch (Bug#9574).
2701 * emacs.c: Include <close-stream.h>.
2702 (close_output_streams): New function.
2703 (main): Pass it to atexit, so that Emacs closes stdout and stderr
2704 and handles errors appropriately.
2705 (Fkill_emacs): Don't worry about flushing, as close_output_stream
2706 does that now.
2707
2708 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
2709 The symptom is a diagnostic "GLib-WARNING **: In call to
2710 g_spawn_sync(), exit status of a child process was requested but
2711 SIGCHLD action was set to SIG_IGN and ECHILD was received by
2712 waitpid(), so exit status can't be returned." The diagnostic
2713 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
2714 The real bug is a race condition between Emacs and glib: Emacs
2715 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
2716 so that glib can't find it. Work around the bug by invoking
2717 waitpid only on subprocesses that Emacs itself creates.
2718 * process.c (create_process, record_child_status_change):
2719 Don't use special value -1 in pid field, as the caller now must
2720 know the pid rather than having the callee infer it.
2721 The inference was sometimes incorrect anyway, due to another race.
2722 (create_process): Set new 'alive' member if child is created.
2723 (process_status_retrieved): New function.
2724 (record_child_status_change): Use it.
2725 Accept negative 1st argument, which means to wait for the
2726 processes that Emacs already knows about. Move special-case code
2727 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
2728 processes that have already been waited for, by testing and
2729 clearing new 'alive' member.
2730 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
2731 now does this internally.
2732 (handle_child_signal): Let record_child_status_change do all
2733 the work, since we do not want to reap all exited child processes,
2734 only the child processes that Emacs itself created.
2735 * process.h (Lisp_Process): New boolean member 'alive'.
2736
2737 Omit duplicate definitions no longer needed with gcc -g3.
2738 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
2739 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
2740 Define only as macros. There's no longer any need to also define
2741 these symbols as enums or as constants, since we now assume
2742 gcc -g3 when debugging.
2743
2744 2012-11-03 Eli Zaretskii <eliz@gnu.org>
2745
2746 * lisp.mk: Adjust comments to the fact that term/internal is now
2747 loaded from loadup.el.
2748
2749 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
2750 (msdos_fatal_signal): New function.
2751 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
2752 its argument list.
2753
2754 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
2755 for GCC versions before 4.
2756 (emacs_raise): Define to call msdos_fatal_signal.
2757
2758 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
2759 iterator when starting in the middle of a display or overlay
2760 string. (Bug#12745)
2761
2762 2012-11-03 Chong Yidong <cyd@gnu.org>
2763
2764 * process.c (wait_reading_process_output): Clean up the last
2765 change.
2766
2767 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
2768
2769 * process.c (wait_reading_process_output): Avoid a race condition
2770 with SIGIO delivery (Bug#11536).
2771
2772 2012-11-03 Chong Yidong <cyd@gnu.org>
2773
2774 * buffer.c (cursor_type): Untabify docstring.
2775
2776 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2777
2778 * frame.h (struct frame): Drop can_have_scroll_bars member
2779 which is meaningless for a long time. Adjust comments.
2780 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
2781 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
2782
2783 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2784
2785 * window.c (decode_next_window_args): Update window arg after
2786 calling decode_live_window and so fix crash reported at
2787 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
2788 by Juanma Barranquero <lekktu@gmail.com>.
2789 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
2790 * font.c (Ffont_at): Likewise.
2791
2792 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
2793
2794 * widget.c (resize_cb): New function.
2795 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
2796 (EmacsFrameResize): Check if all is up to date before changing frame
2797 size.
2798
2799 2012-11-02 Eli Zaretskii <eliz@gnu.org>
2800
2801 Implement backtrace output for fatal errors on MS-Windows.
2802 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
2803 (BACKTRACE_LIMIT_MAX): New macro.
2804 (w32_backtrace): New function.
2805 (emacs_abort): Use w32_backtrace when the user chooses not to
2806 attach a debugger. Update the text of the abort dialog.
2807
2808 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2809
2810 Window-related stuff cleanup here and there.
2811 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
2812 Use decode_any_window.
2813 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
2814 * xdisp.c (Fformat_mode_line): Likewise.
2815 * font.c (Ffont_at): Use decode_live_window.
2816 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
2817 * window.c (decode_next_window_args): Likewise.
2818 (decode_any_window): Remove static.
2819 * window.h (decode_any_window): Add prototype.
2820 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
2821 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
2822 respectively.
2823
2824 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2825
2826 Remove pad from struct input_event.
2827 * termhooks.h (struct input_event): Remove padding field.
2828 Adjust comment.
2829 * keyboard.c (event_to_kboard): Simplify because frame_or_window
2830 member is never cons for a long time. Adjust comment.
2831 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
2832 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
2833 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
2834 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
2835
2836 2012-11-01 Eli Zaretskii <eliz@gnu.org>
2837
2838 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2839
2840 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 Fix crash when using Emacs as commit editor for git (Bug#12697).
2843 * callproc.c (setpgrp): Remove macro, as we now use setpgid
2844 and it is configured in conf_post.h.
2845 (Fcall_process): Don't invoke both setsid and setpgid; the former
2846 is enough, if it exists.
2847 * callproc.c (Fcall_process, child_setup):
2848 * process.c (create_process): Use setpgid.
2849 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
2850 for the real thing.
2851 * dispnew.c (init_display): Initialize the foreground group
2852 if we are running a tty display.
2853 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
2854 * lisp.h (init_foreground_group): New decl.
2855 * sysdep.c (inherited_pgroup): New static var.
2856 (init_foreground_group, tcsetpgrp_without_stopping)
2857 (narrow_foreground_group, widen_foreground_group): New functions.
2858 (init_sys_modes): Narrow foreground group.
2859 (reset_sys_modes): Widen foreground group.
2860
2861 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
2862
2863 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
2864
2865 2012-10-31 Martin Rudalics <rudalics@gmx.at>
2866
2867 * minibuf.c (read_minibuf): Restore current buffer since
2868 choose_minibuf_frame calling Fset_frame_selected_window may
2869 change it (Bug#12766).
2870
2871 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
2872
2873 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
2874
2875 2012-10-30 Kenichi Handa <handa@gnu.org>
2876
2877 * font.c (Ffont_at): If WINDOW is specified and it is not
2878 displaying the current buffer, signal an error.
2879
2880 2012-10-29 Daniel Colascione <dancol@dancol.org>
2881
2882 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
2883 In preparation for fixing bug#12739, move these functions from
2884 here...
2885
2886 * coding.h, coding.c: ... to here, and compile them only when
2887 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
2888 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
2889
2890 2012-10-28 Eli Zaretskii <eliz@gnu.org>
2891
2892 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
2893 (timer_loop, getitimer, setitimer): Use it instead of
2894 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
2895 'clock'.
2896 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
2897 literal 10000.
2898
2899 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
2900
2901 * nsterm.m (NO_APPDEFINED_DATA): New define.
2902 (last_appdefined_event_data): New variable
2903 (last_appdefined_event): Remove.
2904 (ns_select): Initialize t from last_appdefined_event_data instead
2905 of [last_appdefined_event data1].
2906 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
2907 remove last_appdefined_event (Bug#12698).
2908
2909 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2910
2911 * frame.c (x_set_font): Catch internal error.
2912
2913 2012-10-27 Eli Zaretskii <eliz@gnu.org>
2914
2915 Avoid overflow in w32 implementation of interval timers.
2916 When possible, for ITIMER_PROF count only times the main thread
2917 actually executes.
2918 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2919 'volatile ULONGLONG' types. All the other data which was
2920 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
2921 (GetThreadTimes_Proc): New typedef.
2922 (w32_get_timer_time): New function, returns a suitable time value
2923 for the timer.
2924 (timer_loop): Enter critical section when accessing ULONGLONG
2925 values of the itimer_data struct, as these accesses are no longer
2926 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2927 Remove unused variable.
2928 (init_timers): Initialize s_pfn_Get_Thread_Times.
2929 (start_timer_thread): Don't assign itimer->caller_thread here.
2930 (getitimer): Assign itimer->caller_thread here.
2931 (setitimer): Always call getitimer to get the value of ticks_now.
2932 (sys_spawnve): Avoid compiler warning about format mismatch.
2933
2934 2012-10-26 Eli Zaretskii <eliz@gnu.org>
2935
2936 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
2937 mouse movement events if the menu bar is active. This avoids
2938 producing a busy "hour-glass" cursor by Windows if the mouse
2939 pointer is positioned over a tooltip shown for some menu item.
2940
2941 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2942
2943 Don't assume process IDs fit in int.
2944 * emacs.c (shut_down_emacs) [!DOS_NT]:
2945 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
2946 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
2947 Use pid_t, not int, to store process IDs, as 'int'
2948 is not wide enough on a few platforms (e.g., AIX and IRIX).
2949
2950 2012-10-23 Kenichi Handa <handa@gnu.org>
2951
2952 The following change is to make face-font-rescale-alist work
2953 correctly for non-ASCII fonts.
2954
2955 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
2956 (font_open_for_lface): Handle Vface_font_rescale_alist.
2957
2958 2012-10-23 Chong Yidong <cyd@gnu.org>
2959
2960 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
2961
2962 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
2963
2964 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
2965 for screen font.
2966 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
2967
2968 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
2969 event (Bug#12681).
2970
2971 2012-10-21 Glenn Morris <rgm@gnu.org>
2972
2973 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
2974
2975 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
2976
2977 Port to OpenBSD 5.1.
2978 * frame.c (Fmouse_position, Fmouse_pixel_position):
2979 * xdisp.c (produce_stretch_glyph):
2980 Declare local vars only when they're needed.
2981 This is clearer and avoids a warning on OpenBSD about unused vars.
2982 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
2983 This is safer, and avoids OpenBSD warnings about unused vars.
2984 * keyboard.c (record_menu_key): Remove unnecessary decl.
2985 (poll_timer): Define only if POLL_FOR_INPUT is defined.
2986 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
2987 as our definition clashes with OpenBSD's.
2988 * xfaces.c (load_face_colors, check_lface_attrs)
2989 (get_lface_attributes_no_remap, get_lface_attributes)
2990 (lface_fully_specified_p, x_supports_face_attributes_p)
2991 (tty_supports_face_attributes_p, face_fontset, realize_face)
2992 (realize_x_face, realize_tty_face):
2993 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
2994 merely Lisp_Object *. This is more informative and avoids
2995 a warning on OpenBSD about accessing beyond an object's size.
2996
2997 2012-10-20 Chong Yidong <cyd@gnu.org>
2998
2999 * lread.c (Fload): Doc fix (Bug#12592).
3000
3001 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3002
3003 * font.c (Ffont_at): Fix previous change.
3004
3005 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3006
3007 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3008 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3009 for the reasons.
3010
3011 * alloc.c (NSTATICS): Decrease to 0x800.
3012
3013 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3014
3015 * fns.c (Fnreverse): Include the problem element when signaling an
3016 error (bug#12677).
3017
3018 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3019
3020 * nsterm.m (ns_select): Check writefds before call to
3021 FD_ISSET (Bug#12668).
3022
3023 2012-10-18 Daniel Colascione <dancol@dancol.org>
3024
3025 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3026 (staticpro): If we run out of staticpro slots, die with an
3027 informative error instead of just calling emacs_abort.
3028
3029 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3030
3031 Fix two flaws reported by Dmitry Antipov.
3032 * window.c (Ftemp_output_buffer_show): Remove.
3033 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3034 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3035
3036 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3037
3038 * makefile.w32-in ($(BLD)/w32.$(O)):
3039 ($(BLD)/vm-limit.$(O)):
3040 ($(BLD)/term.$(O)):
3041 ($(BLD)/unexw32.$(O)):
3042 ($(BLD)/fileio.$(O)):
3043 ($(BLD)/dispnew.$(O)): Update dependencies.
3044
3045 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3046 Add prototypes.
3047
3048 * w32proc.c: Include ctype.h.
3049
3050 * w32.h (init_environment, check_windows_init_file)
3051 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3052 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3053 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3054 (sys_link): Add prototypes.
3055
3056 * w32.c: Include w32select.h.
3057 (sys_access, e_malloc, sys_select): Add prototypes.
3058 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3059
3060 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3061
3062 * unexw32.c: Include lisp.h and w32.h.
3063
3064 * term.c [WINDOWSNT]: Include w32term.h.
3065
3066 * process.c [WINDOWSNT]: Add prototype of sys_select.
3067
3068 * fileio.c [WINDOWSNT]: Include w32.h.
3069
3070 * dispnew.c [WINDOWSNT]: Include w32.h.
3071
3072 * cygw32.c (Fcygwin_convert_path_to_windows)
3073 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3074 Lisp_Object values. (Bug#12661)
3075
3076 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3077 to Lisp_Object. (Bug#12661)
3078
3079 2012-10-17 Kenichi Handa <handa@gnu.org>
3080
3081 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3082 invalidate.
3083
3084 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3085
3086 * buffer.c (Fkill_buffer): When unchaining the marker,
3087 reset its buffer pointer to NULL (Bug#12652).
3088
3089 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3090
3091 Do not verify indirection counters of killed buffers (Bug#12579).
3092 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3093 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3094
3095 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3096
3097 * alloc.c (Fmake_byte_code): Fix typo in comment.
3098 * print.c (print_interval): Define as static to match prototype.
3099 * indent.c (disptab_matches_widthtab, recompute_width_table):
3100 Convert to eassert.
3101
3102 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3103
3104 * editfns.c (get_system_name): Remove.
3105 * lisp.h (get_system_name): Remove prototype.
3106 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3107 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3108
3109 2012-10-15 Daniel Colascione <dancol@dancol.org>
3110
3111 * dbusbind.c: Add comment explaining reason for previous change.
3112
3113 2012-10-15 Martin Rudalics <rudalics@gmx.at>
3114
3115 * window.c (Fwindow_end): Rewrite check whether cached position
3116 can be used (Bug#12600).
3117 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3118 Set windows_or_buffers_changed.
3119
3120 2012-10-15 Daniel Colascione <dancol@dancol.org>
3121
3122 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3123 enabled by undefining the symbol "interface", which the platform
3124 headers define to something incompatible.
3125
3126 2012-10-14 Daniel Colascione <dancol@dancol.org>
3127
3128 * image.c (init_tiff_functions, init_imagemagick_functions)
3129 (init_svg_functions): Fix cygw32 build break by using these
3130 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3131
3132 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3133
3134 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3135
3136 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3137
3138 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3139
3140 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3141
3142 * coding.c (detect_coding): Set coding->id before calling
3143 this->detector.
3144
3145 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3146
3147 * fileio.c: Formatting fixes.
3148
3149 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3150
3151 Fix some stat-related races.
3152 * fileio.c (Fwrite_region): Avoid race condition if a file is
3153 removed or renamed by some other process immediately after Emacs
3154 writes it but before Emacs stats it. Do not assume that stat (or
3155 fstat) succeeds.
3156 * image.c (slurp_file): Resolve the file name with fopen + fstat
3157 rather than stat + fopen.
3158 (pbm_read_file) [0]: Remove unused code with stat race.
3159 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3160 Remove ineffective code with stat race.
3161
3162 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3163
3164 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3165
3166 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3167
3168 * nsterm.m (hold_event_q): New static variable.
3169 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3170 ! q_event_ptr.
3171 (hold_event): New function.
3172 (ns_read_socket): If hold_event_q have events, store them and
3173 return (Bug#12384).
3174 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3175 is zero (Bug#12384).
3176
3177 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
3178
3179 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3180
3181 2012-10-12 Eli Zaretskii <eliz@gnu.org>
3182
3183 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3184
3185 * fileio.c (check_existing): New function.
3186 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3187 instead of calling 'stat', when what's needed is to check whether
3188 a file exists. This avoids expensive system calls on MS-Windows.
3189 (Bug#12587)
3190
3191 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
3192
3193 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3194 determine whether a file exists and is not a directory.
3195
3196 * lisp.h (check_existing): Add prototype.
3197
3198 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3199
3200 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3201
3202 2012-10-12 Glenn Morris <rgm@gnu.org>
3203
3204 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3205
3206 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3207
3208 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3209
3210 * eval.c (Fautoload): Remember previous autoload status in load-history.
3211
3212 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3213
3214 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3215 * lread.c (load_each_byte, new_backquote_flag, readchar)
3216 (read_filtered_event, lisp_file_lexically_bound_p)
3217 (safe_to_load_version, Fload, complete_filename_p, openp)
3218 (build_load_history, readevalloop, read_escape, read1)
3219 (string_to_number, read_vector, read_list):
3220 * macros.c (Fstart_kbd_macro):
3221 * marker.c (CONSIDER):
3222 * menu.c (parse_single_submenu, digest_single_submenu)
3223 (find_and_return_menu_selection, Fx_popup_menu):
3224 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3225 (Ftry_completion):
3226 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3227 (ns_menu_show):
3228 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3229 (xmenu_show, xdialog_show):
3230 Use bool for booleans.
3231 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3232 as it's not a predicate. All uses changed. Omit unnecessary
3233 buffer termination.
3234
3235 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3236
3237 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3238 (save_excursion_restore): Do not restore mark if it was not saved.
3239
3240 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3241
3242 * marker.c (cached_modiff): EMACS_INT, not int.
3243
3244 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3245 instead of having a wrong decl.
3246 * nsmenu.m (waiting_for_input): Remove wrong decl.
3247
3248 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 keyboard.c, keymap.c: Use bool for booleans.
3251 * dispnew.c (sit_for): Distinguish between 3-way display_option
3252 and boolean do_display.
3253 * keyboard.c (single_kboard, this_command_key_count_reset)
3254 (waiting_for_input, echoing, immediate_quit, input_pending)
3255 (interrupt_input, interrupts_deferred, pop_kboard)
3256 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3257 (command_loop_1, adjust_point_for_property)
3258 (safe_run_hooks_error, input_polling_used, read_char):
3259 (help_char_p, readable_events, kbd_buffer_events_waiting)
3260 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3261 (lucid_event_type_list_p, get_input_pending):
3262 (gobble_input, menu_separator_name_p, menu_bar_item)
3263 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3264 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3265 (keyremap_step, test_undefined, read_key_sequence)
3266 (detect_input_pending, detect_input_pending_ignore_squeezables)
3267 (detect_input_pending_run_timers, requeued_events_pending_p)
3268 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3269 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3270 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3271 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3272 (accessible_keymaps_1, Fkey_description, push_key_description):
3273 (shadow_lookup, struct where_is_internal_data)
3274 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3275 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3276 (describe_map, describe_vector):
3277 * menu.c (single_menu_item):
3278 * nsmenu.m (ns_update_menubar):
3279 * process.c (wait_reading_process_output):
3280 * search.c (scan_buffer, scan_newline):
3281 Use bool for boolean.
3282 * keyboard.c (timers_run, swallow_events)
3283 (detect_input_pending_run_timers):
3284 * process.c (wait_reading_process_output):
3285 Use unsigned for counter where wraparound-on-overflow is desired,
3286 since unsigned is guaranteed to have that behavior and signed is not.
3287 (read_char): Use ptrdiff_t for string length.
3288 (get_input_pending): Remove first argument, since it was always
3289 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3290 and behave as if it had that value. Return new value of
3291 input_pending. All callers changed.
3292 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3293 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3294 a string length.
3295 * keymap.c (push_key_description): Omit last arg, which was always 1.
3296 All callers changed.
3297
3298 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3299
3300 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
3301
3302 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3303 ($(BLD)/term.$(O)): Update dependencies.
3304
3305 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3308 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3309 initializer for PVEC_NORMAL_VECTOR.
3310
3311 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3312
3313 Clean out old termopts cruft.
3314 * termopts.h (flow_control, meta_key): Remove unused decls.
3315 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3316 Don't include termopts.h.
3317
3318 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3319
3320 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3321
3322 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3323
3324 * commands.h (immediate_quit): Remove duplicate decl.
3325
3326 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3327
3328 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3329 caching.
3330 (nsfont_open): Remove setting of Vfonts_in_cache.
3331 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
3332
3333 2012-10-09 Eli Zaretskii <eliz@gnu.org>
3334
3335 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3336 match what GetLastError returns. Explain why the function is
3337 needed.
3338
3339 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3340 'is_tooltip_frame', to avoid confusion with its global namesake.
3341
3342 2012-10-08 Daniel Colascione <dancol@dancol.org>
3343
3344 * xdisp.c (start_hourglass): Call w32_note_current_window when
3345 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3346 build that caused Emacs to display the hourglass cursor forever.
3347
3348 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3349 which is broken under remote desktop, calculate the number of
3350 colors available for a display based on the display's number of
3351 planes and number of bits per pixel per plane. (bug#10397).
3352
3353 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
3354
3355 * nsfont.m (Vfonts_in_cache): New variable.
3356 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3357 are used. Add cached fonts to Vfonts_in_cache.
3358 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3359
3360 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
3361
3362 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3363 in nt/config.nt.
3364 (FONT_H): Define after FRAME_H.
3365 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3366 Update dependencies.
3367
3368 * w32term.c: Remove leftover declaration of keyboard_codepage.
3369
3370 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3371
3372 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3373 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3374 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3375 (GLOBAL_SOURCES): Add cygw32.c.
3376 ($(BLD)/unexw32.$(O)):
3377 ($(BLD)/w32.$(O)):
3378 ($(BLD)/w32console.$(O)):
3379 ($(BLD)/w32fns.$(O)):
3380 ($(BLD)/w32heap.$(O)):
3381 ($(BLD)/w32menu.$(O)):
3382 ($(BLD)/w32proc.$(O)): Add w32common.h.
3383
3384 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3385 'const char *'.
3386 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3387
3388 2012-10-08 Daniel Colascione <dancol@dancol.org>
3389
3390 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3391 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3392 accidental message numbering hole. Change other messages to
3393 match.
3394
3395 * w32select.h (HAVE_W32SELECT): Remove.
3396
3397 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
3398 w32common.h instead of w32heap.h.
3399
3400 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3401 (get_allocation_unit, get_processor_type, get_w32_major_version)
3402 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3403 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3404 (OS_NT, os_subtype, cache_system_info): Move declarations to
3405 w32common.
3406
3407 * w32heap.c: Include w32common.h.
3408 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
3409 (w32_minor_version, w32_build_number, w32_subtype):
3410 Remove duplicate definitions.
3411
3412 * w32fns.c: Include w32common.h; include w32heap.h only in
3413 WINDOWSNT.
3414
3415 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3416 Use `report_file_error' instead of `error' in order to better
3417 inform users of what went wrong. Increase NTGUI_UNICODE file
3418 dialog box file name length to 32k, the maximum allowed by the NT
3419 kernel.
3420
3421 * w32common.h: New file.
3422 (ROUND_UP, ROUND_DOWN, get_page_size)
3423 (get_allocation_unit, get_processor_type, get_w32_major_version)
3424 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3425 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3426 (OS_NT, os_subtype, cache_system_info): Move here.
3427
3428 * unexw32.c, unexcw.c: Include w32common.h.
3429
3430 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3431 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3432 to call syms_of_w32select.
3433
3434 * cygw32.h: Remove obsolete EXFUN declarations.
3435
3436 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3437
3438 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3439 of w32inevt.o from SOME_MACHINE_OBJECTS.
3440
3441 2012-10-08 Daniel Colascione <dancol@dancol.org>
3442
3443 * image.c: Permanent fix for JPEG compilation issue --- limit
3444 jpeglib `boolean' redefinition to Cygwin builds.
3445
3446 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3447
3448 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3449
3450 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3451 Cygwin.
3452
3453 2012-10-08 Daniel Colascione <dancol@dancol.org>
3454
3455 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3456 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3457 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3458 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3459 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3460 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3461 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3462 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3463 now a supported configuration.
3464
3465 * Makefile.in: consolidate image variables into LIBIMAGE; add
3466 W32_OBJ and W32_LIBS. Compile new files.
3467
3468 * conf_post.h:
3469 (_DebPrint) declare tracing facility for W32 debugging. We need
3470 to unify tracing later.
3471
3472 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3473 unconditional use of W32 Unicode functions. Cygwin runs only on
3474 100% Unicode operating systems.
3475
3476 * cygw32.c: New file. Define Cygwin-specific facilities.
3477 (Fcygwin_convert_path_to_windows)
3478 (Fcygwin_convert_path_from_windows): New user functions for
3479 accessing Cygwin path-munging routines.
3480
3481 * cygw32.h: New file.
3482 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3483 UTF-16LE strings temporarily inside non-Lisp-visible string
3484 objects.
3485
3486 (w32_strerror): Just what it says on the tin.
3487
3488 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3489 also run for Cygwin; both systems have the same problem with using
3490 GUI facilities in a forked child. Also call syms_of_cygw32,
3491 syms_of_w32select in correct places.
3492
3493 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3494 needs fork-then-exec for daemon launching.
3495
3496 * font.h: Include frame.h.
3497
3498 * image.c: Use the image library cache machinery only when we're
3499 compiling for native WINDOWSNT; Cygwin can use shared libraries
3500 like any other Unixlike system.
3501
3502 * keyboard.c: Clarify a comment regarding the input loop.
3503
3504 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3505 functions directly instead of trying to detect at runtime that our
3506 host operating system supports them. We make this change for two
3507 reasons: Cygwin lacks support for the multibyte character
3508 conversion functions used by the legacy menu code, and Cygwin
3509 never needs to rely on non-Unicode APIs.
3510
3511 * unexw32.c (hinst): Declare extern.
3512
3513 * w32.c: Change header order;
3514 (w32_strerror): Move to w32fns.c because we need it for
3515 non-WINDOWSNT builds.
3516
3517 * w32.h: Add #error macro to make sure we don't include w32.h for
3518 Cygwin builds. Remove w32select declarations.
3519
3520 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
3521 w32fns.c. w32console.c is WINDOWSNT-only.
3522
3523 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3524 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3525 POSIXy alternative.
3526 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
3527 (w32_major_version, w32_minor_version, w32_build_number)
3528 (os_subtype, sound_type): Define here
3529 (w32_defined_color): Make color parameter const for consistency
3530 with other _defined_color functions.
3531 (w32_createwindow): Unconditionally call w32_init_class instead of
3532 doing so only when hprevinst is non-NULL. Plumbing hprevinst
3533 through the code is complex and unnecessary because class
3534 registration is practically free.
3535 (w32_name_of_message): New EMACSDEBUG-only function.
3536 (Fset_message_beep): Move here
3537 (Fx_open_connection): Require that the display name for Windows be
3538 "w32" for consistency, emacsclient disambiguation, and maybe, one
3539 day, multi-window-system support.
3540 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
3541 Cygwin files for W32 GUI facilities, since these clearly don't
3542 expect Cygwin names.
3543 (_DebPrint): Define.
3544 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
3545 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
3546 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
3547 (w32_last_error): Remove.
3548
3549 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3550
3551 * w32heap.c (syspage_mask): Declare here.
3552 (cache_system_info): Remove.
3553
3554 * w32inevt.c (faked_key): Define globally, not statically.
3555 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3556 (w32_console_toggle_lock_key): Move to w32fns.c.
3557
3558 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3559
3560 * w32proc.c (_DebPrint): Move to w32fns.c.
3561 * w32select.c: Include string.h, stdio.h for Cygwin.
3562 * w32select.h: New File.
3563
3564 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3565 get_osfhandle.
3566 (w32_message_fd): New variable. Under Cygwin, holds the file
3567 descriptor the system used to tell us about pending thread
3568 messages.
3569
3570 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3571 that prevented compilation under non-WINDOWSNT systems.
3572
3573 (w32_initialize): Open /dev/windows and assign it to
3574 w32_message_fd. Provide w32 feature.
3575
3576 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3577 (WM_EMACS_INPUT_READY): add.
3578 (prepend_msg, w32_message_fd): Declare globally.
3579
3580 * w32xfns.c:
3581 (keyboard_handle): Use only when WINDOWSNT.
3582 (notify_msg_ready): New function. Posts a message to the main
3583 thread's message queue under CYGWIN, which wakes up the main
3584 thread from select(2) by making the /dev/windows file descriptor
3585 ready. Under WINDOWSNT, it sets an event the same way the old
3586 code did.
3587
3588 (post, prepend_msg): Actually call notify_msg_ready instead of
3589 setting the input event directly.
3590
3591 2012-10-07 Eli Zaretskii <eliz@gnu.org>
3592
3593 * ralloc.c (relinquish): If a heap is ready to be relinquished,
3594 but it still has blocs in it, don't return it to the system,
3595 instead of aborting. (Bug#12402)
3596
3597 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
3598
3599 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
3600
3601 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
3602 MAC_OS_X_VERSION_10_6.
3603 (syms_of_nsterm): Remove comment about Panther and above for
3604 ns-antialias-text.
3605 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
3606 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
3607 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
3608
3609 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
3610 MAC_OS_X_VERSION_10_4.
3611
3612 * nsmenu.m (fillWithWidgetValue:): Remove code for <
3613 MAC_OS_X_VERSION_10_2.
3614
3615 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
3616
3617 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
3618 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
3619
3620 * nsterm.m (ns_in_resize): Remove (Bug#12479).
3621 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
3622 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
3623 Remove ns_in_resize check.
3624 (ns_clear_frame_area): Remove resize handle code.
3625
3626 * nsfns.m (ns_in_resize): Remove.
3627 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
3628 Remove ns_in_resize check.
3629
3630 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
3631
3632 Improve sys_siglist detection.
3633 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
3634 defined as a macro, as is done in Solaris.
3635 (sys_siglist_entries): New macro.
3636 (save_strsignal): Use it.
3637 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
3638 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
3639
3640 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
3641
3642 * nsfns.m (Fx_create_frame): Call x_default_parameter with
3643 fullscreen/Fullscreen.
3644
3645 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
3646 tobar_height is new.
3647
3648 * nsterm.m (x_make_frame_visible): Check for fullscreen.
3649 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
3650 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
3651 (windowDidResize:): Check for correct window if old style fullscreen.
3652 Capitalize word in comment. Remove incorrect comment.
3653 (initFrameFromEmacs:): tbar_height renamed tibar_height.
3654 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
3655 error in drawing background.
3656 (toggleFullScreen:): Remove comment. Rearrange calls.
3657 Set toolbar values to zero, save old height in tobar_height.
3658 Restore tool bar height when leaving fullscreen.
3659 (canBecomeMainWindow): New function.
3660
3661 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
3662
3663 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
3664
3665 2012-10-05 Eli Zaretskii <eliz@gnu.org>
3666
3667 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
3668
3669 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
3670 that time stamps of directories could also be changed.
3671 Don't request the too broad GENERIC_WRITE, only the more restrictive
3672 FILE_WRITE_ATTRIBUTES access rights.
3673
3674 * fileio.c (Fset_file_times): Special-case ignoring errors for
3675 directories only on MSDOS, not on MS-Windows.
3676
3677 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
3678
3679 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
3680
3681 2012-10-04 Eli Zaretskii <eliz@gnu.org>
3682
3683 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
3684 see whether CreateFile failed.
3685
3686 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
3689 to avoid similar races.
3690 * keyboard.c (pending_signals): Now bool, not int.
3691
3692 Port timers to OpenBSD, plus check for timer failures.
3693 OpenBSD problem reported by Han Boetes.
3694 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
3695 and/or setitimer.
3696 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
3697 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
3698 like OpenBSD, which has timer_settime but does not declare it.
3699 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
3700 whether to use itimerspec-related primitives. All uses of
3701 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
3702
3703 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 * profiler.c (handle_profiler_signal): Fix a malloc race
3706 that caused Emacs to hang on Fedora 17 when profiling Lisp.
3707
3708 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
3709
3710 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
3711
3712 2012-10-02 Eli Zaretskii <eliz@gnu.org>
3713
3714 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
3715 consistent with the change in return value of 'safe_strsignal'.
3716
3717 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3718
3719 Prefer plain 'static' to 'static inline' (Bug#12541).
3720 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
3721 (bidi_set_sor_type, bidi_push_embedding_level)
3722 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
3723 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
3724 (bidi_cache_search, bidi_cache_ensure_space)
3725 (bidi_cache_iterator_state, bidi_cache_find)
3726 (bidi_peek_at_next_level, bidi_set_paragraph_end)
3727 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3728 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
3729 Now 'static', not 'static inline'.
3730
3731 Count overruns when profiling; change units to ns.
3732 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
3733 Give extra weight to samples after overruns, to attempt to count
3734 the time more accurately.
3735 (setup_cpu_timer): Change sampling interval units from ms to ns, since
3736 the underlying primitives nominally do ns.
3737 (Fprofiler_cpu_start): Document the change. Mention that
3738 the sampling intervals are only approximate.
3739
3740 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3741
3742 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
3743
3744 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
3745 case for the special 0 coding-system.
3746
3747 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
3748 (Fmake_overlay): Remove redundant tests.
3749 (fix_start_end_in_overlays): Remove redundant recentering.
3750
3751 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
3752
3753 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
3754 Update dependencies.
3755
3756 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3757
3758 Fix a malloc race condition involving strsignal.
3759 A signal can arrive in the middle of a malloc, and Emacs's signal
3760 handler can invoke strsignal, which can invoke malloc, which is
3761 not portable. This race condition bug makes Emacs hang on GNU/Linux.
3762 Fix it by altering the signal handler so that it does not invoke
3763 strsignal.
3764 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
3765 * process.c (status_message): Use const pointer, in case strsignal
3766 is #defined to safe_strsignal.
3767 * sysdep.c (sys_siglist, init_signals): Always define and
3768 initialize a substitute sys_siglist if the system does not define
3769 one, even if HAVE_STRSIGNAL.
3770 (safe_strsignal): Rename from strsignal. Always define,
3771 using sys_siglist. Return a const pointer.
3772 * syssignal.h (safe_strsignal): New decl.
3773 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
3774
3775 2012-10-01 Eli Zaretskii <eliz@gnu.org>
3776
3777 * w32proc.c (timer_loop): Fix code that waits for timer
3778 expiration, to avoid high CPU usage.
3779
3780 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
3781
3782 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
3783 (sweep_weak_table): Remove redundant prototypes.
3784
3785 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
3786
3787 * emacs.c: Move the inclusion of TERM_HEADER after including
3788 windows.h on WINDOWSNT. This avoids compilation problems with
3789 MSVC.
3790
3791 2012-10-01 Eli Zaretskii <eliz@gnu.org>
3792
3793 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
3794 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
3795 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
3796 as the previous version used 'void *'.
3797
3798 * ralloc.c (ROUNDUP): Fix last change.
3799 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
3800 'size_t'.
3801
3802 * w32proc.c <disable_itimers>: New static flag.
3803 (init_timers): Initialize it to zero, after creating the critical
3804 sections used by the timer threads.
3805 (term_timers): Set to 1 before deleting the critical sections.
3806 (getitimer, setitimer): If disable_itimers is non-zero, return an
3807 error indication without doing anything. Reported by Fabrice
3808 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
3809 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
3810 return results.
3811 [!HAVE_SETITIMER]: Behave as the previous version that didn't
3812 support timers.
3813
3814 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
3815 term_ntproc after all the other bookkeeping, to get timers working
3816 as long as possible.
3817
3818 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3819
3820 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
3821 Suggested by Juri Linkov in
3822 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
3823
3824 Prefer plain 'static' to 'static inline' (Bug#12541).
3825 With static functions, modern compilers inline pretty well by
3826 themselves; advice from programmers often hurts as much as it helps.
3827 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
3828 this change shrinks the text size of the Emacs executable by 1.1%
3829 without affecting CPU significantly in my benchmark.
3830 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
3831 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
3832 (mark_maybe_object, mark_maybe_pointer, bounded_number):
3833 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3834 (bset_auto_fill_function, bset_auto_save_file_format)
3835 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3836 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3837 (bset_cache_long_line_scans, bset_case_fold_search)
3838 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3839 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3840 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3841 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3842 (bset_header_line_format, bset_indicate_buffer_boundaries)
3843 (bset_indicate_empty_lines, bset_invisibility_spec)
3844 (bset_left_fringe_width, bset_major_mode, bset_mark)
3845 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3846 (bset_name, bset_overwrite_mode, bset_pt_marker)
3847 (bset_right_fringe_width, bset_save_length)
3848 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3849 (bset_scroll_up_aggressively, bset_selective_display)
3850 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3851 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
3852 (set_buffer_overlays_after):
3853 * category.c (bset_category_table):
3854 * charset.c (read_hex):
3855 * coding.c (produce_composition, produce_charset)
3856 (handle_composition_annotation, handle_charset_annotation)
3857 (char_encodable_p):
3858 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
3859 (assign_row, set_frame_matrix_frame, make_current)
3860 (add_row_entry):
3861 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
3862 * fns.c (maybe_resize_hash_table):
3863 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
3864 * gmalloc.c (register_heapinfo):
3865 * image.c (lookup_image_type):
3866 * intervals.c (set_interval_object, set_interval_left)
3867 (set_interval_right, copy_interval_parent, rotate_right)
3868 (rotate_left, balance_possible_root_interval):
3869 * keyboard.c (kset_echo_string, kset_kbd_queue)
3870 (kset_keyboard_translate_table, kset_last_prefix_arg)
3871 (kset_last_repeatable_command, kset_local_function_key_map)
3872 (kset_overriding_terminal_local_map, kset_real_last_command)
3873 (kset_system_key_syms, clear_event, set_prop):
3874 * lread.c (digit_to_number):
3875 * marker.c (attach_marker, live_buffer, set_marker_internal):
3876 * nsterm.m (ns_compute_glyph_string_overhangs):
3877 * process.c (pset_buffer, pset_command)
3878 (pset_decode_coding_system, pset_decoding_buf)
3879 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
3880 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
3881 (pset_status, pset_tty_name, pset_type, pset_write_queue):
3882 * syntax.c (bset_syntax_table, dec_bytepos):
3883 * terminal.c (tset_param_alist):
3884 * textprop.c (interval_has_some_properties)
3885 (interval_has_some_properties_list):
3886 * window.c (wset_combination_limit, wset_dedicated)
3887 (wset_display_table, wset_hchild, wset_left_fringe_width)
3888 (wset_left_margin_cols, wset_new_normal, wset_new_total)
3889 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3890 (wset_right_fringe_width, wset_right_margin_cols)
3891 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
3892 (wset_vertical_scroll_bar_type, wset_window_parameters):
3893 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3894 (wset_column_number_displayed, wset_region_showing)
3895 (window_box_edges, run_window_scroll_functions)
3896 (append_glyph_string_lists, prepend_glyph_string_lists)
3897 (append_glyph_string, set_glyph_string_background_width)
3898 (append_glyph, append_composite_glyph)
3899 (take_vertical_position_into_account):
3900 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
3901 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
3902 (lface_hash, lface_same_font_attributes_p, lookup_face):
3903 * xml.c (libxml2_loaded_p):
3904 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
3905 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
3906 Now 'static', not 'static inline'.
3907
3908 * bidi.c: Tune.
3909 (bidi_copy_it): Do the whole copy with a single memcpy.
3910 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3911
3912 Revert the FOLLOW-SYMLINKS change for file-attributes.
3913 Doing it right would require several changes to Tramp, and there's
3914 not enough time to get that tested before the freeze today.
3915 * dired.c (directory_files_internal, Ffile_attributes):
3916 Undo last change.
3917
3918 * frame.c (x_report_frame_params): Port better to wider ints.
3919 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3920 or that pointers can be printed in 15 decimal digits.
3921 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3922
3923 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3924
3925 Support x64 build on MS-Windows.
3926 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3927 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3928 compatibility with x64.
3929 (x_get_focus_frame): Add prototype.
3930
3931 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
3932 defining an XRectangle structure.
3933
3934 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
3935 arithmetics for compatibility with x64.
3936
3937 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
3938 compatibility with x64.
3939
3940 * w32heap.h: Adjust prototypes and declarations.
3941
3942 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
3943 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
3944 DWORD, long, and unsigned long, for compatibility with x64.
3945 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
3946 (sbrk): Argument is now of type ptrdiff_t.
3947
3948 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
3949 less than 0x0500.
3950 (w32_msg_pump): Use WPARAM type for 'result'.
3951
3952 * w32.c (init_environment, get_emacs_configuration): Support AMD64
3953 architecture.
3954 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
3955 compatibility with x64.
3956
3957 * vm-limit.c (lim_data): Now size_t.
3958 (check_memory_limits): Adjust prototypes of real_morecore and
3959 __morecore to receive argument of type ptrdiff_t. Use size_t for
3960 five_percent and data_size.
3961
3962 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
3963 variables, for compatibility with x64.
3964 (rva_to_section, offset_to_section, relocate_offset)
3965 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
3966 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
3967 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
3968 for compatibility with x64.
3969
3970 * sysdep.c (STDERR_FILENO): Define if not already defined.
3971
3972 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
3973 (__morecore): Argument type is now ptrdiff_t.
3974 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
3975 (relinquish): Use ptrdiff_t type for 'excess'.
3976 (r_alloc_sbrk): Argument type is now ptrdiff_t.
3977
3978 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
3979 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
3980 instead of a literal number.
3981
3982 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
3983 (min): Define only if not already defined.
3984
3985 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
3986 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
3987 hosts.
3988
3989 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
3990 'bitmaps' is a pointer.
3991
3992 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
3993
3994 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
3995
3996 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3997
3998 file-attributes has a new optional arg FOLLOW-SYMLINKS.
3999 * dired.c (directory_files_internal, Ffile_attributes):
4000 New arg follow_symlinks. All uses changed.
4001
4002 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4003
4004 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4005
4006 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4007
4008 Support atimers and CPU profiler via profile.c on MS-Windows.
4009 * w32proc.c (sig_mask, crit_sig): New static variables.
4010 (sys_signal): Support SIGALRM and SIGPROF.
4011 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4012 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4013 sigfillset, and sigprocmask are no longer no-ops.
4014 (sigismember): New function.
4015 (struct itimer_data): New definition.
4016 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4017 (crit_prof): New static variables.
4018 (MAX_SINGLE_SLEEP): New definition.
4019 (timer_loop, stop_timer_thread, term_timers, init_timers)
4020 (start_timer_thread, getitimer, setitimer): New functions.
4021 (alarm): No longer a no-op, calls setitimer.
4022
4023 * w32.c (term_ntproc): Call term_timers.
4024 (init_ntproc): Make sure all signals are unblocked at startup, to
4025 erase any traces of dumping. Call init_timers.
4026
4027 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4028 Windows-specific code to display the hourglass mouse pointer is no
4029 longer used.
4030 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4031 to hourglass timer expiration.
4032 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4033 Remove, no longer used.
4034 (w32_note_current_window, show_hourglass, hide_hourglass):
4035 New functions, in support of hourglass cursor display similar to other
4036 window systems.
4037 (syms_of_w32fns): Don't initialize hourglass_timer.
4038
4039 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4040 WINDOWSNT as well.
4041 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4042
4043 * w32.h (init_timers, term_timers): Add prototypes.
4044
4045 2012-09-30 Kenichi Handa <handa@gnu.org>
4046
4047 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4048 to the buffer relocation which may be caused by ccl_driver.
4049
4050 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4051
4052 * xfns.c (Fx_file_dialog): Update comment.
4053
4054 * w32fns.c (Fx_file_dialog): Update comment.
4055
4056 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4057 Initialize panel name field if OSX >= 10.6.
4058
4059 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4060
4061 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4062
4063 * nsterm.m (NEW_STYLE_FS): New define.
4064 (ns_fullscreen_hook, windowWillEnterFullScreen)
4065 (windowDidEnterFullScreen, windowWillExitFullScreen)
4066 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4067 (setFSValue): New functions.
4068 (EmacsFSWindow): New implementation.
4069 (canBecomeKeyWindow): New function for EmacsFSWindow.
4070 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4071 (dealloc): Release nonfs_window if in fullscreen.
4072 (updateFrameSize:): Call windowDidMove to update top/left.
4073 (windowWillResize:toSize:): Check if frame is still maximized.
4074 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4075 next_maximized, maximized_width, maximized_height and nonfs_window.
4076 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4077 tbar_height.
4078 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
4079 fullscreen. Set maximized_width/height. Act on next_maximized.
4080
4081 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4082 (EmacsView): Add variables for fullscreen.
4083 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4084 (EmacsFSWindow): New interface for fullscreen.
4085
4086 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
4087
4088 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4089
4090 2012-09-30 Chong Yidong <cyd@gnu.org>
4091
4092 * fns.c (Frandom): Doc fix.
4093
4094 2012-09-30 Martin Rudalics <rudalics@gmx.at>
4095
4096 * window.c (Vwindow_combination_limit): New default value.
4097 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4098
4099 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4100
4101 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4102 Suggested by Eli Zaretskii in
4103 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4104
4105 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4106
4107 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4108 HAVE_TIMER_SETTIME is defined.
4109
4110 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4111
4112 Profiler improvements: more-accurate timers, overflow checks.
4113 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4114 signal.h, setjmp.h. Include systime.h instead.
4115 (saturated_add): New function.
4116 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4117 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4118 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4119 New static vars.
4120 (enum profiler_cpu_running): New enum.
4121 (profiler_cpu_running): Now of that enum type, not bool.
4122 All uses changed to store the new value.
4123 (handle_profiler_signal): Rename from sigprof_handler_1,
4124 for consistency with other handlers. Do not check whether
4125 cpu_log is a hash-table if garbage collecting, since it
4126 doesn't matter in that case.
4127 (deliver_profiler_signal): Rename from sigprof_handler,
4128 for consistency with other handlers.
4129 (setup_cpu_timer): New function, with much of what used to be in
4130 Fprofiler_cpu_start. Check for out-of-range argument.
4131 Prefer timer_settime if available, and prefer
4132 thread cputime clocks, then process cputime clocks, then
4133 monotonic clocks, to the old realtime clock. Use make_timeval
4134 to round more-correctly when falling back to setitimer.
4135 (Fprofiler_cpu_start): Use it.
4136 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4137 Don't assume that passing NULL as the 2nd argument of setitimer
4138 is the same as passing a pointer to all-zero storage.
4139 Ignore SIGPROF afterwards.
4140 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4141 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4142 non-fatal signal handlers. Ignore SIGPROF on startup.
4143 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4144 in profiler.c, since sysdep.c now uses it.
4145
4146 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4147 Suggested by Eli Zaretskii in
4148 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4149
4150 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
4151
4152 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4153
4154 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4155
4156 * lisp.h (struct backtrace): Remove indirection for `function' field.
4157 * xdisp.c (redisplay_internal):
4158 * profiler.c (record_backtrace, sigprof_handler_1):
4159 * alloc.c (Fgarbage_collect):
4160 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4161 (Fbacktrace_frame): Adjust accordingly.
4162
4163 2012-09-28 Glenn Morris <rgm@gnu.org>
4164
4165 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4166 (Frun_hook_with_args_until_failure): Doc fixes.
4167
4168 2012-09-28 Eli Zaretskii <eliz@gnu.org>
4169
4170 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4171 Qautomatic_redisplay and change the symbol name. All users changed.
4172
4173 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4174
4175 * profiler.c (sigprof_handler): Fix race condition.
4176
4177 2012-09-28 Glenn Morris <rgm@gnu.org>
4178
4179 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4180
4181 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4182
4183 Check more robustly for timer_settime.
4184 * Makefile.in (LIB_TIMER_TIME): New macro.
4185 (LIBES): Add it.
4186 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4187 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4188 call timer_settime.
4189
4190 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4191
4192 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4193
4194 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
4195
4196 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4197
4198 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4199
4200 * character.h (MAYBE_UNIFY_CHAR): Remove.
4201 * charset.c, charset.h (maybe_unify_char): Now static.
4202 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4203 Since this stuff is now private to charset.c, there's no need for
4204 a public macro and no need to inline by hand.
4205
4206 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4207 Stefan Monnier <monnier@iro.umontreal.ca>
4208 Juanma Barranquero <lekktu@gmail.com>
4209
4210 * profiler.c: New file.
4211 * Makefile.in (base_obj): Add profiler.o.
4212 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4213 ($(BLD)/profiler.$(O)): New target.
4214 * emacs.c (main): Call syms_of_profiler.
4215 * alloc.c (Qautomatic_gc): New constant.
4216 (MALLOC_PROBE): New macro.
4217 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4218 (total_bytes_of_live_objects): New function.
4219 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4220 Call malloc_probe for the memory profiler.
4221 (syms_of_alloc): Define Qautomatic_gc.
4222 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4223 race condition.
4224 (struct backtrace): Move definition...
4225 * lisp.h (struct backtrace): ..here.
4226 (Qautomatic_gc, profiler_memory_running): Declare vars.
4227 (malloc_probe, syms_of_profiler): Declare functions.
4228 * xdisp.c (Qautomatic_redisplay): New constant.
4229 (redisplay_internal): Record itself in backtrace_list.
4230 (syms_of_xdisp): Define Qautomatic_redisplay.
4231
4232 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4233 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4234
4235 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4236
4237 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4238
4239 Prefer POSIX timers if available.
4240 They avoid a race if the timer is too close to the current time.
4241 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4242 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
4243 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
4244
4245 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4246
4247 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4248 CHAR_STRING_ADVANCE.
4249 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4250 STRING_CHAR_ADVANCE.
4251
4252 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
4253
4254 Move Vlibrary_cache to emacs.c and reset before dumping.
4255
4256 * lisp.h (reset_image_types): Declare.
4257 [WINDOWSNT] (Vlibrary_cache): Declare.
4258
4259 * image.c (reset_image_types): New function.
4260
4261 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4262 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4263 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4264
4265 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4266 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4267
4268 * w32.h (Vlibrary_cache): Do not declare.
4269
4270 2012-09-25 Eli Zaretskii <eliz@gnu.org>
4271
4272 * w32proc.c (sys_signal): Handle all signals defined by the
4273 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4274 handlers for signals supported by Windows. Don't override
4275 term_ntproc as the handler for SIGABRT.
4276 (sigaction): Rewrite to call sys_signal instead of duplicating its
4277 code.
4278 (sys_kill): Improve commentary.
4279
4280 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4281 consistency with a signature of a signal handler. All callers
4282 changed.
4283 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4284 install term_ntproc as a signal handler for SIGABRT, as that
4285 should be done by the dumped Emacs.
4286
4287 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4288
4289 * w32select.c (term_w32select): Protect against repeated
4290 invocation by setting clipboard_owner to NULL after calling
4291 DestroyWindow.
4292
4293 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4294 and term_ntproc to their modified signatures.
4295
4296 * character.c (char_string, string_char): Remove calls to
4297 MAYBE_UNIFY_CHAR. See the discussion starting at
4298 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4299 for the details.
4300
4301 2012-09-25 Chong Yidong <cyd@gnu.org>
4302
4303 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4304
4305 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4306
4307 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4308 when encountering an unknown bytecode.
4309
4310 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4311
4312 image.c, indent.c: Use bool for booleans.
4313 * dispextern.h (struct image_type): Members valid_p, load, init
4314 now return bool, not int. All uses changed.
4315 * image.c: Omit unnecessary static decls.
4316 (x_create_bitmap_mask, x_build_heuristic_mask):
4317 Return void, not int, since callers don't care about the return value.
4318 (x_create_bitmap_mask, define_image_type, valid_image_p)
4319 (struct image_keyword, parse_image_spec, image_spec_value)
4320 (check_image_size, image_background)
4321 (image_background_transparent, x_clear_image_1)
4322 (postprocess_image, lookup_image, x_check_image_size)
4323 (x_create_x_image_and_pixmap, xbm_image_p)
4324 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4325 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4326 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4327 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4328 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4329 (png_image_p, init_png_functions, png_load_body, png_load)
4330 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4331 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4332 (init_gif_functions, gif_load, imagemagick_image_p)
4333 (imagemagick_load_image, imagemagick_load, svg_image_p)
4334 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4335 (gs_load):
4336 * nsimage.m (ns_load_image):
4337 * nsterm.m (ns_defined_color):
4338 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4339 * xfns.c (x_defined_color):
4340 * xterm.c (x_alloc_lighter_color_for_widget)
4341 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4342 (x_alloc_lighter_color):
4343 * indent.c (disptab_matches_widthtab, current_column)
4344 (scan_for_column, string_display_width, indented_beyond_p)
4345 (compute_motion, vmotion, Fvertical_motion):
4346 Use bool for booleans.
4347
4348 2012-09-24 Chong Yidong <cyd@gnu.org>
4349
4350 * chartab.c (Fset_char_table_default): Obsolete function removed.
4351
4352 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4353
4354 Move pid_t related decls out of lisp.h.
4355 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4356 (interruptible_wait_for_termination):
4357 Move these decls from lisp.h to syswait.h, since they use pid_t.
4358 Needed on FreeBSD; see Herbert J. Skuhra in
4359 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4360 * callproc.c: Include syswait.h.
4361
4362 gnutls.c, gtkutil.c: Use bool for boolean.
4363 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4364 (emacs_gnutls_handle_error):
4365 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4366 (xg_hide_tooltip, xg_create_frame_widgets)
4367 (create_dialog, xg_uses_old_file_dialog)
4368 (xg_get_file_with_chooser, xg_get_file_with_selection)
4369 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4370 (xg_item_label_same_p, xg_update_menubar)
4371 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4372 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4373 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4374 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4375 (update_frame_tool_bar, free_frame_tool_bar):
4376 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4377 * nsmenu.m (ns_update_menubar):
4378 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4379 * xfns.c (Fx_show_tip) [USE_GTK]:
4380 Use bool for boolean.
4381 * gtkutil.c (xg_update_frame_menubar):
4382 * xmenu.c (update_frame_menubar):
4383 Return void, not int, since caller ignores return value.
4384 * gtkutil.c (xg_change_toolbar_position):
4385 Return void, not 1.
4386
4387 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4388
4389 * makefile.w32-in (BLOCKINPUT_H): Remove.
4390 (SYSSIGNAL_H): New macro.
4391 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4392 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4393 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4394 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4395 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4396 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4397 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4398 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4399 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4400 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4401 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4402 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4403 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4404 ($(BLD)/w32xfns.$(O)): Update dependencies.
4405
4406 2012-09-23 Eli Zaretskii <eliz@gnu.org>
4407
4408 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4409 fatal_error_backtrace.
4410
4411 * w32proc.c (sys_kill): Undo last change: don't do anything when
4412 invoked to deliver SIGABRT to our own process. This is now
4413 handled by emacs_raise.
4414
4415 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4416
4417 * w32term.c (w32_read_socket): Remove leftover reference to
4418 interrupt_input_pending.
4419
4420 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4421
4422 Do not use SA_NODEFER.
4423 Problem reported by Dani Moncayo in
4424 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4425 * alloc.c (die):
4426 * sysdep.c (emacs_abort): Do not reset signal handler.
4427 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4428 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4429 wanted even on POSIXish hosts, and it doesn't work on Windows.
4430
4431 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4432
4433 * xterm.c (x_term_init): Call fixup_locale before and after calling
4434 gtk_init (Bug#12392).
4435
4436 2012-09-23 Chong Yidong <cyd@gnu.org>
4437
4438 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4439 Vdynamic_library_alist.
4440
4441 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4442 (Fgnutls_available_p): Caller changed.
4443
4444 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4445 (Flibxml_parse_xml_region): Likewise.
4446
4447 * dispextern.h (struct image_type): Remove arg from init function.
4448
4449 * image.c (Finit_image_library, lookup_image_type)
4450 (define_image_type): Remove now-unneeded second arg.
4451 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4452 (init_tiff_functions, init_gif_functions, init_svg_functions):
4453 Arglist and w32_delayed_load calling convention changed.
4454 (gs_type): Remove init_gs_functions; there is no such function.
4455 (valid_image_p, make_image): Fix caller to lookup_image_type.
4456
4457 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4458
4459 Simplify and avoid signal-handling races (Bug#12471).
4460 * alloc.c (die):
4461 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4462 Avoid recursive loop if there's a fatal error in the function itself.
4463 * atimer.c (pending_atimers):
4464 * blockinput.h: Don't include "atimer.h"; no longer needed.
4465 (interrupt_input_pending): Remove. All uses removed.
4466 pending_signals now counts both atimers and ordinary interrupts.
4467 This is less racy than having three separate pending-signal flags.
4468 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4469 (input_blocked_p):
4470 Rename from their upper-case counterparts BLOCK_INPUT,
4471 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4472 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4473 This makes it easier to access volatile variables more accurately.
4474 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4475 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4476 that's more reliable if the code is buggy and sets
4477 interrupt_input_blocked to a negative value. All uses changed.
4478 * atimer.c (deliver_alarm_signal):
4479 Remove. No need to deliver this to the parent; any thread can
4480 handle this signal now. All uses replaced by underlying handler.
4481 * atimer.c (turn_on_atimers):
4482 * dispnew.c (handle_window_change_signal):
4483 * emacs.c (handle_danger_signal):
4484 * keyboard.c (kbd_buffer_get_event):
4485 Don't reestablish signal handler; not needed with sigaction.
4486 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4487 (UNBLOCK_INPUT_TO):
4488 Rework to avoid unnecessary accesses to volatile variables.
4489 (UNBLOCK_INPUT_TO): Now a function.
4490 (totally_unblock_input, unblock_input): New decls.
4491 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4492 (init_data): Remove. Necessary stuff now done in init_signal.
4493 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4494 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4495 (fatal_error_code): Remove; no longer needed.
4496 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4497 it doesn't always backtrace. All uses changed. No need to reset
4498 signal to default, since sigaction and/or die does that for us now.
4499 Use emacs_raise (FOO), not kill (getpid (), FOO).
4500 (main): Check more-accurately whether we're dumping.
4501 Move fatal-error setup to sysdep.c
4502 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4503 * gtkutil.c (xg_get_file_name, xg_get_font):
4504 Remove no-longer-needed signal-mask manipulation.
4505 * keyboard.c, process.c (POLL_FOR_INPUT):
4506 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4507 * keyboard.c (read_avail_input): Remove.
4508 All uses replaced by gobble_input.
4509 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4510 (kbd_buffer_store_event_hold, gobble_input):
4511 (record_asynch_buffer_change) [USABLE_SIGIO]:
4512 (store_user_signal_events):
4513 No need to mess with signal mask.
4514 (gobble_input): If blocking input and there are terminals, simply
4515 set pending_signals to 1 and return. All hooks changed to not
4516 worry about whether input is blocked.
4517 (process_pending_signals): Clear pending_signals before processing
4518 them, in case a signal comes in while we're processing.
4519 By convention callers now test pending_signals before calling us.
4520 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4521 New functions, to support changes to blockinput.h.
4522 (handle_input_available_signal): Now extern.
4523 (reinvoke_input_signal): Remove. All uses replaced by
4524 handle_async_input.
4525 (quit_count): Now volatile, since a signal handler uses it.
4526 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
4527 All callers changed. Block SIGINT only if not already blocked.
4528 Clear sigmask reliably, even if Fsignal returns, which it can.
4529 Omit unnecessary accesses to volatile var.
4530 (quit_throw_to_read_char): No need to restore sigmask.
4531 * keyboard.c (gobble_input, handle_user_signal):
4532 * process.c (wait_reading_process_output):
4533 Call signal-handling code rather than killing ourselves.
4534 * lisp.h: Include <float.h>, for...
4535 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
4536 (pending_signals): Now volatile.
4537 (syms_of_data): Now const if IEEE floating point.
4538 (handle_input_available_signal) [USABLE_SIGIO]:
4539 (terminate_due_to_signal, record_child_status_change): New decls.
4540 * process.c (create_process): Avoid disaster if memory is exhausted
4541 while we're processing a vfork, by tightening the critical section
4542 around the vfork.
4543 (send_process_frame, process_sent_to, handle_pipe_signal)
4544 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
4545 ignores SIGPIPE.
4546 (send_process): No need for setjmp/longjmp any more, since the
4547 SIGPIPE stuff is now gone. Instead, report an error if errno
4548 is EPIPE.
4549 (record_child_status_change): Now extern. PID and W are now args.
4550 Return void, not bool. All callers changed.
4551 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4552 Remove. All uses removed. This bug should be fixed now in a
4553 different way.
4554 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4555 and record the child status change directly. This avoids the
4556 need to futz with the signal mask.
4557 (process_fatal_action): Move here from emacs.c.
4558 (emacs_sigaction_flags): New function, containing
4559 much of what used to be in emacs_sigaction_init.
4560 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4561 caught by emacs, to make races less likely.
4562 (deliver_process_signal): Rename from handle_on_main_thread.
4563 All uses changed.
4564 (BACKTRACE_LIMIT_MAX): Now at top level.
4565 (thread_backtrace_buffer, threadback_backtrace_pointers):
4566 New static vars.
4567 (deliver_thread_signal, deliver_fatal_thread_signal):
4568 New functions, for more-accurate delivery of thread-specific signals.
4569 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4570 (deliver_arith_signal): Handle in this thread, not
4571 in the main thread, since it's triggered by this thread.
4572 (maybe_fatal_sig): New function.
4573 (init_signals): New arg DUMPING so that we can be more accurate
4574 about whether we're dumping. Caller changed.
4575 Treat thread-specific signals differently from process-general signals.
4576 Block all signals while handling fatal error; that's safer.
4577 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4578 on IEEE hosts.
4579 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
4580 Ignore SIGPIPE unless batch.
4581 (emacs_backtrace): Output backtrace for the appropriate thread,
4582 which is not necessarily the main thread.
4583 * syssignal.h: Include <stdbool.h>.
4584 (emacs_raise): New macro.
4585 * xterm.c (x_connection_signal): Remove; no longer needed
4586 now that we use sigaction.
4587 (x_connection_closed): No need to mess with sigmask now.
4588 (x_initialize): No need to reset SIGPIPE handler here, since
4589 init_signals does this for us now.
4590
4591 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4592
4593 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
4594 background rect may be larger (Bug#12245).
4595
4596 2012-09-23 Chong Yidong <cyd@gnu.org>
4597
4598 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
4599
4600 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4601
4602 * .gdbinit: Just stop at fatal_error_backtrace.
4603 See Stefan Monnier's request in
4604 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
4605 Remove no-longer-used query of system type.
4606
4607 2012-09-22 Chong Yidong <cyd@gnu.org>
4608
4609 * search.c (Freplace_match): Doc fix (Bug#12325).
4610
4611 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
4612
4613 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
4614 (Fline_end_position): Doc fix.
4615
4616 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
4617
4618 2012-09-22 Chong Yidong <cyd@gnu.org>
4619
4620 * dispextern.h (struct image_type): Add new slot, storing a type
4621 initialization function.
4622
4623 * image.c (define_image_type): Call the image initializer function
4624 if it is defined. Arguments and return value changed.
4625 (valid_image_p, make_image): Callers changed.
4626 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
4627 (gif_type, imagemagick_type, svg_type, gs_type):
4628 Add initialization functions.
4629 (Finit_image_library): Call lookup_image_type.
4630 (CHECK_LIB_AVAILABLE): Macro deleted.
4631 (lookup_image_type): Call define_image_type here, rather than via
4632 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
4633 (syms_of_image): Move define_image_type calls for xbm_type and
4634 pbm_type to lookup_image_type.
4635
4636 2012-09-22 Eli Zaretskii <eliz@gnu.org>
4637
4638 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4639 'idle_timers' from here ...
4640 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
4641 lists, to avoid infloops when the timer does something stupid,
4642 like reinvoke itself with the same or smaller time-out.
4643 (Bug#12447)
4644
4645 2012-09-22 Martin Rudalics <rudalics@gmx.at>
4646
4647 * window.c (Fsplit_window_internal): Handle only Qt value of
4648 Vwindow_combination_limit separately.
4649 (Qtemp_buffer_resize): New symbol.
4650 (Vwindow_combination_limit): New default value.
4651 Rewrite doc-string.
4652
4653 2012-09-22 Eli Zaretskii <eliz@gnu.org>
4654
4655 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4656 the new overlay string. (Bug#10159)
4657
4658 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4661 or that fprintf is async-signal-safe. POSIX doesn't require
4662 either assumption.
4663
4664 2012-09-22 Chong Yidong <cyd@gnu.org>
4665
4666 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
4667 (Bug#8207).
4668
4669 2012-09-22 Kenichi Handa <handa@gnu.org>
4670
4671 * composite.c (composition_reseat_it): Handle the case that a
4672 grapheme cluster is not covered by a single font (Bug#12352).
4673
4674 2012-09-21 Chong Yidong <cyd@gnu.org>
4675
4676 * image.c (define_image_type): Avoid adding duplicate types to
4677 image_types (Bug#12463). Suggested by Jörg Walter.
4678
4679 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4680
4681 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4682 (print_load_command_name): Add case LC_DATA_IN_CODE.
4683 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
4684
4685 2012-09-21 Glenn Morris <rgm@gnu.org>
4686
4687 * eval.c (Frun_hook_with_args_until_success)
4688 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
4689
4690 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
4691
4692 * fileio.c (Ffile_selinux_context): Only call freecon when
4693 lgetfilecon succeeded.
4694 (Fset_file_selinux_context): Likewise. (Bug#12444)
4695
4696 2012-09-21 Eli Zaretskii <eliz@gnu.org>
4697
4698 * xdisp.c (try_window_reusing_current_matrix): Under bidi
4699 reordering, locate the cursor by calling set_cursor_from_row; if
4700 that fails, clear the desired glyph matrix before returning a
4701 failure indication to the caller. Fixes leaving garbled display
4702 when fast scrolling with a down-key. (Bug#12403)
4703 (compute_stop_pos_backwards): Fix a typo that caused crashes while
4704 scrolling through multibyte text.
4705
4706 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
4707
4708 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
4709 calling mark_vectorlike since that's the one that marks the window.
4710 (mark_discard_killed_buffers): Mark the final cdr.
4711 * window.h (struct window): Move prev/next_buffers to the
4712 non-standard fields.
4713 * window.c (make_window): Initialize prev/next_buffers manually.
4714
4715 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
4716
4717 Omit unused arg EXPECTED from socket hooks.
4718 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
4719 * nsterm.m (ns_term_init):
4720 * termhooks.h (struct terminal.read_socket_hook):
4721 * w32inevt.c (w32_console_read_socket):
4722 * w32term.c (w32_read_socket):
4723 * xterm.c (XTread_socket):
4724 Omit unused arg EXPECTED. All callers changed.
4725 (store_user_signal_events): Return void, not int, since callers no
4726 longer care about the return value. All uses changed.
4727
4728 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
4729
4730 * w32gui.h (XParseGeometry): Do not declare.
4731
4732 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
4735 Ignore 'expected'. See Eli Zaretskii in
4736 <http://bugs.gnu.org/12471#8> (last line).
4737
4738 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
4739 (XParseGeometry): Now static. Substitute extremal values for
4740 values that are out of range.
4741
4742 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
4743
4744 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
4745
4746 * nsfns.m (XParseGeometry): Remove.
4747 (Fx_create_frame): Call x_set_offset to correctly interpret
4748 top_pos in geometry.
4749
4750 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
4751 (Fx_parse_geometry): If there is a space in string, call
4752 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
4753
4754 2012-09-17 Eli Zaretskii <eliz@gnu.org>
4755
4756 * search.c (scan_buffer): Use character positions in calls to
4757 region_cache_forward and region_cache_backward, not byte
4758 positions. (Bug#12196)
4759
4760 * w32term.c (w32_read_socket): Set pending_signals to 1, like
4761 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
4762
4763 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
4764 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
4765 emacs_blocked_malloc, now deleted.
4766
4767 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
4770 The workaround was for improving performance on Solaris 2.4, but
4771 is getting in the way now. Emacs will still work if someone is
4772 still running Solaris 2.4 in a museum somewhere; Sun dropped
4773 support for Solaris 2.4 in 2003.
4774 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
4775 * process.c (create_process) [HAVE_WORKING_VFORK]:
4776 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
4777 since Emacs no longer uses vfork on that platform.
4778
4779 2012-09-17 Glenn Morris <rgm@gnu.org>
4780
4781 * emacs.c: Use COPYRIGHT.
4782
4783 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
4784
4785 Remove configure's --without-sync-input option (Bug#12450).
4786 When auditing signal-handling in preparation for cleaning it up,
4787 I found that SYNC_INPUT has race conditions and would be a real
4788 pain to fix. Since it's an undocumented and deprecated
4789 configure-time option, now seems like a good time to remove it.
4790 Also see <http://bugs.gnu.org/11080#16>.
4791 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
4792 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
4793 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4794 (malloc_hysteresis):
4795 (check_depth) [XMALLOC_OVERRUN_CHECK]:
4796 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
4797 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
4798 (dont_register_blocks, bytes_used_when_reconsidered)
4799 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
4800 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
4801 [!SYSTEM_MALLOC && !SYNC_INPUT]:
4802 Remove. All uses removed.
4803 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
4804 implementation, one that depends on whether the new macro
4805 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
4806 is defined.
4807 * atimer.c (run_timers, handle_alarm_signal):
4808 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
4809 (handle_async_input, process_pending_signals)
4810 (handle_input_available_signal, init_keyboard):
4811 * nsterm.m (ns_read_socket):
4812 * process.c (wait_reading_process_output):
4813 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
4814 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
4815 (emacs_write):
4816 * xterm.c (XTread_socket):
4817 Assume SYNC_INPUT.
4818 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
4819 * eval.c (handling_signal): Remove. All uses removed.
4820 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
4821 All uses replaced with the SYNC_INPUT version.
4822 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
4823 Remove decls.
4824 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4825 Now static.
4826
4827 * font.c (Ffont_shape_gstring): Remove unused local.
4828
4829 2012-09-16 Glenn Morris <rgm@gnu.org>
4830
4831 * Makefile.in (clean): No longer run nextstep's clean.
4832
4833 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
4834 (ns_frag): Remove.
4835 (ns-app): Move here from ns.mk, and simplify.
4836 (clean): Simplify nextstep entry.
4837 * ns.mk: Remove file.
4838
4839 2012-09-17 Kenichi Handa <handa@gnu.org>
4840
4841 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4842 not covert the last few charactes.
4843
4844 2012-09-16 Kenichi Handa <handa@gnu.org>
4845
4846 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4847 here, but just check the validity of glyphs in the glyph-string.
4848
4849 2012-09-16 Martin Rudalics <rudalics@gmx.at>
4850
4851 * window.c (Fwindow_parameter, Fset_window_parameter):
4852 Accept any window as argument (Bug#12452).
4853
4854 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
4855
4856 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
4857 to ns_term_init to avoid memory leak.
4858
4859 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
4860 explicit retain/release.
4861 (ns_term_init): Only allow one display. Initialize outerpool and
4862 ns_*_types.
4863
4864 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4865
4866 Port _setjmp fix to POSIXish hosts as well as Microsoft.
4867 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
4868 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
4869 the Microsoft problem in a different way, by altering ../nt/config.nt.
4870
4871 2012-09-15 Eli Zaretskii <eliz@gnu.org>
4872
4873 * w32xfns.c:
4874 * w32uniscribe.c:
4875 * w32term.c:
4876 * w32select.c:
4877 * w32reg.c:
4878 * w32proc.c:
4879 * w32menu.c:
4880 * w32inevt.c:
4881 * w32heap.c:
4882 * w32font.c:
4883 * w32fns.c:
4884 * w32console.c:
4885 * w32.c:
4886 * w16select.c: Remove inclusion of setjmp.h, as it is now included
4887 by lisp.h. This completes removal of setjmp.h inclusion
4888 erroneously announced in the previous commit. (Bug#12446)
4889
4890 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
4891 more accurate.
4892
4893 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
4894 not defined as a macro. The latter happens on MS-Windows.
4895 (Bug#12446)
4896
4897 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4898
4899 Port better to POSIX hosts lacking _setjmp (Bug#12446).
4900 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
4901 Some instances of '#include <setjmp.h>' removed, if the
4902 only reason for the instance was because "lisp.h" was included.
4903 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
4904 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
4905 and _longjmp with the new symbols. Emacs already uses _setjmp if
4906 available, so this change affects only POSIXish hosts that have
4907 sigsetjmp but not _setjmp, such as some versions of Solaris and
4908 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
4909 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4910 (png_load_body) [HAVE_PNG]:
4911 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4912 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4913 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4914 since PNG requires jmp_buf. This is the only exception to the
4915 general rule that we now use sys_setjmp and sys_longjmp.
4916 This exception is OK since this code does not change the signal
4917 mask or longjmp out of a signal handler.
4918
4919 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4920
4921 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4922 Include "syssignal.h", for 'main_thread'.
4923
4924 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4925
4926 Avoid out-of-range marker position (Bug#12426).
4927 * insdel.c (replace_range, replace_range_2):
4928 Adjust markers before overlays, as suggested by comments.
4929 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4930 Remove redundant check before calling offset_intervals.
4931
4932 2012-09-14 Martin Rudalics <rudalics@gmx.at>
4933
4934 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
4935 current buffer (Bug#12387).
4936
4937 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
4938
4939 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
4940
4941 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4942
4943 Use a more backwards-compatible timer format (Bug#12430).
4944 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
4945 vector element, not from the 4th, since PSECS is now at the end.
4946 (Fcurrent_idle_time): Doc fix.
4947
4948 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Function to mark objects and remove killed buffers at once.
4951 * alloc.c (discard_killed_buffers): Rename to ...
4952 (mark_discard_killed buffers) ... new name. Add marking
4953 of remaining objects. Fix comment. Adjust users.
4954 (mark_object): Do not touch frame buffer lists here.
4955 * frame.c (delete_frame): Reset frame buffer lists here.
4956
4957 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4958
4959 Better workaround for GNOME bug when --enable-gcc-warnings.
4960 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
4961 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
4962 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
4963
4964 Simplify SIGIO usage (Bug#12408).
4965 The code that dealt with SIGIO was crufty and confusing, e.g., it
4966 played tricks like "#undef SIGIO" but these tricks were not used
4967 consistently. Simplify mostly by not #undeffing standard symbols,
4968 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
4969 or not as we please) rather than "defined SIGIO" (standard symbol
4970 that we probably shouldn't #undef).
4971 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
4972 Modules that need it can include it.
4973 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
4974 * dispextern.h (ignore_sigio): New decl.
4975 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
4976 unconditionally, since it's now a no-op if !USABLE_SIGIO.
4977 * emacs.c (shut_down_emacs):
4978 * keyboard.c (kbd_buffer_store_event_hold):
4979 Use ignore_sigio rather than invoking 'signal' directly.
4980 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
4981 for FIONREAD.
4982 (FIONREAD, SIGIO): Do not #undef.
4983 (tty_read_avail_input): Use #error rather than a syntax error.
4984 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
4985 for I_PIPE, used by SETUP_SLAVE_PTY.
4986 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
4987 * sysdep.c (croak): Remove; no longer needed. This bit of
4988 temporary code, with Fred N. Fish's comment that it's temporary,
4989 has been in Emacs since at least 1992!
4990 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
4991 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
4992 * syssignal.h (croak): Remove decl.
4993 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
4994 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
4995 now that we're termios-only.
4996 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
4997 * term.c (dissociate_if_controlling_tty): Use #error rather than
4998 a run-time error.
4999
5000 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5001 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5002 to work around GNOME bug 683906.
5003 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5004 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5005 This works around GCC bug 54561.
5006
5007 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5008
5009 More fixes for 'volatile' and setjmp/longjmp.
5010 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5011 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5012 (png_load_body) [HAVE_PNG]:
5013 (jpeg_load_body) [HAVE_JPEG]:
5014 New function, with most of the old parent function's body.
5015 (png_load) [HAVE_PNG]:
5016 (jpeg_load) [HAVE_JPEG]:
5017 Invoke the new function, to avoid longjmp munging our locals.
5018 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5019 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5020 longjmp is passed 2, as the C standard doesn't guarantee this.
5021 Instead, store the failure code into mgr->failure_code.
5022
5023 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5024
5025 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5026 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5027 (syms_of_keyboard): Remove support for unread-command-char.
5028
5029 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5030
5031 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5032 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5033 violation. (Bug#12426)
5034
5035 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5036
5037 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5038
5039 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5040
5041 * eval.c: Add `inhibit-debugger'.
5042 (Qinhibit_debugger): New symbol.
5043 (call_debugger): Bind it instead of Qdebug_on_error.
5044 (maybe_call_debugger): Test Vinhibit_debugger.
5045 (syms_of_eval): Define inhibit-debugger.
5046 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5047 (syms_of_xdisp): Remove inhibit-debug-on-message.
5048
5049 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5050
5051 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5052 If a nonvolatile local variable is written before a _longjmp to
5053 the frame containing the variable, and is read after the _longjmp,
5054 the value read is indeterminate. Some local variables of type
5055 'struct handler' and 'struct catchtag' are used in this way, so
5056 mark each of their slots as volatile if the slot can be set before
5057 _longjmp and read afterwards.
5058 * lisp.h (struct handler): var and chosen_clause are now volatile.
5059 (struct catchtag): val, next, and pdlcount are now volatile.
5060
5061 * bidi.c (bidi_push_it, bidi_pop_it):
5062 * fns.c (copy_hash_table):
5063 * image.c (define_image_type):
5064 * keyboard.c (kbd_buffer_store_event_hold):
5065 * process.c (Fprocess_send_eof):
5066 * xfaces.c (x_create_gc) [HAVE_NS]:
5067 * xgselect.c (xg_select):
5068 Prefer assignment to memcpy when either will do.
5069
5070 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5071 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5072 time an item is removed. No need to mark this function 'inline';
5073 the compiler knows better than we do.
5074
5075 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5076
5077 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5078 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5079 to change_frame_size (Bug#12388).
5080 (windowDidResize:): Pass YES to updateFrameSize.
5081
5082 * nsterm.h: Add delay parameter to updateFrameSize.
5083
5084 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 Discard killed buffers from deleted window and frame objects.
5087 This reduces an amount of references to killed buffers and
5088 helps GC to reclaim them faster.
5089 * alloc.c (discard_killed_buffers): New function.
5090 (mark_object): Use it for deleted windows and frames.
5091 (mark_object): If symbol's value is set up for a killed buffer
5092 or deleted frame, restore its global binding.
5093 * data.c (swap_in_global_binding): Add GC notice.
5094 (swap_in_symval_forwarding): Use convenient set_blv_where.
5095 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5096 * window.h: ... to here.
5097
5098 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5099
5100 Convenient macro to check whether the buffer is live.
5101 * buffer.h (BUFFER_LIVE_P): New macro.
5102 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5103 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5104
5105 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5106
5107 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5108 composition cases (Bug#12364).
5109
5110 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5111 overhang of succeeding glyphs overlapping box cursor.
5112
5113 * w32term.c (x_draw_glyph_string): Likewise.
5114
5115 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5116
5117 Simplify, document, and port floating-point (Bug#12381).
5118 The porting part of this patch fixes bugs on non-IEEE platforms
5119 with frexp, ldexp, logb.
5120 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5121 Now static.
5122 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5123 support, by removing commented-out code and briefly listing the
5124 C89 functions excluded. The commented-out stuff was confusing
5125 maintenance, e.g., we thought we needed cbrt but it was commented out.
5126 (logb): Remove decl; no longer needed.
5127 (isfinite): New macro, if not already supplied.
5128 (isnan): Don't replace any existing macro.
5129 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5130 are present on all C89 platforms.
5131 (Ffrexp): Do not special-case zero, as frexp does the right thing
5132 for that case.
5133 (Flogb): Do not use logb, as it doesn't have the desired meaning
5134 on hosts that use non-base-2 floating point. Instead, stick with
5135 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5136 frexp, to avoid getting an unspecified result.
5137
5138 * xdisp.c (Qinhibit_debug_on_message): Now static.
5139
5140 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5141
5142 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5143 NSBezierPath (Bug#12131).
5144
5145 2012-09-10 Chong Yidong <cyd@gnu.org>
5146
5147 * fns.c (Fdelq, Fdelete): Doc fix.
5148
5149 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5150
5151 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5152 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5153
5154 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5155
5156 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5157 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5158 Use it.
5159
5160 2012-09-09 Eli Zaretskii <eliz@gnu.org>
5161
5162 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5163 left fringe if the window has a left margin. This avoids leaving
5164 traces of the cursor because its leftmost pixel is not drawn over.
5165
5166 * dispnew.c (update_window_line): When the left margin area of a
5167 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5168 that screen line. (Bug#12277)
5169
5170 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5171
5172 Assume C89 or later for math functions (Bug#12381).
5173 This simplifies the code, and makes it a bit smaller and faster,
5174 and (most important) makes it easier to clean up signal handling
5175 since we can stop worring about floating-point exceptions in
5176 library code. That was a problem before C89, but the problem
5177 went away many years ago on all practical Emacs targets.
5178 * data.c, image.c, lread.c, print.c:
5179 Don't include <math.h>; no longer needed.
5180 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5181 might be autoconfigured, as that never happens.
5182 * data.c (fmod):
5183 * doprnt.c (DBL_MAX_10_EXP):
5184 * print.c (DBL_DIG):
5185 Remove. C89 or later always defines these.
5186 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5187 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5188 (arith_error, domain_error, domain_error2):
5189 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5190 no longer needed -- we simply return what C returns. All uses removed.
5191 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5192 the wrapped code.
5193 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5194 Remove. All uses expanded, as these macros are no longer used
5195 more than once and are now more trouble than they're worth.
5196 (Ftan): Use tan, not sin / cos.
5197 (Flogb): Assume C89 frexp.
5198 (fmod_float): Assume C89 fmod.
5199 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5200 (init_floatfns): Remove. All uses removed.
5201
5202 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5203
5204 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5205 compositeToPoint for OSX < 10.6 (Bug#12390).
5206
5207 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5208
5209 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5210 This produces more-accurate results.
5211
5212 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5213
5214 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5215 changes (Bug#12088).
5216
5217 2012-09-08 Chong Yidong <cyd@gnu.org>
5218
5219 * syntax.c (Fstring_to_syntax): Doc fix.
5220
5221 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5222
5223 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5224 in the internal border.
5225 (x_set_window_size): Remove static variables and their usage.
5226 (ns_redraw_scroll_bars): Fix NSTRACE arg.
5227 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5228 Remove fringe/internal border adjustment (Bug#11052).
5229 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5230 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5231 (ns_fix_rect_ibw): Remove.
5232 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5233 (ns_dumpglyphs_box_or_relief): Ditto.
5234 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5235 adjustment.
5236 (ns_dumpglyphs_image): Ditto.
5237 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
5238 border adjustment.
5239 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5240 their usage. Add fringe_extended_p and its use as in other terms.
5241 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5242 scroll bar was removed.
5243 (updateFrameSize): New function.
5244 (windowDidResize): Move code to updateFrameSize and call it.
5245
5246 * nsterm.h (EmacsView): Add updateFrameSize.
5247
5248 2012-09-07 Chong Yidong <cyd@gnu.org>
5249
5250 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5251
5252 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5253
5254 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5255
5256 More signal-handler cleanup (Bug#12327).
5257 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5258 Problem introduced when merging patches. Noted by Eli Zaretskii in
5259 <http://bugs.gnu.org/12327#67>.
5260 * floatfns.c: Comment fix.
5261 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5262 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5263 and anyway the declaration is harmless even if SIGDANGER is not defined.
5264 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5265 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5266 source files not surprisingly expected syssignal.h to define, or
5267 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5268 Include <sys/ioctl.h>, for FIONREAD.
5269 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5270 This eliminates a problem whereby other files mysteriously had
5271 to include "syssignal.h" before including "systty.h" if they
5272 wanted to use "#ifdef SIGIO".
5273
5274 2012-09-07 Eli Zaretskii <eliz@gnu.org>
5275
5276 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5277
5278 * w32.c (sigemptyset): Empty the set.
5279 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5280
5281 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5282
5283 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5284
5285 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5286 (mark_object): Likewise for frame objects.
5287
5288 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5289
5290 * syssignal.h (handle_on_main_thread): Always declare,
5291 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5292 This ports to platforms without HAVE_PTHREAD.
5293
5294 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5295
5296 Signal-handler cleanup (Bug#12327).
5297 Emacs's signal handlers were written in the old 4.2BSD style with
5298 sigblock and sigmask and so forth, and this led to some
5299 inefficiencies and confusion. Rewrite these to use
5300 pthread_sigmask etc. without copying signal sets around. Also,
5301 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5302 'signal', and instead use functions that do not attempt to take
5303 over the system name space. This patch causes Emacs's text
5304 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5305 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5306 Do not include <signal.h> or "syssignal.h", as these
5307 modules do not use signals.
5308 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5309 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5310 Do not include <signal.h>, as "syssignal.h" does that for us now.
5311 * atimer.c (sigmask_atimers): New function.
5312 (block_atimers, unblock_atimers): New functions,
5313 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5314 All uses replaced.
5315 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5316 no longer needed here.
5317 * emacs.c (main): Inspect existing signal handler with sigaction,
5318 so that there's no need to block and unblock SIGHUP.
5319 * sysdep.c (struct save_signal): New member 'action', replacing
5320 old member 'handler'.
5321 (save_signal_handlers, restore_signal_handlers):
5322 Use sigaction instead of 'signal' to save and restore.
5323 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5324 New function. All users of 'signal' modified to use set_sighandler
5325 if they're writeonly, and to use sys_signal if they're read+write.
5326 (emacs_sigaction_init, forwarded_signal): New functions.
5327 (sys_signal): Remove. All uses replaced by calls to sigaction
5328 and emacs_sigaction_init, or by direct calls to 'signal'.
5329 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5330 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5331 all uses replaced by pthread_sigmask etc. calls.
5332 * syssignal.h: Include <signal.h>.
5333 (emacs_sigaction_init, forwarded_signal): New decls.
5334 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5335 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5336 (sigmask, sys_sigmask): Remove; no longer needed.
5337 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5338 (sigblock, sigunblock, sigfree):
5339 (sigsetmask) [!defined sigsetmask]:
5340 Remove. All uses replaced by pthread_sigmask.
5341 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5342 no longer need to be replaced, and its typical old uses
5343 are now done via emacs_sigaction_init and sigaction.
5344 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5345 (sys_sigdel): Remove; unused.
5346 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5347
5348 2012-09-06 Eli Zaretskii <eliz@gnu.org>
5349
5350 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5351 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5352
5353 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5354
5355 Explicitly mark buffer_defaults and buffer_local_symbols.
5356 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5357 mark_local_symbols here.
5358 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5359 since special buffers aren't marked here any more.
5360 (allocate_buffer): Chain new buffer with all_buffers here...
5361 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5362 not here.
5363 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5364 (syms_of_buffer): Remove staticpro of the above.
5365 (init_buffer_once): Set names for buffer_defaults and
5366 buffer_local_symbols.
5367
5368 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5369
5370 Use bool for booleans in font-related modules.
5371 * font.c (font_intern_prop, font_style_to_value)
5372 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5373 (generate_otf_features, font_check_otf_features, font_check_otf)
5374 (font_match_p, font_list_entities, font_at):
5375 * fontset.c (fontset_id_valid_p, reorder_font_vector
5376 (fontset_find_font, Fset_fontset_font)
5377 (face_suitable_for_char_p) [0]:
5378 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5379 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5380 (m17n_flt_initialized, ftfont_shape_by_flt):
5381 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5382 * nsfont.m (nsfont_draw):
5383 * w32font.c (w32font_draw):
5384 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5385 Use bool for booleans.
5386 * font.h: Adjust to above API changes.
5387 (struct font, struct font_driver, struct font_driver_list):
5388 Use bool for booleans.
5389 (struct font): Remove useless member encoding_type.
5390 All users removed.
5391 * fontset.c, xftfont.c: Omit unnecessary static decls.
5392
5393 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5394
5395 * alloc.c (mark_object): Revert window marking code
5396 since it's unsafe for the Fset_window_configuration.
5397
5398 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5399
5400 Fix race conditions with signal handlers and errno (Bug#12327).
5401 Be more systematic about preserving errno whenever a signal
5402 handler returns, even if it's not in the main thread. Do this by
5403 renaming signal handlers to distinguish between signal delivery
5404 and signal handling. All uses changed.
5405 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5406 * data.c (deliver_arith_signal): Rename from arith_error.
5407 * dispnew.c (deliver_window_change_signal): Rename from
5408 window_change_signal.
5409 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5410 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5411 * keyboard.c (deliver_input_available_signal): Rename from
5412 input_available_signal.
5413 (deliver_user_signal): Rename from handle_user_signal.
5414 (deliver_interrupt_signal): Rename from interrupt_signal.
5415 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5416 (deliver_child_signal): Rename from sigchld_handler.
5417 * atimer.c (handle_alarm_signal):
5418 * data.c (handle_arith_signal):
5419 * dispnew.c (handle_window_change_signal):
5420 * emacs.c (handle_fatal_signal, handle_danger_signal):
5421 * keyboard.c (handle_input_available_signal):
5422 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5423 * process.c (handle_pipe_signal, handle_child_signal):
5424 New functions, with the actual signal-handling code taken from the
5425 original respective signal handlers, sans the sporadic attempts to
5426 preserve errno, since that's now done by handle_on_main_thread.
5427 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5428 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5429 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5430 Move to sysdep.c.
5431 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5432 Move initialization of main_thread to sysdep.c's init_signals.
5433 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5434 our usage, and simplifies the mainline code.
5435 (record_child_status_change): New static function, as a helper
5436 for handle_child_signal, and with most of the old child handler's
5437 contents.
5438 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5439 (handle_child_signal): Use the above.
5440 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5441 Moved here from emacs.c.
5442 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5443 code moved here from emacs.c's main function.
5444 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
5445 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5446 This lets callers save and restore errno properly.
5447
5448 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5449
5450 Remove redundant or unused things here and there.
5451 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5452 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5453 * editfns.c (Fcompare_buffer_substrings): Likewise.
5454 * frame.h (struct terminal, struct font_driver_list):
5455 Remove redundant declarations.
5456 * window.h (Qleft, Qright): Likewise.
5457
5458 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5459
5460 Do not mark objects from deleted buffers, windows and frames.
5461 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5462 (mark_object): Likewise for windows and frames.
5463
5464 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5467 buffer_defaults and buffer_local_symbols as valid objects.
5468 Return special value to denote them.
5469
5470 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5471
5472 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5473 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5474 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5475 (file_name_absolute_p, Fsubstitute_in_file_name):
5476 (check_executable, check_writable, Ffile_accessible_directory_p)
5477 (Fset_file_selinux_context, Fdefault_file_modes)
5478 (Finsert_file_contents, choose_write_coding_system)
5479 (Fwrite_region, build_annotations, a_write, e_write)
5480 (Fdo_auto_save):
5481 * filelock.c (boot_time_initialized, get_boot_time)
5482 (get_boot_time_1, lock_file_1, within_one_second):
5483 * floatfns.c (in_float):
5484 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5485 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5486 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5487 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5488 * window.c (compare_window_configurations):
5489 Use bool for booleans.
5490 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5491 (Fdefault_file_modes): Now mode_t, not int, for modes.
5492 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5493 (internal_delete_file): Now returns void, not a (boolean) int,
5494 since nobody was looking at the return value.
5495 * lisp.h, window.h: Adjust to above API changes.
5496
5497 * xdisp.c (set_message): Simplify and reindent last change.
5498
5499 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
5500
5501 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5502
5503 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5504
5505 * eval.c (call_debugger): Make the function non-static so that we
5506 can call it from set_message.
5507
5508 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5509 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5510
5511 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5512
5513 Give more-useful info on a fatal error (Bug#12328).
5514 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5515 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5516 of doing the work ourselves.
5517 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5518 do most of the work.
5519 (fatal_error_backtrace): New function, taken from the guts
5520 of the old fatal_error_signal, but with a new option to output
5521 a backtrace.
5522 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5523 info about the signal than just its number.
5524 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5525 * sysdep.c: Include <execinfo.h>
5526 (emacs_backtrace): New function, taken partly from the previous
5527 code of the 'die' function.
5528 (emacs_abort): Call fatal_error_backtrace rather than abort.
5529
5530 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
5531
5532 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
5533 eager (load-time) macro-expansion.
5534 * lisp.mk (lisp): Add macroexp.
5535
5536 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5537
5538 Simplify redefinition of 'abort' (Bug#12316).
5539 Do not try to redefine the 'abort' function. Instead, redo
5540 the code so that it calls 'emacs_abort' rather than 'abort'.
5541 This removes the need for the NO_ABORT configure-time macro
5542 and makes it easier to change the abort code to do a backtrace.
5543 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
5544 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
5545 Remove; sysdep.c's emacs_abort now takes its place.
5546 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
5547 'abort' changed to use 'emacs_abort'.
5548 * msdos.c (dos_abort) [defined abort]: Remove; not used.
5549 (abort) [!defined abort]: Rename to ...
5550 (emacs_abort): ... new name.
5551 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5552 the place of the old 'abort' in emacs.c.
5553 * w32.c, w32fns.c (abort): Do not #undef.
5554 * w32.c (emacs_abort): Rename from w32_abort.
5555
5556 2012-09-04 Eli Zaretskii <eliz@gnu.org>
5557
5558 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5559 offsets[j].dv, since the y axis of the screen coordinates points
5560 down, while the y axis of the font definition coordinates points
5561 up. This fixes display of Arabic diacritics such as KASRA and
5562 KASRATAN. (Bug#11860)
5563
5564 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5565
5566 Be more systematic about _setjmp vs setjmp.
5567 * alloc.c (test_setjmp, mark_stack):
5568 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5569 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5570 (png_load, my_error_exit, jpeg_load):
5571 * process.c (send_process_trap, send_process):
5572 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5573 The underscored versions are up to 30x faster on some hosts.
5574 Formerly, the code used setjmp+longjmp sometimes and
5575 _setjmp+_longjmp at other times, with no particular reason to
5576 prefer setjmp+longjmp.
5577
5578 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 Fix minor problem found by static checking.
5581 * buffer.c (Fdelete_all_overlays): Return nil.
5582
5583 2012-09-03 Martin Rudalics <rudalics@gmx.at>
5584
5585 * buffer.c (Fdelete_all_overlays): New function.
5586
5587 2012-09-03 Chong Yidong <cyd@gnu.org>
5588
5589 * gtkutil.c: Add extern decl for Qxft.
5590
5591 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5592
5593 * emacs.c, eval.c: Use bool for boolean.
5594 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5595 (malloc_using_checking) [DOUG_LEA_MALLOC]:
5596 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
5597 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
5598 (main, decode_env_path, Fdaemon_initialized):
5599 * eval.c (call_debugger, Finteractive_p, interactive_p):
5600 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
5601 (maybe_call_debugger, Fbacktrace):
5602 * process.c (read_process_output, exec_sentinel):
5603 Use bool for booleans.
5604 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
5605 All callers changed.
5606 * eval.c (interactive_p): Omit always-true boolean argument
5607 EXCLUDE_SUBRS_P. All callers changed.
5608 * dispextern.h, lisp.h: Reflect above API changes.
5609 * firstfile.c (dummy): Use the address of 'main', whose signature
5610 won't change, instead of the address of 'initialize', whose
5611 signature just changed from int to bool.
5612 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
5613 * msdos.c (fatal_error_in_progress): ... from here.
5614 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
5615 of incrementing it.
5616 (redisplay_internal, unwind_redisplay): Simply clear
5617 REDISPLAYING_P when unwinding, instead of saving its previous,
5618 always-false value and then restoring it.
5619
5620 Clean up some extern decls.
5621 Mostly, this hoists extern decls out of .c files and into .h files.
5622 That way, we're more likely to catch errors if the interfaces change.
5623 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
5624 declare xg_mark_data.
5625 * dispextern.h (x_frame_parm_handlers):
5626 * font.h (Qxft):
5627 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
5628 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
5629 (Qultra_bold, Qoblique, Qitalic):
5630 Move extern decl here from .c file.
5631 * alloc.c (xg_mark_data) [USE_GTK]:
5632 * doc.c (Qclosure):
5633 * eval.c (Qlexical_binding):
5634 * fns.c (time) [!HAVE_UNISTD_H]:
5635 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
5636 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
5637 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
5638 * lread.c (Qinternal_interpreter_environment):
5639 * minibuf.c (Qbuffer):
5640 * process.c (QCfamily, QCfilter):
5641 * widget.c (free_frame_faces):
5642 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
5643 * xfont.c (x_clear_errors):
5644 * xterm.c (x_frame_parm_handlers):
5645 Remove now-redundant extern decls.
5646 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
5647 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
5648 Now static.
5649 * xfaces.c: Remove unnecessary static decls.
5650 * xterm.c (updating_frame): Remove decl of nonexistent object.
5651
5652 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
5653 when building globals.h, as the objects that are not built on
5654 this host are not needed to compile C files on this host.
5655
5656 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
5657
5658 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
5659
5660 * frame.h: Add missing prototype for x_wm_set_size_hint.
5661
5662 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
5665 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5666 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
5667 (Fsubstitute_command_keys):
5668 * editfns.c (region_limit, find_field, Fconstrain_to_field)
5669 (save_excursion_save, save_excursion_restore)
5670 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
5671 (format_time_string, general_insert_function)
5672 (make_buffer_string, make_buffer_string_both)
5673 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
5674 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
5675 (copy_text, insert_1, insert_1_both, insert_from_string)
5676 (insert_from_string_before_markers, insert_from_string_1)
5677 (insert_from_buffer, insert_from_buffer_1, replace_range)
5678 (replace_range_2, del_range_1, del_range_byte, del_range_both)
5679 (del_range_2, modify_region):
5680 * intervals.c (intervals_equal, balance_possible_root_interval)
5681 (adjust_intervals_for_insertion, merge_properties_sticky)
5682 (graft_intervals_into_buffer, lookup_char_property)
5683 (adjust_for_invis_intang, set_point_both)
5684 (get_property_and_range, compare_string_intervals)
5685 (set_intervals_multibyte_1, set_intervals_multibyte):
5686 * keyboard.c (decode_timer):
5687 Use bool for boolean.
5688 * intervals.h, lisp.h, systime.h: Reflect above API changes.
5689 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
5690
5691 2012-09-02 Chong Yidong <cyd@gnu.org>
5692
5693 * keymap.c (push_key_description): Print M-TAB as C-M-i
5694 (Bug#11758).
5695
5696 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
5697
5698 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
5699 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
5700 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
5701 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
5702 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
5703 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
5704 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5705
5706 2012-09-01 Eli Zaretskii <eliz@gnu.org>
5707
5708 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
5709 more than one grapheme cluster passed to the shaper: compute the
5710 offset adjustment values separately for each cluster. (Bug#11860)
5711
5712 * image.c: Restore mistakenly removed inclusion of w32.h. Without
5713 it, GCC doesn't see prototypes of w32_delayed_load, and complains
5714 about implicit conversions from integer to pointer.
5715
5716 2012-09-01 Daniel Colascione <dancol@dancol.org>
5717
5718 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
5719 system used too early.
5720
5721 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
5722
5723 Better seed support for (random).
5724 * emacs.c (main): Call init_random.
5725 * fns.c (Frandom): Set the seed from a string argument, if given.
5726 Remove long-obsolete Gentzel cruft.
5727 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
5728 (init_random): New function.
5729
5730 2012-09-01 Daniel Colascione <dancol@dancol.org>
5731
5732 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
5733 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5734 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
5735 x_wm_set_size_hint, x_query_colors, x_real_positions,
5736 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
5737 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
5738 all of which have been moved to common code.
5739
5740 * xfaces.c: Include TERM_HEADER instead of listing all possible
5741 window-system headers.
5742
5743 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
5744 to match header.
5745
5746 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
5747 directly accessing frame internals.
5748
5749 * w32font.h: Include font.h. Define syms_of_w32font and
5750 globals_of_w32font.
5751
5752 * process.c: Include TERM_HEADER instead of listing all possible
5753 window-system headers.
5754
5755 * nsterm.h: Remove declarations now in frame.h.
5756 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
5757
5758 * menu.c: Include TERM_HEADER instead of listing all possible
5759 window-system headers.
5760
5761 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
5762 window system.
5763
5764 * keyboard.c: Include TERM_HEADER instead of listing all possible
5765 window-system headers.
5766
5767 * image.c: Include TERM_HEADER instead of listing all possible
5768 window-system headers. Declare Vlibrary_cache when compiling for
5769 Windows.
5770
5771 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
5772 window system declarations.
5773
5774 * frame.h: Move common functions here: set_frame_menubar,
5775 x_set_window_size, x_sync, x_get_focus_frame,
5776 x_set_mouse_position, x_set_mouse_pixel_position,
5777 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
5778 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
5779 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
5780 x_activate_menubar, x_real_positions, x_bitmap_icon,
5781 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
5782 and x_query_colors.
5783
5784 * frame.c: Include TERM_HEADER instead of listing all possible
5785 window-system headers.
5786
5787 * font.c: Include TERM_HEADER instead of listing all possible
5788 window-system headers.
5789
5790 * emacs.c: Include TERM_HEADER.
5791
5792 * dispnew.c: Include TERM_HEADER instead of listing all possible
5793 window-system headers.
5794
5795 * ccl.h: Include character.h.
5796
5797 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
5798 the current window system; include in list of objects to link into
5799 Emacs.
5800
5801 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5802
5803 Remove mark_ttys function and fix tty_display_info initialization.
5804 * lisp.h (mark_ttys): Remove prototype.
5805 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
5806 to mark_ttys because all possible values of 'top_frame' slot are
5807 the frames which are reachable from Vframe_list.
5808 * term.c (mark_ttys): Remove.
5809 (init_tty): Safely initialize 'top_frame' slot with Qnil.
5810
5811 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5812
5813 Change struct frame bitfields from unsigned char to unsigned.
5814 * frame.h (struct frame): Change type of 'display_preempted',
5815 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
5816 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
5817 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
5818 bitfields from unsigned char to unsigned.
5819
5820 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5821
5822 Remove unused member of struct x_output and struct w32_output.
5823 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
5824 * w32term.h (struct w32_output): Likewise.
5825
5826 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
5827
5828 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
5829 does not become zero (Bug#12234).
5830
5831 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
5832
5833 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
5834 for GCC 4.7.1 x86-64.
5835
5836 2012-08-30 Glenn Morris <rgm@gnu.org>
5837
5838 * lread.c (init_lread): For out-of-tree builds, only add the
5839 source directory's site-lisp dir to the load-path if it exists,
5840 consistent with in-tree builds. (Bug#12302)
5841
5842 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
5843
5844 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
5845 button_values to NULL. Call setStykeMask so dialogs get a close button.
5846 (windowShouldClose:): Set window_closed.
5847 (dealloc): New member, free button_values.
5848 (process_dialog:): Make member function. Remove window argument,
5849 replace window with self. Count buttons and allocate and store values
5850 in button_values.
5851 (addButton:value:row:): value is int with the name tag. Call setTag
5852 with tag. Remove return self, declare return value as void.
5853 (addString:row:): Remove return self, declare return value as void.
5854 (addSplit): Remove return self, declare return value as void.
5855 (clicked:): Remove return self, declare return value as void.
5856 Set dialog_return to button_values[seltag]. Code formatting change.
5857 (initFromContents:isQuestion:): Adjust call to process_dialog.
5858 Code formatting change.
5859 (timeout_handler:): Set timer_fired to YES.
5860 (runDialogAt:): Set timer_fired to NO.
5861 Handle click on close button as quit.
5862
5863 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
5864 Add window_closed and button_values. Add void as return value for
5865 add(Button|String|Split). addButton takes int instead of Lisp_Object.
5866 Add process_dialog as new member.
5867
5868 2012-08-28 Eli Zaretskii <eliz@gnu.org>
5869
5870 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
5871 is not one of the heaps we manage. (Bug#12242)
5872
5873 2012-08-28 Glenn Morris <rgm@gnu.org>
5874
5875 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
5876
5877 2012-08-28 Martin Rudalics <rudalics@gmx.at>
5878
5879 * window.c (Fset_window_configuration): Remove handling of
5880 auto-buffer-name window parameter. Install revision of reverted
5881 fix.
5882
5883 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5884
5885 Do not allow to set major mode for a dead buffer.
5886 * buffer.c (Fset_buffer_major_mode): Signal an error
5887 if the buffer is dead.
5888 (Fother_buffer, other_buffer_safely): Remove redundant
5889 nested declaration.
5890
5891 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5892
5893 Always use set_buffer_if_live to restore original buffer at unwind.
5894 * buffer.h (record_unwind_current_buffer): New function.
5895 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
5896 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
5897 * undo.c, window.c: Adjust users.
5898 * buffer.c (set_buffer_if_live): Fix comment.
5899
5900 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5901
5902 Fix usage of set_buffer_internal.
5903 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
5904 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
5905 * coding.c (decode_coding): Omit redundant test.
5906 * fileio.c (decide_coding_unwind): Likewise.
5907 * fns.c (secure_hash): Likewise.
5908 * insdel.c (modify_region): Likewise.
5909 * keyboard.c (command_loop_1): Likewise.
5910 * print.c (PRINTFINISH): Likewise.
5911 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5912
5913 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * dispnew.c: Use bool for boolean.
5916 (frame_garbaged, display_completed, delayed_size_change)
5917 (fonts_changed_p, add_window_display_history)
5918 (add_frame_display_history, verify_row_hash)
5919 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5920 (row_equal_p, realloc_glyph_pool)
5921 (allocate_matrices_for_frame_redisplay)
5922 (showing_window_margins_p)
5923 (adjust_frame_glyphs_for_frame_redisplay)
5924 (build_frame_matrix_from_leaf_window, make_current)
5925 (mirrored_line_dance, mirror_line_dance, update_frame)
5926 (update_window_tree, update_single_window)
5927 (check_current_matrix_flags, update_window, update_text_area)
5928 (update_window_line, set_window_update_flags, scrolling_window)
5929 (update_frame_1, scrolling, buffer_posn_from_coords)
5930 (do_pending_window_change, change_frame_size)
5931 (change_frame_size_1, sit_for):
5932 Use bool for boolean.
5933 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
5934 and remove last int (actually boolean) argument, which was always 0.
5935 All callers changed.
5936 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
5937 * dispextern.h (struct composition_it): Use bool for boolean.
5938 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
5939 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
5940 * dired.c (file_name_completion):
5941 Use bool for boolean. (This was missed in an earlier change.)
5942
5943 2012-08-27 Martin Rudalics <rudalics@gmx.at>
5944
5945 * window.c (Fset_window_configuration): Revert first part of
5946 last change.
5947
5948 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
5949
5950 * nsterm.h (NSPanel): New class variable dialog_return.
5951
5952 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
5953 Initialize dialog_return.
5954 (windowShouldClose:): Use stop instead of stopModalWithCode.
5955 (clicked:): Ditto, and also set dialog_return (Bug#12258).
5956 (timeout_handler:): Use stop instead of abortModal. Send a dummy
5957 event.
5958 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
5959 modal loop returns.
5960
5961 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5962
5963 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
5964 * composite.c (find_composition, composition_gstring_p)
5965 (composition_reseat_it, find_automatic_composition):
5966 * data.c (let_shadows_buffer_binding_p)
5967 (let_shadows_global_binding_p, set_internal, make_blv)
5968 (Fmake_variable_buffer_local, Fmake_local_variable)
5969 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
5970 (cons_to_signed, arith_driver):
5971 * dbusbind.c (xd_in_read_queued_messages):
5972 * dired.c (directory_files_internal, file_name_completion):
5973 Use bool for booleans.
5974 * dired.c (file_name_completion):
5975 * process.h (fd_callback):
5976 Omit int (actually boolean) argument. It wasn't being used.
5977 All uses changed.
5978 * composite.h, lisp.h: Reflect above API changes.
5979
5980 * cmds.c, coding.c: Use bool for booleans.
5981 * cmds.c (move_point, Fself_insert_command):
5982 * coding.h (struct composition status, struct coding_system):
5983 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
5984 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
5985 (emacs_mule_char, decode_coding_emacs_mule)
5986 (encode_coding_emacs_mule, detect_coding_iso_2022)
5987 (decode_coding_iso_2022, encode_invocation_designation)
5988 (encode_designation_at_bol, encode_coding_iso_2022)
5989 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
5990 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
5991 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
5992 (encode_coding_raw_text, detect_coding_charset)
5993 (decode_coding_charset, encode_coding_charset, detect_eol)
5994 (detect_coding, get_translation_table, produce_chars)
5995 (consume_chars, reused_workbuf_in_use)
5996 (make_conversion_work_buffer, code_conversion_save)
5997 (decode_coding_object, encode_coding_object)
5998 (detect_coding_system, char_encodable_p)
5999 (Funencodable_char_position, code_convert_region)
6000 (code_convert_string, code_convert_string_norecord)
6001 (Fset_coding_system_priority):
6002 * fileio.c (Finsert_file_contents):
6003 Use bool for booleans.
6004 * coding.h, lisp.h: Reflect above API changes.
6005 * coding.c: Remove unnecessary static function decls.
6006 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6007 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6008 not a boolean 'int', since callers never look at the return value.
6009 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6010 * coding.h (decoding_buffer_size, encoding_buffer_size)
6011 (emacs_mule_string_char): Remove unused extern decls.
6012 (struct iso_2022_spec, struct coding_system):
6013 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6014 (struct emacs_mule_spec): Remove unused field 'full_support'.
6015 All initializations removed.
6016 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6017
6018 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6019
6020 Fix spare memory change (Bug#12286).
6021 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6022 (valid_lisp_object_p): Likewise.
6023
6024 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6025
6026 * window.c (Fset_window_configuration): Record any window's old
6027 buffer if it's replaced (see Bug#8789). If the new current
6028 buffer doesn't appear in the selected window, go to its old
6029 point (Bug#12208).
6030
6031 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6032
6033 Special MEM_TYPE_SPARE to denote reserved memory.
6034 * alloc.c (enum mem_type): New memory type.
6035 (refill_memory_reserve): Use new type for spare memory.
6036 This prevents live_cons_p and live_string_p from incorrect
6037 detection of uninitialized objects from spare memory as live.
6038
6039 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 Spelling fixes.
6042 * Makefile.in (.PHONY): versioclean -> versionclean.
6043
6044 Remove unused external symbols.
6045 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6046 * window.c (Qwindow_valid_p, decode_valid_window):
6047 Now static, not extern.
6048 * data.c (Qinterval): Remove; unused.
6049 (syms_of_data): Do not define 'interval'.
6050 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6051 * window.h (decode_valid_window):
6052 Remove decls.
6053
6054 * character.c, charset.c, chartab.c: Use bool for booleans.
6055 * character.c (lisp_string_width, string_count_byte8)
6056 (string_escape_byte8):
6057 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6058 (load_charset_map_from_file, map_charset_chars)
6059 (Fdefine_charset_internal, define_charset_internal)
6060 (Fdeclare_equiv_charset, find_charsets_in_text)
6061 (Ffind_charset_region, char_charset, Fiso_charset):
6062 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6063 (sub_char_table_set, sub_char_table_set_range)
6064 (char_table_set_range, optimize_sub_char_table)
6065 (map_sub_char_table):
6066 Use bool for boolean.
6067 * character.c (str_to_unibyte): Omit last boolean argument; it was
6068 always 0. All callers changed.
6069 * character.h, charset.h: Adjust to match previous changes.
6070 * character.h (char_printable_p): Remove decl of nonexistent function.
6071 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6072 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6073 are all boolean, so make them single-bit bitfields.
6074
6075 * lisp.h (ASET): Remove attempt to detect side effects.
6076 It was meant to be temporary and it often doesn't work,
6077 because when IDX has side effects the behavior of IDX==IDX
6078 is undefined. See Stefan Monnier in
6079 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6080
6081 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6082
6083 * lisp.h (functionp): New function (extracted from Ffunctionp).
6084 (FUNCTIONP): Use it.
6085 * eval.c (Ffunctionp): Use it.
6086
6087 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6088
6089 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6090 as that's faster and simpler than static storage. Don't bother
6091 with the g_main_context_query overhead if g_main_context_pending
6092 says no events are pending.
6093 (gfds, gfds_size): Remove these static vars.
6094 (xgselect_initialize): Remove; no longer needed.
6095 All uses and decls removed.
6096
6097 * emacs.c (fatal_error_signal_hook): Remove.
6098 All uses removed. This leftover from old code was always 0.
6099
6100 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6101 * casefiddle.c (casify_object, casify_region):
6102 * casetab.c (set_case_table):
6103 * category.c, category.h (word_boundary_p):
6104 * category.h (CHAR_HAS_CATEGORY):
6105 Use bool for booleans, instead of int.
6106
6107 2012-08-25 Eli Zaretskii <eliz@gnu.org>
6108
6109 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6110
6111 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6112
6113 On assertion failure, print backtrace if available.
6114 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6115 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6116 * Makefile.in (LIB_EXECINFO): New macro.
6117 (LIBES): Use it.
6118
6119 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6120 * bytecode.c (exec_byte_code):
6121 * callint.c (check_mark, Fcall_interactively):
6122 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6123 (getenv_internal, sync_process_alive, call_process_exited):
6124 * lisp.h (USE_SAFE_ALLOCA):
6125 Use bool for booleans, instead of int.
6126 * lisp.h, process.h: Adjust prototypes to match above changes.
6127 * callint.c (Fcall_interactively): Don't assume the mark's
6128 offset fits in 'int'.
6129
6130 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 * buffer.c, buffer.h: Use bool for boolean.
6133 * buffer.c (reset_buffer_local_variables)
6134 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6135 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6136 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6137 (overlay_touches_p, overlay_strings, Foverlay_put)
6138 (report_overlay_modification, call_overlay_mod_hooks):
6139 (mmap_enlarge, mmap_set_vars):
6140 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6141 Use bool for booleans, instead of int.
6142 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6143 since the 1-or-0 return value is always ignored anyway.
6144 (mmap_initialized_p):
6145 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6146 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6147
6148 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6149
6150 * bidi.c: Use bool for boolean.
6151 This is a bit more readable, and makes the text segment of bidi.o
6152 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6153 Presumably it's faster too.
6154 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6155 Now bool.
6156 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6157 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6158 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6159 (bidi_explicit_dir_char, bidi_level_of_next_char)
6160 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6161 Use bool for booleans, instead of int.
6162 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6163 (bidi_unshelve_cache): Adjust decls to match code.
6164
6165 2012-08-23 Martin Rudalics <rudalics@gmx.at>
6166
6167 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6168 argument.
6169
6170 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6173 * atimer.h: Include <stdbool.h>.
6174
6175 2012-08-22 Dan Nicolaescu <dann@gnu.org>
6176
6177 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6178 compile time tests instead of run time tests on systems that do
6179 not use them.
6180 (FRAME_MAC_P): Remove leftover from deleted code.
6181 * frame.c (syms_of_frame): Remove leftover from deleted code.
6182
6183 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6184
6185 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6186
6187 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6188
6189 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6190 Otherwise, the compiler complains about (A?B:C) where B is void
6191 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
6192 (fontset_add): Return void, for FONTSET_ADD.
6193
6194 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6195
6196 * alloc.c: Use bool for booleans.
6197 (gc_in_progress, abort_on_gc)
6198 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6199 (dont_register_blocks) [GC_MALLOC_CHECK]:
6200 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6201 (check_string_bytes, make_specified_string, memory_full)
6202 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6203 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6204 (mark_stack, valid_pointer_p, make_pure_string)
6205 (Fgarbage_collect, survives_gc_p, gc_sweep):
6206 Use bool for booleans, instead of int.
6207 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6208 Remove unused local.
6209 * alloc.c (PURE_POINTER_P):
6210 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6211 * editfns.c (Fformat):
6212 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6213 (Fdo_auto_save):
6214 * fns.c (sweep_weak_table):
6215 * lisp.h (suppress_checking, push_message, survives_gc_p)
6216 (make_pure_string, gc_in_progress, abort_on_gc):
6217 * lread.c (readchar, read1):
6218 * print.c (Fprin1_to_string):
6219 * xdisp.c (push_message):
6220 Use bool for booleans affected directly or indirectly by
6221 alloc.c's changes.
6222
6223 Make recently-introduced setters macros.
6224 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6225 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6226 (set_fontset_default, set_fontset_fallback): Rename from their
6227 upper-case counterparts, and make them functions rather than macros.
6228 This is more consistent with the other recently-introduced setters.
6229 These don't need to be inline, since they're local.
6230
6231 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6232
6233 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6234 the loop (Bug#12247).
6235
6236 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6237
6238 * lisp.h (vcopy): Use memcpy rather than our own loop.
6239 This fixes a performance regression introduced by the recent
6240 addition of vcopy. This means 'vcopy' will need to be modified
6241 for a copying collector, but that's OK. Also, tighten the
6242 checking in the assertion.
6243
6244 2012-08-21 Eli Zaretskii <eliz@gnu.org>
6245
6246 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6247 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6248 non-base glyph for the width of the base character, according to
6249 what x_draw_composite_glyph_string_foreground expects.
6250 Generate WADJUST value according to composition_gstring_width's
6251 expectations, to produce correct width of the composed character.
6252 Reverse the sign of the DU offset produced by ScriptPlace.
6253
6254 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6255
6256 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6257
6258 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6259
6260 Avoid direct writes to contents member of struct Lisp_Vector.
6261 * lisp.h (vcopy): New function to copy data into vector.
6262 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6263 * fns.c (Ffillarray): Use ASET.
6264 * keyboard.c (timer_check_2): Use AREF and ASET.
6265 (append_tool_bar_item, Frecent_keys): Use vcopy.
6266 * lread.c (read_vector): Use ASET.
6267 * msdos.c (Frecent_doskeys): Use vcopy.
6268 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6269 (Finternal_merge_in_global_face): Use ASET and vcopy.
6270 * xfont.c (xfont_list_pattern): Likewise.
6271
6272 2012-08-21 Martin Rudalics <rudalics@gmx.at>
6273
6274 * window.c (Fwindow_point): For the selected window always return
6275 the position of its buffer's point.
6276 (Fset_window_point): For the selected window always go in its
6277 buffer to the specified position.
6278
6279 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6280
6281 Setter macros for fontsets.
6282 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6283 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6284 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6285 Adjust users.
6286
6287 2012-08-20 Glenn Morris <rgm@gnu.org>
6288
6289 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6290 Don't assume that `ln -f' works.
6291
6292 2012-08-20 Eli Zaretskii <eliz@gnu.org>
6293
6294 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6295 and later about non-assignments with no effect. See discussion at
6296 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6297 details.
6298
6299 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6300
6301 Inline setter functions for Lisp_Objects slots of struct specbinding.
6302 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6303 Adjust users.
6304
6305 2012-08-20 Martin Rudalics <rudalics@gmx.at>
6306
6307 * window.c (select_window): Always make selected window's buffer
6308 current.
6309
6310 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6311
6312 Use AREF and ASET for docstrings of category tables.
6313 * category.h (CATEGORY_DOCSTRING): Use AREF.
6314 (SET_CATEGORY_DOCSTRING): Use ASET.
6315 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6316
6317 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6318
6319 Inline setter functions for hash table members.
6320 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6321 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6322 (set_hash_key_and_value, set_hash_index, set_hash_next)
6323 (set_hash_hash): New functions.
6324 * charset.c, fns.c: Adjust users.
6325
6326 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6327
6328 Inline getter and setter functions for per-buffer values.
6329 * buffer.h (per_buffer_default, set_per_buffer_default)
6330 (per_buffer_value, set_per_buffer_value): New functions.
6331 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6332 * buffer.c, data.c: Adjust users.
6333
6334 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
6335
6336 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6337
6338 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 Rely on <config.h> + <unistd.h> to declare 'environ',
6341 as gnulib does this if the system doesn't.
6342 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
6343 Remove declaration. MS-Windows declares it on stdlib.h which is
6344 included by conf_post.h.
6345 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6346 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6347 * vm-limit.c: Include <unistd.h>, for 'environ'.
6348
6349 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6350 (start_of_data): Remove decl; mem-limits.h provides it.
6351
6352 * xdisp.c (handle_invisible_prop): Make it a bit faster
6353 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6354
6355 2012-08-19 Chong Yidong <cyd@gnu.org>
6356
6357 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6358 ends (Bug#3874).
6359
6360 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6361
6362 * .gdbinit: Use call instead of set when calling a function in the
6363 inferior.
6364
6365 * data.c (set_internal): Don't use set_blv_found.
6366 (Fkill_local_variable): Likewise.
6367
6368 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6369
6370 * nsfont.m (ns_ascii_average_width): Ensure the string
6371 ascii_printable is initialized with a null-terminated character
6372 array. Otherwise, it can contain undesired extra characters.
6373
6374 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6375
6376 port new setting code to Sun C 5.8 2005/10/13
6377 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6378 Return void, not Lisp_Object. Otherwise, the compiler
6379 complains about (A?B:C) where B is void and C is Lisp_Object
6380 when compiling CHAR_TABLE_SET, due to the recent change to
6381 the API of sub_char_table_set_contents.
6382
6383 2012-08-18 Chong Yidong <cyd@gnu.org>
6384
6385 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6386 for the string case (Bug#3874).
6387
6388 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6389
6390 * buffer.h (BSET): Remove (Bug#12215).
6391 Replace all uses with calls to new setter functions.
6392 (bset_bidi_paragraph_direction, bset_case_canon_table)
6393 (bset_case_eqv_table, bset_directory, bset_display_count)
6394 (bset_display_time, bset_downcase_table)
6395 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6396 (bset_last_selected_window, bset_local_var_alist)
6397 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6398 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6399 (bset_width_table):
6400 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6401 (bset_auto_fill_function, bset_auto_save_file_format)
6402 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6403 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6404 (bset_cache_long_line_scans, bset_case_fold_search)
6405 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6406 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6407 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6408 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6409 (bset_header_line_format, bset_indicate_buffer_boundaries)
6410 (bset_indicate_empty_lines, bset_invisibility_spec)
6411 (bset_left_fringe_width, bset_major_mode, bset_mark)
6412 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6413 (bset_name, bset_overwrite_mode, bset_pt_marker)
6414 (bset_right_fringe_width, bset_save_length)
6415 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6416 (bset_scroll_up_aggressively, bset_selective_display)
6417 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6418 (bset_word_wrap, bset_zv_marker):
6419 * category.c (bset_category_table):
6420 * syntax.c (bset_syntax_table):
6421 New setter functions.
6422
6423 * process.h (PSET): Remove (Bug#12215).
6424 Replace all uses with calls to new setter functions.
6425 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6426 (PROCESS_INLINE): New macro.
6427 (pset_childp): New setter function.
6428 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6429 * process.c (PROCESS_INLINE):
6430 Define to EXTERN_INLINE, so that the corresponding functions
6431 are compiled into code.
6432 (pset_buffer, pset_command, pset_decode_coding_system)
6433 (pset_decoding_buf, pset_encode_coding_system)
6434 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6435 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6436 (pset_type, pset_write_queue): New setter functions.
6437
6438 * window.h (WSET): Remove (Bug#12215).
6439 Replace all uses with calls to new setter functions.
6440 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6441 (WINDOW_INLINE): New macro.
6442 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6443 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6444 (wset_total_lines, wset_vertical_scroll_bar)
6445 (wset_window_end_pos, wset_window_end_valid)
6446 (wset_window_end_vpos): New setter functions.
6447 * window.c (WINDOW_INLINE):
6448 Define to EXTERN_INLINE, so that the corresponding functions
6449 are compiled into code.
6450 (wset_combination_limit, wset_dedicated, wset_display_table)
6451 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6452 (wset_new_normal, wset_new_total, wset_next_buffers)
6453 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6454 (wset_prev_buffers, wset_right_fringe_width)
6455 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6456 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6457 (wset_window_parameters):
6458 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6459 (wset_column_number_displayed, wset_region_showing):
6460 New setter functions.
6461
6462 * termhooks.h (TSET): Remove (Bug#12215).
6463 Replace all uses with calls to new setter functions.
6464 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6465 (TERMHOOKS_INLINE): New macro.
6466 (tset_charset_list, tset_selection_alist): New setter functions.
6467 * terminal.c (TERMHOOKS_INLINE):
6468 Define to EXTERN_INLINE, so that the corresponding functions
6469 are compiled into code.
6470 (tset_param_alist): New setter function.
6471
6472 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6473
6474 * keyboard.h (KSET): Remove (Bug#12215).
6475 Replace all uses with calls to new setter functions.
6476 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6477 (KEYBOARD_INLINE): New macro.
6478 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6479 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6480 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6481 New setter functions.
6482 * keyboard.c (KEYBOARD_INLINE):
6483 Define to EXTERN_INLINE, so that the corresponding functions
6484 are compiled into code.
6485 (kset_echo_string, kset_kbd_queue)
6486 (kset_keyboard_translate_table, kset_last_prefix_arg)
6487 (kset_last_repeatable_command, kset_local_function_key_map)
6488 (kset_overriding_terminal_local_map, kset_real_last_command)
6489 (kset_system_key_syms): New setter functions.
6490
6491 * frame.h (FSET): Remove (Bug#12215).
6492 Replace all uses with calls to new setter functions.
6493 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6494 (FRAME_INLINE): New macro.
6495 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6496 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6497 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6498 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6499 (fset_param_alist, fset_root_window, fset_scroll_bars)
6500 (fset_selected_window, fset_title, fset_tool_bar_items)
6501 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6502 * frame.c (FRAME_INLINE):
6503 Define to EXTERN_INLINE, so that the corresponding functions
6504 are compiled into code.
6505 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6506
6507 A few more naming-convention fixes for getters and setters.
6508 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6509 and rename from buffer_overlays_set_before.
6510 (set_buffer_overlays_after): Move here from buffer.h, and rename
6511 from buffer_overlays_set_after.
6512 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6513 All uses changed.
6514 (set_buffer_intervals): Rename from buffer_set_intervals.
6515 * intervals.c (set_interval_object): Move here from intervals.h,
6516 and rename from interval_set_object.
6517 (set_interval_left): Move here from intervals.h, and rename from
6518 interval_set_left.
6519 (set_interval_right): Move here from intervals.h, and rename from
6520 interval_set_right.
6521 (copy_interval_parent): Move here from intervals.h, and rename from
6522 interval_copy_parent.
6523 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6524 (set_interval_plist): Rename from interval_set_plist.
6525 Return void, not Lisp_Object, since no caller uses the result.
6526 * lisp.h (string_intervals): Rename from string_get_intervals.
6527 (set_string_intervals): Rename from string_set_intervals.
6528
6529 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
6530 (set_char_table_contents): Rename from char_table_set_contents.
6531 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
6532 All uses changed. See the end of
6533 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
6534
6535 * lisp.h (CSET): Remove (Bug#12215).
6536 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
6537 (set_char_table_purpose): New functions,
6538 replacing CSET. All uses changed. For example, replace
6539 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
6540 "set_char_table_parent (char_table, parent);".
6541 The old version was confusing because it used the same name
6542 'parent' for two different things.
6543
6544 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6545
6546 Functions to get and set Lisp_Object fields of buffer-local variables.
6547 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
6548 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
6549 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6550 * data.c, eval.c, frame.c: Adjust users.
6551
6552 2012-08-17 Chong Yidong <cyd@gnu.org>
6553
6554 * xfaces.c (merge_face_vectors): If the target font specfies a
6555 font spec, make the font's attributes take precedence over
6556 directly-specified attributes.
6557 (merge_face_ref): Recognize :font.
6558
6559 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6560
6561 Do not use memcpy for copying intervals.
6562 * intervals.c (reproduce_interval): New function.
6563 (reproduce_tree, reproduce_tree_obj): Use it.
6564 (reproduce_tree_obj): Remove prototype.
6565
6566 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6567
6568 * lisp.h (duration_to_sec_usec): Remove unused decl.
6569
6570 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6571
6572 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6573 to an allocated instance of NSString, not to the class itself.
6574
6575 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
6576
6577 * makefile.w32-in (C_CTYPE_H): New macro.
6578 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6579 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
6580 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6581
6582 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
6583
6584 Use ASCII tests for character types.
6585 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
6586 * xfns.c, xterm.c:
6587 Don't include <ctype.h>; was not needed.
6588 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
6589 * sysdep.c, xfaces.c:
6590 Include <c-ctype.h> instead of <ctype.h>.
6591 * nsterm.m: Include <c-ctype.h>.
6592 * charset.c (read_hex):
6593 * doc.c (Fsnarf_documentation):
6594 * fileio.c (IS_DRIVE) [WINDOWSNT]:
6595 (DRIVE_LETTER) [DOS_NT]:
6596 (Ffile_name_directory, Fexpand_file_name)
6597 (Fsubstitute_in_file_name):
6598 * font.c (font_parse_xlfd, font_parse_fcname):
6599 * frame.c (x_set_font_backend):
6600 * gtkutil.c (xg_get_font):
6601 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
6602 * nsimage.m (hexchar):
6603 * nsterm.m (ns_xlfd_to_fontname):
6604 * sysdep.c (system_process_attributes):
6605 * xfaces.c (hash_string_case_insensitive):
6606 Use C-locale tests instead of locale-specific tests for character
6607 types, since we want the ASCII interpretation here, not the
6608 interpretation suitable for whatever happens to be the current locale.
6609
6610 2012-08-16 Martin Rudalics <rudalics@gmx.at>
6611
6612 Consistently check windows for validity/liveness
6613 (Bug#11984, Bug#12025, Bug#12026).
6614 * lisp.h (CHECK_VALID_WINDOW): New macro.
6615 * window.c (decode_window): Rename to decode_live_window.
6616 (decode_valid_window, Fwindow_valid_p): New functions.
6617 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
6618 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
6619 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
6620 (Fwindow_prev_sibling, Fwindow_combination_limit)
6621 (Fset_window_combination_limit, Fwindow_use_time)
6622 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
6623 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
6624 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
6625 (Fwindow_hscroll, Fset_window_hscroll)
6626 (Fwindow_redisplay_end_trigger)
6627 (Fset_window_redisplay_end_trigger, Fwindow_edges)
6628 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
6629 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6630 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
6631 (Fwindow_end, Fset_window_point, Fset_window_start)
6632 (Fpos_visible_in_window_p, Fwindow_line_height)
6633 (Fwindow_dedicated_p, Fset_window_dedicated_p)
6634 (Fwindow_prev_buffers, Fset_window_prev_buffers)
6635 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
6636 (Fset_window_parameter, Fwindow_display_table)
6637 (Fset_window_display_table, Fdelete_other_windows_internal)
6638 (Fset_window_buffer, Fset_window_new_total)
6639 (Fset_window_new_normal, Fdelete_window_internal)
6640 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
6641 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
6642 (Fwindow_scroll_bars): Check whether argument window is a valid or
6643 live window. Update doc-strings.
6644 (syms_of_window): New symbol Qwindow_valid_p.
6645 * keyboard.c (Fposn_at_x_y): Check whether argument
6646 frame_or_window denotes a valid window.
6647
6648 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6649
6650 Fix previous char table change.
6651 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
6652 * chartab.c (optimize_sub_char_table): Likewise.
6653
6654 2012-08-16 Chong Yidong <cyd@gnu.org>
6655
6656 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
6657
6658 * xfont.c (xfont_open):
6659 * xftfont.c (xftfont_open): Set the font's max_width field.
6660
6661 * nsfont.m (nsfont_open): Similar to the Xft backend, set
6662 min_width to space_width and average_width to the average over
6663 printable ASCII characters.
6664 (ns_char_width): Code cleanup.
6665 (ns_ascii_average_width): New utility function.
6666
6667 * font.h (struct font): Update comments.
6668
6669 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6670
6671 Simple interface to set Lisp_Object fields of character tables.
6672 * lisp.h (CSET): New macro.
6673 (char_table_set_extras, char_table_set_contents)
6674 (sub_char_table_set_contents): New function.
6675 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
6676 * syntax.c: Adjust users.
6677
6678 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
6679
6680 * eval.c (eval_sub): Bind lexical-binding.
6681 * lread.c (Qlexical_binding): Make non-static.
6682
6683 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
6684
6685 * nsmenu.m (popupSession): Remove.
6686 (pop_down_menu): Remove endModalSession.
6687 (timeout_handler:): New method.
6688 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
6689 Call runModalForWindow. Check timer_fired when it returns.
6690 If not set, cancel timer and break out of loop.
6691 Otherwise loop again, with a new timeout.
6692
6693 * nsterm.m: Include fcntl.h if present.
6694 (fd_entry, t_readfds, inNsSelect): Remove.
6695 (select_writefds, select_valid, select_timeout, selfds)
6696 (select_mutex, apploopnr): Add.
6697 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
6698 Otherwise call kbd_buffer_store_event.
6699 (ns_send_appdefined): Remove release of fd_entry.
6700 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
6701 Increment and decrement apploopnr.
6702 (ns_select): If no file descriptors, just do a NSTimer.
6703 Otherwise copy read/write masks and start select thread (fd_handler).
6704 Start main loop and wait for application defined event.
6705 Inform select thread to stop selecting after main loop is exited.
6706 (ns_term_init): Create selfds pipe and set non-blocking.
6707 Initialize select_mutex. Start the select thread (fd_handler).
6708 (fd_handler:): Loop forever, wait for info from the main thread
6709 to either start or stop selecting. When select returns, send
6710 and appdefined event.
6711 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
6712 If not call kbd_buffer_store_event.
6713
6714 * nsterm.h (EmacsApp): fd_handler takes id argument.
6715 (EmacsDialogPanel): Add timer_fired and timeout_handler.
6716
6717 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
6718
6719 2012-08-15 Eli Zaretskii <eliz@gnu.org>
6720
6721 * region-cache.c (move_cache_gap): Update gap_len using the actual
6722 growth of the boundaries array. Do not change cache_len.
6723 (Bug#12196)
6724
6725 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6726
6727 Generalize and cleanup font subsystem checks.
6728 * font.h (FONT_DEBUG, font_assert): Remove.
6729 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
6730 Change font_assert to eassert. Use eassert where appropriate.
6731
6732 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6733
6734 * gtkutil.c (xg_get_font): Use pango_units_to_double.
6735
6736 2012-08-15 Chong Yidong <cyd@gnu.org>
6737
6738 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
6739 When using the new font chooser, use gtk_font_chooser_get_font_desc to
6740 extract the font descriptor instead of just the font name.
6741 In that case, return a font spec instead of a string.
6742 (x_last_font_name): Move to this file from xfns.c.
6743
6744 * xfns.c (Fx_select_font): The return value can also be a font
6745 spec. Move x_last_font_name management to gtkutil.c.
6746
6747 * xfaces.c: Make font weight and style symbols non-static.
6748
6749 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
6750
6751 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
6752 (bug#12117).
6753
6754 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
6755
6756 * alloc.c (Fgarbage_collect): Use plural form consistently.
6757
6758 2012-08-14 Eli Zaretskii <eliz@gnu.org>
6759
6760 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
6761 iteration through the command loop. Fixes a problem whereby mouse
6762 movements are ignored until the first mouse click.
6763
6764 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 Use bool, not int, for Lisp booleans.
6767 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
6768 makes Emacs a bit smaller and presumably a bit faster.
6769 * lisp.h: Include <stdbool.h>.
6770 (struct Lisp_Boolfwd, defvar_bool):
6771 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
6772 * regex.c [!emacs]: Include <stdbool.h>.
6773 (false, true): Remove; <stdbool.h> does this for us now.
6774
6775 2012-08-14 Chong Yidong <cyd@gnu.org>
6776
6777 * character.c (Fcharacterp): Doc fix (Bug#12076).
6778
6779 * data.c (Findirect_variable): Doc fix (Bug#11040).
6780
6781 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
6782
6783 * editfns.c (Fformat): Doc fix (Bug#12059).
6784 (Fsave_current_buffer): Doc fix (Bug#11542).
6785
6786 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6787
6788 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
6789 (bug#12022).
6790
6791 2012-08-14 Martin Rudalics <rudalics@gmx.at>
6792
6793 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
6794 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
6795 * minibuf.c (choose_minibuf_frame, read_minibuf):
6796 * w32fns.c (x_create_tip_frame):
6797 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
6798 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
6799
6800 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6801
6802 * intervals.c (offset_intervals): Remove obsolete comment.
6803
6804 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
6805
6806 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
6807
6808 2012-08-14 Gergely Risko <gergely@risko.hu>
6809
6810 * coding.c (decode_coding): Record buffer modification before
6811 disabling undo_list (Bug#11773).
6812
6813 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 Revert and cleanup some recent overlay changes.
6816 * buffer.h (enum overlay_type): Remove.
6817 (buffer_get_overlays, buffer_set_overlays): Likewise.
6818 (buffer_set_overlays_before, buffer_set_overlays_after):
6819 New function. Adjust users.
6820 (unchain_both): Add eassert.
6821
6822 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6823
6824 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
6825
6826 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6827
6828 * gtkutil.c (xg_mark_data): Don't assume C99.
6829
6830 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
6831
6832 * gtkutil.c (xg_frame_tb_info): New struct.
6833 (TB_INFO_KEY): New define.
6834 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
6835 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
6836 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
6837 if not present.
6838 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
6839 is up to date. Otherwise store new data.
6840 (free_frame_tool_bar): Free xg_frame_tb_info if present.
6841
6842 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6843
6844 Use KSET for write access to Lisp_Object members of struct kboard.
6845 * keyboard.h (KSET): New macro.
6846 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6847 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
6848 * xterm.c: Adjust users.
6849
6850 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6851
6852 Use BSET for write access to Lisp_Object members of struct buffer.
6853 * buffer.h (BSET): New macro.
6854 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
6855 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
6856 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
6857 * window.c, xdisp.c, xfns.c: Adjust users.
6858
6859 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
6860
6861 * lread.c (syms_of_lread): Initialize Vlexical_binding.
6862
6863 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
6864
6865 * nsterm.m (not_in_argv): New function.
6866 (application:openFile, application:openTempFile:):
6867 (application:openFileWithoutUI:, application:openFiles:): Open file
6868 if not_in_argv returns non-zero (bug#12171).
6869
6870 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
6871 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
6872 Define for Gtk+ versions less than 3.2.
6873 (xg_get_font_name): Use those functions/macros here.
6874 Reported by Frans Oilinki <moilinki@gmail.com>.
6875
6876 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6877
6878 * unexmacosx.c (copy_data_segment): Copy initialized data in
6879 statically linked libraries from input file rather than memory.
6880
6881 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
6882 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
6883 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
6884
6885 2012-08-10 Glenn Morris <rgm@gnu.org>
6886
6887 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
6888 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
6889
6890 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6891
6892 Fix last change to allow compilation with low optimization levels.
6893 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
6894 Reported by Jan Djärv <jan.h.d@swipnet.se>.
6895
6896 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6897
6898 Use common inline syntax in intervals.h.
6899 * intervals.h (INTERVALS_INLINE): New macro.
6900 Change all users from LISP_INLINE.
6901
6902 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6903
6904 Define Qnone once for all platforms.
6905 * frame.c (Qnone): Define here.
6906 (syms_of_frame): DEFSYM it.
6907 * lisp.h (Qnone): New declaration.
6908 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
6909 * xfns.c: Remove duplication. Adjust users.
6910
6911 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6912
6913 Remove unused macros from intervals.h.
6914 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6915 * intervals.c: Adjust comment.
6916
6917 2012-08-10 Eli Zaretskii <eliz@gnu.org>
6918
6919 * w32fns.c <w32_unicode_gui>: New static variable.
6920 (globals_of_w32fns): Initialize it according to os_subtype.
6921 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6922 testing os_subtype.
6923
6924 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
6925 Eli Zaretskii <eliz@gnu.org>
6926
6927 Fix bug #10299 with Unicode characters sent by customized
6928 keyboards created by MSKLC.
6929 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6930 (w32_init_class): Use it to initialize the Emacs class with either
6931 ANSI or Unicode API calls.
6932 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
6933 later.
6934 (w32_wnd_proc): If the character code sent by WM_CHAR or
6935 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
6936 original message. Call DefWindowProcW on NT and later.
6937
6938 2012-08-10 Glenn Morris <rgm@gnu.org>
6939
6940 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
6941
6942 * lisp.h (DIRECTORY_SEP): Let configure set it.
6943
6944 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
6945
6946 Use TSET for write access to Lisp_Object slots of struct terminal.
6947 * termhooks.h (TSET): New macro.
6948 * coding.c, terminal.c, xselect.c: Adjust users.
6949
6950 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
6951
6952 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
6953 the failing expression, include them in the error message.
6954 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
6955 * lisp.h (internal_condition_case_n): Update declaration.
6956
6957 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6958
6959 Inline functions to examine and change buffer overlays.
6960 * buffer.c (unchain_both): New function.
6961 * buffer.h (buffer_get_overlays, buffer_set_overlays):
6962 (buffer_has_overlays): New function.
6963 (enum overlay_type): New enum.
6964 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
6965 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
6966
6967 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6968
6969 Inline functions to examine and change buffer intervals.
6970 * alloc.c (mark_interval_tree): Remove.
6971 (MARK_INTERVAL_TREE): Simplify.
6972 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
6973 * intervals.c (buffer_balance_intervals): New function.
6974 (graft_intervals_into_buffer): Adjust indentation.
6975 (set_intervals_multibyte): Simplify.
6976 * buffer.h (BUF_INTERVALS): Remove.
6977 (buffer_get_intervals, buffer_set_intervals): New function.
6978 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
6979 * intervals.c, textprop.c: Adjust users.
6980
6981 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6982
6983 Inline functions to examine and change string intervals.
6984 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
6985 (string_get_intervals, string_set_intervals): New function.
6986 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6987 * lread.c, print.c, textprop.c: Adjust users.
6988
6989 2012-08-08 Glenn Morris <rgm@gnu.org>
6990
6991 * lisp.mk (lisp): Remove language/persian.elc.
6992
6993 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6994
6995 Cleanup intervals.
6996 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
6997 (NULL_INTERVAL_P): Likewise. Adjust users.
6998 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
6999 Adjust comment. Move under #if 0.
7000 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7001 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7002
7003 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7004
7005 Check total length of intervals with eassert.
7006 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7007 * intervals.c: Change all users to eassert.
7008
7009 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7010
7011 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7012 Rename fields to match removal of FGET and WGET and disuse of
7013 INTERNAL_FIELD in Lisp_Cons.
7014
7015 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7016
7017 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7018 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7019 name since all xname users are fixed long time ago. Do not
7020 use INTERNAL_FIELD.
7021 (set_symbol_name, set_symbol_function, set_symbol_plist):
7022 (set_symbol_next, set_overlay_plist): New function.
7023 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7024 (struct Lisp_Overlay): Likewise.
7025 (CVAR, MVAR, SVAR): Remove.
7026 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7027 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7028 * xterm.c: Adjust users.
7029 * .gdbinit: Change to use name field of struct Lisp_Symbol
7030 where appropriate.
7031
7032 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7033
7034 Basic functions to set Lisp_Object and pointer slots of intervals.
7035 * intervals.h (interval_set_parent, interval_set_object):
7036 (interval_set_left, interval_set_right, interval_set_plist):
7037 (interval_copy_parent): New function.
7038 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7039 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7040 Adjust indentation.
7041 (INTERVAL_SIZE): Remove. Adjust users.
7042 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7043
7044 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7045
7046 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7047 * process.h (PGET): Remove.
7048 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7049 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7050
7051 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7052
7053 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7054 * window.h (WGET): Remove.
7055 (struct window): Do not use INTERNAL_FIELD.
7056 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7057 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7058 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7059 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7060 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7061 Adjust users.
7062
7063 2012-08-07 Chong Yidong <cyd@gnu.org>
7064
7065 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7066 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7067 (Fdelete_window_internal): Signal an error if the window is not on
7068 a live frame (Bug#12025).
7069
7070 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7071
7072 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7073 * frame.h (FGET): Remove.
7074 (struct frame): Do not use INTERNAL_FIELD.
7075 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7076 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7077 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7078 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7079
7080 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
7081
7082 * w32.c: Silence compiler warnings.
7083 (map_w32_filename): Remove unused variable `is_fat'.
7084 (chase_symlinks): Add parentheses around expression.
7085
7086 2012-08-06 Glenn Morris <rgm@gnu.org>
7087
7088 * sysdep.c: Respect BROKEN_GETWD.
7089
7090 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7091 Let configure handle it.
7092 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7093
7094 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7095
7096 Use GCALIGNMENT where appropriate.
7097 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7098 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7099 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7100
7101 2012-08-06 Eli Zaretskii <eliz@gnu.org>
7102
7103 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7104 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
7105
7106 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7107
7108 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7109 that should be sufficient for everyone.
7110
7111 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7112
7113 * keyboard.c (timer_check_2): Add break so timer_check returns next
7114 timeout.
7115
7116 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7117
7118 Fix Windows build errors introduced after converting to WGET and WSET.
7119 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7120 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7121
7122 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7123
7124 * nsterm.m (ns_frame_rehighlight): Use FSET.
7125
7126 * nsmenu.m (ns_update_menubar): Use FSET.
7127
7128 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7129
7130 Separate read and write access to Lisp_Object slots of Lisp_Process.
7131 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7132 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7133
7134 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7135
7136 Separate read and write access to Lisp_Object slots of struct window.
7137 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7138 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7139 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7140 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7141 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7142 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7143 Adjust users.
7144
7145 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7146
7147 Fix Windows build errors introduced after converting to FGET and FSET.
7148 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7149 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7150 (w32_judge_scroll_bars): Change to use FSET.
7151 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7152
7153 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7154
7155 Fix replacement typo.
7156 * window.c (replace_window): Set root_window instead of
7157 selected_window. This fixes a total window subsystem
7158 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7159
7160 2012-08-06 Glenn Morris <rgm@gnu.org>
7161
7162 * lisp.mk (lisp): Add language/persian.elc.
7163
7164 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7165
7166 Separate read and write access to Lisp_Object slots of struct frame.
7167 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7168 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7169 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7170 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7171 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7172
7173 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7174
7175 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7176
7177 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7178
7179 Generalize common compile-time constants.
7180 * lisp.h (header_size, bool_header_size, word_size): Now here.
7181 (struct Lisp_Vector): Add comment.
7182 (struct Lisp_Bool_Vector): Move up to define handy constants.
7183 (VECSIZE, PSEUDOVECSIZE): Simplify.
7184 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7185 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7186 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7187 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7188 * xfont.c, xmenu.c: Use word_size where appropriate.
7189
7190 2012-08-05 Lawrence Mitchell <wence@gmx.li>
7191
7192 * search.c (Freplace_match): Treat \? in the replacement text
7193 literally (Bug#8161).
7194
7195 2012-08-05 Chong Yidong <cyd@gnu.org>
7196
7197 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7198 * frame.c (Vdelete_frame_functions):
7199 * emacs.c (Vkill_emacs_hook): Doc fix.
7200
7201 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7202
7203 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7204 --with-x-toolkit=no builds.
7205 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7206
7207 2012-08-04 Chong Yidong <cyd@gnu.org>
7208
7209 * syntax.c (Fmodify_syntax_entry): Doc fix.
7210
7211 2012-08-04 Eli Zaretskii <eliz@gnu.org>
7212
7213 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7214 * w32.c (init_environment): Change the default values of many
7215 environment variables in dflt_envvars[] to NULL, to avoid pushing
7216 them into environment when they were not already defined.
7217 Remove the code that deletes site-lisp subdirectories from the default
7218 value of EMACSLOADPATH, as it is no longer needed.
7219 (check_windows_init_file): Now external, not static.
7220 Use Vload_path as is, without adding anything, as this function is now
7221 called when Vload_path is already set up.
7222
7223 * w32.h (check_windows_init_file): Add prototype.
7224
7225 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7226 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7227 compatibility with Posix platforms.
7228 (main): Move the call to check_windows_init_file to here from
7229 w32.c.
7230 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7231 any, in the DEFALT argument into the root of the Emacs build or
7232 installation tree, as appropriate.
7233
7234 * callproc.c (init_callproc_1): Call decode_env_path instead of
7235 doing its equivalent by hand.
7236 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7237 the code that sets Vexec_path run on MS-Windows.
7238
7239 * lread.c (init_lread): Add comments to #ifdef's.
7240
7241 * msdos.c (dos_set_window_size, IT_update_begin)
7242 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7243 instead of direct references.
7244
7245 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7246
7247 Export DEFAULT_REHASH_* to GDB.
7248 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7249 Now constants, not macros.
7250
7251 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 Remove unnecessary casts involving pointers.
7254 These casts are no longer needed now that we assume C89 or later,
7255 since they involve casting to or from void *.
7256 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7257 (make_pure_float, make_pure_vector):
7258 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7259 * macros.c (Fstart_kbd_macro):
7260 * menu.c (find_and_return_menu_selection):
7261 * minibuf.c (read_minibuf_noninteractive):
7262 * sysdep.c (closedir):
7263 * xdisp.c (x_produce_glyphs):
7264 * xfaces.c (compare_fonts_by_sort_order):
7265 * xfns.c (x_real_positions, select_visual):
7266 * xselect.c (x_stop_queuing_selection_requests)
7267 (x_get_window_property, x_get_window_property_as_lisp_data):
7268 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7269 Remove unnecessary pointer casts.
7270 * alloc.c (record_xmalloc): New function.
7271 * lisp.h (record_xmalloc): New decl.
7272 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7273 more like a function. This is because the pointer cast is not
7274 needed. All uses changed.
7275 * print.c (print_string, print_error_message): Avoid length recalc.
7276
7277 Improve fix for macroexp crash with debugging (Bug#12118).
7278 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7279 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7280 not supposed to be invoked from the garbage collector.
7281 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7282 (gc_aset): New function, which is like ASET but can be
7283 used in the garbage collector.
7284 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7285 (set_hash_index): Use it instead of ASET.
7286
7287 2012-08-03 Eli Zaretskii <eliz@gnu.org>
7288
7289 Support symlinks on latest versions of MS-Windows.
7290 * w32.c: Include winioctl.h and aclapi.h.
7291 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7292 (revert_to_self): Forward declarations of static functions.
7293 <static BOOL g_b_init_get_security_info>:
7294 <g_b_init_create_symbolic_link>: New static flags.
7295 (globals_of_w32): Initialize them to zero.
7296 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7297 (map_w32_filename): Improve commentary. Simplify switch.
7298 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7299 headers (most versions of MinGW w32api don't).
7300 (get_security_info, create_symbolic_link)
7301 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7302 New functions.
7303 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7304 in the argument file name.
7305 (sys_access): Call unc_volume_file_attributes only if
7306 GetFileAttributes fails with network-related error codes.
7307 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7308 have the required privileges.
7309 (get_file_security_desc_by_name): Rename from
7310 get_file_security_desc.
7311 (stat_worker): New function, with most of the guts of 'stat', and
7312 with addition of handling of symlinks and support for 'lstat'.
7313 If possible, get file's attributes and security information by
7314 handle, not by name. Produce S_IFLNK bit for symlinks, when
7315 called from 'lstat'.
7316 (stat, lstat): New functions, call 'stat_worker'.
7317 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7318 symlinks when the underlying filesystem supports them.
7319
7320 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7321
7322 Fix macroexp crash on Windows with debugging (Bug#12118).
7323 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7324 checking subscripts; problem introduced with the recent
7325 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7326 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7327 since it's used in non-static inline functions now.
7328
7329 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7330 Don't assume buffer size fits in 'int'. Remove unused local.
7331
7332 Use C99-style 'extern inline' if available.
7333 * buffer.h (BUFFER_INLINE):
7334 * category.h (CATEGORY_INLINE):
7335 * character.h (CHARACTER_INLINE):
7336 * charset.h (CHARSET_INLINE):
7337 * composite.h (COMPOSITE_INLINE):
7338 * dispextern.h (DISPEXTERN_INLINE):
7339 * lisp.h (LISP_INLINE):
7340 * systime.h (SYSTIME_INLINE):
7341 New macro, replacing 'static inline' in this header.
7342 * buffer.h, category.h, character.h, charset.h, composite.h:
7343 * dispextern.h, lisp.h, systime.h:
7344 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7345 * alloc.c (LISP_INLINE):
7346 * buffer.c (BUFFER_INLINE):
7347 * category.c (CATEGORY_INLINE):
7348 * character.c (CHARACTER_INLINE):
7349 * charset.c (CHARSET_INLINE):
7350 * composite.c (COMPOSITE_INLINE):
7351 * dispnew.c (DISPEXTERN_INLINE):
7352 * sysdep.c (SYSTIME_INLINE):
7353 Define to EXTERN_INLINE, so that the corresponding functions
7354 are compiled into code.
7355 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7356 (INLINE_HEADER_END): New macros.
7357 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7358 since it's used in non-static inline functions now.
7359 (VALMASK) [!USE_LSB_TAG]: Likewise.
7360
7361 2012-08-02 Glenn Morris <rgm@gnu.org>
7362
7363 * s/: Remove empty directory.
7364
7365 * s/ms-w32.h: Move to ../nt/inc.
7366 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7367 Update for new ms-w32.h location.
7368
7369 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7370
7371 Port to Solaris 8.
7372 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7373
7374 2012-08-02 Glenn Morris <rgm@gnu.org>
7375
7376 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7377 hard-coding the path separator.
7378
7379 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7382 This how ASET and AREF are supposed to work, and makes
7383 it easier to think about future improvements. See
7384 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7385 * charset.h (set_charset_attr): New function.
7386 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7387 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7388 (aref_addr): New function. All uses of &AREF(...) changed.
7389 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7390 (set_hash_index): New functions. All lvalue-style uses of
7391 HASH_KEY etc. changed.
7392 * keyboard.c (set_prop): New function. All lvalue-style uses
7393 of PROP changed.
7394
7395 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7396
7397 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7398 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
7399 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
7400 * nsfns.m (ns_set_name_as_filename): Likewise.
7401 * nsmenu.m (ns_update_menubar): Likewise.
7402 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7403
7404 2012-08-01 Eli Zaretskii <eliz@gnu.org>
7405
7406 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7407 Adapt to latest changes in field names of the corresponding Lisp
7408 objects.
7409
7410 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7411
7412 2012-08-01 Glenn Morris <rgm@gnu.org>
7413
7414 * s/msdos.h: Remove file.
7415 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7416 * Makefile.in (S_FILE): Remove.
7417 (config_h): Remove S_FILE.
7418
7419 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7420
7421 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7422 Remove; moved to nt/config.nt.
7423
7424 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7425
7426 Use INTERNAL_FIELD for conses and overlays.
7427 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7428 Remove obsolete comment.
7429 (MVAR): New macro.
7430 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7431 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7432
7433 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7434
7435 Use INTERNAL_FIELD for symbols.
7436 * lisp.h (SVAR): New macro. Adjust users.
7437 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7438 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7439
7440 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7441
7442 Use INTERNAL_FIELD for processes.
7443 * process.h (PVAR): New macro. Adjust style.
7444 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7445 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7446
7447 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7448
7449 Use INTERNAL_FIELD for windows.
7450 * window.h (WVAR): New macro.
7451 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7452 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7453 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7454 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7455 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7456 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7457
7458 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7459
7460 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7461
7462 2012-08-01 Glenn Morris <rgm@gnu.org>
7463
7464 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7465 Move to configure.ac.
7466
7467 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7468
7469 * makefile.w32-in (CONFIG_H): Update dependencies.
7470 (CONF_POST_H): New macro.
7471
7472 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7473
7474 2012-07-31 Glenn Morris <rgm@gnu.org>
7475
7476 * Makefile.in (S_FILE): No longer set by configure.
7477
7478 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7479 is available.
7480 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7481
7482 * process.h (NULL_DEVICE):
7483 * emacs.c (SEPCHAR):
7484 * editfns.c (USER_FULL_NAME): Let configure set them.
7485
7486 * s/README, s/template.h: Remove files.
7487
7488 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7489
7490 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7491 Move to configure.ac.
7492
7493 2012-07-31 Eli Zaretskii <eliz@gnu.org>
7494
7495 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7496 resulting renaming of 'struct frame' members.
7497
7498 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7499
7500 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7501 after introduction of FVAR.
7502
7503 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7504
7505 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7506
7507 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7508 instead of compositeToPoint.
7509 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7510
7511 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
7512
7513 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7514
7515 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7516 * lisp.h (INTERNAL_FIELD): New macro.
7517 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
7518 (BVAR): Change to use INTERNAL_FIELD.
7519 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7520 (KVAR): Change to use INTERNAL_FIELD.
7521 * frame.h (FVAR): New macro.
7522 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
7523 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7524 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7525 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7526 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7527
7528 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7529
7530 Miscellaneous fixes for non-default X toolkits.
7531 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
7532 * xterm.c (x_frame_of_widget): Remove redundant prototype.
7533 Move under #ifdef USE_LUCID.
7534 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
7535 definition and usage to avoid warnings.
7536
7537 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7538
7539 * nsterm.m (openFiles): Fix previous checkin.
7540
7541 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
7542
7543 * indent.c (compute_motion): Remove unused local.
7544
7545 2012-07-31 Glenn Morris <rgm@gnu.org>
7546
7547 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
7548
7549 * conf_post.h [USG5_4]:
7550 Move remaining contents of s/usg5-4-common.h here.
7551 * s/usg5-4-common.h: Remove file.
7552
7553 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7554 * s/irix6-5.h: Remove file.
7555
7556 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7557 * s/darwin.h: Remove file.
7558
7559 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7560 * s/hpux10-20.h: Remove file, which is now empty.
7561
7562 2012-07-30 Glenn Morris <rgm@gnu.org>
7563
7564 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7565 * Makefile.in (config_h): Add conf_post.h.
7566 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7567
7568 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7569
7570 * nsterm.m (ns_do_open_file): New variable.
7571 (ns_term_init): Set ns_do_open_file to YES after run returns.
7572 (openFile, openTempFile, openFileWithoutUI, openFiles):
7573 Open files only if ns_do_open_file.
7574
7575 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7578 This no-op macro hasn't been needed for many years.
7579 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
7580
7581 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
7582 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
7583 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
7584 gdb_make_enums_visible.
7585 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
7586 (DIRECTORY_SEP): Now a constant, not a macro.
7587
7588 2012-07-30 Eli Zaretskii <eliz@gnu.org>
7589
7590 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
7591 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
7592
7593 * w32term.c <w32_keyboard_codepage>: Renamed from
7594 keyboard_codepage and now external. All users changed.
7595
7596 * w32term.h: Add declaration of w32_keyboard_codepage.
7597
7598 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
7599 the codepage to translate keys to Unicode. If this argument is
7600 -1, use the value returned by GetConsoleCP. All callers changed.
7601
7602 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7603
7604 Update .PHONY listings in makefiles.
7605 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
7606 bootstrap-clean, distclean, maintainer-clean, versioclean,
7607 extraclean, frc.
7608
7609 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
7610 This is a bit clearer. Fix some commentary typos.
7611
7612 2012-07-30 Glenn Morris <rgm@gnu.org>
7613
7614 * s/netbsd.h: Let configure include signal.h if needed.
7615 Remove file, which is now empty.
7616
7617 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
7618 Let configure set them.
7619 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
7620 No more need to undefine.
7621
7622 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
7623
7624 * keymap.c (Fkey_description): Don't remove 0x80 bit from
7625 non-single-byte char when adding meta modifier. (Bug#12090)
7626
7627 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7628
7629 Convert safe_call to use variable number of arguments.
7630 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
7631 (safe_call2): Fix comment.
7632 * lisp.h (safe_call): Adjust prototype.
7633 * coding.c (encode_coding_object): Change to use safe_call2.
7634 * xfaces.c (merge_face_heights): Change to use safe_call1.
7635
7636 2012-07-30 Glenn Morris <rgm@gnu.org>
7637
7638 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
7639 does that unconditionally. Remove file, which is now empty.
7640
7641 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
7642 Remove empty files.
7643
7644 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7645
7646 Export to GDB most of lisp.h's remaining object-like macros.
7647 * lisp.h (min, max): Move earlier, because they're used earlier now.
7648 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
7649 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
7650 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
7651 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
7652 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
7653 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
7654 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
7655 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
7656 Now constants, for GDB. They need not be macros.
7657 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
7658 Now constants, for GDB, as well as macros, for static initializers.
7659 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
7660 Move to after the definition of struct Lisp_Char_Table,
7661 since the former now needs that type defined.
7662 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
7663 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
7664 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
7665 New enums, for gdb_make_enums_visible.
7666 (GLYPH_MODE_LINE_FACE): Remove; unused.
7667 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
7668 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
7669 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
7670 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
7671 enum maxargs, enum MAX_ALLOCA.
7672 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
7673 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
7674 no longer needed, now that they are done in lisp.h.
7675
7676 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7677
7678 Cleanup string bytes checking.
7679 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
7680 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
7681 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7682 (check_sblock, compact_small_strings): Simplify.
7683
7684 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7685
7686 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
7687 These macros are confusing and no longer need to be defined, as
7688 the enum values now suffice. All uses replaced with definiens.
7689 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
7690
7691 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
7692
7693 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
7694 ($(BLD)/w32console.$(O)): Update dependencies.
7695
7696 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7697
7698 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
7699 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
7700 time. Adjust users.
7701 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
7702
7703 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
7704
7705 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
7706 setting sitelisp (Bug#12010).
7707
7708 2012-07-29 Eli Zaretskii <eliz@gnu.org>
7709
7710 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
7711
7712 * w32heap.c (cache_system_info):
7713 * w32.c (sys_rename):
7714 * w32proc.c (find_child_console, sys_kill): All users changed.
7715
7716 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7717
7718 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
7719
7720 2012-07-29 Eli Zaretskii <eliz@gnu.org>
7721
7722 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
7723
7724 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7725
7726 Cleanup statistics calculation in Fgarbage_collect.
7727 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
7728 Fix zombies percentage calculation. Simplify elapsed time calculation.
7729
7730 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7731
7732 Generalize marker debugging code under MARKER_DEBUG and use eassert.
7733 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
7734 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
7735 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
7736 (replace_range, replace_range_2, del_range_2): Change to eassert.
7737 * marker.c (byte_char_debug_check): Adjust style.
7738
7739 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7740
7741 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
7742 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
7743 long-ago-commented-out code that talks about "WIN32".
7744 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
7745 All uses changed.
7746
7747 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
7748
7749 Use Gnulib stdalign module (Bug#9772, Bug#9960).
7750 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
7751 Simplify by using alignof.
7752 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
7753 * lisp.h: Include <stdalign.h>.
7754 (GCALIGNMENT): New macro and constant.
7755 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
7756 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
7757 (stdalign): New macro, if not already defined.
7758
7759 2012-07-28 Eli Zaretskii <eliz@gnu.org>
7760
7761 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
7762 * w32inevt.c: Include w32inevt.h.
7763 (w32_read_console_input): New inline function, calls either
7764 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
7765 w32_console_unicode_input.
7766 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
7767 (w32_kbd_patch_key, key_event): Use the codepage returned by
7768 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
7769 (key_event): use uChar.UnicodeChar only if
7770 w32_console_unicode_input is non-zero.
7771
7772 * w32console.c: Include w32heap.h.
7773 <w32_console_unicode_input>: New global variable.
7774 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
7775 family of Windows, zero otherwise.
7776
7777 * w32inevt.h: Declare w32_console_unicode_input.
7778
7779 * xdisp.c (init_iterator): Don't reference tip_frame in a build
7780 --without-x. (Bug#11742)
7781
7782 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7783
7784 Adjust GDB to reflect pvec_type changes (Bug#12036).
7785 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
7786 2012-07-04 changes to pseudovector representation.
7787 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
7788
7789 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
7790
7791 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
7792 bus address.
7793 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
7794
7795 2012-07-27 Eli Zaretskii <eliz@gnu.org>
7796
7797 * alloc.c (listn): Fix the order the arguments are consed onto the
7798 list.
7799
7800 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
7801 enumeration constants, as PURE and HEAP are too general, and clash
7802 with other headers and sources, such as gmalloc.c and the
7803 MS-Windows system headers. All users changed.
7804
7805 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7806
7807 Revert last save_excursion_save and save_excursion_restore changes.
7808 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
7809 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
7810
7811 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7812
7813 Fix recently-introduced typos in Windows port.
7814 Reported by Martin Rudalics <rudalics@gmx.at>.
7815 * w32.c (init_environment): Replace comma with semicolon.
7816 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
7817
7818 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7819
7820 Improve GDB symbol export (Bug#12036).
7821 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
7822 arms of an 'if', not using conditional expressions; otherwise GDB
7823 complains about the types in the unevaluated arm when the argument
7824 is an integer literal.
7825 (xgetint): Simplify expression.
7826 * alloc.c (gdb_make_enums_visible): New constant. This ports to
7827 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
7828 Zaretskii in <http://bugs.gnu.org/12036#13>.
7829 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
7830 needed now that we have gdb_make_enums_visible.
7831 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
7832 (enum enum_USE_LSB_TAG):
7833 New enum types, packaging up enums that need to be exported to GDB.
7834
7835 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7836
7837 Utility function to make a list from specified amount of objects.
7838 * lisp.h (enum constype): New datatype.
7839 (listn): New prototype.
7840 * alloc.c (listn): New function.
7841 (Fmemory_use_count, syms_of_alloc): Use it.
7842 * buffer.c (syms_of_buffer): Likewise.
7843 * callint.c (syms_of_callint): Likewise.
7844 * charset.c (define_charset_internal): Likewise.
7845 * coding.c (syms_of_coding): Likewise.
7846 * keymap.c (syms_of_keymap): Likewise.
7847 * search.c (syms_of_search): Likewise.
7848 * syntax.c (syms_of_syntax): Likewise.
7849 * w32.c (init_environment): Likewise.
7850 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
7851 * xdisp.c (syms_of_xdisp): Likewise.
7852 * xfns.c (syms_of_xfns): Likewise.
7853
7854 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7855
7856 Fast save_excursion_save and save_excursion_restore.
7857 * lisp.h (struct Lisp_Excursion): New data type.
7858 (PVEC_EXCURSION): New pseudovector type.
7859 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
7860 to deal with it. Adjust comments.
7861 (init_marker, attach_marker): New prototype.
7862 (unchain_marker): Adjust prototype.
7863 * marker.c (attach_marker): Change to global.
7864 (init_marker): New function.
7865 * alloc.c (Fmake_marker, build_marker): Use it.
7866 (build_marker): More easserts.
7867 (mark_object): Handle struct Lisp_Excursion.
7868 * editfns.c (save_excursion_save, save_excursion_restore):
7869 Reimplement to use struct Lisp_Excursion. Add comments.
7870
7871 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7872
7873 Fix export of symbols to GDB (Bug#12036).
7874 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
7875 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
7876 emacs.c, as this is a more-suitable home. Had this been done earlier
7877 the fix for 12036 would have avoided some of the problems noted in
7878 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
7879 would have been more obvious.
7880 * emacs.c: Do not include <verify.h>; no longer needed.
7881 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
7882 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
7883 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7884 Remove; now done in lisp.h.
7885 * lisp.h (PUBLISH_TO_GDB): New macro.
7886 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
7887 (DATA_SEG_BITS): Use it.
7888 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
7889 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
7890 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
7891 not be usable in #if. This simplifies things.
7892
7893 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
7894
7895 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
7896
7897 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7898
7899 Simplify export of symbols to GDB (Bug#12036).
7900 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
7901 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
7902 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
7903 Adjust to changes in lisp.h and emacs.c, by using
7904 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
7905 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
7906 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
7907 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
7908 instead of gdb_valbits.
7909 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7910 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7911 instead of gdb_array_mark_flag.
7912 (xboolvector): Get size from $->size, not $->header.size.
7913 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7914 (xreload, hook-run, hookpost-run): Remove.
7915 * emacs.c: Include <verify.h>.
7916 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7917 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7918 Remove.
7919 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7920 (gdb_USE_LSB_TAG): New enum constants.
7921 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7922 Also define these as enum constants, so they're visible to GDB.
7923 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7924 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7925 as constants, so they're visible to GDB.
7926 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7927 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7928 Now enum constants, not macros, so they're visible to GDB.
7929 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7930 more convenient now. All uses changed.
7931 (VALMASK) [USE_LSB_TAG]: Also define in this case.
7932 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
7933
7934 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
7935
7936 Explicitly free restriction data that are not needed anymore.
7937 * editfns.c (save_restriction_restore): Free restriction data.
7938
7939 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
7940
7941 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
7942 add argument, tune behavior, and adjust all callers.
7943
7944 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
7945
7946 Use typedef for EMACS_INT, EMACS_UINT.
7947 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
7948 than macros. This simplifies debugging in the usual case, since
7949 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7950 and it allows expressions involving EMACS_INT casts.
7951 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
7952
7953 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
7954
7955 * nsterm.m (ns_read_socket): Return early if there is a modal
7956 window (Bug#12043).
7957
7958 2012-07-25 Martin Rudalics <rudalics@gmx.at>
7959
7960 * frame.c (Fredirect_frame_focus): In doc-string don't mention
7961 that FOCUS-FRAME can be omitted.
7962
7963 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
7964
7965 Adjust buffer text indirection counters at the end of Fkill_buffer.
7966 * buffer.c (Fkill_buffer): Adjust indirection counters when the
7967 buffer is definitely dead. This should really fix an issue reported
7968 by Christoph Scholtes again. (Bug#12007).
7969 (init_buffer_once): Initialize indirection counters of
7970 buffer_defaults and buffer_local_symbols (for sanity and safety).
7971
7972 2012-07-24 Eli Zaretskii <eliz@gnu.org>
7973
7974 * xdisp.c (init_iterator): Don't compute dimensions of truncation
7975 and continuation glyphs on tooltip frames, leave them at zero.
7976 Avoids continued lines in tooltips. (Bug#11832)
7977
7978 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
7979
7980 Simplify copy_overlay.
7981 * buffer.c (copy_overlay): Simplify. Use build_marker.
7982 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
7983
7984 2012-07-23 Eli Zaretskii <eliz@gnu.org>
7985
7986 * print.c (print_object): Don't crash when a frame's name is nil
7987 or invalid. (Bug#12025)
7988
7989 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7990 it signals an error when a tooltip frame is being created.
7991
7992 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7993
7994 Cleanup miscellaneous objects allocation and initialization.
7995 * alloc.c (allocate_misc): Change to static. Add argument to
7996 specify the subtype. Adjust comment and users.
7997 (build_overlay): New function.
7998 * buffer.c (copy_overlays, Fmake_overlay): Use it.
7999 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8000 (allocate_misc): Remove prototype.
8001 (build_overlay): Add prototype.
8002
8003 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8004
8005 Swap buffer text indirection counters in Fbuffer_swap_text.
8006 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8007 This avoids crash reported by Christoph Scholtes at
8008 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8009
8010 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8011
8012 * nsmenu.m (Popdown_data): New struct.
8013 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8014 free Popdown_data.
8015 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8016 (initWithContentRect): Make imgView and contentView non-static
8017 and autorelease them. Also autorelease img and matrix (Bug#12005).
8018 (dealloc): Remove (Bug#12005).
8019
8020 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8021
8022 Adjust consing_since_gc when objects are explicitly freed.
8023 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8024 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8025 (free_cons, free_misc): Subtract object size from consing_since_gc.
8026
8027 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8028
8029 Simplify and cleanup markers positioning code.
8030 * marker.c (attach_marker): More useful eassert.
8031 (live_buffer, set_marker_internal): New function.
8032 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8033 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8034
8035 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8036
8037 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8038 as it's limited by the amount of memory, not by INT_MAX.
8039
8040 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8041
8042 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8043 in special-event-map. See the discussion at
8044 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8045 for the reasons.
8046
8047 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8048 info.dwItemData. Fixes crashes on 64-bit Windows.
8049 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8050
8051 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8052
8053 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8054 (conversationIdentifier): Return value is NSInteger.
8055 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8056
8057 2012-07-21 Chong Yidong <cyd@gnu.org>
8058
8059 * window.c (decode_any_window): Signal an error if the window is
8060 on a dead frame (Bug#11984).
8061
8062 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8063
8064 Add indirection counting to speed up Fkill_buffer.
8065 * buffer.h (struct buffer): New member.
8066 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8067 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8068 base buffer indirection counter.
8069 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8070 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8071 through buffer list if indirection counter is 0.
8072
8073 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8074
8075 Extend the value returned by Fgarbage_collect with heap statistics.
8076 * alloc.c (Qheap): New symbol.
8077 (syms_of_alloc): DEFSYM it.
8078 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8079 (Fmemory_free): Remove.
8080 (syms_of_alloc): Don't defsubr it.
8081 * buffer.c (Fcompact_buffer): Remove.
8082 (syms_of_buffer): Don't defsubr it.
8083
8084 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8085
8086 Make maybe_gc inline.
8087 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8088 * lisp.h (consing_since_gc, gc_relative_threshold)
8089 (memory_full_cons_threshold): Revert declaration.
8090 (maybe_gc): Remove prototype, define as inline.
8091 * alloc.c: Remove old commented-out code.
8092 (consing_since_gc, gc_relative_threshold)
8093 (memory_full_cons_threshold): Revert to global.
8094 (maybe_gc): Remove.
8095
8096 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8097
8098 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8099 * lisp.h (build_unibyte_string): New function.
8100 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8101 * sysdep.c, w32fns.c, xfns.c: Use it.
8102 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8103 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8104 Adjust users accordingly.
8105 * font.h (font_open_by_name): Adjust prototype.
8106
8107 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8108
8109 Cleanup calls to Fgarbage_collect.
8110 * lisp.h (maybe_gc): New prototype.
8111 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8112 Remove declarations.
8113 * alloc.c (maybe_gc): New function.
8114 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8115 Make them static.
8116 * bytecode.c (MAYBE_GC): Use maybe_gc.
8117 * eval.c (eval_sub, Ffuncall): Likewise.
8118 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8119 to avoid dependency from auto-save feature.
8120
8121 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8122
8123 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8124 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8125 'for_each_per_buffer_object_at'.
8126 All uses changed. It's better to use upper-case for macros that
8127 cannot be implemented as functions, to give the reader a clue
8128 that they're special.
8129
8130 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8131
8132 * alloc.c (Fgarbage_collect): Tweak docstring.
8133
8134 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8135
8136 Tweak the value returned from Fgarbage_collect again.
8137 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8138 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8139 Adjust documentation.
8140 (total_vector_bytes): Rename to total_vector_slots, adjust
8141 accounting.
8142 (total_free_vector_bytes): Rename to total_free_vector_slots,
8143 adjust accounting.
8144 (Qstring_bytes, Qvector_slots): New symbols.
8145 (syms_of_alloc): DEFSYM them.
8146
8147 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8148
8149 Buffer compaction primitive which may be used from Lisp.
8150 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8151 (syms_of_buffer): Register Fcompact_buffer.
8152 * alloc.c (Fgarbage_collect): Use compact_buffer.
8153 * buffer.h (compact_buffer): New prototype.
8154 (struct buffer_text): New member.
8155
8156 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8157
8158 New macro to iterate over all buffers, miscellaneous cleanups.
8159 * lisp.h (all_buffers): Remove declaration.
8160 * buffer.h (all_buffers): Add declaration, with comment.
8161 (for_each_buffer): New macro.
8162 * alloc.c (Fgarbage_collect, mark_object): Use it.
8163 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8164 (init_buffer): Likewise.
8165 * data.c (Fset_default): Likewise.
8166 * coding.c (code_conversion_restore): Remove redundant check
8167 for dead buffer.
8168 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8169
8170 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8171
8172 Fix bug that created negative-length intervals.
8173 * intervals.c (merge_interval_right, merge_interval_left):
8174 Do not zero out this interval if it is absorbed by its children,
8175 as this interval's total length doesn't change in that case. See
8176 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8177
8178 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8181 when invoking (make-bool-vector N t) and N is a positive
8182 multiple of 8 -- the last 8 bits were mistakenly cleared.
8183
8184 Remove some struct layout assumptions in bool vectors.
8185 * alloc.c (bool_header_size): New constant.
8186 (header_size, word_size): Move earlier, as they're now used earlier.
8187 Use 'word_size' in a few more places, where it's appropriate.
8188 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8189 padding before the data member of a bool vector.
8190 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8191 than doing the check by hand with an abort ().
8192
8193 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8194
8195 * eval.c (Fdefvar): Don't check constants since we only set the var if
8196 it's not yet defined anyway (bug#11904).
8197
8198 * lisp.h (last_undo_boundary): Declare new var.
8199 * keyboard.c (command_loop_1): Set it.
8200 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8201 were auto-added by the command loop (bug#11774).
8202
8203 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8204
8205 * w32font.c (Qsymbol): Remove local definition.
8206 (syms_of_w32font): Don't DEFSYM it.
8207
8208 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8209
8210 Fix sweep_vectors to handle large bool vectors correctly.
8211 * alloc.c (sweep_vectors): Account total_vector_bytes for
8212 bool vectors larger than VBLOCK_BYTES_MAX.
8213
8214 2012-07-18 Chong Yidong <cyd@gnu.org>
8215
8216 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8217 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8218
8219 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8220
8221 Return more descriptive data from Fgarbage_collect.
8222 Suggested by Stefan Monnier in
8223 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8224 * alloc.c (bounded_number): New function.
8225 (total_buffers, total_vectors): New variable.
8226 (total_string_size): Rename to total_string_bytes, adjust users.
8227 (total_vector_size): Rename to total_vector_bytes, adjust users.
8228 (sweep_vectors): Account total_vectors and total_vector_bytes.
8229 (Fgarbage_collect): New return value. Adjust documentation.
8230 (gc_sweep): Account total_buffers.
8231 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8232 (VECTOR_SIZE): Remove.
8233 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8234 (Qinterval, Qmisc): New symbols.
8235 (syms_of_data): Initialize them.
8236 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8237 (Qcons, Qbuffer): New declarations.
8238
8239 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8240
8241 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8242 Round up, not down. Improve doc.
8243
8244 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8245
8246 Restore old code in allocate_string_data to avoid Faset breakage.
8247 Reported by Julien Danjou <julien@danjou.info> in
8248 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8249 * alloc.c (allocate_string_data): Restore old code with minor
8250 adjustments, fix comment to explain this subtle issue.
8251
8252 2012-07-17 Eli Zaretskii <eliz@gnu.org>
8253
8254 Remove FILE_SYSTEM_CASE.
8255 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8256
8257 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8258 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8259 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8260 call-process-region passes it through expand-file-name.
8261
8262 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8263
8264 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8265
8266 Fix crash when creating indirect buffer (Bug#11917)
8267 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8268 Don't handle unbound variables specially if non-zero.
8269 (Fbuffer_local_variables): Pass zero.
8270 (clone_per_buffer_values): Pass non-zero.
8271
8272 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8273
8274 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8275 to make the loop interruptible.
8276
8277 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8278
8279 * gnutls.c (emacs_gnutls_handshake): Only retry if
8280 GNUTLS_E_INTERRUPTED.
8281
8282 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8283
8284 Cleanup and convert miscellaneous checks to eassert.
8285 * alloc.c (mark_interval): Fix comment, partially rephrase
8286 old comment from intervals.h (see below).
8287 * intervals.c (find_interval, adjust_intervals_for_insertion)
8288 (delete_interval, adjust_intervals_for_deletion)
8289 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8290 Convert to eassert.
8291 (adjust_intervals_for_insertion, make_new_interval):
8292 Remove obsolete and unused code.
8293 * intervals.h (struct interval): Remove obsolete comment.
8294 * textprotp.c (erase_properties): Remove unused code.
8295 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8296 (Fremove_list_of_text_properties): Convert to eassert.
8297
8298 2012-07-17 Chong Yidong <cyd@gnu.org>
8299
8300 * editfns.c (Finsert_char): Doc fix.
8301
8302 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8303
8304 Fix previous change to make Fmemory_free always accurate.
8305 * alloc.c (make_interval): Update total_free_intervals.
8306 (make_float): Likewise for total_free_floats.
8307 (free_cons, Fcons): Likewise for total_free_conses.
8308 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8309 Likewise for total_free_vector_bytes.
8310 (Fmake_symbol): Likewise for total_free_symbols.
8311 (bytes_free): Remove.
8312
8313 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8314
8315 Simple free memory accounting feature.
8316 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8317 (sweep_vectors): Accumulate size of free vectors.
8318 (Fgarbage_collect): Setup bytes_free.
8319 (Fmemory_free): New function.
8320 (syms_of_alloc): Register it.
8321
8322 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8323
8324 Cleanup overlays checking.
8325 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8326 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8327 eassert and OVERLAYP.
8328 (sort_overlays): Change to use OVERLAYP.
8329
8330 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8331
8332 * editfns.c (Finsert_char): Make it interactive, and make the
8333 second arg optional. Copy interactive spec and docstring from
8334 ucs-insert.
8335
8336 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8337
8338 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8339 Unlike the other wrapped functions, fabs has an unspecified
8340 effect on errno.
8341
8342 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8343
8344 * nsterm.m (keyDown): Interpret flags without left/right bits
8345 as the left key (Bug#11670).
8346
8347 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8348
8349 Remove empty and useless init functions.
8350 * lisp.h (init_character_once, init_fns, init_image)
8351 (init_filelock, init_sound): Remove prototype.
8352 * character.c (init_character_once): Remove.
8353 * filelock.c (init_filelock): Likewise.
8354 * fns.c (init_fns): Likewise.
8355 * image.c (init_image): Likewise.
8356 * sound.c (init_sound): Likewise.
8357 * emacs.c (main): Adjust accordingly.
8358
8359 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8360
8361 * gtkutil.h: Tiny cleanups.
8362 (use_old_gtk_file_dialog): Remove useless declaration.
8363 (xg_uses_old_file_dialog): Add suggested const attribute.
8364
8365 2012-07-15 Eli Zaretskii <eliz@gnu.org>
8366
8367 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8368 (bidi_paragraph_init): Use it to limit search forward for a strong
8369 directional character in abnormally large paragraphs full of
8370 neutral or weak characters. (Bug#11943)
8371
8372 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8373
8374 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8375 the toolbar (Bug#9451).
8376 (xg_make_tool_item): Give the widget event box a transparent
8377 background.
8378
8379 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8380
8381 Cleanup basic allocation variables and functions.
8382 * alloc.c (ignore_warnings, init_intervals, init_float)
8383 (init_cons, init_symbol, init_marker): Remove.
8384 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8385 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8386 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8387 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8388 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8389 (staticidx, init_alloc_once, init_strings, free_ablock):
8390 Remove redundant initialization.
8391 * fns.c (init_weak_hash_tables): Remove.
8392 * lisp.h (init_weak_hash_tables): Remove prototype.
8393
8394 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8395
8396 Use zero_vector where appropriate.
8397 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8398 accordingly.
8399 * lisp.h (zero_vector): New declaration.
8400 * font.c (null_vector): Remove.
8401 (syms_of_font): Remove initialization and staticpro.
8402 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8403 * keymap.c (Faccessible_keymaps): Likewise.
8404
8405 2012-07-15 Leo Liu <sdl.web@gmail.com>
8406
8407 * fringe.c: Fix typo in comments.
8408
8409 2012-07-14 Leo Liu <sdl.web@gmail.com>
8410
8411 * fringe.c: Add a new bitmap exclamation-mark.
8412
8413 2012-07-14 Eli Zaretskii <eliz@gnu.org>
8414
8415 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8416
8417 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8418 (HAVE_MENUS): Don't define, defined by editing config.in with
8419 msdos/sed2v2.inp.
8420 (GMALLOC_INHIBIT_VALLOC): Don't define.
8421 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8422
8423 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
8424
8425 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8426
8427 2012-07-14 Glenn Morris <rgm@gnu.org>
8428
8429 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8430 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8431 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8432
8433 2012-07-13 Glenn Morris <rgm@gnu.org>
8434
8435 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8436
8437 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8438 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8439
8440 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8441
8442 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8443 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8444 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8445 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8446 where appropriate.
8447 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8448 as boolean expression.
8449 (x_set_window_size): Remove unused variable toolbar.
8450 (ns_get_color_default, ns_mod_to_lisp): Remove.
8451 (ns_mouse_position): Remove unused variables xchar and ychar.
8452 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8453 (ns_set_vertical_scroll_bar): Remove unused variable count.
8454 (ns_delete_terminal): Remove unused variable i.
8455 (ns_term_init): Remove unused variables r, g and b.
8456 (mouseDown): Remove unused variable window.
8457 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8458 (initFrameFromEmacs): Remove unused variable vbextra.
8459 (mouseEntered): Remove unused variables p and dpyinfo.
8460 (mouseExited): Remove unused variables p and r.
8461 (ns_define_frame_cursor, ns_clear_frame_area)
8462 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8463 (menuDown): Assign [sender tag] to variable and cast the variable.
8464
8465 * nsterm.h (menuDown): Add id as type to argument sender.
8466 (ns_display_info_for_name): Add Lisp_Object argument.
8467 (ns_term_init): Add Lisp_Object argument.
8468 (ns_map_event_to_object): Add void argument.
8469 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8470 prototype with arguments and only declare if __OBJC__.
8471 (nxatoms_of_nsselect): Add void argument.
8472 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8473 (ns_alloc_autorelease_pool): Add void argument.
8474 (ns_release_autorelease_pool): Add void* argument.
8475 (ns_get_defaults_value): Add const char* argument.
8476
8477 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8478 (initFromContents): Use SSDATA where appropriate.
8479 (ns_update_menubar): Add braces to ambigous if-else.
8480 (initWithTitle): Put () around assignment in if statement.
8481 (ns_menu_show): Remove unused variables window and keymap.
8482 (update_frame_tool_bar): Remove unused variable selected_p.
8483 (initWithContentRect): Remove unused variable this_cmd_name.
8484
8485 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8486 appropriate.
8487 (setXBMColor): Remove unused variable len.
8488 (setPixmapData): Put () around assignment in loop statement.
8489
8490 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8491 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8492 where appropriate.
8493 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8494 around assignment in loop statement.
8495 (nsfont_open): Remove unused variable i.
8496 (nsfont_open): Remove unused variable len.
8497 (nsfont_draw): Remove unused variable cs.
8498
8499 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8500 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8501 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8502 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8503 (Fns_font_name, Fns_perform_service)
8504 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8505 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8506 (ns_set_name): Remove unused variable view.
8507 (x_set_menu_bar_lines): Remove unused variable olines.
8508 (x_set_tool_bar_lines): Remove unused variable root_window.
8509 (Fns_list_colors): Put () around assignment in while statement.
8510 (Fns_perform_service): Remove unused variable len.
8511 (Fns_display_usable_bounds): Remove unused variable top.
8512 (syms_of_nsfns): Remove unused variable i.
8513
8514 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8515 memcpy (Bug#11907).
8516
8517 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
8518
8519 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8520 and free it with DestroyExceptionInfo (Bug#11558).
8521
8522 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
8523
8524 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8525 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
8526 Set here, not in nt/config.nt.
8527
8528 2012-07-13 Eli Zaretskii <eliz@gnu.org>
8529
8530 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
8531 cursor overflow into the last glyph on display line when the right
8532 fringe is off. (Bug#11832)
8533
8534 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
8535
8536 * xdisp.c (produce_special_glyphs): Now static.
8537 * dispextern.h (produce_special_glyphs): Remove decl.
8538
8539 2012-07-13 Glenn Morris <rgm@gnu.org>
8540
8541 * s/bsd-common.h, s/cygwin.h: Remove empty files.
8542 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
8543
8544 * s/usg5-4-common.h (USG, USG5):
8545 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8546 * s/sol2-6.h (SOLARIS2):
8547 * s/irix6-5.h (IRIX6_5):
8548 * s/hpux10-20.h (USG, USG5, HPUX):
8549 * s/gnu-linux.h (USG, GNU_LINUX):
8550 * s/freebsd.h (BSD_SYSTEM):
8551 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8552 * s/cygwin.h (CYGWIN):
8553 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8554 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8555
8556 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
8557
8558 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
8559
8560 2012-07-13 Glenn Morris <rgm@gnu.org>
8561
8562 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8563
8564 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8565
8566 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8567 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8568
8569 2012-07-12 Glenn Morris <rgm@gnu.org>
8570
8571 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
8572
8573 * process.c (init_process_emacs): Rename from init_process.
8574 The old name is also the name of a Mach system call.
8575 * lisp.h, emacs.c: Update for this name change.
8576 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8577 longer needed.
8578
8579 2012-07-12 Eli Zaretskii <eliz@gnu.org>
8580
8581 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
8582 memmove call that removes glyphs covered by the left truncation
8583 glyph. Improve commentary.
8584 (display_line): Fix display of continuation glyphs on GUI frames
8585 when the right fringe is turned off and variable-size fonts are
8586 used in the window. Move the code that appends a stretch glyph to
8587 produce_special_glyphs, so that it could be used for truncation
8588 and continuation glyphs alike.
8589 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
8590 glyph of a suitably computed width, to align the special glyphs at
8591 the window margin. Code moved from display_line. (Bug#11832)
8592
8593 2012-07-12 Glenn Morris <rgm@gnu.org>
8594
8595 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
8596
8597 * s/gnu-linux.h, s/hpux10-20.h:
8598 Do not unconditionally define HAVE_XRMSETDATABASE.
8599
8600 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
8601
8602 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
8603
8604 Fix typos that broke OS X build.
8605 Reported by Randal L. Schwartz in
8606 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
8607 * nsterm.m (ns_timeout): Add missing local decl.
8608 (ns_get_color): snprintf -> sprintf, to fix typo.
8609
8610 2012-07-12 Glenn Morris <rgm@gnu.org>
8611
8612 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
8613 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
8614 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
8615 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
8616
8617 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
8618 Move PTY_OPEN to configure.
8619
8620 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8621 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
8622 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
8623
8624 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
8625
8626 Use empty_unibyte_string where applicable.
8627 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
8628 * lread.c (read1): Likewise.
8629 * xsettings.c (syms_of_xsettings): Likewise.
8630
8631 2012-07-12 Glenn Morris <rgm@gnu.org>
8632
8633 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
8634 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
8635 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
8636 * s/hpux10-20.h (RUN_TIME_REMAP):
8637 * s/bsd-common.h (TABDLY): Move to configure.
8638
8639 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
8640
8641 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
8642
8643 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8644 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
8645
8646 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
8647
8648 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
8649 * s/template.h: Move NARROWPROTO to configure.
8650
8651 2012-07-11 Glenn Morris <rgm@gnu.org>
8652
8653 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
8654 unused since 2011-01-17 change to systty.h.
8655
8656 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
8657 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8658 Move HAVE_PTYS and HAVE_SOCKETS to configure.
8659
8660 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8661
8662 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
8663
8664 2012-07-11 Glenn Morris <rgm@gnu.org>
8665
8666 * s/darwin.h, s/gnu-linux.h, s/template.h:
8667 Move INTERRUPT_INPUT to configure.
8668
8669 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8670
8671 Minor adjustments to interning code.
8672 * lisp.h (intern, intern_c_string): Redefine as static inline
8673 wrappers for intern_1 and intern_c_string_1, respectively.
8674 (intern_1, intern_c_string_1): Rename prototypes.
8675 * lread.c (intern_1, intern_c_string_1, oblookup):
8676 Simplify Vobarray checking.
8677 * font.c (font_intern_prop): Likewise. Adjust comment.
8678 * w32font.c (intern_font_name): Likewise.
8679
8680 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
8681
8682 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
8683
8684 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
8685 of Fcar/Fcdr if possible.
8686 * font.c (check_otf_features): Likewise.
8687 * fontset.c (Fnew_fontset): Likewise.
8688 * gnutls.c (Fgnutls_boot): Likewise.
8689 * minibuf.c (read_minibuf): Likewise.
8690 * msdos.c (IT_set_frame_parameters): Likewise.
8691 * xmenu.c (Fx_popup_dialog): Likewise.
8692 * w32menu.c (Fx_popup_dialog): Likewise.
8693
8694 2012-07-11 Glenn Morris <rgm@gnu.org>
8695
8696 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
8697 since nothing has defined it on these platforms.
8698
8699 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
8700 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
8701
8702 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8703 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8704 Move CLASH_DETECTION to configure.
8705
8706 * s/gnu.h: Remove file, which is now empty.
8707
8708 * s/gnu.h, s/gnu-linux.h:
8709 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
8710
8711 2012-07-11 John Wiegley <johnw@newartisans.com>
8712
8713 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
8714 function attribute, so we only use it if it exists in the
8715 compiler.
8716
8717 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Avoid call to strlen in fast_c_string_match_ignore_case.
8720 * search.c (fast_c_string_match_ignore_case): Change to use
8721 length argument. Adjust users accordingly.
8722 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
8723
8724 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8725
8726 Assume mkdir, rmdir.
8727 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
8728 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
8729
8730 Assume rename.
8731 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
8732
8733 Assume perror.
8734 * s/hpux10-20.h (HAVE_PERROR): Remove.
8735 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
8736 Remove dummy definition, as this problem was obsolete long ago.
8737
8738 Assume strerror.
8739 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
8740
8741 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8742
8743 Avoid calls to strlen in font processing functions.
8744 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
8745 (font_open_by_name): Change to use length argument.
8746 Adjust users accordingly.
8747 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
8748 Adjust prototypes.
8749 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
8750 Change to return ptrdiff_t.
8751 (xfont_list_pattern, xfont_match): Use length returned by
8752 xfont_decode_coding_xlfd.
8753 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
8754
8755 2012-07-11 Glenn Morris <rgm@gnu.org>
8756
8757 * s/darwin.h, s/freebsd.h, s/netbsd.h:
8758 Move DONT_REOPEN_PTY to configure.
8759
8760 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
8761 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
8762
8763 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
8764
8765 Remove "#define unix" that is no longer needed (Bug#11905).
8766 * s/aix4-2.h (unix): Remove; no longer needed.
8767
8768 EMACS_TIME simplification (Bug#11875).
8769 This replaces macros (which typically do not work in GDB)
8770 with functions, typedefs and enums, making the code easier to debug.
8771 The functional style also makes code easier to read and maintain.
8772 * systime.h: Include <sys/time.h> on all hosts, not just if
8773 WINDOWSNT, since 'struct timeval' is needed in general.
8774 (EMACS_TIME): Now a typedef, not a macro.
8775 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
8776 not macros.
8777 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
8778 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
8779 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
8780 (EMACS_TIME_LE): Now functions, not macros.
8781 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
8782 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
8783 which are not functions. All uses rewritten to use:
8784 (make_emacs_time): New function.
8785 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
8786 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
8787 not functions. All uses rewritten to use the following, respectively:
8788 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
8789 (add_emacs_time, sub_emacs_time): New functions.
8790 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
8791 * fileio.c (Fcopy_file):
8792 * xterm.c (XTflash): Get the current time closer to when it's used.
8793 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
8794
8795 * bytecode.c (targets): Suppress -Woverride-init warnings.
8796
8797 Simplify by avoiding confusing use of strncpy etc.
8798 * doc.c (Fsnarf_documentation):
8799 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
8800 * frame.c (Fmake_terminal_frame):
8801 * gtkutil.c (get_utf8_string):
8802 * lread.c (openp):
8803 * nsmenu.m (ns_update_menubar):
8804 * regex.c (regerror):
8805 Prefer memcpy to strncpy and strncat when either will do.
8806 * fileio.c (Fsubstitute_in_file_name):
8807 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
8808 (menu_separator_name_p):
8809 * nsmenu.m (ns_update_menubar):
8810 Prefer memcmp to strncmp when either will do.
8811 * nsterm.m: Include <ftoastr.h>.
8812 (ns_get_color):
8813 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
8814 Prefer snprintf to strncpy.
8815 * nsterm.m (ns_term_init):
8816 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
8817 * nsterm.m (ns_term_init):
8818 Avoid the need for strncpy, by using build_string or
8819 make_unibyte_string directly. Use dtoastr, not snprintf.
8820 * process.c (Fmake_network_process): Diagnose service names that
8821 are too long, rather than silently truncating them or creating
8822 non-null-terminated names.
8823 (Fnetwork_interface_info): Likewise, for interface names.
8824 * sysdep.c (system_process_attributes) [GNU_LINUX]:
8825 Prefer sprintf to strncat.
8826 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
8827 Prefer vsnprintf to vsprintf + strncpy.
8828
8829 2012-07-10 Glenn Morris <rgm@gnu.org>
8830
8831 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
8832 Clarify fallback case.
8833
8834 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8835
8836 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
8837 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
8838 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
8839 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
8840 where argument type is known to be a Lisp_Cons.
8841
8842 2012-07-10 Tom Tromey <tromey@redhat.com>
8843
8844 * bytecode.c (BYTE_CODE_THREADED): New macro.
8845 (BYTE_CODES): New macro. Replaces all old byte-code defines.
8846 (enum byte_code_op): New type.
8847 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
8848 (exec_byte_code): Use them. Use token threading when applicable.
8849
8850 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8851
8852 Optimize pure C strings initialization.
8853 * lisp.h (make_pure_string): Fix prototype.
8854 (build_pure_c_string): New function, defined as static inline. This
8855 provides a better opportunity to optimize away calls to strlen when
8856 the function is called with compile-time constant argument.
8857 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
8858 argument, adjust users accordingly. Use build_pure_c_string where
8859 appropriate.
8860 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
8861 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
8862 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8863
8864 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8865
8866 Avoid calls to strlen in miscellaneous functions.
8867 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
8868 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
8869 * lread.c (openp): Likewise.
8870
8871 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8872
8873 Avoid calls to strlen in path processing functions.
8874 * fileio.c (file_name_as_directory): Add comment. Change to add
8875 srclen argument and return the length of result. Adjust users
8876 accordingly.
8877 (directory_file_name): Fix comment. Change to add srclen argument,
8878 swap 1st and 2nd arguments to obey the common convention.
8879 Adjust users accordingly.
8880 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
8881
8882 2012-07-10 Glenn Morris <rgm@gnu.org>
8883
8884 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
8885 Move PENDING_OUTPUT_COUNT definition to configure.
8886
8887 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
8888 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
8889 * s/gnu.h (DATA_START): Move definitions to configure.
8890
8891 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
8892 We include usg5-4-common.h, which defines them both.
8893
8894 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
8895 O_RDONLY already includes it).
8896
8897 Stop ns builds setting the EMACSLOADPATH environment variable.
8898 * nsterm.m (ns_load_path): Rename from ns_init_paths.
8899 Now it does not set EMACSLOADPATH, just returns the load-path string.
8900 * nsterm.h: Update accordingly.
8901 * lread.c [HAVE_NS]: Include nsterm.h.
8902 (init_lread) [HAVE_NS]: Use ns_load_path.
8903 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
8904
8905 2012-07-09 Glenn Morris <rgm@gnu.org>
8906
8907 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
8908 since the included bsd-common.h does so.
8909
8910 Stop ns builds setting the EMACSPATH environment variable.
8911 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8912 (ns_init_paths): Do not set EMACSPATH.
8913 * nsterm.h (ns_exec_path): Add it.
8914 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8915 Use ns_exec_path.
8916
8917 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8918
8919 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8920
8921 * process.c (wait_reading_process_output): 'waitchannels' was unset
8922 when read_kbd || !NILP (wait_for_cell); fix this.
8923
8924 Add GCC-style 'const' attribute to functions that can use it.
8925 * character.h (char_resolve_modifier_mask):
8926 * keyboard.h (make_ctrl_char):
8927 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8928 (init_character_once, next_almost_prime, init_fns, init_image)
8929 (flush_pending_output, init_sound):
8930 * mem-limits.h (start_of_data):
8931 * menu.h (finish_menu_items):
8932 Add ATTRIBUTE_CONST.
8933 * emacs.c (DEFINE_DUMMY_FUNCTION):
8934 Declare the dummy function with ATTRIBUTE_CONST.
8935 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
8936 Add decls with ATTRIBUTE_CONST.
8937
8938 Minor improvements to make_formatted_string.
8939 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
8940 where int is good enough, as vsprintf returns an int.
8941 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
8942
8943 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8944
8945 Use make_formatted_string to avoid double length calculation.
8946 * lisp.h (make_formatted_string): New prototype.
8947 * alloc.c (make_formatted_string): New function.
8948 * buffer.c (Fgenerate_new_buffer_name): Use it.
8949 * dbusbind.c (syms_of_dbusbind): Likewise.
8950 * editfns.c (Fcurrent_time_zone): Likewise.
8951 * filelock.c (get_boot_time): Likewise.
8952 * frame.c (make_terminal_frame, set_term_frame_name)
8953 (x_report_frame_params): Likewise.
8954 * image.c (gs_load): Likewise.
8955 * minibuf.c (get_minibuffer): Likewise.
8956 * msdos.c (dos_set_window_size): Likewise.
8957 * process.c (make_process): Likewise.
8958 * xdisp.c (ensure_echo_area_buffers): Likewise.
8959 * xsettings.c (apply_xft_settings): Likewise.
8960
8961 2012-07-09 Glenn Morris <rgm@gnu.org>
8962
8963 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
8964 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
8965 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
8966 * nsterm.h (ns_etc_directory): Add it.
8967 * callproc.c [HAVE_NS]: Include nsterm.h.
8968 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
8969
8970 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8971
8972 Move marker debugging code under MARKER_DEBUG.
8973 * marker.c (MARKER_DEBUG): Move marker debugging code under
8974 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
8975 for bootstrap with --enable-checking (~3x slowdown reported
8976 by Juanma Barranquero <lekktu@gmail.com>).
8977 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
8978
8979 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
8980
8981 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
8982 See <http://bugs.gnu.org/11825#29>.
8983
8984 2012-07-08 Eli Zaretskii <eliz@gnu.org>
8985
8986 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
8987 has no font, use the frame's font. (Bug#11813)
8988 (display_line): Add commentary about displaying truncation glyphs
8989 on GUI frames.
8990 (produce_special_glyphs): Move here from term.c.
8991
8992 * term.c (produce_special_glyphs): Move to xdisp.c.
8993
8994 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
8995 section.
8996
8997 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
8998
8999 * xdisp.c (display_line): Avoid warning about implicit declaration
9000 of FRAME_FONT.
9001
9002 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9003
9004 * lisp.h: Remove empty conditional.
9005
9006 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9007
9008 * lread.c (load_path_check): Now static.
9009
9010 Fix some minor --with-ns problems found by static checking.
9011 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9012 (x_set_font) [!HAVE_X_WINDOWS]:
9013 * image.c (xpm_load_image) [HAVE_NS]:
9014 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9015 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9016 Remove unused local.
9017 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9018 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9019 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9020 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9021 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9022 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9023 Fix pointer signedness problem.
9024 * xfaces.c (FRAME_X_FONT_TABLE):
9025 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9026
9027 2012-07-07 Glenn Morris <rgm@gnu.org>
9028
9029 * lread.c (load_path_check): New function, split from init_lread.
9030 (init_lread): Reorganize. Motivation:
9031 If EMACSLOADPATH is set, check/warn about that rather than the
9032 defaults, which we are not going to use. Hence we can remove
9033 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9034 Don't warn if site-lisp directories are missing.
9035 If not installed, start from a blank load-path, since
9036 PATH_LOADSEARCH refers to the eventual installation directories.
9037
9038 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9039
9040 Support truncation and continuation glyphs on GUI frames, when
9041 fringes are disabled. (Bug#11832)
9042 * xdisp.c (init_iterator): Get dimensions of truncation and
9043 continuation glyphs even if on GUI frames.
9044 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9045 or both, are absent.
9046 (start_display, move_it_in_display_line_to): Handle the case of a
9047 GUI frame without a fringe to display continuation or truncation
9048 glyphs.
9049 (insert_left_trunc_glyphs): Support GUI frames: make sure
9050 truncation glyphs overwrite enough glyphs from the current line to
9051 have sufficient space in pixels.
9052 (display_line): Support truncation and continuation glyphs on GUI
9053 frames. If some spare pixels are left on the line after inserting
9054 the truncation glyphs, fill that space with a stretch glyph of a
9055 suitably computed width.
9056
9057 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9058 produce_glyphs, to support GUI sessions.
9059
9060 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9063
9064 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9065
9066 Do not require float-time's arg to fit in time_t (Bug#11825).
9067 This works better on hosts where time_t is unsigned, and where
9068 float-time is applied to the (negative) difference between two times.
9069 * editfns.c (decode_time_components): Last arg is now double *,
9070 not int *, and means to store all the result as a double, without
9071 worrying about whether the seconds part fits in time_t.
9072 All callers changed.
9073 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9074 All callers changed.
9075 (Ffloat_time): Do not fail merely because the specified time falls
9076 outside of time_t range.
9077
9078 2012-07-07 Glenn Morris <rgm@gnu.org>
9079
9080 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9081 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9082 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9083
9084 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
9085
9086 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9087 Update dependencies.
9088
9089 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9090
9091 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9094 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9095 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9096 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9097 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9098 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9099
9100 * xfont.c (compare_font_names): Redo to omit the need for casts.
9101
9102 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9103
9104 * xfns.c (Fx_change_window_property): Doc fix.
9105 * w32fns.c (Fx_change_window_property): Doc fix.
9106
9107 * w32fns.c (Fx_window_property): Accept the same arguments as the
9108 X Windows version. Doc fix.
9109 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9110
9111 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
9112 Eli Zaretskii <eliz@gnu.org>
9113
9114 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9115 Windows-specific code from nt/config.nt moved here.
9116 Obsolete settings removed.
9117
9118 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9119
9120 * process.c: Avoid unnecessary calls to gettime.
9121 (wait_reading_process_output): Don't get the time of day
9122 when gobbling data immediately and not waiting, as there's no need
9123 for it in that case. This removes a FIXME.
9124
9125 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9126
9127 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9128 is defined (Bug#11768).
9129
9130 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9131
9132 Fix marker debugging code.
9133 * marker.c (byte_char_debug_check): Do not perform the check
9134 if buffer is not multibyte.
9135 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9136 Call byte_char_debug_check with correct arguments.
9137
9138 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9139
9140 Compile marker debugging code only if ENABLE_CHECKING is defined.
9141 * marker.c (byte_char_debug_check, count_markers):
9142 Use only if ENABLE_CHECKING is defined.
9143 (byte_debug_flag): Remove.
9144 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9145 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9146
9147 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9148
9149 Avoid code repetition in marker-related functions.
9150 * marker.c (attach_marker): New function.
9151 (Fset_marker, set_marker_restricted, set_marker_both)
9152 (set_marker_restricted_both): Use it.
9153 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9154 Consistently rename charno to charpos.
9155 (marker_position): Add eassert.
9156 (marker_byte_position): Convert to eassert.
9157
9158 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9159
9160 Simplify list operations in unchain_overlay and unchain_marker.
9161 * buffer.c (unchain_overlay): Simplify. Add comment.
9162 * marker.c (unchain_marker): Simplify. Fix comments.
9163
9164 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9165
9166 Introduce fast path for the widely used marker operation.
9167 * alloc.c (build_marker): New function.
9168 * lisp.h (build_marker): New prototype.
9169 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9170 * composite.c (autocmp_chars): Likewise.
9171 * editfns.c (buildmark): Remove.
9172 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9173 (save_restriction_save): Use build_marker.
9174 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9175 * window.c (save_window_save): Likewise.
9176
9177 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9178
9179 Do not use Fdelete_overlay in delete_all_overlays
9180 to avoid redundant calls to unchain_overlay.
9181 * buffer.c (drop_overlay): New function.
9182 (delete_all_overlays, Fdelete_overlay): Use it.
9183 * minibuf.c (get_minibuffer): Fix comment.
9184
9185 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9186
9187 Port to OpenBSD 5.1 amd64.
9188 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9189 This is needed for OpenBSD, and should be harmless on all BSD systems.
9190 Also, include <sys/sysctl.h>, as it should be available on all
9191 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9192 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9193 use p_pid member, not kp_proc.pid.
9194
9195 2012-07-06 Glenn Morris <rgm@gnu.org>
9196
9197 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9198
9199 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 More xmalloc and related cleanup.
9202 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9203 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9204 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9205 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9206 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9207 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9208 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9209 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9210 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9211 * xterm.c:
9212 Omit needless casts involving void * pointers and allocation.
9213 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9214 as the former is more robust if P's type is changed.
9215 Prefer xzalloc to xmalloc + memset 0.
9216 Simplify malloc-or-realloc to realloc.
9217 Don't worry about xmalloc returning a null pointer.
9218 Prefer xstrdup to xmalloc + strcpy.
9219 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9220 growing it.
9221 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9222 alloca of a constant.
9223
9224 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9225
9226 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9227 hscroll is larger than the line width. Fixes long and futile
9228 looping inside extend_face_to_end_of_line (on a TTY) producing
9229 glyphs that are not needed and thrown away.
9230
9231 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9232
9233 * marker.c (set_marker_restricted_both): Simplify by using
9234 clip_to_bounds.
9235
9236 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9237
9238 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9239
9240 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9241
9242 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9243 not defined (Bug#11768).
9244 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9245 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9246 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9247 followed by gtk_box_set_homogeneous (Bug#11768).
9248 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
9249 (update_theme_scrollbar_width, xg_create_scroll_bar):
9250 Use gtk_scrollbar_new (Bug#11768).
9251 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9252 (is_box_type): New function (Bug#11768).
9253 (xg_tool_item_stale_p): Call is_box_type.
9254 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
9255 with default display (Bug#11768).
9256
9257 2012-07-05 Eli Zaretskii <eliz@gnu.org>
9258
9259 * xdisp.c (window_hscroll_limited): New function.
9260 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9261 coordinates when window's hscroll is set to insanely large
9262 values. (Bug#11857)
9263
9264 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
9265
9266 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9267 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9268
9269 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9270
9271 Cleanup xmalloc.
9272 * lisp.h (xzalloc): New prototype. Omit needless casts.
9273 * alloc.c (xzalloc): New function. Omit needless casts.
9274 * charset.c: Omit needless casts. Convert all calls to
9275 xmalloc with following memset to xzalloc.
9276 * dispnew.c: Likewise.
9277 * fringe.c: Likewise.
9278 * image.c: Likewise.
9279 * sound.c: Likewise.
9280 * term.c: Likewise.
9281 * w32fns.c: Likewise.
9282 * w32font.c: Likewise.
9283 * w32term.c: Likewise.
9284 * xfaces.c: Likewise.
9285 * xfns.c: Likewise.
9286 * xterm.c: Likewise.
9287 * atimer.c: Omit needless casts.
9288 * buffer.c: Likewise.
9289 * callproc.c: Likewise.
9290 * ccl.c: Likewise.
9291 * coding.c: Likewise.
9292 * composite.c: Likewise.
9293 * doc.c: Likewise.
9294 * doprnt.c: Likewise.
9295 * editfns.c: Likewise.
9296 * emacs.c: Likewise.
9297 * eval.c: Likewise.
9298 * filelock.c: Likewise.
9299 * fns.c: Likewise.
9300 * gtkutil.c: Likewise.
9301 * keyboard.c: Likewise.
9302 * lisp.h: Likewise.
9303 * lread.c: Likewise.
9304 * minibuf.c: Likewise.
9305 * msdos.c: Likewise.
9306 * print.c: Likewise.
9307 * process.c: Likewise.
9308 * region-cache.c: Likewise.
9309 * search.c: Likewise.
9310 * sysdep.c: Likewise.
9311 * termcap.c: Likewise.
9312 * terminal.c: Likewise.
9313 * tparam.c: Likewise.
9314 * w16select.c: Likewise.
9315 * w32.c: Likewise.
9316 * w32reg.c: Likewise.
9317 * w32select.c: Likewise.
9318 * w32uniscribe.c: Likewise.
9319 * widget.c: Likewise.
9320 * xdisp.c: Likewise.
9321 * xmenu.c: Likewise.
9322 * xrdb.c: Likewise.
9323 * xselect.c: Likewise.
9324
9325 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9326
9327 * fileio.c (time_error_value): Check the right error number.
9328 Problem reported by Troels Nielsen in
9329 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9330
9331 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9332
9333 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9334 This should be fixed in a better way; see Eli Zaretskii in
9335 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9336 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9337
9338 * fileio.c (time_error_value): Rename from special_mtime.
9339 The old name's problems were noted by Eli Zaretskii in
9340 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9341
9342 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9343 This variable's comment says Emacs needs at least one GDB-visible
9344 symbol of type enum pvec_type, to work around GDB problems.
9345 The symbol's value doesn't matter.
9346
9347 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9348 that causes compilation to fail on pre-C99 compilers.
9349
9350 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
9351
9352 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9353 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9354
9355 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9356
9357 * buffer.c (init_buffer_once): Fix initialization of
9358 headers for buffer_defaults and buffer_local_symbols.
9359 Reported by Juanma Barranquero <lekktu@gmail.com>.
9360
9361 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9362
9363 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9364 * lisp.h (enum pvec_type): Use fewer bits.
9365 (PSEUDOVECTOR_SIZE_BITS): New constant.
9366 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9367 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9368 change in pvec_type.
9369 (PSEUDOVECTOR_TYPEP): New macro.
9370 (TYPED_PSEUDOVECTORP): Use it.
9371 * fns.c (internal_equal): Adapt code to extract pvectype.
9372 * emacs.c (gdb_pvec_type): Update type.
9373 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9374 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9375 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9376 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9377 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9378 abusing vector->header.next.nbytes.
9379 (live_vector_p): Use PVEC_TYPE.
9380 (mark_object): Adapt code to extract pvectype. Use switch.
9381
9382 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9383
9384 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9385 Tighten new eassert a bit.
9386
9387 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9388
9389 Fix compilation with --enable-gcc-warnings and -O1
9390 optimization level.
9391 * doprnt.c (doprnt): Change type of tem to int, initialize
9392 to avoid compiler warning. Add eassert.
9393 * search.c (simple_search): Initialize match_byte to avoid
9394 compiler warning. Add eassert.
9395
9396 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9397
9398 Avoid weird behavior with large horizontal scrolls.
9399 Without this change, for example, large hscroll values would
9400 mess up Emacs's display on Fedora 15 x86, presumably due to
9401 overflows in int calculations in the display code.
9402 Also, if buffers had long lines, Emacs would freeze.
9403 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9404 (set_window_hscroll): New function, containing the old guts of
9405 Fset_window_hscroll. Return the clipped value.
9406 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9407 This avoids the need to check against PTRDIFF_MAX.
9408
9409 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9410
9411 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9412
9413 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9414
9415 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9416
9417 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9418 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9419 since GCC 4.4.6 issues a bogus warning for them.
9420
9421 Fix bugs in file timestamp newness comparisons.
9422 * fileio.c (Ffile_newer_than_file_p):
9423 * lread.c (Fload): Use full timestamp resolution of files,
9424 not just the 1-second resolution, so that files that are only
9425 slightly newer still count as newer.
9426 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9427 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9428
9429 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9430
9431 * fileio.c: Improve handling of file time marker. (Bug#11852)
9432 (special_mtime): New function.
9433 (Finsert_file_contents, Fverify_visited_file_modtime):
9434 Use it to set special mtime values consistently.
9435
9436 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9437
9438 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9439 marker for non-existing file. (Bug#11852)
9440
9441 2012-07-03 Glenn Morris <rgm@gnu.org>
9442
9443 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9444 and did not make it into globals.h).
9445
9446 2012-07-03 Tom Tromey <tromey@redhat.com>
9447
9448 * window.c (Fset_window_margins, Fset_window_fringes)
9449 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9450 * textprop.c (Fprevious_property_change): No longer static.
9451 * syntax.c (Fsyntax_table_p): No longer static.
9452 * process.c (Fget_process, Fprocess_datagram_address): No longer
9453 static.
9454 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9455 * keyboard.c (Fcommand_execute): No longer static.
9456 Remove EXFUN.
9457 * insdel.c (Fcombine_after_change_execute): No longer static.
9458 * image.c (Finit_image_library): No longer static.
9459 * fileio.c (Fmake_symbolic_link): No longer static.
9460 * eval.c (Ffetch_bytecode): No longer static.
9461 * editfns.c (Fuser_full_name): No longer static.
9462 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9463 No longer static.
9464 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9465 static.
9466 * dired.c (Ffile_attributes): No longer static.
9467 * composite.c (Fcomposition_get_gstring): No longer static.
9468 * callproc.c (Fgetenv_internal): No longer static.
9469
9470 * ccl.h: Remove EXFUNs.
9471 * buffer.h: Remove EXFUNs.
9472 * dispextern.h: Remove EXFUNs.
9473 * intervals.h: Remove EXFUNs.
9474 * fontset.h: Remove EXFUN.
9475 * font.h: Remove EXFUNs.
9476 * dosfns.c (system_process_attributes): Remove EXFUN.
9477 * keymap.h: Remove EXFUNs.
9478 * lisp.h: Remove EXFUNs.
9479 * w32term.h: Remove EXFUNs.
9480 * window.h: Remove EXFUNs.
9481 * xsettings.h: Remove EXFUN.
9482 * xterm.h: Remove EXFUN.
9483
9484 2012-07-03 Glenn Morris <rgm@gnu.org>
9485
9486 * lisp.h (Frandom): Make it visible to C.
9487 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9488 buffer for invisible buffers. (Bug#1229)
9489
9490 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9491
9492 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9493 values which aren't power of 2.
9494 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
9495 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
9496 accordingly.
9497
9498 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9499
9500 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9501
9502 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9503
9504 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9505
9506 * alloc.c (allocate_vector_block): Remove redundant
9507 calls to mallopt if DOUG_LEA_MALLOC is defined.
9508 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9509 avoid calls to mallopt if zero_vector is returned.
9510
9511 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9512
9513 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9514 is enabled, avoid dereferencing NULL current_sblock if
9515 running undumped.
9516
9517 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9518
9519 Cleanup basic buffer management.
9520 * buffer.h (struct buffer): Change layout to use generic vector
9521 marking code. Fix some comments. Change type of 'clip_changed'
9522 to bitfield. Remove unused #ifndef old.
9523 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9524 (GET_OVERLAYS_AT): Fix indentation.
9525 (for_each_per_buffer_object_at): New macro.
9526 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
9527 (Fbuffer_local_variables): Use it.
9528 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
9529 * alloc.c (allocate_buffer): Adjust to match new layout of
9530 struct buffer. Fix comment.
9531 (mark_overlay): New function.
9532 (mark_buffer): Use it. Use mark_vectorlike to mark normal
9533 Lisp area of struct buffer.
9534 (mark_object): Use it. Adjust marking of misc objects
9535 and related comments.
9536
9537 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
9538
9539 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
9540 wrapper that is not needed because the wrapped code is a no-op (zero
9541 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
9542 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
9543
9544 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
9545
9546 * alloc.c (mark_buffer): Simplify. Remove prototype.
9547 (mark_object): Add comment. Reorganize marking of vector-like
9548 objects. Use CHECK_LIVE for all vector-like objects except buffers
9549 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9550 Avoid redundant calls to mark_vectorlike for bool vectors.
9551
9552 2012-06-30 Glenn Morris <rgm@gnu.org>
9553
9554 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9555
9556 * epaths.in (PATH_SITELOADSEARCH): New.
9557 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9558 This is rather than relying on --enable-locallisppath elements
9559 having "site-lisp" in their names. (Bug#10208#25, 11658)
9560
9561 2012-06-30 Eli Zaretskii <eliz@gnu.org>
9562
9563 * w32proc.c (sys_select): Accept and ignore one more argument.
9564
9565 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9566
9567 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9568 (pselect) [!MS_DOS]: Redirect to sys_select.
9569
9570 * sysdep.c: Don't include dos.h and dosfns.h.
9571
9572 * process.c (sys_select):
9573 * msdos.c (sys_select): Accept one more argument and ignore it.
9574
9575 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9576 adapt data types and code to that.
9577
9578 * dosfns.c:
9579 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
9580 which clashes with the gnulib function of the same name.
9581
9582 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
9583
9584 * font.c (font_style_to_value, font_style_symbolic)
9585 (font_prop_validate_style): Add type checks for values in
9586 font_style_table.
9587
9588 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
9589 argument.
9590 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
9591 uses.
9592
9593 2012-06-29 Eli Zaretskii <eliz@gnu.org>
9594
9595 * xdisp.c (try_window_id): Undo last change.
9596
9597 * w32.c (getwd): Adjust commentary about startup_dir.
9598 (init_environment): Always call sys_access, even in non-MSVC
9599 builds. Don't chdir to the directory of the Emacs executable.
9600 This undoes code from 1997 which was justified by the need to
9601 "avoid conflicts when removing and renaming directories". But its
9602 downside was that every relative file name was being interpreted
9603 relative to the directory of the Emacs executable, which can never
9604 be TRT. In particular, it broke sys_access when called with
9605 relative file names.
9606 (sys_access): Map GetLastError to errno.
9607
9608 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9609
9610 * window.h (struct window): Change type of 'fringes_outside_margins'
9611 to bitfield. Fix comment. Adjust users accordingly.
9612 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
9613 Adjust comment.
9614 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
9615 to ptrdiff_t.
9616
9617 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
9618
9619 * gnutls.c (emacs_gnutls_handshake):
9620 Add QUIT to make the loop interruptible.
9621
9622 2012-06-29 Glenn Morris <rgm@gnu.org>
9623
9624 * charset.c (init_charset): Make lack of etc/charsets fatal.
9625
9626 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9627
9628 * editfns.c (region_limit): Fix type mismatch.
9629
9630 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9631
9632 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
9633 undefined. Convert from xassert to eassert.
9634 * nsmenu.m: Convert from xassert to eassert.
9635 * nsterm.m: Likewise.
9636
9637 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
9638
9639 * editfns.c (region_limit): Clip to narrowing (bug#11770).
9640
9641 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
9642
9643 Avoid integer overflow on scroll-left and scroll-right.
9644 * window.c (HSCROLL_MAX): New macro.
9645 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
9646 overflow when requested scroll falls outside ptrdiff_t range.
9647
9648 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9649
9650 * window.h (struct window): Change type of 'hscroll',
9651 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
9652 'last_modified' and 'last_overlay_modified' to EMACS_INT.
9653 Adjust users accordingly.
9654 * xdisp.c (try_cursor_movement): Replace type check with eassert.
9655 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
9656 from EMACS_INT to ptrdiff_t.
9657 (make_window): Omit redundant initialization.
9658
9659 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
9660
9661 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
9662
9663 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9664
9665 * window.h (struct window): Change type of 'use_time' and
9666 'sequence_number' from Lisp_Object to int.
9667 * frame.c (make_frame): Adjust users accordingly.
9668 * print.c (print_object): Likewise.
9669 * window.c (select_window, Fwindow_use_time, make_parent_window)
9670 (make_window): Likewise.
9671
9672 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9673
9674 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
9675 enabled with --enable-checking=[all,glyphs] configure option.
9676 Fix GLYPH_DEBUG usage assuming that it may be undefined,
9677 adjust comments accordingly.
9678 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
9679 undefined, adjust comments accordingly.
9680 * image.c: Likewise.
9681 * scroll.c: Likewise.
9682 * w32fns.c: Likewise.
9683 * w32term.c: Likewise.
9684 * xdisp.c: Likewise.
9685 * xfaces.c: Likewise.
9686 * xfns.c: Likewise.
9687 * xterm.c: Likewise.
9688
9689 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9690
9691 Generalize run-time debugging checks.
9692 * dispextern.h (XASSERTS): Remove.
9693 * fontset.c (xassert): Remove.
9694 Convert from xassert to eassert.
9695 * alloc.c: Convert from xassert to eassert.
9696 * bidi.c: Likewise.
9697 * dispnew.c: Likewise.
9698 * fns.c: Likewise.
9699 * fringe.c: Likewise.
9700 * ftfont.c: Likewise.
9701 * gtkutil.c: Likewise.
9702 * image.c: Likewise.
9703 * keyboard.c: Likewise.
9704 * menu.c: Likewise.
9705 * process.c: Likewise.
9706 * scroll.c: Likewise.
9707 * sound.c: Likewise.
9708 * term.c: Likewise.
9709 * w32console.c: Likewise.
9710 * w32fns.c: Likewise.
9711 * w32term.c: Likewise.
9712 * window.c: Likewise.
9713 * xdisp.c: Likewise.
9714 * xfaces.c: Likewise.
9715 * xfns.c: Likewise.
9716 * xselect.c: Likewise.
9717 * xterm.c: Likewise.
9718
9719 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
9720
9721 * fns.c (maybe_resize_hash_table): Output message when growing the
9722 purify-hashtable.
9723
9724 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9725
9726 * alloc.c (allocate_string_data): Remove dead code.
9727 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
9728 avoid GCC warning about unused macro.
9729
9730 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9731
9732 * alloc.c (allocate_string): Omit intervals initialization.
9733 * alloc.c (make_uninit_multibyte_string): Initialize intervals
9734 as in make_pure_string and make_pure_c_string.
9735
9736 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 * alloc.c (allocate_string): Fix last change.
9739
9740 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9741
9742 * alloc.c (allocate_string): Remove two redundant calls
9743 to memset, add explicit initialization where appropriate.
9744
9745 2012-06-27 Glenn Morris <rgm@gnu.org>
9746
9747 * lisp.mk (lisp): Remove paths.elc.
9748
9749 2012-06-27 Chong Yidong <cyd@gnu.org>
9750
9751 * doc.c (Fsubstitute_command_keys): Fix punctuation.
9752
9753 2012-06-26 John Wiegley <johnw@newartisans.com>
9754
9755 * unexmacosx.c (copy_data_segment): Add two section names used
9756 on Mac OS X Lion: __mod_init_func and __mod_term_func.
9757
9758 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
9759 when building with Clang.
9760
9761 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
9762
9763 * eval.c (Fapply): Allow calling it with a single argument.
9764
9765 2012-06-26 Eli Zaretskii <eliz@gnu.org>
9766
9767 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
9768 _stricmp and _strnicmp.
9769 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
9770
9771 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9772
9773 * alloc.c (allocate_window): Zero out non-Lisp part of newly
9774 allocated window.
9775 (allocate_process): Likewise for new process.
9776 (allocate_terminal): Change to use offsetof.
9777 (allocate_frame): Likewise.
9778 * frame.c (make_frame): Omit redundant initialization.
9779 * window.c (make_parent_window): Use memset.
9780 (make_window): Omit redundant initialization.
9781 * process.c (make_process): Omit redundant initialization.
9782 * terminal.c (create_terminal): Likewise.
9783
9784 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9785
9786 * term.c (delete_tty): Remove redundant call to memset.
9787
9788 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9789
9790 * alloc.c: Remove build_string.
9791 * lisp.h: Define build_string as static inline. This provides
9792 a better opportunity to optimize away calls to strlen when the
9793 function is called with compile-time constant argument.
9794 * image.c (imagemagick_error): Convert to build_string.
9795 * w32proc.c (sys_spawnve): Likewise.
9796 * xterm.c (x_term_init): Likewise.
9797
9798 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
9799
9800 Use sprintf return value instead of invoking strlen on result.
9801 In the old days this wasn't portable, since some sprintf
9802 implementations returned char *. But they died out years ago and
9803 Emacs already assumes sprintf returns int.
9804 Similarly for float_to_string.
9805 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
9806 * ccl.c (ccl_driver):
9807 * character.c (string_escape_byte8):
9808 * data.c (Fnumber_to_string):
9809 * doprnt.c (doprnt):
9810 * print.c (print_object):
9811 * xdisp.c (message_dolog):
9812 * xfns.c (syms_of_xfns):
9813 Use sprintf or float_to_string result to avoid need to call strlen.
9814 * data.c (Fnumber_to_string):
9815 Use make_unibyte_string, since the string must be ASCII.
9816 * lisp.h, print.c (float_to_string): Now returns int length.
9817 * term.c (produce_glyphless_glyph):
9818 Use sprintf result rather than recomputing it.
9819
9820 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
9821 * Makefile.in (ALL_CFLAGS):
9822 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
9823 * gmalloc.c, regex.c: Include <config.h> unconditionally.
9824
9825 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9826
9827 * dispextern.h (xstrcasecmp): Define to library function
9828 strcasecmp if available.
9829 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
9830
9831 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
9832
9833 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
9834 Avoid comma operator.
9835 * menu.c (push_submenu_start, push_submenu_end)
9836 (push_left_right_boundary, push_menu_pane): Likewise.
9837 * msdos.c (dos_rawgetc): Likewise.
9838
9839 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9840
9841 * xfns.c (xic_create_fontsetname): Remove redundant calls
9842 to memset.
9843
9844 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 * gtkutil.c (get_utf8_string): Remove redundant assignment.
9847 sprintf already null-terminates its output.
9848
9849 * xfns.c (x_window): Remove redundant cast.
9850
9851 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9852
9853 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
9854 `const char *' to `char *' to avoid compiler warning.
9855
9856 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9857
9858 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
9859 instead of truncating it to 63 (admittedly a generous limit).
9860
9861 * process.c: Fix spelling and caps in comments.
9862
9863 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
9864
9865 * emacs.c (setpgrp): Remove definition, unused.
9866 * sysdep.c (setpgrp): Remove definition, not used in this file.
9867
9868 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
9869
9870 * makefile.w32-in: Update dependencies.
9871
9872 2012-06-24 Eli Zaretskii <eliz@gnu.org>
9873
9874 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
9875 (SYSTIME_H): Add nt/inc/sys/time.h.
9876
9877 * systime.h [WINDOWSNT]: Include sys/time.h.
9878
9879 * s/ms-w32.h (struct timespec): Definition moved from
9880 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
9881
9882 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9883
9884 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
9885 * buffer.h (buffer_slot_type_mismatch):
9886 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9887 * eval.c (unwind_to_catch):
9888 * image.c (my_png_error, my_error_exit):
9889 * keyboard.c (quit_throw_to_read_char, user_error)
9890 (Fexit_recursive_edit, Fabort_recursive_edit):
9891 * lisp.h (die, args_out_of_range, args_out_of_range_3)
9892 (wrong_type_argument, buffer_overflow, __executable_start)
9893 (memory_full, buffer_memory_full, string_overflow, Fthrow)
9894 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
9895 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
9896 (fatal):
9897 (child_setup) [!DOS_NT]:
9898 * lread.c (end_of_file_error, invalid_syntax):
9899 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9900 * puresize.h (pure_write_error):
9901 * search.c (matcher_overflow):
9902 * sound.c (sound_perror, alsa_sound_perror):
9903 * sysdep.c, syssignal.h (croak):
9904 * term.c (maybe_fatal, vfatal):
9905 * textprop.c (text_read_only):
9906 * undo.c (user_error):
9907 * unexmacosx.c (unexec_error):
9908 * xterm.c (x_ins_del_lines, x_delete_glyphs):
9909 Use _Noreturn rather than NO_RETURN.
9910 No need for separate decl merely because of _Noreturn.
9911 * sound.c (sound_warning, parse_sound):
9912 Remove unnecessary forward decls.
9913
9914 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9915
9916 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9917 * lisp.h (WAIT_READING_MAX): New macro.
9918 * dispnew.c (Fsleep_for, sit_for):
9919 * keyboard.c (kbd_buffer_get_event):
9920 * process.c (Faccept_process_output):
9921 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9922 This improves on the previous patch, which introduced a bug
9923 when time_t is unsigned and as wide as intmax_t.
9924 See <http://bugs.gnu.org/9000#51>.
9925
9926 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9927
9928 * dispnew.c (sit_for, Fsleep_for):
9929 * keyboard.c (kbd_buffer_get_event):
9930 * process.c (Faccept_process_output): Avoid compiler warnings when
9931 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
9932
9933 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
9934
9935 * makefile.w32-in: Update dependencies.
9936
9937 * w32.c (ltime): Add return type and declare static.
9938 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
9939
9940 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9941
9942 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9943 Privately reported by Herbert J. Skuhra.
9944 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
9945 All uses changed.
9946 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
9947 not make_lisp_timeval, when the argument is of type EMACS_TIME.
9948
9949 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9950
9951 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
9952 last argument of make_unibyte_string.
9953
9954 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
9955 language ID in the event parameters.
9956
9957 * w32term.c (w32_read_socket): Put the new keyboard codepage into
9958 event.code, not the obscure "character set ID".
9959
9960 2012-06-23 Chong Yidong <cyd@gnu.org>
9961
9962 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
9963
9964 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9965
9966 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
9967 * w32.c (fdutimens): New function.
9968
9969 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
9970
9971 * s/ms-w32.h (pselect): Redirect to sys_select.
9972
9973 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
9974
9975 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
9976 in the logic of incrementing and decrementing the value of
9977 use_relocatable_buffers.
9978
9979 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9980
9981 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
9982 Privately reported by Herbert J. Skuhra.
9983 [__FreeBSD__]: Remove "*/" typo after "#include".
9984 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
9985 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
9986 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
9987 Don't assume EMACS_TIME and struct timeval are the same type.
9988
9989 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
9990
9991 Support higher-resolution time stamps (Bug#9000).
9992 The time stamps are only nanosecond-resolution at the C level,
9993 since that's the best that any real-world system supports now.
9994 But they are picosecond-resolution at the Lisp level, as that's
9995 easy, and leaves room for future OS improvements.
9996
9997 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
9998 (LIBES): Use it.
9999
10000 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10001 Don't get current time unless it's needed.
10002
10003 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10004 now provides it if it's absent.
10005 (start_atimer): Port to higher-res time stamps.
10006 Check for time stamp overflow. Don't get current time more
10007 often than is needed.
10008
10009 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10010 Include systime.h, not time.h.
10011 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10012
10013 * dired.c: Include stat-time.h.
10014 (Ffile-attributes): File times now have higher resolution.
10015
10016 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10017 (struct image): Timestamp now has higher resolution.
10018
10019 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10020 has at least microseconds now. All uses removed.
10021 (update_frame, update_single_window, update_window, update_frame_1)
10022 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10023 (duration_to_sec_usec): Remove; no longer needed.
10024
10025 * editfns.c (time_overflow): Now extern.
10026 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10027 (float-time, Fformat_time_string, Fcurrent_time_string)
10028 (Fcurrent_time_zone): Accept and generate higher-resolution
10029 time stamps.
10030 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10031 (decode_time_components, lisp_seconds_argument): New functions.
10032 (make_time): Now static.
10033 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10034 Report an error if the time is invalid, rather than having the caller
10035 do that.
10036
10037 * fileio.c: Include <stat-time.h>
10038 (Fcopy_file): Copy higher-resolution time stamps.
10039 Prefer to set the time stamp via a file descriptor if that works.
10040 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10041 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10042 (Fvisited_file_modtime, Fset_visited_file_modtime):
10043 Support higher-resolution time stamps.
10044
10045 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10046
10047 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10048
10049 * image.c (prepare_image_for_display, clear_image_cache)
10050 (lookup_image): Port to higer-resolution time stamps.
10051
10052 * keyboard.c (start_polling, bind_polling_period):
10053 Check for time stamp overflow.
10054 (read_char, kbd_buffer_get_event, timer_start_idle)
10055 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10056 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10057 Port to higher-resolution time stamps. Do not assume time_t is signed.
10058 (decode_timer): New function. Timers are now vectors of length 9,
10059 not 8, to accommodate the picosecond component.
10060 (timer_check_2): Use it.
10061
10062 * nsterm.m (select_timeout, timeval_subtract): Remove.
10063 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10064 as they're a bit more accurate and handle overflow better.
10065 (ns_select): Change prototype to be compatible with pselect.
10066 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10067 * nsterm.h (ns_select): Adjust prototype.
10068
10069 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10070 us-resolution time stamps.
10071 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10072
10073 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10074
10075 * lisp.h (time_overflow): New decl.
10076 (wait_reading_process_output): First arg is now intmax_t, not int,
10077 to accommodate larger waits.
10078
10079 * process.h (struct Lisp_Process.read_output_delay):
10080 Now counts nanoseconds, not microseconds.
10081 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10082 EMACS_HAS_USECS.
10083 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10084 (wait_reading_process_output):
10085 Port to ns-resolution time stamps.
10086 (Faccept_process_output, wait_reading_process_output):
10087 Check for time stamp overflow. Do not assume time_t is signed.
10088 (select_wrapper): Remove; we now use pselect.
10089 (Fprocess_attributes): Now generates ns-resolution time stamps.
10090
10091 * sysdep.c: Include utimens.h. Don't include utime.h
10092 or worry about struct utimbuf; gnulib does that for us now.
10093 (gettimeofday): Remove; gnulib provides a substitute.
10094 (make_timeval): New function.
10095 (set_file_times): Now sets ns-resolution time stamps.
10096 New arg FD; all uses changed.
10097 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10098 (system_process_attributes):
10099 Now returns ns-resolution time stamp. All uses changed.
10100 Check for time stamp overflow.
10101
10102 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10103 provides a substitute now.
10104
10105 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10106 since it guarantees struct timespec.
10107 (EMACS_TIME): Now struct timespec, so that we can support
10108 ns-resolution time stamps.
10109 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10110 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10111 (EMACS_USECS): Remove.
10112 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10113 so multiply the arg by 1000 before storing it.
10114 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10115 New macros.
10116 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10117 Port to ns-resolution time stamps.
10118 (EMACS_TIME_NEG_P): Remove; replaced by....
10119 (EMACS_TIME_SIGN): New macro.
10120 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10121 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10122 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10123 (make_timeval, make_lisp_time, decode_time_components): New decls.
10124 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10125 that it mishandled time_t overflow. You can't compare by subtracting!
10126 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10127 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10128
10129 * term.c: Include <sys/time.h>.
10130 (timeval_to_Time): New function, for proper overflow wraparound.
10131 (term_mouse_position, term_mouse_click): Use it.
10132
10133 * undo.c (record_first_change): Support higher-resolution time stamps
10134 in the undo buffer.
10135 (Fprimitive_undo): Use them when restoring time stamps.
10136
10137 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10138 (w32_get_internal_run_time):
10139 Port to higher-resolution Emacs time stamps.
10140 (ltime): Now accepts single 64-bit integer, as that's more convenient
10141 for callers.
10142
10143 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10144
10145 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10146 for compatibility with pselect. Support ns-resolution time stamps.
10147
10148 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10149
10150 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10151 Check for time stamp overflow, and support ns-resolution time stamps.
10152
10153 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10154 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10155 (timeval_subtract): Remove; no longer needed.
10156 (XTflash, XTring_bell, x_wait_for_event):
10157 Port to ns-resolution time stamps. Don't assume time_t is signed.
10158
10159 2012-06-22 Chong Yidong <cyd@gnu.org>
10160
10161 * xdisp.c (x_consider_frame_title): Revert last change.
10162
10163 2012-06-22 Eli Zaretskii <eliz@gnu.org>
10164
10165 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10166 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10167 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10168 staticidx goes up to 1597 out of 1600 = 0x640.)
10169
10170 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10171
10172 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10173 Otherwise, the umask might be mistakenly 0 while handling input signals.
10174
10175 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10176
10177 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10178
10179 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10180
10181 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10182 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10183 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10184 access to `contents' member of Lisp_Vector objects with AREF and ASET
10185 where appropriate.
10186
10187 2012-06-19 Chong Yidong <cyd@gnu.org>
10188
10189 * frame.c (delete_frame): When selecting a frame on a different
10190 text terminal, do not alter the terminal's top-frame.
10191
10192 * xdisp.c (format_mode_line_unwind_data): Record the target
10193 frame's selected window and its terminal's top-frame.
10194 (unwind_format_mode_line): Restore them.
10195 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10196 Callers changed.
10197 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10198 since tty frames can be explicitly named.
10199 (prepare_menu_bars): Likewise.
10200
10201 * term.c (Ftty_top_frame): New function.
10202
10203 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10204
10205 Port byte-code-meter to modern targets.
10206 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10207 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
10208 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
10209 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10210 (METER_1, METER_2): Simplify.
10211
10212 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10213
10214 * data.c (Fdefalias): Return `symbol' (bug#11686).
10215
10216 2012-06-18 Martin Rudalics <rudalics@gmx.at>
10217
10218 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
10219 gets killed during executing of this function (Bug#11665).
10220 Try to always return Qt when the buffer has been actually killed.
10221 (Vkill_buffer_query_functions): In doc-string say that functions
10222 run by this hook should not change the current buffer.
10223
10224 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10225
10226 Fix recently-introduced process.c problems found by static checking.
10227 * process.c (write_queue_push, write_queue_pop, send_process):
10228 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10229 (write_queue_pop): Fix pointer signedness problem.
10230 (send_process): Remove unused local.
10231
10232 2012-06-17 Chong Yidong <cyd@gnu.org>
10233
10234 * xdisp.c (redisplay_internal): No need to redisplay terminal
10235 frames that are not on top.
10236
10237 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
10238
10239 * process.c (make_process): Initialize write_queue.
10240 (write_queue_push, write_queue_pop): New functions.
10241 (send_process): Use them to maintain correct ordering of process
10242 writes (Bug#10815).
10243
10244 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10245
10246 * lisp.h (eassert): Assume C89 or later.
10247 This removes the need for CHECK.
10248 (CHECK): Remove. Its comments about always evaluating its
10249 argument were confusing, as 'eassert' typically does not evaluate
10250 its argument.
10251
10252 * coding.c (produce_chars): Use ptrdiff_t, not int.
10253
10254 * xterm.c (x_draw_underwave): Check for integer overflow.
10255 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10256
10257 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
10258
10259 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10260 referenced (Bug#11583).
10261
10262 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10263
10264 Implement wave-style variant of underlining.
10265 * dispextern.h (face_underline_type): New enum.
10266 (face): Add field for underline type.
10267 * nsterm.m (ns_draw_underwave): New function.
10268 (ns_draw_text_decoration): Use it.
10269 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10270 New functions.
10271 (x_draw_glyph_string): Use them.
10272 * xfaces.c (Qline, Qwave): New Lisp objects.
10273 (check_lface_attrs, merge_face_ref)
10274 (Finternal_set_lisp_face_attribute, realize_x_face):
10275 Handle wave-style underline face attributes.
10276 * xterm.c (x_draw_underwave): New function.
10277 (x_draw_glyph_string): Use it.
10278
10279 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
10280
10281 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10282 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10283 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10284 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10285 ($(BLD)/w32select.$(O)): Update dependencies.
10286
10287 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10288
10289 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10290 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10291 * character.c (_fetch_multibyte_char_p): Remove.
10292 * alloc.c: Include "character.h" before "buffer.h".
10293 * bidi.c: Likewise.
10294 * buffer.c: Likewise.
10295 * bytecode.c: Likewise.
10296 * callint.c: Likewise.
10297 * callproc.c: Likewise.
10298 * casefiddle.c: Likewise.
10299 * casetab.c: Likewise.
10300 * category.c: Likewise.
10301 * cmds.c: Likewise.
10302 * coding.c: Likewise.
10303 * composite.c: Likewise.
10304 * dired.c: Likewise.
10305 * dispnew.c: Likewise.
10306 * doc.c: Likewise.
10307 * dosfns.c: Likewise.
10308 * editfns.c: Likewise.
10309 * emacs.c: Likewise.
10310 * fileio.c: Likewise.
10311 * filelock.c: Likewise.
10312 * font.c: Likewise.
10313 * fontset.c: Likewise.
10314 * fringe.c: Likewise.
10315 * indent.c: Likewise.
10316 * insdel.c: Likewise.
10317 * intervals.c: Likewise.
10318 * keyboard.c: Likewise.
10319 * keymap.c: Likewise.
10320 * lread.c: Likewise.
10321 * macros.c: Likewise.
10322 * marker.c: Likewise.
10323 * minibuf.c: Likewise.
10324 * nsfns.m: Likewise.
10325 * nsmenu.m: Likewise.
10326 * print.c: Likewise.
10327 * process.c: Likewise.
10328 * regex.c: Likewise.
10329 * region-cache.c: Likewise.
10330 * search.c: Likewise.
10331 * syntax.c: Likewise.
10332 * term.c: Likewise.
10333 * textprop.c: Likewise.
10334 * undo.c: Likewise.
10335 * unexsol.c: Likewise.
10336 * w16select.c: Likewise.
10337 * w32fns.c: Likewise.
10338 * w32menu.c: Likewise.
10339 * window.c: Likewise.
10340 * xdisp.c: Likewise.
10341 * xfns.c: Likewise.
10342 * xmenu.c: Likewise.
10343 * xml.c: Likewise.
10344 * xselect.c: Likewise.
10345
10346 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10347
10348 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10349 If all the glyphs of the glyph row came from strings, and we have no
10350 cursor positioning clues, put the cursor on the first glyph of the
10351 row.
10352 (handle_face_prop): Use chunk-relative overlay string index when
10353 indexing into it->string_overlays array. (Bug#11653)
10354 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10355 the rightmost. (Bug#11720)
10356
10357 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10358
10359 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10360 (CATEGORY_MEMBER): Enforce 1/0 value.
10361 * category.c (_temp_category_set): Remove.
10362
10363 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10364
10365 * window.c (Fdelete_other_windows_internal)
10366 (Fdelete_window_internal): Don't access frame's mouse highlight
10367 info of the initial frame. (Bug#11677)
10368
10369 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10370
10371 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10372 Assume USE_2_TAGS_FOR_INTS.
10373 (xreload): Adjust $tagmask width to match recent lisp.h change.
10374
10375 Simplify lisp.h in minor ways that should not affect code.
10376 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10377 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10378 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10379 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10380 (INTTYPEBITS): New macro, for clarity.
10381 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
10382 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10383 Simplify now that USE_LSB_TAG is always defined.
10384 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10385 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10386
10387 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
10388
10389 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10390
10391 2012-06-13 Glenn Morris <rgm@gnu.org>
10392
10393 * s/bsd-common.h (BSD4_3):
10394 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10395
10396 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10397
10398 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10399 instead of union.
10400 (XLI, XIL): Define.
10401 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10402 Use them.
10403 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
10404 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
10405 * alloc.c (widen_to_Lisp_Object): Remove.
10406 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10407 * frame.c (delete_frame): Remove outdated comment.
10408 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10409 USE_LISP_UNION_TYPE.
10410 (Fw32_unregister_hot_key): Likewise.
10411 (Fw32_toggle_lock_key): Likewise.
10412 * w32menu.c (add_menu_item): Likewise.
10413 (w32_menu_display_help): Use XIL instead of checking
10414 USE_LISP_UNION_TYPE.
10415 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10416 (init_heap): Likewise.
10417 * w32term.c (w32_read_socket): Update comment.
10418
10419 2012-06-13 Glenn Morris <rgm@gnu.org>
10420
10421 * s/usg5-4-common.h, src/s/unixware.h:
10422 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10423
10424 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10425
10426 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10427
10428 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10429 * alloc.c (make_number) [!defined make_number]:
10430 Remove, as lisp.h always defines this now.
10431 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10432 (roundup_size): Verify that it is a power of 2.
10433 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10434 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10435 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10436 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10437 USE_LSB_TAG now is always defined to be either 0 or 1.
10438 All uses changed.
10439 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10440 code works fine either way, and efficiency is not a concern here,
10441 as the union type is for debugging, not for production.
10442 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10443 Use an inline function on all platforms when using the union type,
10444 since this is simpler and 'static inline' can be used portably
10445 within Emacs now.
10446 (LISP_INITIALLY_ZERO): New macro.
10447 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10448 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10449
10450 2012-06-12 Glenn Morris <rgm@gnu.org>
10451
10452 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10453
10454 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
10455
10456 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10457 Move BROKEN_SIGIO to configure.
10458
10459 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10460 Move NO_TERMIO to configure.
10461
10462 2012-06-12 Chong Yidong <cyd@gnu.org>
10463
10464 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10465 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10466 MagickExportImagePixels is undefined.
10467
10468 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10469
10470 * image.c (imagemagick_load_image): Remove unused label.
10471
10472 2012-06-11 Glenn Morris <rgm@gnu.org>
10473
10474 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10475 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10476 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10477 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10478
10479 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10480
10481 * alloc.c (make_byte_code): New function.
10482 (Fmake_byte_code): Use it. Don't purify here.
10483 * lread.c (read1): Use it as well to avoid extra allocation.
10484
10485 2012-06-11 Chong Yidong <cyd@gnu.org>
10486
10487 * image.c (imagemagick_load_image): Implement transparency.
10488
10489 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10490
10491 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10492 account for preceding backslashes. (Bug#11663)
10493
10494 2012-06-09 Chong Yidong <cyd@gnu.org>
10495
10496 * term.c: Support italics in capable terminals (Bug#9652).
10497 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10498 (turn_on_face): Output using TS_enter_italic_mode if available.
10499 Don't handle unused blinking and alt-charset cases.
10500 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10501 and tty_alt_charset_p cases.
10502 (tty_capable_p, init_tty): Support italics.
10503
10504 * termchar.h (struct tty_display_info): Add field for italics.
10505 Remove unused blink field.
10506
10507 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10508 Handle slant.
10509
10510 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10511 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10512 tty_alt_charset_p. Add tty_italic_p.
10513
10514 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
10515
10516 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10517 dbus_type_is_basic if available.
10518 (xd_extract_signed, xd_extract_unsigned): Rename from
10519 extract_signed and extract_unsigned, respectively. Adapt callers.
10520
10521 2012-06-09 Chong Yidong <cyd@gnu.org>
10522
10523 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10524
10525 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
10526 case (Bug#9752).
10527
10528 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
10529
10530 * xdisp.c (vmessage): Treat frame message as multibyte.
10531 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
10532 would generate the diagnostic "Making \302\247 buffer-local while
10533 let-bound!".
10534
10535 2012-06-08 Eli Zaretskii <eliz@gnu.org>
10536
10537 * dispnew.c (showing_window_margins_p): Undo last change, which
10538 was done due to an inadvertent commit.
10539 (adjust_frame_glyphs_for_frame_redisplay): Do call
10540 showing_window_margins_p.
10541
10542 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10543
10544 * eval.c (Fmake_var_non_special): New primitive.
10545 (syms_of_eval): Defsubr it.
10546 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
10547
10548 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
10549
10550 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10551 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10552
10553 2012-06-08 Eli Zaretskii <eliz@gnu.org>
10554
10555 * alloc.c (allocate_vectorlike): Fix last change.
10556
10557 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10558
10559 Block-based vector allocation of small vectors.
10560 * lisp.h (struct vectorlike_header): New field `nbytes',
10561 adjust comment accordingly.
10562 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
10563 to denote vector blocks. Adjust users (live_vector_p,
10564 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10565 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10566 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10567 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10568 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10569 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10570 (roundup_size): New constant.
10571 (struct vector_block): New data type.
10572 (vector_blocks, vector_free_lists, zero_vector): New variables.
10573 (all_vectors): Rename to `large_vectors'.
10574 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10575 (sweep_vectors): New functions.
10576 (allocate_vectorlike): Return `zero_vector' as the only vector of
10577 0 items. Allocate new vector from block if vector size is less than
10578 or equal to VBLOCK_BYTES_MAX.
10579 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
10580 (init_alloc_once): Add call to init_vectors.
10581
10582 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10583
10584 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
10585
10586 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
10587
10588 * doprnt.c (doprnt): Truncate multibyte char correctly.
10589 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
10590 would mishandle a string argument "Xc" if X was a multibyte
10591 character of length 2: it would truncate after X's first byte
10592 rather than including all of X.
10593
10594 2012-06-06 Chong Yidong <cyd@gnu.org>
10595
10596 * buffer.c (word_wrap): Doc fix.
10597
10598 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
10599
10600 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
10601
10602 2012-06-03 Glenn Morris <rgm@gnu.org>
10603
10604 * xdisp.c (tool-bar-style): Doc fix.
10605
10606 2012-06-03 Ulrich Müller <ulm@gentoo.org>
10607
10608 * Makefile.in (PAXCTL): Define.
10609 (temacs$(EXEEXT)): Disable memory randomization for the temacs
10610 binary via PaX flags if the paxctl utility is available.
10611 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
10612 Restore PaX flags to their default. (Bug#11398)
10613
10614 2012-06-03 Chong Yidong <cyd@gnu.org>
10615
10616 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
10617 buffer (Bug#11226).
10618
10619 2012-06-03 Chong Yidong <cyd@gnu.org>
10620
10621 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
10622 (note_mode_line_or_margin_highlight): If there is no help echo,
10623 use mode-line-default-help-echo. Handle the case where the mouse
10624 position is past the end of the mode line string.
10625
10626 * buffer.c (buffer_local_value_1): New function, split from
10627 Fbuffer_local_value; can return Qunbound.
10628 (Fbuffer_local_value): Use it.
10629 (Vmode_line_format): Docstring tweaks.
10630
10631 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10632
10633 * sysdep.c (system_process_attributes): Improve comment.
10634
10635 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
10636
10637 * keyboard.c: Export real-this-command to Elisp.
10638 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
10639 and DEFVAR it. Update all users.
10640
10641 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10642
10643 * minibuf.c (Fassoc_string): Remove duplicate declaration.
10644
10645 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
10646 Convert pctcpu and pctmem to Lisp float properly.
10647 Let the compiler fold better, as 100.0/0x8000 is exact.
10648
10649 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
10650
10651 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
10652 cons_block.
10653
10654 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
10655
10656 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
10657
10658 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
10659
10660 For a 'struct window', replace some Lisp_Object fields to
10661 bitfields where appropriate, remove unused fields.
10662 * window.h (struct window): Remove unused 'last_mark_x' and
10663 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
10664 change its type from Lisp_Object to bitfield.
10665 Change type of 'force_start', 'optional_new_start',
10666 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
10667 fields from Lisp_Object to bitfield. Adjust users accordingly.
10668
10669 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10670
10671 Pacify gcc -Wdouble-precision when using Xaw.
10672 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
10673 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
10674 Use 'float' consistently, rather than 'float' in most places
10675 and 'double' in a couple of places.
10676
10677 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10678
10679 * xdisp.c (handle_stop): Detect whether we have overlay strings
10680 loaded by testing it->current.overlay_string_index to be
10681 non-negative, instead of checking whether n_overlay_strings is
10682 positive. (Bug#11587)
10683
10684 2012-05-31 Chong Yidong <cyd@gnu.org>
10685
10686 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
10687
10688 * doc.c (Fsubstitute_command_keys): Doc fix.
10689
10690 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10691
10692 * search.c (search_buffer): Remove calls to
10693 r_alloc_inhibit_buffer_relocation, as it is now called by
10694 maybe_unify_char, which was the cause of relocation of buffer text
10695 in bug#11519.
10696
10697 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10698
10699 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
10700 for the duration of call to load_charset, to avoid problems with
10701 callers of maybe_unify_char that access buffer text through C
10702 pointers.
10703
10704 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
10705 decrement the inhibition flag, instead of just setting or
10706 resetting it.
10707
10708 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10709
10710 Remove obsolete '#define static' cruft.
10711 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
10712 This #undef was "temporary" in 2000; it is no longer needed
10713 now that '#define static' has gone away.
10714 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
10715 (gray_bitmap_bits): Remove; no longer needed.
10716 All uses replaced with definiens.
10717 * xterm.c: Include "bitmaps/gray.xbm".
10718
10719 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10720
10721 Clean up __executable_start, monstartup when --enable-profiling.
10722 The following changes affect the code only when profiling.
10723 * dispnew.c (__executable_start): Rename from safe_bcopy.
10724 Define only on platforms that need it.
10725 * emacs.c: Include <sys/gmon.h> when profiling.
10726 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
10727 (__executable_start): Remove decl, since lisp.h does it now.
10728 (safe_bcopy): Remove decl; no longer has that name.
10729 (main): Coalesce #if into single bit of code, for simplicity.
10730 Cast pointers to uintptr_t, since standard libraries want integers
10731 and not pointers.
10732 * lisp.h (__executable_start): New decl.
10733
10734 2012-05-31 Glenn Morris <rgm@gnu.org>
10735
10736 * image.c (Fimagemagick_types): Doc fix.
10737
10738 2012-05-30 Jim Meyering <meyering@redhat.com>
10739
10740 * callproc.c (Fcall_process_region): Include directory component
10741 in mkstemp error message (Bug#11586).
10742
10743 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10744
10745 * alloc.c, lisp.h (make_pure_vector): Now static.
10746
10747 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
10748
10749 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
10750 Move to byte-run.el.
10751 (Fautoload): Do the hash-doc more carefully.
10752 * data.c (Fdefalias): Purify definition, except for keymaps.
10753 (Qdefun): Move from eval.c.
10754 * lisp.h (Qdefun): Remove.
10755 * lread.c (read1): Tiny simplification.
10756
10757 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
10758
10759 Do not create empty overlays with the evaporate property (Bug#9642).
10760 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
10761 Bug#9642, but explicitly check that the buffer the overlay would
10762 be moved to is live and rearrange lines to make sure that errors
10763 will not put the overlay in an inconsistent state.
10764 (Fdelete_overlay): Cosmetics.
10765
10766 2012-05-28 Eli Zaretskii <eliz@gnu.org>
10767
10768 * w32term.c (my_bring_window_to_top): New function.
10769 (x_raise_frame): Use handle returned by DeferWindowPos, which
10770 could be different from the original one.
10771 Call my_bring_window_to_top instead of my_set_foreground_window.
10772 (Bug#11513)
10773
10774 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
10775 by calling BringWindowToTop.
10776
10777 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
10778 (WM_EMACS_END): Increase by one.
10779
10780 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
10781
10782 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
10783 This avoids undefined behavior that might cause the eassert
10784 to not catch an out-of-range value.
10785
10786 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
10787
10788 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
10789 Update dependencies.
10790
10791 2012-05-27 Eli Zaretskii <eliz@gnu.org>
10792
10793 * bidi.c (bidi_mirror_char): Fix last change.
10794
10795 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
10796
10797 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
10798 when referring to sectname field in printf format.
10799
10800 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
10801
10802 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
10803 Only r_alloc_inhibit_buffer_relocation needed to be added;
10804 the others were already declared.
10805
10806 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
10807 before checking whether it's out of range. Put the check inside
10808 eassert. See
10809 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
10810
10811 2012-05-27 Ken Brown <kbrown@cornell.edu>
10812
10813 * callproc.c (Fcall_process): Restore a line that was accidentally
10814 commented out in the 2011-02-13 change (bug#11547).
10815
10816 2012-05-27 Eli Zaretskii <eliz@gnu.org>
10817
10818 * lisp.h [REL_ALLOC]: Add prototypes for external functions
10819 defined on ralloc.c.
10820
10821 * buffer.c [REL_ALLOC]: Remove prototypes of
10822 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
10823 they are now on lisp.h.
10824
10825 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
10826
10827 * search.c (search_buffer): Use it to inhibit relocation of buffer
10828 text while re_search_2 is doing its job, because re_search_2 is
10829 passed C pointers to buffer text. (Bug#11519)
10830
10831 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
10832 Update value to 24.
10833
10834 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
10835 state after an additional call to move_it_in_display_line_to, keep
10836 the values of it->max_ascent and it->max_descent found for the
10837 entire line.
10838 (pos_visible_p): Revert the comparison against bottom_y to what it
10839 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
10840 (Bug#11464)
10841
10842 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10843
10844 Fix coding-related core dumps with gcc -ftrapv.
10845 The code was computing A - B, where A and B are pointers, and B is
10846 random garbage. This can lead to core dumps on platforms that
10847 have special pointer registers, and it also leads to core dumps on
10848 x86-64 when compiled with gcc -ftrapv. The fix is to compute
10849 A - B only when B is initialized properly.
10850 * coding.c (coding_set_source, coding_set_destination): Return void.
10851 (coding_change_source, coding_change_destinations): New functions,
10852 with the old behaviors of coding_set_source and coding_set_destination.
10853 All callers that need an offset changed to use these new functions.
10854
10855 2012-05-26 Glenn Morris <rgm@gnu.org>
10856
10857 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
10858
10859 2012-05-26 Eli Zaretskii <eliz@gnu.org>
10860
10861 Extend mouse support on W32 text-mode console.
10862 * xdisp.c (draw_row_with_mouse_face):
10863 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
10864
10865 * w32console.c: Include window.h.
10866 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
10867 New functions.
10868 (initialize_w32_display): Initialize mouse-highlight data.
10869
10870 * w32inevt.c: Include termchar.h and window.h.
10871 (do_mouse_event): Support mouse-autoselect-window. When the mouse
10872 moves, call note_mouse_highlight. If help_echo changed, call
10873 gen_help_event to produce help-echo message in the echo area.
10874 Call clear_mouse_face if mouse_face_hidden is set in the mouse
10875 highlight info.
10876
10877 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10878
10879 * lread.c (read1): Simplify slightly to avoid an overflow warning
10880 with GCC 4.7.0 on x86-64.
10881
10882 2012-05-26 Eli Zaretskii <eliz@gnu.org>
10883
10884 * bidi.c (bidi_mirror_char): Revert last change: an int is
10885 definitely wide enough here.
10886
10887 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
10888
10889 Fix integer width and related bugs (Bug#9874).
10890 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
10891 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
10892 (string_bytes, check_sblock, allocate_string_data):
10893 (compact_small_strings, Fmake_bool_vector, make_string)
10894 (make_unibyte_string, make_multibyte_string)
10895 (make_string_from_bytes, make_specified_string)
10896 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10897 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
10898 (mark_vectorlike):
10899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10900 (allocate_pseudovector):
10901 Use int, not EMACS_INT, where int is wide enough.
10902 (inhibit_garbage_collection, Fgarbage_collect):
10903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10904 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
10905 int might not be wide enough.
10906 (bidi_cache_search, bidi_cache_find, bidi_init_it)
10907 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
10908 (bidi_at_paragraph_end, bidi_find_paragraph_start)
10909 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10910 (bidi_level_of_next_char, bidi_move_to_visually_next):
10911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10912 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10913 (Fkill_buffer, Fset_buffer_major_mode)
10914 (advance_to_char_boundary, Fbuffer_swap_text)
10915 (Fset_buffer_multibyte, overlays_at, overlays_in)
10916 (overlay_touches_p, struct sortvec, record_overlay_string)
10917 (overlay_strings, recenter_overlay_lists)
10918 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10919 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10920 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10921 (Foverlay_recenter, last_overlay_modification_hooks_used)
10922 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10924 (validate_region): Omit unnecessary test for b <= e,
10925 since that's guaranteed by the previous test.
10926 (adjust_overlays_for_delete): Avoid pos + length overflow.
10927 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10928 (report_overlay_modification):
10929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10930 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10931 Omit pointer cast, which isn't needed anyway, and doesn't work
10932 after the EMACS_INT -> ptrdiff_t change.
10933 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
10934 * buffer.h: Adjust decls to match defn changes elsewhere.
10935 (struct buffer_text, struct buffer):
10936 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10937 Use EMACS_INT, not int, where int might not be wide enough.
10938 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
10939 not int, to avoid needless 32-bit limit on 64-bit hosts.
10940 (exec_byte_code): Use tighter memory-full test, one that checks
10941 for alloca overflow. Don't compute the address of the object just
10942 before an array, as that's not portable. Use EMACS_INT, not
10943 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
10944 * callint.c (Fcall_interactively):
10945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10946 * callproc.c (call_process_kill, Fcall_process):
10947 Don't assume pid_t fits into an Emacs fixnum.
10948 (call_process_cleanup, Fcall_process, child_setup):
10949 Don't assume pid_t fits into int.
10950 (call_process_cleanup, Fcall_process, delete_temp_file)
10951 (Fcall_process_region):
10952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10953 (Fcall_process): Simplify handling of volatile integers.
10954 Use int, not EMACS_INT, where int will do.
10955 * casefiddle.c (casify_object, casify_region, operate_on_word)
10956 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
10957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10958 (casify_object): Avoid integer overflow when overallocating buffer.
10959 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
10960 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
10961 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
10962 * category.h (CATEGORYP): Don't assume arg is nonnegative.
10963 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
10964 integers are now checked earlier. All uses replaced with XINT.
10965 (ccl_driver):
10966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10967 For CCL_MapSingle, check that content and value are in int range.
10968 (ccl_driver, Fregister_code_conversion_map):
10969 Check that Vcode_version_map_vector is a vector.
10970 (resolve_symbol_ccl_program): Check that vector header is in range.
10971 Always copy the vector, so that we can check its contents reliably
10972 now rather than having to recheck each instruction as it's being
10973 executed. Check that vector words fit in 'int'.
10974 (ccl_get_compiled_code, Fregister_ccl_program)
10975 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
10976 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
10977 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
10978 contents are in range.
10979 (Fccl_execute_on_string): Check that status is in range.
10980 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
10981 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
10982 Accept and return EMACS_INT, not int, because callers can pass values
10983 out of 'int' range.
10984 (c_string_width, strwidth, lisp_string_width, chars_in_text)
10985 (multibyte_chars_in_text, parse_str_as_multibyte)
10986 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
10987 (str_as_unibyte, str_to_unibyte, string_count_byte8)
10988 (string_escape_byte8, Fget_byte):
10989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10990 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
10991 avoid mishandling large integers.
10992 * character.h: Adjust decls to match defn changes elsewhere.
10993 * charset.c (load_charset_map_from_file, find_charsets_in_text)
10994 (Ffind_charset_region):
10995 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10996 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
10997 (load_charset_map_from_vector, Fdefine_charset_internal):
10998 Don't assume fixnum fits in int.
10999 (load_charset_map_from_vector, Fmap_charset_chars):
11000 Remove now-unnecessary CHECK_NATNUMs.
11001 (Fdefine_charset_internal): Check ranges here, more carefully.
11002 Don't rely on undefined behavior with signed left shift overflow.
11003 Don't assume unsigned int fits into fixnum, or that fixnum fits
11004 into unsigned int. Don't require max_code to be a valid fixnum;
11005 that's not true for gb10830 4-byte on a 32-bit host. Allow
11006 invalid_code to be a cons, for the same reason. Require code_offset
11007 to be a character. Avoid int overflow if max_char is close
11008 to INT_MAX.
11009 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11010 this is intended anyway and avoids some undefined behavior.
11011 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11012 INDEX_TO_CODE_POINT, as that's what it expects.
11013 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11014 * charset.h (DECODE_CHAR): Return int, not unsigned;
11015 this is what was intended anyway, and it avoids undefined behavior.
11016 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11017 integer-overflow issues.
11018 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11019 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11020 where the argument is EMACS_INT, and this behavior is not intended.
11021 * chartab.c (Fmake_char_table, Fset_char_table_range)
11022 (uniprop_get_decoder, uniprop_get_encoder):
11023 Don't assume fixnum fits in int.
11024 * cmds.c (move_point): New function, that does the gist of
11025 Fforward_char and Fbackward_char, but does so while checking
11026 for integer overflow more accurately.
11027 (Fforward_char, Fbackward_char): Use it.
11028 (Fforward_line, Fend_of_line, internal_self_insert)
11029 (internal_self_insert):
11030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11031 Fix a FIXME, by checking for integer overflow when calculating
11032 target_clm and actual_clm.
11033 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11034 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11035 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11036 (coding_alloc_by_making_gap, alloc_destination)
11037 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11038 (encode_coding_utf_16, detect_coding_emacs_mule)
11039 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11040 (detect_coding_iso_2022, decode_coding_iso_2022)
11041 (encode_invocation_designation, encode_designation_at_bol)
11042 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11043 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11044 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11045 (encode_coding_ccl, encode_coding_raw_text)
11046 (detect_coding_charset, decode_coding_charset)
11047 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11048 (produce_composition, produce_charset, produce_annotation)
11049 (decode_coding, handle_composition_annotation)
11050 (handle_charset_annotation, consume_chars, decode_coding_gap)
11051 (decode_coding_object, encode_coding_object, detect_coding_system)
11052 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11053 (code_convert_region, code_convert_string)
11054 (Fdefine_coding_system_internal)
11055 (coding_set_source, coding_set_destination):
11056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11057 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11058 (Fdefine_coding_system_internal):
11059 Don't assume fixnums fit in int.
11060 (decode_coding_gap, decode_coding_object, encode_coding_object)
11061 (Fread_coding_system, Fdetect_coding_region)
11062 (Funencodable_char_position, Fcheck_coding_systems_region)
11063 (get_translation, handle_composition_annotation, consume_chars):
11064 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11065 (consume_chars): Rewrite to not calculate an address outside buffer.
11066 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11067 Don't access memory outside of the args array.
11068 (Fdefine_coding_system_internal): Check for charset-id overflow.
11069 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11070 result of ENCODE_CHAR.
11071 * coding.h: Adjust decls to match defn changes elsewhere.
11072 (struct coding_system):
11073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11074 * composite.c (get_composition_id, find_composition)
11075 (run_composition_function, update_compositions)
11076 (compose_text, composition_gstring_put_cache)
11077 (composition_gstring_p, composition_gstring_width)
11078 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11079 (composition_compute_stop_pos, composition_reseat_it)
11080 (composition_update_it, struct position_record)
11081 (find_automatic_composition, composition_adjust_point)
11082 (Fcomposition_get_gstring, Ffind_composition_internal):
11083 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11084 (update_compositions):
11085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11086 * composite.h: Adjust decls to match defn changes elsewhere.
11087 (struct composition):
11088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11089 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11090 Do not attempt to compute the address of the object just before a
11091 buffer; this is not portable.
11092 (Faref, Faset):
11093 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11094 (Faset): Use int, not EMACS_INT, where int is wide enough.
11095 (Fstring_to_number): Don't assume fixnums fit in int.
11096 (Frem): Don't assume arg is nonnegative.
11097 * dbusbind.c (xd_append_arg): Check for integers out of range.
11098 (Fdbus_call_method): Don't overflow the timeout int.
11099 (extract_signed, extract_unsigned): New functions.
11100 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11101 (xd_get_connection_references): Return ptrdiff_t, not int.
11102 All uses changed.
11103 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11104 (xd_read_message_1):
11105 Use int, not unsigned, where the dbus API uses int.
11106 (Fdbus_message_internal): Don't overflow mtype.
11107 (syms_of_dbusbind): Allocate right-sized buffer for integers.
11108 * dired.c (directory_files_internal, file_name_completion, scmp)
11109 (file_name_completion_stat):
11110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11111 (file_name_completion): Don't overflow matchcount.
11112 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11113 * dispextern.h: Adjust decls to match defn changes elsewhere.
11114 (struct text_pos, struct glyph, struct bidi_saved_info)
11115 (struct bidi_string_data, struct bidi_it, struct composition_it)
11116 (struct it):
11117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11118 (struct display_pos, struct composition_it, struct it):
11119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11120 * dispnew.c (increment_matrix_positions)
11121 (increment_row_positions, mode_line_string)
11122 (marginal_area_string):
11123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11124 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
11125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11126 (duration_to_sec_usec): New function, to check for overflow better.
11127 (Fsleep_for, sit_for): Use it.
11128 * doc.c (get_doc_string, store_function_docstring):
11129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11130 (get_doc_string, Fsnarf_documentation):
11131 Use int, not EMACS_INT, where int is wide enough.
11132 (get_doc_string):
11133 Use SAFE_ALLOCA, not alloca.
11134 Check for overflow when converting EMACS_INT to off_t.
11135 * doprnt.c (doprnt):
11136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11137 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11138 Don't assume uid_t fits into fixnum.
11139 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11140 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11141 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11142 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11143 (general_insert_function)
11144 (Finsert_char, make_buffer_string, make_buffer_string_both)
11145 (update_buffer_properties, Fbuffer_substring)
11146 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11147 (Fsubst_char_in_region, check_translation)
11148 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11149 (transpose_markers, Ftranspose_regions):
11150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11151 (clip_to_bounds): Move to lisp.h as an inline function).
11152 (Fconstrain_to_field): Don't assume integers are nonnegative.
11153 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11154 (Fsubst_char_in_region, Fsave_restriction):
11155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11156 (Femacs_pid): Don't assume pid_t fits into fixnum.
11157 (lo_time): Use int, not EMACS_INT, when int suffices.
11158 (lisp_time_argument): Check for usec out of range.
11159 (Fencode_time): Don't assume fixnum fits in int.
11160 (Fuser_login_name, Fuser_full_name): Signal an error
11161 if a uid argument is out of range, rather than relying on
11162 undefined behavior.
11163 (Fformat_time_string): Remove now-unnecessary check.
11164 lisp_time_argument checks for out-of-range usec now.
11165 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
11166 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11167 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11168 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11169 (init_cmdargs, Fdump_emacs):
11170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11171 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11172 the bottom (typically) 32 bits of the fixnum.
11173 * eval.c (specpdl_size, call_debugger):
11174 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11175 (when_entered_debugger, Fbacktrace_debug):
11176 Don't assume fixnum can fit in int.
11177 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11178 the object just before a buffer; this is not portable.
11179 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11180 (grow_specpdl, unbind_to):
11181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11182 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11183 (grow_specpdl): Simplify allocation by using xpalloc.
11184 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
11185 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11186 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11187 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11188 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11189 (a_write, e_write):
11190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11191 (Fcopy_file, non_regular_nbytes, read_non_regular)
11192 (Finsert_file_contents):
11193 Use int, not EMACS_INT, where int is wide enough.
11194 (READ_BUF_SIZE): Verify that it fits in int.
11195 (Finsert_file_contents): Check that counts are in proper range,
11196 rather than assuming fixnums fit into ptrdiff_t etc.
11197 Don't assume fixnums fit into int.
11198 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
11199 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11200 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
11201 (string_char_to_byte, string_byte_to_char)
11202 (string_make_multibyte, string_to_multibyte)
11203 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11204 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11205 (substring_both, Fdelete, internal_equal, Ffillarray)
11206 (Fclear_string, mapcar1)
11207 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11208 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11209 (larger_vector, make_hash_table, maybe_resize_hash_table)
11210 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11211 (Fmaphash, secure_hash):
11212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11213 (concat): Check for string index and length overflow.
11214 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11215 (Frequire):
11216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11217 (larger_vector): New API (vec, incr_min, size_max) replaces old
11218 one (vec, new_size, init). This catches size overflow.
11219 INIT was removed because it was always Qnil.
11220 All callers changed.
11221 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11222 the upper bound on a hash table index size.
11223 (make_hash_table, maybe_resize_hash_table): Use it.
11224 (secure_hash): Computer start_byte and end_byte only after
11225 they're known to be in ptrdiff_t range.
11226 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11227 (Ffont_get_glyphs, Ffont_at):
11228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11229 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11230 (Flist_fonts, Fopen_font):
11231 Don't assume fixnum can fit in int.
11232 (check_gstring): Don't assume index can fit in int.
11233 (font_match_p): Check that fixnum is a character, not a nonnegative
11234 fixnum, since the later code needs to stuff it into an int.
11235 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11236 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11237 conversion overflow issues.
11238 (Fopen_font): Check for integer out of range.
11239 (Ffont_get_glyphs): Don't assume index can fit in int.
11240 * font.h: Adjust decls to match defn changes elsewhere.
11241 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11242 integer overflow.
11243 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11244 printmax_t, where ptrdiff_t is wide enough.
11245 (Finternal_char_font):
11246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11247 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11248 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11249 (Fset_frame_position, x_set_frame_parameters)
11250 (x_set_line_spacing, x_set_border_width)
11251 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11252 Check that fixnums are in proper range for system types.
11253 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11255 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11256 Use SAFE_ALLOCA_LISP, not alloca.
11257 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11258 intptr_t is wide enough.
11259 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11260 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11261 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11262 Check for fixnum out of range.
11263 * ftfont.c (ftfont_list): Don't assume index fits in int.
11264 Check that fixnums are in proper range for system types.
11265 (ftfont_shape_by_flt):
11266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11267 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11268 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11269 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11270 Check that fixnums are in proper range for system types.
11271 * gnutls.h: Adjust decls to match defn changes elsewhere.
11272 * gtkutil.c (xg_dialog_run):
11273 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11274 (update_frame_tool_bar):
11275 Check that fixnums are in proper range for system types.
11276 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
11277 (lookup_image): Check that fixnums are in range for system types.
11278 * indent.c (last_known_column, last_known_column_point):
11279 (current_column_bol_cache):
11280 (skip_invisible, current_column, check_display_width):
11281 (check_display_width, scan_for_column, current_column_1)
11282 (Findent_to, Fcurrent_indentation, position_indentation)
11283 (indented_beyond_p, Fmove_to_column, compute_motion):
11284 (Fcompute_motion, Fvertical_motion):
11285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11286 (last_known_column_modified): Use EMACS_INT, not int.
11287 (check_display_width):
11288 (Fcompute_motion):
11289 Check that fixnums and floats are in proper range for system types.
11290 (compute_motion): Don't assume index or fixnum fits in int.
11291 (compute_motion, Fcompute_motion):
11292 Use int, not EMACS_INT, when it is wide enough.
11293 (vmotion): Omit local var start_hpos that is always 0; that way
11294 we don't need to worry about overflow in expressions involving it.
11295 * indent.h: Adjust decls to match defn changes elsewhere.
11296 (struct position):
11297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11298 Use int, not EMACS_INT, where int is wide enough.
11299 Remove unused members ovstring_chars_done and tab_offset;
11300 all uses removed.
11301 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11302 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11303 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11304 (make_gap, copy_text, insert, insert_and_inherit)
11305 (insert_before_markers, insert_before_markers_and_inherit)
11306 (insert_1, count_combining_before, count_combining_after)
11307 (insert_1_both, insert_from_string)
11308 (insert_from_string_before_markers, insert_from_string_1)
11309 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11310 (adjust_after_replace, adjust_after_insert, replace_range)
11311 (replace_range_2, del_range, del_range_1, del_range_byte)
11312 (del_range_both, del_range_2, modify_region)
11313 (prepare_to_modify_buffer, signal_before_change)
11314 (signal_after_change, Fcombine_after_change_execute):
11315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11316 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11317 (balance_an_interval, split_interval_right, split_interval_left)
11318 (find_interval, next_interval, update_interval)
11319 (adjust_intervals_for_insertion, delete_node, delete_interval)
11320 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11321 (static_offset_intervals, offset_intervals)
11322 (merge_interval_right, merge_interval_left, make_new_interval)
11323 (graft_intervals_into_buffer, temp_set_point_both)
11324 (temp_set_point, set_point, adjust_for_invis_intang)
11325 (set_point_both, move_if_not_intangible, get_property_and_range)
11326 (get_local_map, copy_intervals, copy_intervals_to_string)
11327 (compare_string_intervals, set_intervals_multibyte_1):
11328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11329 * intervals.h: Adjust decls to match defn changes elsewhere.
11330 (struct interval):
11331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11332 * keyboard.c (this_command_key_count, this_single_command_key_start)
11333 (before_command_key_count, before_command_echo_length, echo_now)
11334 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11335 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11336 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11337 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11339 (last_non_minibuf_size, last_point_position, echo_truncate)
11340 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11341 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11342 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11343 (stuff_buffered_input):
11344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11345 (last_auto_save, command_loop_1, read_char):
11346 Use EMACS_INT, not int, to avoid integer overflow.
11347 (record_char): Avoid overflow in total_keys computation.
11348 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11349 * keyboard.h: Adjust decls to match defn changes elsewhere.
11350 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11351 (Fkey_description, Fdescribe_vector, Flookup_key):
11352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11353 (click_position): New function, to check that positions are in range.
11354 (Fcurrent_active_maps):
11355 (describe_command):
11356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11357 (Faccessible_keymaps, Fkey_description):
11358 (preferred_sequence_p):
11359 Don't assume fixnum can fit into int.
11360 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11361 Check for integer overflow in size calculations.
11362 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11363 avoid mishandling large integers.
11364 * lisp.h: Adjust decls to match defn changes elsewhere.
11365 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11366 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11367 (struct Lisp_Marker):
11368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11369 (clip_to_bounds): Now an inline function, moved here from editfns.c.
11370 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11371 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11372 All callers changed.
11373 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11374 Assume the arg has valid form, since it always does.
11375 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11376 unsigned integer system type.
11377 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11378 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11380 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11381 (duration_to_sec_usec): New decl.
11382 * lread.c (read_from_string_index, read_from_string_index_byte)
11383 (read_from_string_limit, readchar, unreadchar, openp)
11384 (read_internal_start, read1, oblookup):
11385 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11386 (Fload, readevalloop, Feval_buffer, Feval_region):
11387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11388 (openp): Check for out-of-range argument to 'access'.
11389 (read1): Use int, not EMACS_INT, where int is wide enough.
11390 Don't assume fixnum fits into int.
11391 Fix off-by-one error that can read outside a buffer.
11392 (read_filtered_event): Use duration_to_sec_usec
11393 to do proper overflow checking on durations.
11394 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11395 in size calculation.
11396 (Fexecute_kbd_macro):
11397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11398 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11399 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11400 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11401 (set_marker_both, set_marker_restricted_both, marker_position)
11402 (marker_byte_position, Fbuffer_has_markers_at):
11403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11404 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
11405 * menu.c (ensure_menu_items): Rename from grow_menu_items.
11406 It now merely ensures that the menu is large enough, without
11407 necessarily growing it, as this avoids some integer overflow issues.
11408 All callers changed.
11409 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11410 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11411 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11412 Use SAFE_ALLOCA_LISP, not alloca.
11413 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11414 to EMACS_INT. Check that fixnums are in proper range for system types.
11415 * minibuf.c (minibuf_prompt_width, string_to_object)
11416 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11417 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11419 (get_minibuffer, read_minibuf_unwind):
11420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11421 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11422 this simplifies overflow checking. All callers changed.
11423 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11424 (Ftest_completion):
11425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11426 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11427 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11428 Check that fixnums are in proper range for system types.
11429 (Fx_create_frame, Fx_show_tip):
11430 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11431 * nsfont.m (ns_findfonts, nsfont_list_family):
11432 Don't assume fixnum fits in long.
11433 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11435 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11436 wide enough.
11437 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
11438 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11439 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11440 (PRINTDECLARE, PRINTPREPARE):
11441 (strout, print_string):
11442 (print, print_preprocess, print_check_string_charset_prop)
11443 (print_object):
11444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11445 (PRINTDECLARE):
11446 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11448 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
11449 (printchar, strout): Use xpalloc to catch size calculation overflow.
11450 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
11451 (print_error_message): Use SAFE_ALLOCA, not alloca.
11452 (print_object): Use int, not EMACS_INT, where int is wide enough.
11453 (print_depth, new_backquote_output, print_number_index):
11454 Use ptrdiff_t, not int, where int might not be wide enough.
11455 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11456 (Fset_process_window_size, Fformat_network_address)
11457 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
11458 (sigchld_handler):
11459 Check that fixnums are in proper range for system types.
11460 (Fsignal_process): Simplify by avoiding a goto.
11461 Check for process-ids out of pid_t range rather than relying on
11462 undefined behavior.
11463 (process_tick, update_tick): Use EMACS_INT, not int.
11464 (Fformat_network_address, read_process_output, send_process)
11465 (Fprocess_send_region, status_notify):
11466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11467 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11468 (wait_reading_process_output, read_process_output, exec_sentinel):
11469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11470 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11471 (Faccept_process_output): Use duration_to_sec_usec to do proper
11472 overflow checking on durations.
11473 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11474 Don't assume pid_t fits in int.
11475 * process.h (struct Lisp_Process): Members tick and update_tick
11476 are now of type EMACS_INT, not int.
11477 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11478 configured --with-wide-int.
11479 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11480 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11481 * search.c (looking_at_1, string_match_1):
11482 (fast_string_match, fast_c_string_match_ignore_case)
11483 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11484 (scan_newline, find_before_next_newline, search_command)
11485 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11486 (set_search_regs, wordify):
11487 (Freplace_match):
11488 (Fmatch_data):
11489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11490 (string_match_1, search_buffer, set_search_regs):
11491 (Fmatch_data):
11492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11493 (wordify): Check for overflow in size calculation.
11494 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11495 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11496 Check that fixnums are in proper range for system types.
11497 * sound.c (struct sound_device)
11498 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11499 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11500 (Fplay_sound_internal):
11501 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11502 * syntax.c (struct lisp_parse_state, find_start_modiff)
11503 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11504 (Fparse_partial_sexp):
11505 Don't assume fixnums can fit in int.
11506 (struct lisp_parse_state, find_start_pos, find_start_value)
11507 (find_start_value_byte, find_start_begv)
11508 (update_syntax_table, char_quoted, dec_bytepos)
11509 (find_defun_start, prev_char_comend_first, back_comment):
11510 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11511 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11513 (Finternal_describe_syntax_value): Check that match_lisp is a
11514 character, not an integer, since the code stuffs it into int.
11515 (scan_words, scan_sexps_forward):
11516 Check that fixnums are in proper range for system types.
11517 (Fforward_word):
11518 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11519 (scan_sexps_forward):
11520 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11521 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11522 * syntax.h: Adjust decls to match defn changes elsewhere.
11523 (struct gl_state_s):
11524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11525 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
11526 MOST_POSITIVE_FIXNUM.
11527 * sysdep.c (wait_for_termination_1, wait_for_termination)
11528 (interruptible_wait_for_termination, mkdir):
11529 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
11530 (emacs_read, emacs_write):
11531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11532 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
11533 and double all fit in int.
11534 * term.c (set_tty_color_mode):
11535 Check that fixnums are in proper range for system types.
11536 * termhooks.h (struct input_event):
11537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11538 * textprop.c (validate_interval_range, interval_of)
11539 (Fadd_text_properties, set_text_properties_1)
11540 (Fremove_text_properties, Fremove_list_of_text_properties)
11541 (Ftext_property_any, Ftext_property_not_all)
11542 (copy_text_properties, text_property_list, extend_property_ranges)
11543 (verify_interval_modification):
11544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11545 (Fnext_single_char_property_change)
11546 (Fprevious_single_char_property_change):
11547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11548 (copy_text_properties):
11549 Check for integer overflow in index calculation.
11550 * undo.c (last_boundary_position, record_point, record_insert)
11551 (record_delete, record_marker_adjustment, record_change)
11552 (record_property_change):
11553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11554 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11556 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11557 (Fx_hide_tip, Fx_file_dialog):
11558 * w32menu.c (set_frame_menubar):
11559 Use ptrdiff_t, not int, for consistency with rest of code.
11560 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11561 (select_window, Fdelete_other_windows_internal)
11562 (window_scroll_pixel_based, window_scroll_line_based)
11563 (Frecenter, Fset_window_configuration):
11564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11565 (Fset_window_hscroll, run_window_configuration_change_hook)
11566 (set_window_buffer, temp_output_buffer_show, scroll_command)
11567 (Fscroll_other_window, Frecenter):
11568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11569 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11570 Don't assume fixnum fits in int.
11571 (Fset_window_scroll_bars):
11572 Check that fixnums are in proper range for system types.
11573 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11574 (string_pos, c_string_pos, number_of_chars, init_iterator)
11575 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11576 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11577 (compute_display_string_end, handle_face_prop)
11578 (face_before_or_after_it_pos, handle_invisible_prop)
11579 (handle_display_prop, handle_display_spec, handle_single_display_spec)
11580 (display_prop_intangible_p, string_buffer_position_lim)
11581 (string_buffer_position, handle_composition_prop, load_overlay_strings)
11582 (get_overlay_strings_1, get_overlay_strings)
11583 (iterate_out_of_display_property, forward_to_next_line_start)
11584 (back_to_previous_visible_line_start, reseat, reseat_to_string)
11585 (get_next_display_element, set_iterator_to_next)
11586 (get_visually_first_element, compute_stop_pos_backwards)
11587 (handle_stop_backwards, next_element_from_buffer)
11588 (move_it_in_display_line_to, move_it_in_display_line)
11589 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11590 (add_to_log, message_dolog, message_log_check_duplicate)
11591 (message2, message2_nolog, message3, message3_nolog
11592 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
11593 (current_message_1, truncate_echo_area, truncate_message_1)
11594 (set_message, set_message_1, store_mode_line_noprop)
11595 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
11596 (text_outside_line_unchanged_p, check_point_in_composition)
11597 (reconsider_clip_changes)
11598 (redisplay_internal, set_cursor_from_row, try_scrolling)
11599 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
11600 (redisplay_window, find_last_unchanged_at_beg_row)
11601 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
11602 (trailing_whitespace_p, find_row_edges, display_line)
11603 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
11604 (display_mode_element, store_mode_line_string)
11605 (pint2str, pint2hrstr, decode_mode_spec)
11606 (display_count_lines, display_string, draw_glyphs)
11607 (x_produce_glyphs, x_insert_glyphs)
11608 (rows_from_pos_range, mouse_face_from_buffer_pos)
11609 (fast_find_string_pos, mouse_face_from_string_pos)
11610 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11612 (safe_call, init_from_display_pos, handle_fontified_prop)
11613 (handle_single_display_spec, load_overlay_strings)
11614 (with_echo_area_buffer, setup_echo_area_for_printing)
11615 (display_echo_area, echo_area_display)
11616 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
11617 (update_tool_bar, hscroll_window_tree, redisplay_internal)
11618 (redisplay_window, dump_glyph_row, display_mode_line)
11619 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
11620 (handle_display_spec, display_prop_string_p):
11621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11622 (handle_single_display_spec, build_desired_tool_bar_string)
11623 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
11624 (get_specified_cursor_type):
11625 Check that fixnums are in proper range for system types.
11626 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
11627 (Flookup_image_map):
11628 Don't assume fixnums fit in int.
11629 (compare_overlay_entries):
11630 Avoid mishandling comparisons due to subtraction overflow.
11631 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
11632 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
11633 (handle_tool_bar_click):
11634 Use int, not unsigned, since we prefer signed and the signedness
11635 doesn't matter here.
11636 (get_next_display_element, next_element_from_display_vector):
11637 Use int, not EMACS_INT, when int is wide enough.
11638 (start_hourglass): Use duration_to_sec_usec to do proper
11639 overflow checking on durations.
11640 * xfaces.c (Fbitmap_spec_p):
11641 Check that fixnums are in proper range for system types.
11642 (compare_fonts_by_sort_order):
11643 Avoid mishandling comparisons due to subtraction overflow.
11644 (Fx_family_fonts, realize_basic_faces):
11645 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11646 (Fx_family_fonts):
11647 Don't assume fixnum fits in int.
11648 Use SAFE_ALLOCA_LISP, not alloca.
11649 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
11650 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
11651 (face_at_buffer_position, face_for_overlay_string)
11652 (face_at_string_position):
11653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11654 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
11655 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
11656 (Fx_show_tip):
11657 Check that fixnums are in proper range for system types.
11658 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11659 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
11660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11661 (Fx_change_window_property): Don't assume fixnums fit in int.
11662 * xfont.c (xfont_chars_supported):
11663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11664 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
11665 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
11666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11667 * xml.c (parse_region):
11668 * xrdb.c (magic_file_p):
11669 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11670 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
11671 (x_get_local_selection, x_reply_selection_request)
11672 (x_handle_selection_request, wait_for_property_change):
11673 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11674 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
11675 short is wide enough.
11676 (x_send_client_event): Don't assume fixnum fits in int.
11677 * xterm.c (x_x_to_emacs_modifiers):
11678 Don't assume EMACS_INT overflows nicely into int.
11679 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
11680 may come from Lisp.
11681 (handle_one_xevent): NATNUMP can eval its arg twice.
11682 (x_connection_closed):
11683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11684 * xterm.h: Adjust decls to match defn changes elsewhere.
11685 (struct scroll_bar): Use struct vectorlike_header
11686 rather than rolling our own approximation.
11687 (SCROLL_BAR_VEC_SIZE): Remove; not used.
11688
11689 2012-05-25 Glenn Morris <rgm@gnu.org>
11690
11691 * lisp.mk (lisp): Update for more files being compiled now.
11692
11693 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
11694
11695 * lread.c: Remove `read_pure' which makes no difference.
11696 (read_pure): Remove var.
11697 (unreadpure): Remove function.
11698 (readevalloop): Don't call read_list with -1 flag.
11699 (read1, read_vector): Don't test read_pure any more.
11700 (read_list): Simplify.
11701
11702 * fileio.c, character.h: Minor style tweaks.
11703
11704 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
11705
11706 * window.h (clip_changed): Remove useless declaration.
11707
11708 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
11709
11710 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
11711 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
11712
11713 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 Remove src/m/*.
11716 This directory predates autoconf and is no longer needed nowadays.
11717 Move its few remaining bits of functionality to where they're needed.
11718 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
11719 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
11720 * m/template.h: Remove.
11721 * Makefile.in (M_FILE): Remove. All uses removed.
11722 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11723 * lisp.h (USE_LSB_TAG):
11724 * mem-limits.h (EXCEEDS_LISP_PTR):
11725 Use VAL_MAX, not VALBITS, in #if.
11726 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
11727 (EMACS_UINT): Define unconditionally now.
11728 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
11729 (BITS_PER_EMACS_INT): New constants, replacing
11730 what used to be in config.h, but not useful in #if.
11731 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
11732 define them any more.
11733 (VAL_MAX): New macro.
11734 (VALMASK): Use it.
11735 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
11736 BITS_PER_EMACS_INT, in #if.
11737 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11738 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
11739 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
11740 * s/ms-w32.h (DATA_START):
11741 Move here from removed file m/intel386.h.
11742 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
11743 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
11744
11745 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
11746
11747 Assume C89 or later.
11748 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
11749 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
11750 (xrealloc):
11751 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
11752 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
11753 * textprop.c, tparam.c (NULL): Remove.
11754 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11755 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
11756 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
11757 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
11758 * xterm.c (input_signal_count): Assume volatile works.
11759
11760 2012-05-21 Ken Brown <kbrown@cornell.edu>
11761
11762 * xgselect.c (xg_select): Fix first argument in call to 'select'
11763 (bug#11508).
11764
11765 2012-05-20 Ken Brown <kbrown@cornell.edu>
11766
11767 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
11768 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
11769
11770 2012-05-19 Ken Brown <kbrown@cornell.edu>
11771
11772 * xfns.c (x_in_use): Remove `static' qualifier.
11773 * xterm.h (x_in_use): Declare.
11774 * xgselect.c: Include xterm.h.
11775 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
11776 and `display_arg' (bug#9754).
11777
11778 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
11779
11780 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
11781
11782 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
11783 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
11784
11785 2012-05-18 Eli Zaretskii <eliz@gnu.org>
11786
11787 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
11788
11789 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
11790 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
11791
11792 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
11793 reference to image_cache->refcount.
11794 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
11795
11796 2012-05-17 Juri Linkov <juri@jurta.org>
11797
11798 * search.c (Fword_search_regexp, Fword_search_backward)
11799 (Fword_search_forward, Fword_search_backward_lax)
11800 (Fword_search_forward_lax): Move functions to isearch.el
11801 (bug#10145, bug#11381).
11802
11803 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
11804
11805 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
11806
11807 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
11808
11809 * lread.c (init_obarray): Declare Qt and Qnil as special.
11810
11811 2012-05-14 Glenn Morris <rgm@gnu.org>
11812
11813 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
11814 Put "libexec" before "bin", for the sake of init_callproc_1.
11815
11816 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11817
11818 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
11819
11820 * unexaix.c: Port to more-recent AIX compilers.
11821 (report_error, report_error_1, make_hdr, copy_sym)
11822 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
11823 Make arguments const char *, not char *, to avoid violations of C
11824 standard and to fix some AIX warnings reported by Gilles Pion.
11825
11826 2012-05-14 Eli Zaretskii <eliz@gnu.org>
11827
11828 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
11829 already have overlays loaded.
11830 (handle_single_display_spec): Before returning without displaying
11831 fringe bitmap, synchronize the bidi iterator with the main display
11832 iterator, by calling iterate_out_of_display_property.
11833 (iterate_out_of_display_property): Detect buffer iteration by
11834 testing that it->string is a Lisp string.
11835 (get_next_display_element): When the current object is exhausted,
11836 and there's something on it->stack, call set_iterator_to_next to
11837 proceed with what's on the stack, instead of returning zero.
11838 (set_iterator_to_next): If called at the end of a Lisp string,
11839 proceed to consider_string_end without incrementing string
11840 position. Don't increment display vector index past the end of
11841 the display vector. (Bug#11417)
11842 (pos_visible_p): Don't report a position visible when move_it_to
11843 stopped at the last line of window, which happens to be scanned
11844 backwards by the bidi iteration. (Bug#11464)
11845
11846 2012-05-14 Eli Zaretskii <eliz@gnu.org>
11847
11848 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
11849 and right-margin display specs even if the spec is invalid or we
11850 are on a TTY, and thus unable to display on the fringes.
11851 That's because the text with the property will not be displayed anyway,
11852 so we need to signal to the caller that this is a "replacing"
11853 display spec. This fixes display when the spec is invalid or we
11854 are on a TTY.
11855
11856 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11857
11858 * unexaix.c (make_hdr): Fix typo in prototype.
11859 This bug broke the build on AIX. Problem reported by Gilles Pion.
11860
11861 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
11862
11863 * keyboard.c (kbd_buffer_get_event): Read special events also in
11864 batch mode. (Bug#11415)
11865
11866 2012-05-12 Glenn Morris <rgm@gnu.org>
11867
11868 * ns.mk: Update for ns_appbindir no longer having trailing "/".
11869
11870 2012-05-12 Eli Zaretskii <eliz@gnu.org>
11871
11872 * lisp.mk (lisp): Add newcomment.elc.
11873
11874 2012-05-12 Glenn Morris <rgm@gnu.org>
11875
11876 * Makefile.in (MKDIR_P): New, set by configure.
11877 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
11878
11879 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
11880
11881 Remove unused function hourglass_started.
11882 * dispextern.h (hourglass_started):
11883 * w32fns.c (hourglass_started):
11884 * xdisp.c (hourglass_started): Remove.
11885
11886 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
11887
11888 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
11889 Update dependencies.
11890
11891 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
11892
11893 * xgselect.c (xg_select): Put maxfds+1 into a var.
11894 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
11895
11896 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
11897
11898 2012-05-10 Dave Abrahams <dave@boostpro.com>
11899
11900 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
11901 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
11902
11903 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
11904
11905 * dbusbind.c (xd_registered_buses): New internal Lisp object.
11906 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
11907 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
11908 Initialize xd_registered_buses.
11909
11910 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11911
11912 Untag more efficiently if USE_LSB_TAG.
11913 This is based on a proposal by YAMAMOTO Mitsuharu in
11914 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11915 For an admittedly artificial (nth 8000 longlist) benchmark on
11916 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11917 Emacs's overall text size by 1%.
11918 * lisp.h (XUNTAG): New macro.
11919 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11920 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11921 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11922 * eval.c (Fautoload):
11923 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11924 * frame.h (XFRAME): Use XUNTAG.
11925
11926 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11927 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11928 Remove unportable assumptions about print widths of types like
11929 dbus_uint32_t.
11930 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11931 intptr_t when converting between pointer and integer, to avoid GCC
11932 warnings about wrong width.
11933
11934 2012-05-09 Eli Zaretskii <eliz@gnu.org>
11935
11936 * w32proc.c (new_child): Force Windows to reserve only 64KB of
11937 stack for each reader_thread, instead of defaulting to 8MB
11938 determined by the linker. This avoids failures in creating
11939 subprocesses on Windows 7, see the discussion in this thread:
11940 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
11941
11942 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
11943
11944 Fix up display of the *Minibuf-0* buffer in the mini window.
11945 * keyboard.c (read_char): Don't clear the echo area if there's no
11946 message to clear.
11947 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
11948 contents of *Minibuf-0*) if there's no message displayed in its stead.
11949
11950 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
11951
11952 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
11953 batch mode.
11954
11955 2012-05-06 Chong Yidong <cyd@gnu.org>
11956
11957 * lisp.mk (lisp): Update.
11958
11959 2012-05-05 Jim Meyering <meyering@redhat.com>
11960
11961 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
11962
11963 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
11964
11965 * data.c (PUT_ERROR): New macro.
11966 (syms_of_data): Use it. Add new error type `user-error'.
11967 * undo.c (user_error): New function.
11968 (Fprimitive_undo): Use it.
11969 * print.c (print_error_message): Adjust print style for `user-error'.
11970 * keyboard.c (user_error): New function.
11971 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
11972
11973 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
11974
11975 Do not limit current-time-string to years 1000..9999.
11976 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
11977 (Fcurrent_time_string): Support any year that is supported by the
11978 underlying localtime representation. Don't use asctime, as it
11979 has undefined behavior for years outside the range -999..9999.
11980
11981 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
11982
11983 Fix race conditions involving setenv, gmtime, localtime, asctime.
11984 Without this fix, interrupts could mess up code that uses these
11985 nonreentrant functions, since setting TZ invalidates existing
11986 tm_zone or tzname values, and since most of these functions return
11987 pointers to static storage.
11988 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
11989 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
11990 Grow the critical sections to include not just invoking
11991 localtime/gmtime, but also accessing these functions' results
11992 including their tm_zone values if any, and any related TZ setting.
11993 (format_time_string): Last arg is now struct tm *, not struct tm **,
11994 so that the struct tm is saved in the critical section.
11995 All callers changed. Simplify allocation of initial buffer, partly
11996 motivated by the fact that memory allocation needs to be outside
11997 the critical section.
11998
11999 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12000
12001 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12002 with RESET_INTERVAL.
12003
12004 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12005 Remove duplicated buffer name initialization.
12006
12007 2012-05-02 Jim Meyering <jim@meyering.net>
12008
12009 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12010
12011 * xfns.c (x_window): Use xstrdup (Bug#11375).
12012
12013 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12014
12015 * xdisp.c (pos_visible_p): If already at a newline from the
12016 display string before the 'while' loop, don't walk back the glyphs
12017 from it3.glyph_row. Solves assertion violation when the display
12018 string begins with a newline (egg.el). (Bug#11367)
12019
12020 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12021
12022 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12023 Move to simple.el.
12024
12025 2012-05-01 Glenn Morris <rgm@gnu.org>
12026
12027 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12028 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12029 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12030 All were removed before 23.1.
12031
12032 * dispnew.c: Remove HAVE_LIBNCURSES test;
12033 it is always true on relevant platforms.
12034
12035 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12036 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12037
12038 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12039
12040 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12041
12042 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12043 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12044 Remove.
12045
12046 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12047
12048 Do not avoid creating empty evaporating overlays (Bug#9642).
12049 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12050 That is, do not delete an evaporating overlay if it becomes
12051 empty after its bounds are adjusted to fit within its buffer.
12052 This fix caused other problems, and I'm reverting it until we get
12053 to the bottom of them.
12054
12055 2012-04-27 Chong Yidong <cyd@gnu.org>
12056
12057 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12058
12059 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12060
12061 * xdisp.c (pos_visible_p): If the window start position is beyond
12062 ZV, start the display from buffer beginning. Prevents assertion
12063 violation in init_iterator when the minibuffer window is scrolled
12064 via the scroll bar.
12065
12066 * window.c (window_scroll_pixel_based): Likewise.
12067
12068 2012-04-27 Chong Yidong <cyd@gnu.org>
12069
12070 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12071
12072 2012-04-27 Glenn Morris <rgm@gnu.org>
12073
12074 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12075 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12076
12077 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12078
12079 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12080 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
12081
12082 2012-04-26 Eli Zaretskii <eliz@gnu.org>
12083
12084 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12085 display element, check also the underlying string or buffer
12086 character. (Bug#11341)
12087
12088 * w32menu.c: Include w32heap.h.
12089 (add_menu_item): If the call to AppendMenuW (via
12090 unicode_append_menu) fails, disable Unicode menus only if we are
12091 running on Windows 9X/Me.
12092
12093 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12094
12095 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12096 (xgetint): Add missing shift for LSB tags.
12097
12098 2012-04-24 Martin Rudalics <rudalics@gmx.at>
12099
12100 * keyboard.c (read_char): Don't wipe echo area for select window
12101 events: These might get delayed via `mouse-autoselect-window'
12102 (Bug#11304).
12103
12104 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
12105
12106 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12107 manipulation of :loaded-from data.
12108
12109 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
12110
12111 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12112 now a cons (bug#11311).
12113
12114 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12115
12116 Do not create empty overlays with the evaporate property (Bug#9642).
12117 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12118 if it becomes empty after its bounds are adjusted to fit within
12119 its buffer. Without this fix, in a nonempty buffer (let ((o
12120 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12121 yields an empty overlay that has the evaporate property, which is
12122 not supposed to happen.
12123
12124 Fix minor GTK3 problems found by static checking.
12125 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12126 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12127 (struct _EmacsFixedClass, emacs_fixed_get_type):
12128 Move decls here from emacsgtkfixed.h, since they needn't be public.
12129 (emacs_fixed_get_type): Now static.
12130 (emacs_fixed_class_init): Omit unused local.
12131 (emacs_fixed_child_type): Remove; unused.
12132 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12133 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12134 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12135 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12136 (EMACS_FIXED_GET_CLASS): Remove; unused.
12137 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12138
12139 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12140 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12141
12142 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12143
12144 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
12145 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
12146 (__malloc_size_t, __malloc_ptrdiff_t):
12147 Remove. All uses removed, replaced by the definiens if needed,
12148 since we can assume C89 or better now.
12149 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12150 (protect_malloc_state, align, get_contiguous_space)
12151 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12152 (malloc_atfork_handler_child, malloc_enable_thread)
12153 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12154 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12155 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12156 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12157 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12158 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12159 Define using prototypes, not old style.
12160 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12161 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12162 (align): Don't assume that signed integer overflow wraps around.
12163 Omit unused local var.
12164 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12165 (_free_internal_nolock, memalign, mallochook, reallochook):
12166 Omit no-longer-needed casts.
12167 (valloc): Use getpagesize, not __getpagesize.
12168 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12169 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12170
12171 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12172
12173 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
12174
12175 Move functions from C to Lisp. Make non-blocking method calls
12176 the default. Implement further D-Bus standard interfaces.
12177
12178 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12179 (QCdbus_request_name_allow_replacement)
12180 (QCdbus_request_name_replace_existing)
12181 (QCdbus_request_name_do_not_queue)
12182 (QCdbus_request_name_reply_primary_owner)
12183 (QCdbus_request_name_reply_in_queue)
12184 (QCdbus_request_name_reply_exists)
12185 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12186 (QCdbus_registered_serial, QCdbus_registered_method)
12187 (QCdbus_registered_signal): New Lisp objects.
12188 (XD_DEBUG_MESSAGE): Use sizeof.
12189 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12190 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12191 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12192 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12193 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12194 (xd_signature, xd_append_arg): Allow float for integer types.
12195 (xd_get_connection_references): New function.
12196 (xd_get_connection_address): Rename from xd_initialize.
12197 Return cached address.
12198 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12199 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12200 level.
12201 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
12202 Return number of refcounts.
12203 (Fdbus_get_unique_name): Make stronger parameter check.
12204 (Fdbus_message_internal): New defun.
12205 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12206 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12207 (Fdbus_send_signal, Fdbus_register_service)
12208 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12209 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12210 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12211 (Vdbus_compiled_version, Vdbus_runtime_version)
12212 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12213 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12214 (Vdbus_message_type_signal): New defvars.
12215 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12216 Adapt docstring.
12217
12218 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12219
12220 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12221 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12222 Do not assume ptrdiff_t is the same width as 'int'.
12223
12224 * alloc.c: Handle unusual debugging option combinations.
12225 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12226 since the two debugging options are incompatible.
12227 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12228 is defined.
12229 (mem_init, mem_insert, mem_insert_fixup):
12230 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12231 (NEED_MEM_INSERT): Remove; no longer needed.
12232
12233 2012-04-22 Leo Liu <sdl.web@gmail.com>
12234
12235 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12236
12237 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12238
12239 * sysdep.c [__FreeBSD__]: Minor cleanups.
12240 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12241 Use Emacs indenting style more consistently. Avoid some casts.
12242 Use 'double' consistently rather than mixing 'float' and 'double'.
12243
12244 2012-04-21 Eduard Wiebe <usenet@pusto.de>
12245
12246 * sysdep.c (list_system_processes, system_process_attributes):
12247 Add implementation for FreeBSD (Bug#5243).
12248
12249 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12250
12251 * lisp.mk (lisp): Update.
12252
12253 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12254
12255 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12256 It is never used otherwise.
12257
12258 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12259
12260 * print.c (print_preprocess): Only check print_depth if print-circle
12261 is nil.
12262 (print_object): Check for cycles even when print-circle is nil and
12263 print-gensym is t, but only check print_depth if print-circle is nil.
12264
12265 2012-04-20 Chong Yidong <cyd@gnu.org>
12266
12267 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12268 set the status to "failed" and ensure that sentinel is run.
12269
12270 2012-04-20 Glenn Morris <rgm@gnu.org>
12271
12272 * process.c (Fset_process_inherit_coding_system_flag)
12273 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
12274 (Fmake_network_process, Fmake_serial_process): Doc fix.
12275
12276 2012-04-20 Eli Zaretskii <eliz@gnu.org>
12277
12278 * xdisp.c (string_buffer_position_lim): Limit starting position to
12279 BEGV.
12280 (set_cursor_from_row): If called for a mode-line or header-line
12281 row, return zero immediately.
12282 (try_cursor_movement): If inside continuation line, don't back up
12283 farther than the first row after the header line, if any.
12284 Don't consider the header-line row as "partially visible", even if
12285 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12286
12287 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12288
12289 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12290 (bug#11238).
12291
12292 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
12293 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
12294
12295 configure: new option --enable-gcc-warnings (Bug#11207)
12296 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12297 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12298 (ALL_CFLAGS): Use new macros rather than old.
12299 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12300 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12301 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12302 -Wunused-result, -Wunused-variable. This should go away once
12303 the Emacs and Gnulib regex code is merged.
12304 (xmalloc, xrealloc): Now static.
12305
12306 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12307
12308 * dired.c (Fsystem_groups): Remove unused local.
12309
12310 2012-04-17 Glenn Morris <rgm@gnu.org>
12311
12312 * dired.c (Fsystem_users): Doc fix.
12313
12314 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12315
12316 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12317 (syms_of_dired): Add them.
12318
12319 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12320
12321 Fix minor alloc.c problems found by static checking.
12322 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12323 New extern decls, to avoid calling undeclared functions.
12324 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12325 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12326 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12327 (NEED_MEM_INSERT): New macro.
12328 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
12329 Remove one incorrect comment and fix another.
12330
12331 Fix minor ralloc.c problems found by static checking.
12332 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12333 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12334 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12335 (r_alloc_sbrk): Now static.
12336
12337 Improve ralloc.c interface checking.
12338 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12339 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12340 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12341 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12342 [REL_ALLOC]: ... to here, to check interface.
12343 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12344 Remove decls. This fixes an "It stinks!".
12345
12346 * alloc.c (which_symbols): Fix alignment issue / type clash.
12347
12348 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12349
12350 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12351 (struct Lisp_Misc_Any): Likewise.
12352 (struct Lisp_Free): Likewise.
12353 * alloc.c (union aligned_Lisp_Symbol): Define.
12354 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12355 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12356 (union aligned_Lisp_Misc): Define.
12357 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12358 aligned_Lisp_Misc instead of union Lisp_Misc.
12359 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
12360
12361 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12362
12363 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12364 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12365 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12366 * s/netbsd.h, s/sol2-6.h:
12367 Remove definition of GC_MARK_STACK, since the default now works.
12368 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12369 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12370 no longer the default.
12371 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12372
12373 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12374
12375 * lread.c (lisp_file_lexically_bound_p):
12376 Fix hang at ";-*-\n" (bug#11238).
12377
12378 2012-04-14 Eli Zaretskii <eliz@gnu.org>
12379
12380 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12381 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12382
12383 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12384
12385 * nsterm.m (constrainFrameRect): Always constrain when there is only
12386 one screen (Bug#10962).
12387
12388 2012-04-13 Ken Brown <kbrown@cornell.edu>
12389
12390 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12391
12392 2012-04-13 Reuben Thomas <rrt@sc3d.org>
12393
12394 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12395
12396 2012-04-11 Daniel Colascione <dancol@dancol.org>
12397
12398 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12399 against is gone. It's better to use vfork now so that when Cygwin
12400 gains a new, working vfork, we use it automatically (bug#10398).
12401
12402 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12403
12404 * window.c (save_window_save): Obey window-point-insertion-type.
12405
12406 2012-04-11 Glenn Morris <rgm@gnu.org>
12407
12408 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12409
12410 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12411
12412 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12413
12414 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
12415
12416 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12417 (force_quit_count): New var.
12418 (handle_interrupt): Use it.
12419
12420 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
12421
12422 * w32.c (w32_delayed_load): Record the full path of the library
12423 being loaded (bug#10424).
12424
12425 2012-04-09 Glenn Morris <rgm@gnu.org>
12426
12427 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12428 not just in the obarray, before snarfing them. (Bug#11036)
12429
12430 * Makefile.in ($(leimdir)/leim-list.el):
12431 Pass EMACS rather than BUILT_EMACS.
12432
12433 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12434
12435 * process.c (make_process):
12436 * process.h: Add integer `gnutls_handshakes_tried' member to
12437 process struct.
12438
12439 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12440 Add convenience `GNUTLS_LOG2i' macro.
12441
12442 * gnutls.c (gnutls_log_function2i): Convenience log function.
12443 (emacs_gnutls_read): Use new log functions,
12444 `gnutls_handshakes_tried' process member, and
12445 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12446 attempts per process (connection).
12447
12448 2012-04-09 Chong Yidong <cyd@gnu.org>
12449
12450 * eval.c (Fuser_variable_p, user_variable_p_eh)
12451 (lisp_indirect_variable): Functions deleted.
12452 (Fdefvar): Caller changed.
12453
12454 * callint.c (Finteractive, Fcall_interactively):
12455 * minibuf.c (Fread_variable): Callers changed.
12456
12457 2012-04-09 Eli Zaretskii <eliz@gnu.org>
12458
12459 * xdisp.c (set_cursor_from_row): If the display string appears in
12460 the buffer at position that is closer to point than the position
12461 after the display string, display the cursor on the first glyph of
12462 the display string. Fixes cursor display when a 'display' text
12463 property immediately follows invisible text. (Bug#11094)
12464
12465 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12466
12467 composite.c: use 'double' consistently
12468 * composite.c (get_composition_id): Use 'double' consistently
12469 instead of converting 'float' to 'double' and vice versa; this is
12470 easier to understand and avoids a GCC warning.
12471
12472 2012-04-09 Glenn Morris <rgm@gnu.org>
12473
12474 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12475 preparation for dumping it with emacs. (Bug#4789)
12476 (leimdir): New variable.
12477 ($(leimdir)/leim-list.el): New rule.
12478 (emacs$(EXEEXT)): Depend on leim-list.el.
12479
12480 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12481 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12482 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12483
12484 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12485
12486 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12487 proper alignment.
12488
12489 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
12490
12491 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12492 Remove unused local variable.
12493
12494 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12495
12496 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12497 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12498 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12499 objects, as mark_maybe_pointer will catch them otherwise.
12500 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12501 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12502
12503 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12504
12505 Fix typo that broke non-Windows builds.
12506 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12507
12508 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12509
12510 Support building on MS-Windows with libxml2.
12511
12512 * makefile.w32-in (OBJ2): Add xml.$(O).
12513 (GLOBAL_SOURCES): Add xml.c.
12514 ($(BLD)/xml.$(O)): New dependency list.
12515
12516 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12517 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12518 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12519 [!WINDOWSNT]: New macros.
12520 (init_libxml2_functions, libxml2_loaded_p): New functions.
12521 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12522 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12523 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12524 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12525 linked in).
12526 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
12527 Call init_libxml2_functions before calling libxml2 functions.
12528 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
12529
12530 * emacs.c: Don't include libxml/parser.h.
12531 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
12532 xmlCleanupParser directly.
12533
12534 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
12535
12536 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12537
12538 * indent.c (Fvertical_motion): If there is a display string at
12539 point, use it.vpos to compute how many lines to backtrack after
12540 move_it_to point. (Bug#11133)
12541
12542 2012-04-06 Eli Zaretskii <eliz@gnu.org>
12543
12544 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
12545 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
12546 about subtle differences between FETCH_CHAR* and STRING_CHAR*
12547 macros related to unification of CJK characters. For the details,
12548 see the discussion following the message here:
12549 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12550
12551 2012-04-04 Chong Yidong <cyd@gnu.org>
12552
12553 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12554
12555 2012-04-01 Eli Zaretskii <eliz@gnu.org>
12556
12557 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12558 instead of alloca. (Bug#11138)
12559
12560 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12561
12562 * w32menu.c (is_simple_dialog): Properly check lisp types.
12563 (Bug#11141)
12564
12565 2012-03-31 Eli Zaretskii <eliz@gnu.org>
12566
12567 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12568 position we get to after a call to move_it_to fails the
12569 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12570 only if we wind up in a string from display property. (Bug#11063)
12571
12572 * window.c (Fdelete_other_windows_internal): Invalidate the row
12573 and column information about mouse highlight, so that redisplay
12574 restores it after reallocating the glyph matrices. (Bug#7464)
12575
12576 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12577 string comes from a `display' text property, use the buffer
12578 position of that property as if we actually saw that position in
12579 the row's glyphs.
12580 (move_it_by_lines): Remove the assertion that
12581 "it->current_x == 0 && it->hpos == 0" which can be legitimately
12582 violated when there's a before-string at the beginning of a line.
12583 (Bug#11063)
12584
12585 2012-03-30 Eli Zaretskii <eliz@gnu.org>
12586
12587 * xdisp.c (append_space_for_newline): If the default face was
12588 remapped, use the remapped face for the appended newline.
12589 (extend_face_to_end_of_line): Use the remapped default face for
12590 extending the face to the end of the line.
12591 (display_line): Call extend_face_to_end_of_line when the default
12592 face was remapped. (Bug#11068)
12593
12594 2012-03-29 Eli Zaretskii <eliz@gnu.org>
12595
12596 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
12597
12598 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12599
12600 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
12601
12602 2012-03-27 Glenn Morris <rgm@gnu.org>
12603
12604 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
12605 Doc fixes.
12606
12607 2012-03-26 Kenichi Handa <handa@m17n.org>
12608
12609 * dispextern.h (struct glyph): Fix previous change. Change the
12610 bit length of glyphless.ch to 25 (Bug#11082).
12611
12612 2012-03-26 Chong Yidong <cyd@gnu.org>
12613
12614 * keyboard.c (Vselection_inhibit_update_commands): New variable.
12615 (command_loop_1): Use it; inhibit selection update for
12616 handle-select-window too (Bug#8996).
12617
12618 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
12619
12620 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
12621
12622 2012-03-25 Kenichi Handa <handa@m17n.org>
12623
12624 * dispextern.h (struct glyph): Change the bit length of
12625 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
12626
12627 2012-03-24 Eli Zaretskii <eliz@gnu.org>
12628
12629 * s/ms-w32.h (tzname): Include time.h before redirecting to
12630 _tzname. Fixes the MSVC build. (Bug#9960)
12631
12632 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
12633
12634 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
12635 characters.
12636
12637 * xterm.c (XTread_socket): Only modify handling_signal if
12638 !SYNC_INPUT. (Bug#11080)
12639
12640 2012-03-23 Eli Zaretskii <eliz@gnu.org>
12641
12642 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
12643 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
12644 when fetching a multibyte character consumes more bytes than
12645 CHAR_BYTES returns, due to unification of CJK characters in
12646 string_char. (Bug#11073)
12647
12648 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
12649
12650 * process.c (wait_reading_process_output): Handle pty disconnect
12651 by refraining from sending oneself a SIGCHLD (bug#10933).
12652
12653 2012-03-22 Chong Yidong <cyd@gnu.org>
12654
12655 * dispextern.h (struct it): New member string_from_prefix_prop_p.
12656
12657 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
12658 Mark string as coming from a prefix property.
12659 (handle_face_prop): Use default face for prefix strings (Bug#4281).
12660 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
12661
12662 2012-03-21 Chong Yidong <cyd@gnu.org>
12663
12664 * xfaces.c (Vface_remapping_alist): Doc fix.
12665
12666 2012-03-20 Eli Zaretskii <eliz@gnu.org>
12667
12668 * w32proc.c (Fw32_set_console_codepage)
12669 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
12670 Doc fixes.
12671
12672 2012-03-20 Chong Yidong <cyd@gnu.org>
12673
12674 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
12675 to reflect default non-nil value of redisplay-dont-pause.
12676
12677 2012-03-19 Kenichi Handa <handa@m17n.org>
12678
12679 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
12680 it fit in a valid range (Bug#11003).
12681
12682 2012-03-18 Eli Zaretskii <eliz@gnu.org>
12683
12684 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
12685 that is not from display property, accept the row as a "cursor
12686 row" if one of the string's character has a non-nil `cursor'
12687 property. Fixes cursor positioning when there are newlines in
12688 overlay strings, e.g. in icomplete.el. (Bug#11035)
12689
12690 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
12691
12692 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
12693
12694 2012-03-12 Chong Yidong <cyd@gnu.org>
12695
12696 * eval.c (inhibit_lisp_code): Rename from
12697 inhibit_window_configuration_change_hook; move from window.c.
12698
12699 * xfns.c (unwind_create_frame_1, Fx_create_frame):
12700 * window.c (run_window_configuration_change_hook)
12701 (syms_of_window): Callers changed.
12702
12703 2012-03-11 Chong Yidong <cyd@gnu.org>
12704
12705 * keymap.c (Fkey_description): Doc fix (Bug#9700).
12706
12707 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
12708
12709 2012-03-10 Chong Yidong <cyd@gnu.org>
12710
12711 * frame.c (other_visible_frames): Don't assume the selected frame
12712 is visible (Bug#10955).
12713
12714 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
12715
12716 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
12717
12718 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
12719
12720 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
12721 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
12722 zero (Bug#10954).
12723
12724 2012-03-03 Glenn Morris <rgm@gnu.org>
12725
12726 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
12727
12728 2012-03-02 Eli Zaretskii <eliz@gnu.org>
12729
12730 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
12731 position past the first glyph_row that ends at ZV. (Bug#10902)
12732 (redisplay_window, next_element_from_string): Fix typos in
12733 comments.
12734 (redisplay_window): Pass to move_it_vertically the margin in
12735 pixels, not in screen lines.
12736
12737 2012-03-02 Glenn Morris <rgm@gnu.org>
12738
12739 * buffer.c (buffer-list-update-hook): Doc fix.
12740
12741 2012-02-29 Eli Zaretskii <eliz@gnu.org>
12742
12743 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
12744 push_it before setting up the iterator for the first overlay
12745 string, even if we have an empty string loaded.
12746 (next_overlay_string): If there's an empty string on the iterator
12747 stack, pop the stack. (Bug#10903)
12748
12749 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
12750
12751 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
12752 Suggested by Stefan Monnier in
12753 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
12754 * alloc.c (widen_to_Lisp_Object): New static function.
12755 (mark_memory): Also mark Lisp_Objects by fetching pointer words
12756 and widening them to Lisp_Objects. This would work even if
12757 USE_LSB_TAG is defined and wide integers are used, which might
12758 happen in a future version of Emacs.
12759
12760 2012-02-25 Chong Yidong <cyd@gnu.org>
12761
12762 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
12763 Doc fix.
12764
12765 * xselect.c (Fx_selection_exists_p): Doc fix.
12766 (x_clipboard_manager_save_all): Print an informative message
12767 before saving to clipboard manager.
12768
12769 2012-02-24 Chong Yidong <cyd@gnu.org>
12770
12771 * keyboard.c (process_special_events): Handle all X selection
12772 requests in kbd_buffer, not just the next one (Bug#8869).
12773
12774 2012-02-23 Chong Yidong <cyd@gnu.org>
12775
12776 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
12777 call when setting menu-bar-lines and tool-bar-lines parameters.
12778 (unwind_create_frame_1): New helper function.
12779
12780 * window.c (inhibit_window_configuration_change_hook): New var.
12781 (run_window_configuration_change_hook): Obey it.
12782 (syms_of_window): Initialize it.
12783
12784 2012-02-22 Chong Yidong <cyd@gnu.org>
12785
12786 * xterm.c (x_draw_image_relief): Add missing type check for
12787 Vtool_bar_button_margin (Bug#10743).
12788
12789 2012-02-21 Chong Yidong <cyd@gnu.org>
12790
12791 * fileio.c (Vfile_name_handler_alist): Doc fix.
12792
12793 * buffer.c (Fget_file_buffer): Protect against invalid file
12794 handler return value.
12795
12796 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
12797
12798 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
12799 when computing $valmask.
12800
12801 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
12802 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
12803 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
12804 It's useless in that case, and it can cause problems on hosts
12805 that allocate halves of EMACS_INT values separately.
12806 Reported by Dan Horák. Diagnosed by Andreas Schwab in
12807 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
12808 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
12809 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
12810 it avoids undefined behavior on hosts where shifting right by more
12811 than the word width has undefined behavior.
12812
12813 2012-02-19 Chong Yidong <cyd@gnu.org>
12814
12815 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
12816 (Funhandled_file_name_directory, Ffile_name_as_directory)
12817 (Fdirectory_file_name, Fexpand_file_name)
12818 (Fsubstitute_in_file_name): Protect against invalid file handler
12819 return values (Bug#10845).
12820
12821 2012-02-18 Eli Zaretskii <eliz@gnu.org>
12822
12823 * .gdbinit (pitx): Fix incorrect references to fields of the
12824 iterator stack.
12825
12826 2012-02-17 Chong Yidong <cyd@gnu.org>
12827
12828 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
12829
12830 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
12831
12832 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
12833 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
12834
12835 2012-02-15 Chong Yidong <cyd@gnu.org>
12836
12837 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
12838 marked as special. Also, starting docstrings with * is obsolete.
12839
12840 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
12841
12842 * gnutls.c (emacs_gnutls_write): Fix last change.
12843
12844 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
12845
12846 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
12847 send_process.
12848
12849 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12850
12851 * keymap.c (Fsingle_key_description): Handle char ranges.
12852
12853 2012-02-12 Chong Yidong <cyd@gnu.org>
12854
12855 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
12856 as that creates a dangerous corner case.
12857
12858 * window.c (Fdelete_window_internal): Invalidate the mouse
12859 highlight (Bug#9904).
12860
12861 2012-02-12 Glenn Morris <rgm@gnu.org>
12862
12863 * xselect.c (Fx_own_selection_internal)
12864 (Fx_get_selection_internal, Fx_disown_selection_internal)
12865 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
12866 * nsselect.m (Fx_own_selection_internal)
12867 (Fx_disown_selection_internal, Fx_selection_exists_p)
12868 (Fx_selection_owner_p, Fx_get_selection_internal):
12869 Sync docs and argument specs with the xselect.c versions.
12870
12871 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
12872
12873 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
12874
12875 2012-02-11 Eli Zaretskii <eliz@gnu.org>
12876
12877 * w32select.c (Fx_selection_exists_p): Sync doc string and
12878 argument list with xselect.c. (Bug#10783)
12879
12880 * w16select.c (Fx_selection_exists_p): Sync doc string and
12881 argument list with xselect.c. (Bug#10783)
12882
12883 2012-02-10 Glenn Morris <rgm@gnu.org>
12884
12885 * fns.c (Fsecure_hash): Doc fix.
12886
12887 2012-02-09 Kenichi Handa <handa@m17n.org>
12888
12889 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
12890
12891 2012-02-07 Chong Yidong <cyd@gnu.org>
12892
12893 * buffer.c (Fbuffer_local_variables)
12894 (buffer_lisp_local_variables): Handle unbound vars correctly;
12895 don't let Qunbound leak into Lisp.
12896
12897 2012-02-07 Glenn Morris <rgm@gnu.org>
12898
12899 * image.c (Fimagemagick_types): Doc fix.
12900
12901 * image.c (imagemagick-render-type): Change it from a lisp object
12902 to an integer. Move the doc here from the lisp manual.
12903 Treat all values not equal to 0 the same.
12904
12905 2012-02-06 Chong Yidong <cyd@gnu.org>
12906
12907 * doc.c (store_function_docstring): Avoid applying docstring of
12908 alias to base function (Bug#2603).
12909
12910 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12911
12912 * .gdbinit (pp1, pv1): Remove redundant defines.
12913 (pr): Use pp.
12914
12915 2012-02-04 Chong Yidong <cyd@gnu.org>
12916
12917 * nsterm.m: Declare a global (Bug#10694).
12918
12919 2012-02-04 Eli Zaretskii <eliz@gnu.org>
12920
12921 * w32.c (get_emacs_configuration_options):
12922 Include --enable-checking, if specified, in the return value.
12923
12924 2012-02-04 Martin Rudalics <rudalics@gmx.at>
12925
12926 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12927 after rounding frame sizes. (Bug#9723)
12928
12929 2012-02-04 Eli Zaretskii <eliz@gnu.org>
12930
12931 * keyboard.c (adjust_point_for_property): Don't position point
12932 before BEGV. (Bug#10696)
12933
12934 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
12935
12936 Handle overflow when computing char display width (Bug#9496).
12937 * character.c (char_width): Return EMACS_INT, not int.
12938 (char_width, c_string_width): Check for overflow when
12939 computing the width; this is possible now that individual
12940 characters can have unbounded width. Problem introduced
12941 by merge from Emacs 23 on 2012-01-19.
12942
12943 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
12944
12945 * dbusbind.c (Fdbus_register_method): Mention the return value
12946 :ignore in the docstring.
12947
12948 2012-02-02 Glenn Morris <rgm@gnu.org>
12949
12950 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
12951
12952 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12953 Unconditionally set to t. (Bug#10673)
12954 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12955 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12956 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
12957
12958 2012-02-02 Kenichi Handa <handa@m17n.org>
12959
12960 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
12961 0, do not call append_composite_glyph.
12962
12963 2012-02-02 Kenichi Handa <handa@m17n.org>
12964
12965 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
12966 NULL (Bug#6988).
12967 (x_produce_glyphs): If the component of a composition is a null
12968 string, set it->pixel_width to 1 to avoid zero-width glyph.
12969
12970 2012-02-01 Eli Zaretskii <eliz@gnu.org>
12971
12972 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
12973 first 2 arguments are identical. This makes inserting large
12974 output from a subprocess an order of magnitude faster on
12975 MS-Windows, where all sbrk'ed memory is always contiguous.
12976
12977 2012-01-31 Glenn Morris <rgm@gnu.org>
12978
12979 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12980 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12981 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
12982
12983 2012-01-29 Glenn Morris <rgm@gnu.org>
12984
12985 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
12986
12987 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
12988
12989 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
12990
12991 2012-01-28 Chong Yidong <cyd@gnu.org>
12992
12993 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
12994
12995 2012-01-26 Chong Yidong <cyd@gnu.org>
12996
12997 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
12998
12999 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13000 repeat counts (Bug#10507).
13001
13002 2012-01-26 Glenn Morris <rgm@gnu.org>
13003
13004 * lread.c (syms_of_lread): Doc fix.
13005
13006 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13007
13008 * coding.c (encode_designation_at_bol): Change return value to
13009 EMACS_INT.
13010
13011 2012-01-25 Chong Yidong <cyd@gnu.org>
13012
13013 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13014
13015 2012-01-21 Chong Yidong <cyd@gnu.org>
13016
13017 * floatfns.c (Fcopysign): Make the second argument non-optional,
13018 since nil is not allowed anyway.
13019
13020 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13021
13022 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13023 (send_process): Likewise.
13024
13025 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13026
13027 * window.c (save_window_save, Fcurrent_window_configuration)
13028 (Vwindow_persistent_parameters): Do not use Qstate.
13029 Rewrite doc-strings.
13030
13031 2012-01-19 Kenichi Handa <handa@m17n.org>
13032
13033 * character.c (char_width): New function.
13034 (Fchar_width, c_string_width, lisp_string_width):
13035 Use char_width (Bug#9496).
13036
13037 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13038
13039 * window.c (Vwindow_persistent_parameters): New variable.
13040 (Fset_window_configuration, save_window_save): Handle persistent
13041 window parameters.
13042
13043 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13044
13045 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13046 thrashing the stack of the thread. (Bug#9087)
13047
13048 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13049
13050 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13051
13052 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13053
13054 * xdisp.c (rows_from_pos_range): Handle the case where the
13055 highlight ends on a newline. (Bug#10464)
13056 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13057 he end column for display of highlight that ends on a newline
13058 before a R2L line.
13059
13060 2012-01-11 Glenn Morris <rgm@gnu.org>
13061
13062 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13063 from load-path also when installation-directory is nil. (Bug#10208)
13064
13065 2012-01-10 Glenn Morris <rgm@gnu.org>
13066
13067 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13068
13069 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13070 Update template values to be closer to their typical values these days.
13071
13072 2012-01-09 Eli Zaretskii <eliz@gnu.org>
13073
13074 * xdisp.c (rows_from_pos_range): Accept additional argument
13075 DISP_STRING, and accept any glyph in a row whose object is that
13076 string as eligible for mouse highlight. Fixes mouse highlight of
13077 display strings from overlays. (Bug#10464)
13078
13079 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
13080
13081 emacs: fix an auto-save permissions race condition (Bug#10400)
13082 * fileio.c (auto_saving_dir_umask): New static var.
13083 (Fmake_directory_internal): Use it.
13084 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13085 creating the directory. The old code temporarily assigns
13086 too-generous permissions to the directory.
13087 (do_auto_save_eh): Clear it.
13088 (Fdo_auto_save): Catch all errors, not just file errors, so
13089 that the var is always cleared.
13090
13091 2012-01-07 Eli Zaretskii <eliz@gnu.org>
13092
13093 * search.c (scan_buffer): Pass character positions to
13094 know_region_cache, not byte positions. (Bug#6540)
13095
13096 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
13097
13098 * w32.c (sys_rename): Report EXDEV when rename of a directory
13099 fails because the target is on another logical disk. (Bug#10284)
13100
13101 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13102
13103 * xterm.c (x_embed_request_focus): New function.
13104
13105 * xterm.h: Add prototype.
13106
13107 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13108
13109 2012-01-05 Glenn Morris <rgm@gnu.org>
13110
13111 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13112
13113 2012-01-01 Eli Zaretskii <eliz@gnu.org>
13114
13115 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13116 Load gnutls_transport_set_lowat only if GnuTLS version is below
13117 2.11.1.
13118 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13119 GnuTLS versions below 2.11.1.
13120
13121 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13122
13123 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13124 to the doc string advising against its use for altering the way
13125 windows are scrolled.
13126
13127 2011-12-28 Kenichi Handa <handa@m17n.org>
13128
13129 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13130 coding-system ASCII compatible only when it does not produce BOM
13131 on encoding (Bug#10383).
13132
13133 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13134
13135 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13136 can scroll.
13137 (create_and_show_popup_menu): Always use menu_position_func for
13138 Gtk3 (Bug#10361).
13139
13140 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13141
13142 * callint.c (Fcall_interactively): Don't truncate prompt string.
13143
13144 2011-12-23 Eli Zaretskii <eliz@gnu.org>
13145
13146 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13147 property that ends at ZV, so that the bidi iteration could be
13148 resumed from there (after widening). (Bug#10360)
13149
13150 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13151
13152 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13153
13154 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13155
13156 * nsterm.m (x_free_frame_resources):
13157 Release f->output_data.ns->miniimage.
13158 (ns_index_color): Fix indentation. Do not retain
13159 color_table->colors[i].
13160
13161 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13162 before returning.
13163
13164 * nsfns.m (x_set_background_color): Assign return value from
13165 ns_index_color to face-background instead of NSColor*.
13166 (ns_implicitly_set_icon_type): Fix indentation.
13167 Change assignment in for loop to comparison.
13168
13169 * emacs.c (ns_pool): New variable.
13170 (main): Assign ns_pool.
13171 (Fkill_emacs): Call ns_release_autorelease_pool.
13172
13173 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13174 autorelease fdesc, release fdAttrs and tdict.
13175 (ns_get_covering_families): Release charset.
13176 (ns_findfonts): Release NSFontDescriptor created with new.
13177 (ns_uni_to_glyphs): Fix indentation.
13178 (setString): Release attrStr before assigning new value.
13179
13180 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13181
13182 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13183 and NS_IMPL_COCOA.
13184 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13185 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13186
13187 2011-12-18 David Reitter <reitter@cmu.edu>
13188
13189 * nsterm.m (ns_term_init): Subscribe for notifications
13190 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13191 to method trackingNotification in EmacsMenu.
13192
13193 * nsmenu.m (trackingMenu): New variable.
13194 (trackingNotification): New method (from Aquamacs).
13195 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
13196 from Aquamacs (Bug#7030).
13197
13198 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13199
13200 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13201 (symbol_to_nsstring): Fix indentation.
13202 (ns_symbol_to_pb): New function.
13203 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13204 (Fns_rotate_cut_buffers_internal): Remove.
13205 (Fns_store_selection_internal): Rename from
13206 Fns_store_cut_buffer_internal.
13207 (ns_get_foreign_selection, Fx_own_selection_internal)
13208 (Fx_disown_selection_internal, Fx_selection_exists_p)
13209 (Fns_get_selection_internal, Fns_store_selection_internal):
13210 Use ns_symbol_to_pb and check if return value is nil.
13211 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13212 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
13213 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13214 renamed to Sns_store_selection_internal.
13215 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13216 and remove this function.
13217 (ns_handle_selection_clear): Remove, never used.
13218 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13219 here.
13220
13221 2011-12-17 Ken Brown <kbrown@cornell.edu>
13222
13223 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13224 GID is unknown (Bug#10257).
13225
13226 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13227
13228 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13229 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13230 which caused a build failure on GNU/Linux IA-64. This problem was
13231 introduced by my 2011-10-07 patch.
13232
13233 2011-12-15 Juri Linkov <juri@jurta.org>
13234
13235 * image.c (imagemagick_error): New function. (Bug#10112)
13236 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13237 Use `imagemagick_error' where ImageMagick functions return
13238 `MagickFalse'.
13239 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13240 proper order.
13241
13242 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13243
13244 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13245 fill background (Bug#8992).
13246
13247 2011-12-13 Martin Rudalics <rudalics@gmx.at>
13248
13249 * window.c (Vwindow_combination_resize)
13250 (Vwindow_combination_limit): Use t instead of non-nil in
13251 doc-strings.
13252 (Vrecenter_redisplay): Add first sentence of doc-string on
13253 separate line.
13254 (Frecenter): Fix doc-string typo.
13255
13256 2011-12-11 Kenichi Handa <handa@m17n.org>
13257
13258 * coding.c (Funencodable_char_position): Pay attention to the
13259 buffer text relocation (Bug#9389).
13260
13261 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13262
13263 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13264 gtk_init (Bug#10100).
13265
13266 2011-12-10 Eli Zaretskii <eliz@gnu.org>
13267
13268 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13269 IT->string is nil. (Bug#10263)
13270
13271 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13272
13273 * nsterm.h (x_free_frame_resources): Declare.
13274
13275 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13276 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13277
13278 * nsterm.h (ns_get_defaults_value): Declare.
13279
13280 * nsterm.m (ns_default): Call ns_get_defaults_value.
13281
13282 2011-12-09 Eli Zaretskii <eliz@gnu.org>
13283
13284 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13285 (Bug#10170)
13286
13287 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13288
13289 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13290 that where the value of an _OBJC_* symbol points to is in the .bss
13291 section (Bug#10240).
13292
13293 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13294
13295 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
13296 after the loop to call ccl_driver at least once (Bug#8619).
13297
13298 2011-12-08 Kenichi Handa <handa@m17n.org>
13299
13300 * ftfont.c (get_adstyle_property): Fix previous change
13301 (Bug#10233).
13302
13303 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
13304
13305 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13306 dirs from the default value of EMACSLOADPATH (bug#10208).
13307
13308 2011-12-07 Glenn Morris <rgm@gnu.org>
13309
13310 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13311 installation and source directories as well. (Bug#10208)
13312
13313 2011-12-06 Chong Yidong <cyd@gnu.org>
13314
13315 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13316
13317 2011-12-06 Glenn Morris <rgm@gnu.org>
13318
13319 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13320 as an error, not just -1. (Bug#10217)
13321
13322 2011-12-05 Chong Yidong <cyd@gnu.org>
13323
13324 * keyboard.c (process_special_events): New function.
13325 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13326
13327 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13328
13329 * coding.c (encode_designation_at_bol): Don't use uninitialized
13330 local variable (Bug#9318).
13331
13332 2011-12-05 Kenichi Handa <handa@m17n.org>
13333
13334 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13335 return Qnil (Bug#8046, Bug#10193).
13336
13337 2011-12-05 Kenichi Handa <handa@m17n.org>
13338
13339 * coding.c (encode_designation_at_bol): New args charbuf_end and
13340 dst. Return the number of produced bytes. Callers changed.
13341 (coding_set_source): Return how many bytes coding->source was
13342 relocated.
13343 (coding_set_destination): Return how many bytes
13344 coding->destination was relocated.
13345 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
13346 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
13347
13348 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13349
13350 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13351 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13352 macro (Bug#9318).
13353
13354 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13355
13356 The following changes are to fix Bug#9318.
13357
13358 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
13359 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13360 (encode_coding_iso_2022, encode_coding_sjis)
13361 (encode_coding_big5, encode_coding_charset): Use the above macros.
13362
13363 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
13364
13365 * lisp.h (process_quit_flag): Fix external declaration.
13366
13367 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13368
13369 Don't macro-inline non-performance-critical code.
13370 * eval.c (process_quit_flag): New function.
13371 * lisp.h (QUIT): Use it.
13372
13373 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13374
13375 * nsfns.m (get_geometry_from_preferences): New function.
13376 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13377
13378 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13379
13380 * emacs.c (Qkill_emacs): Define.
13381 (syms_of_emacs): Initialize it.
13382 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13383 Qquit_flag to `kill-emacs' instead.
13384 (quit_throw_to_read_char): Add parameter `from_signal'.
13385 All callers changed. Call Fkill_emacs if requested and safe.
13386 * lisp.h (QUIT): Call Fkill_emacs if requested.
13387
13388 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13389
13390 * widget.c (update_wm_hints): Return if wmshell is null.
13391 (widget_update_wm_size_hints): New function.
13392
13393 * widget.h (widget_update_wm_size_hints): Declare.
13394
13395 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13396 widget_update_wm_size_hints (Bug#10104).
13397
13398 2011-12-03 Eli Zaretskii <eliz@gnu.org>
13399
13400 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13401 before a newline, prepare the bidi iterator for consuming the
13402 newline, and keep the current paragraph direction. (Bug#10183)
13403 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
13404
13405 2011-12-02 Juri Linkov <juri@jurta.org>
13406
13407 * search.c (Fword_search_regexp): New Lisp function created from
13408 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13409 (Fword_search_backward, Fword_search_forward)
13410 (Fword_search_backward_lax, Fword_search_forward_lax):
13411 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13412 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13413
13414 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13415
13416 * fileio.c (Finsert_file_contents): Move after-change-function call
13417 to before the "handled:" label, since all "goto handled" appear in
13418 cases where the *-change-functions have already been properly called
13419 (bug#10117).
13420
13421 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13422
13423 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13424 waiting for input. (Bug#10169)
13425
13426 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13427
13428 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13429 verifies glyph row's hash code--we have just reallocated the
13430 glyphs, so their contents can be complete garbage. (Bug#10164)
13431
13432 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
13433
13434 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13435
13436 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13437
13438 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13439 attributes are tested _before_ calling verify_row_hash, to protect
13440 against GCC re-ordering of the tests. (Bug#10164)
13441
13442 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13443
13444 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13445
13446 * xterm.c (handle_one_xevent): Only set async_visible and friends
13447 if net_wm_state_hidden_seen is non-zero (Bug#10002)
13448 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
13449 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13450
13451 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13452
13453 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13454 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13455 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13456 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13457 All uses changed to use GCPRO1 etc.
13458 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13459 Revert to old implementation (i.e., before 2011-03-11).
13460
13461 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13462
13463 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13464 of scroll runs so as to avoid assigning disabled bogus rows and
13465 unnecessary graphics copy operations.
13466
13467 2011-11-27 Eli Zaretskii <eliz@gnu.org>
13468
13469 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13470 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13471 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13472 (malloc, free, realloc, calloc): Redirect to e_* only when
13473 compiling Emacs.
13474
13475 * lisp.h (GCTYPEBITS): Move before first use.
13476 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13477 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13478 this macro definition.
13479
13480 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13481 _MSC_VER.
13482
13483 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13484
13485 * gtkutil.c (xg_create_frame_widgets):
13486 Call gtk_window_set_has_resize_grip (FALSE) if that function is
13487 present with Gtk+ 2.0.
13488
13489 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13490
13491 * fileio.c (Finsert_file_contents): Undo previous change; see
13492 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13493
13494 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13495
13496 Rename locals to avoid shadowing.
13497 * fileio.c (Finsert_file_contents):
13498 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13499 * process.c (wait_reading_process_output):
13500 Rename inner 'proc' to 'p' to avoid shadowing.
13501 Indent for consistency with usual Emacs style.
13502
13503 2011-11-25 Eli Zaretskii <eliz@gnu.org>
13504
13505 * xdisp.c (redisplay_window): If cursor row is not fully visible
13506 after recentering, and scroll-conservatively is set to a large
13507 number, scroll window by a few more lines to make the cursor fully
13508 visible and out of scroll-margin. (Bug#10105)
13509 (start_display): Don't move to the next line if the display should
13510 start at a newline that is part of a display vector or an overlay
13511 string. (Bug#10119)
13512
13513 2011-11-24 Juri Linkov <juri@jurta.org>
13514
13515 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13516 after the `MagickPingImage' call. (Bug#10112)
13517
13518 2011-11-23 Chong Yidong <cyd@gnu.org>
13519
13520 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13521
13522 2011-11-23 Martin Rudalics <rudalics@gmx.at>
13523
13524 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13525 making another buffer current. (Bug#10114)
13526
13527 2011-11-23 Glenn Morris <rgm@gnu.org>
13528
13529 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
13530
13531 2011-11-23 Chong Yidong <cyd@gnu.org>
13532
13533 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
13534 using it (Bug#5984).
13535
13536 2011-11-22 Eli Zaretskii <eliz@gnu.org>
13537
13538 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
13539 and header-lines, as they don't have one computed for them.
13540 (Bug#10098)
13541
13542 * .gdbinit (prow): Make displayed values more self-explaining.
13543 Add row's hash code.
13544
13545 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
13546
13547 * process.c (wait_reading_process_output): Fix asynchrounous
13548 GnuTLS socket handling on some versions of the GnuTLS library.
13549 (wait_reading_process_output): Add comment and URL.
13550
13551 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13552
13553 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13554
13555 2011-11-21 Chong Yidong <cyd@gnu.org>
13556
13557 * window.c (Fnext_window, Fprevious_window): Doc fix.
13558
13559 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13560
13561 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13562
13563 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
13564
13565 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13566
13567 2011-11-20 Martin Rudalics <rudalics@gmx.at>
13568
13569 * window.c (Fset_window_combination_limit): Rename argument
13570 STATUS to LIMIT.
13571 (Vwindow_combination_limit): Remove "status" from doc-string.
13572
13573 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13574
13575 * m/ibms390.h: Remove.
13576 * m/ibms390x.h: Don't include "ibms390.h".
13577
13578 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13579
13580 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
13581 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
13582
13583 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
13584
13585 * casetab.c (Fset_case_table):
13586 * charset.c (Fcharset_after): Fix typos.
13587
13588 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
13589
13590 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
13591 Otherwise, valgrind does not work on some platforms.
13592 Problem reported by Andreas Schwab in
13593 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
13594 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13595 is set, removing the need for VIRT_ADDRESS_VARIES.
13596 (PURE_P): Use a more-efficient implementation that needs just one
13597 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
13598 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
13599 to 4 (xorl, subq, cmpq, setbe).
13600 * alloc.c (pure): Always extern now, since that's the
13601 VIRT_ADDR_VARIES behavior.
13602 (PURE_POINTER_P): Use a single comparison, not two, for
13603 consistency with the new puresize.h.
13604 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
13605 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
13606 Remove VIRT_ADDR_VARIES no longer needed.
13607
13608 2011-11-19 Eli Zaretskii <eliz@gnu.org>
13609
13610 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
13611 (erase_phys_cursor, update_window_cursor, show_mouse_face)
13612 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
13613 behave as if the cursor position were at the window margin.
13614
13615 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
13616 and the cursor position is out of bounds, behave as if the cursor
13617 position were at the window margin. (Bug#10075)
13618
13619 2011-11-18 Chong Yidong <cyd@gnu.org>
13620
13621 * window.c (Fwindow_combination_limit): Make first argument
13622 non-optional, since it is meaningless for live windows like the
13623 selected window.
13624
13625 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
13626
13627 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
13628
13629 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
13630
13631 * intervals.c: Fix grafting over the whole buffer (bug#10071).
13632 (graft_intervals_into_buffer): Simplify.
13633
13634 2011-11-18 Eli Zaretskii <eliz@gnu.org>
13635
13636 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
13637 hash values of the two rows.
13638 (copy_row_except_pointers): Preserve the used[] arrays and the
13639 hash values of the two rows. (Bug#10035)
13640 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
13641
13642 * xdisp.c (row_hash): New function, body extracted from
13643 compute_line_metrics.
13644 (compute_line_metrics): Call row_hash, instead of computing the
13645 hash code inline.
13646
13647 * dispnew.c (verify_row_hash): Call row_hash for computing the
13648 hash code of a row, instead of duplicating code from xdisp.c.
13649
13650 * dispextern.h (row_hash): Add prototype.
13651
13652 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
13653
13654 * frame.c (delete_frame): Don't delete the terminal when the last
13655 X frame is closed if emacs is built with GTK toolkit.
13656
13657 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
13658
13659 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
13660
13661 2011-11-17 Martin Rudalics <rudalics@gmx.at>
13662
13663 * window.c (Vwindow_splits): Rename to
13664 Vwindow_combination_resize. Suggested by Juri Linkov.
13665 (Fsplit_window_internal): Use Vwindow_combination_resize instead
13666 of Vwindow_splits.
13667
13668 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
13669
13670 * nsfns.m (Fns_font_name):
13671 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
13672
13673 2011-11-16 Martin Rudalics <rudalics@gmx.at>
13674
13675 * window.h (window): Rename slot "nest" to "combination_limit".
13676 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
13677 (Fset_window_nest): Rename to Fset_window_combination_limit.
13678 (Vwindow_nest): Rename to Vwindow_combination_limit.
13679 (recombine_windows, make_parent_window, make_window)
13680 (Fsplit_window_internal, saved_window)
13681 (Fset_window_configuration, save_window_save): Rename all
13682 occurrences of window_nest to window_combination_limit.
13683
13684 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
13685
13686 * image.c (imagemagick_load_image): Fix typo.
13687
13688 2011-11-14 Eli Zaretskii <eliz@gnu.org>
13689
13690 * xdisp.c (display_line): Move the call to
13691 highlight_trailing_whitespace before the call to
13692 compute_line_metrics, since the latter needs to see the final
13693 faces of all the glyphs to compute ROW's hash value.
13694 Fixes assertion violations in row_equal_p. (Bug#10035)
13695
13696 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
13697
13698 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
13699 just return (bug#10044).
13700
13701 2011-11-12 Eli Zaretskii <eliz@gnu.org>
13702
13703 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
13704 with user-defined heap size. Bump the default size of the temacs
13705 heap to 27MB, to avoid memory warning when running temacs.
13706 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
13707
13708 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
13709 current_matrix and desired_matrix. (Bug#9990)
13710 (verify_row_hash) [XASSERTS]: New function.
13711 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
13712 that the hash value of glyph rows is correct.
13713
13714 2011-11-12 Martin Rudalics <rudalics@gmx.at>
13715
13716 * window.h (window): Remove splits slot.
13717 * window.c (Fwindow_splits, Fset_window_splits): Remove.
13718 (Fdelete_other_windows_internal, make_parent_window)
13719 (make_window, Fsplit_window_internal, Fdelete_window_internal)
13720 (Fset_window_configuration, save_window_save): Don't deal with
13721 split status of windows.
13722 (saved_window): Remove splits slot.
13723 (Vwindow_splits): Rewrite doc-string.
13724
13725 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
13726
13727 * xfns.c (unwind_create_frame):
13728 * nsfns.m (unwind_create_frame):
13729 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
13730 Vframe_list (Bug#9999).
13731
13732 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
13733
13734 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
13735
13736 2011-11-11 Kenichi Handa <handa@m17n.org>
13737
13738 * callproc.c (Fcall_process): Set the member dst_multibyte of
13739 process_coding.
13740
13741 2011-11-11 Johan Bockgård <bojohan@gnu.org>
13742
13743 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
13744 avoid a crash (bug#9496).
13745
13746 2011-11-09 Chong Yidong <cyd@gnu.org>
13747
13748 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
13749 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
13750
13751 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13752
13753 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
13754
13755 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13756
13757 Avoid some portability problems by eschewing 'extern inline' functions.
13758 The trivial performance wins aren't worth the portability hassles; see
13759 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
13760 et seq.
13761 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13762 (window_box_width, window_box_left, window_box_left_offset)
13763 (window_box_right, window_box_right_offset): Undo previous change,
13764 by removing the "extern"s.
13765 * intervals.c (adjust_intervals_for_insertion)
13766 (adjust_intervals_for_deletion): Undo previous change,
13767 making these static again.
13768 (offset_intervals, temp_set_point_both, temp_set_point)
13769 (copy_intervals_to_string): No longer inline.
13770 * xdisp.c (window_text_bottom_y, window_box_width)
13771 (window_box_height, window_box_left_offset)
13772 (window_box_right_offset, window_box_left, window_box_right)
13773 (window_box): No longer inline.
13774
13775 2011-11-08 Chong Yidong <cyd@gnu.org>
13776
13777 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
13778 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
13779 Signal an error if not a live window.
13780 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
13781 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
13782
13783 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
13784
13785 * lisp.h (syms_of_abbrev): Remove declaration.
13786 Reported by CHENG Gao <chenggao@royau.me>.
13787
13788 2011-11-07 Eli Zaretskii <eliz@gnu.org>
13789
13790 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
13791 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
13792 of temacs in GUI mode.
13793
13794 2011-11-07 Martin Rudalics <rudalics@gmx.at>
13795
13796 * window.h: Declare delete_all_child_windows instead of
13797 delete_all_subwindows.
13798 * window.c (Fwindow_nest, Fset_window_nest)
13799 (Fset_window_new_total, Fset_window_new_normal)
13800 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
13801 (delete_all_subwindows): Rename to delete_all_child_windows.
13802 (Fdelete_other_windows_internal, Fset_window_configuration):
13803 Call delete_all_child_windows instead of delete_all_subwindows.
13804 * frame.c (delete_frame): Call delete_all_child_windows instead
13805 of delete_all_subwindows.
13806
13807 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
13808
13809 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
13810 This is also needed for porting to any host where GC_MARK_STACK is
13811 not GC_MAKE_GCPROS_NOOPS.
13812 (which_symbols): Use it.
13813
13814 2011-11-07 Kenichi Handa <handa@m17n.org>
13815
13816 * coding.c (coding_set_destination): Check coding->src_pos only
13817 when coding->src_object is a buffer (bug#9910).
13818
13819 * process.c (send_process): Set the member src_multibyte of coding
13820 to 0 (bug#9911) when sending a unibyte text.
13821
13822 * callproc.c (Fcall_process): Set the member src_multibyte of
13823 process_coding to 0 (bug#9912).
13824
13825 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13826
13827 * xmenu.c (cleanup_widget_value_tree): New function.
13828 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
13829 calling free_menubar_widget_value_tree directly (Bug#9830).
13830
13831 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
13832
13833 Fix some portability problems with 'inline'.
13834 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13835 (window_box_width, window_box_left, window_box_left_offset)
13836 (window_box_right, window_box_right_offset): Declare extern.
13837 Otherwise, these inline functions do not conform to C99 and
13838 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
13839 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
13840 * intervals.c (adjust_intervals_for_insertion)
13841 (adjust_intervals_for_deletion): Now extern, because otherwise the
13842 extern inline functions 'offset_intervals' couldn't refer to it.
13843 (static_offset_intervals): Remove.
13844 (offset_intervals): Rewrite using the old contents of
13845 static_offset_intervals. The old version didn't conform to C99
13846 because an extern inline function contained a reference to an
13847 identifier with static linkage.
13848
13849 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
13850
13851 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
13852 GC.
13853
13854 2011-11-06 Eli Zaretskii <eliz@gnu.org>
13855
13856 * xdisp.c (init_iterator, reseat_to_string): Don't set the
13857 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
13858 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
13859 return Qleft_to_right.
13860
13861 2011-11-06 Chong Yidong <cyd@gnu.org>
13862
13863 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
13864 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
13865 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
13866 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
13867 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
13868 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
13869 (Fwindow_vscroll): Doc fix.
13870 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
13871 argument, since it makes no sense to pass a live window and for
13872 consistency with window-child.
13873
13874 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
13875
13876 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
13877 support MSVC.
13878
13879 2011-11-05 Jason Rumney <jasonr@gnu.org>
13880
13881 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
13882 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
13883 fonts (Bug#6029).
13884 (add_font_entity_to_list): Fix logic errors in mixed boolean and
13885 bitwise arithmetic preventing use of unicode-sip and non-truetype
13886 opentype fonts.
13887
13888 2011-11-05 Eli Zaretskii <eliz@gnu.org>
13889
13890 * s/ms-w32.h (fstat, stat, utime): Move redirections to
13891 "emacs"-only part.
13892
13893 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
13894 initialization code to keep similarity to xfns.c after changes
13895 from 2011-11-05.
13896
13897 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
13898
13899 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
13900 (unwind_create_frame): New function (Bug#9943).
13901 (Fx_create_frame): Restructure code to be more similar to the one in
13902 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
13903 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
13904 Move terminal->reference_count++ just before making the frame official
13905 (Bug#9943).
13906
13907 * nsterm.m (x_free_frame_resources): New function.
13908 (x_destroy_window): Move code to x_free_frame_resources.
13909
13910 * xfns.c (unwind_create_frame): Fix comment.
13911 (Fx_create_frame, x_create_tip_frame):
13912 Move terminal->reference_count++ just before making the frame
13913 official. Move initialization of image_cache_refcount and
13914 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13915
13916 2011-11-05 Eli Zaretskii <eliz@gnu.org>
13917
13918 Support MSVC build with newer versions of Visual Studio.
13919 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13920 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13921 nt/gmake.defs.
13922
13923 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13924 which are not supported by MSVC.
13925 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13926 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13927 bitfields.
13928 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13929 types in bitfields.
13930 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13931
13932 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
13933
13934 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
13935
13936 Support MSVC build with newer versions of Visual Studio.
13937 * w32.c: Don't include w32api.h for MSVC.
13938 (init_environment) [_MSC_VER]: Call sys_access, not _access.
13939
13940 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
13941 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
13942 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
13943 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
13944 e_* cousins.
13945 (alloca) [_MSC_VER]: Define to _alloca.
13946
13947 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
13948
13949 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
13950
13951 2011-11-04 Eli Zaretskii <eliz@gnu.org>
13952
13953 * xdisp.c (note_mouse_highlight): If either of
13954 previous/next-single-property-change returns nil, treat that as
13955 the beginning or the end of the buffer. (Bug#9955)
13956
13957 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
13958
13959 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
13960 label is not null (Bug#9951).
13961 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
13962 may be NULL.
13963
13964 2011-11-04 Eli Zaretskii <eliz@gnu.org>
13965
13966 * window.c (Fwindow_body_size): Mention in the doc string that the
13967 return value is in frame's canonical units. (Bug#9949)
13968
13969 2011-11-03 Eli Zaretskii <eliz@gnu.org>
13970
13971 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
13972
13973 * w32fns.c (unwind_create_frame): If needed, free the glyph
13974 matrices of the partially constructed frame. (Bug#9943)
13975 * xfns.c (unwind_create_frame): Likewise.
13976
13977 2011-11-01 Eli Zaretskii <eliz@gnu.org>
13978
13979 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
13980 Don't stop backward scan on the continuation glyph, even though
13981 its CHARPOS is positive.
13982 (mouse_face_from_buffer_pos, note_mouse_highlight):
13983 Rename cover_string to disp_string.
13984
13985 2011-11-01 Martin Rudalics <rudalics@gmx.at>
13986
13987 * window.c (temp_output_buffer_show): Don't use
13988 Vtemp_buffer_show_specifiers.
13989 (Vtemp_buffer_show_specifiers): Remove unused variable.
13990
13991 2011-10-30 Eli Zaretskii <eliz@gnu.org>
13992
13993 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
13994 past the beginning of the current glyph matrix.
13995
13996 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
13997
13998 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
13999 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14000 HAVE_GTK3 (Bug#9869).
14001
14002 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14003 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14004
14005 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14006
14007 * xterm.c: Declare x_handle_net_wm_state to return int.
14008 (handle_one_xevent): Check if we are iconified but don't have
14009 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14010 (get_current_wm_state): Return non-zero if not hidden,
14011 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14012 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14013 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14014 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14015
14016 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14017
14018 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14019 so that this new function doesn't get optimized away by a
14020 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14021
14022 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14023
14024 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14025
14026 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14027
14028 Fix the `xbytecode' command.
14029 * .gdbinit (xprintbytestr): New command.
14030 (xwhichsymbols): Rename from `which'; all callers changed.
14031 (xbytecode): Print the byte-code string as well.
14032
14033 2011-10-29 Kim Storm <storm@cua.dk>
14034
14035 * alloc.c (which_symbols): New function.
14036
14037 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14038
14039 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14040 line. (Bug#9903)
14041
14042 2011-10-29 Glenn Morris <rgm@gnu.org>
14043
14044 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14045 Not clear what it was for, and it causes various bugs. (Bug#9839)
14046
14047 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14048
14049 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14050 possible random value that matches one of those tested as
14051 condition to clear the mouse face.
14052
14053 2011-10-28 Chong Yidong <cyd@gnu.org>
14054
14055 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14056
14057 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14058
14059 * window.c (make_window): Initialize phys_cursor_on_p.
14060
14061 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14062
14063 * lisp.h (struct Lisp_Symbol): Update comments.
14064
14065 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14066
14067 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14068
14069 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14070
14071 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14072 <oslsachem@gmail.com> for helping to debug this.
14073
14074 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14075 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14076 (g_b_init_get_glyph_outline_w): New static variables.
14077 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14078 (GetGlyphOutlineW_Proc): New typedefs.
14079 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
14080 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14081 New functions.
14082 (w32font_open_internal, compute_metrics):
14083 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
14084 instead of calling the "wide" APIs directly.
14085
14086 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14087
14088 * w32.h (syms_of_w32font): Add prototype.
14089
14090 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14091
14092 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14093 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14094 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14095 (Fmove_to_window_line): Doc fix.
14096
14097 2011-10-27 Chong Yidong <cyd@gnu.org>
14098
14099 * process.c (make_process): Set gnutls_state to NULL.
14100
14101 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14102 non-NULL, regardless of GNUTLS_INITSTAGE.
14103 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14104 an error. Set process slots as soon as we allocate them.
14105
14106 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14107
14108 2011-10-27 Chong Yidong <cyd@gnu.org>
14109
14110 * gnutls.c (emacs_gnutls_deinit): New function.
14111 Deallocate credentials structures as well as calling gnutls_deinit.
14112 (Fgnutls_deinit, Fgnutls_boot): Use it.
14113
14114 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14115 (deactivate_process): Call emacs_gnutls_deinit.
14116
14117 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14118
14119 * image.c (x_create_x_image_and_pixmap):
14120 * w32.c (sys_rename, w32_delayed_load):
14121 * w32font.c (fill_in_logfont):
14122 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14123
14124 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
14125
14126 * w32fns.c (w32_default_color_map): New function,
14127 extracted from Fw32_default_color_map.
14128 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
14129
14130 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14131
14132 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14133
14134 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14135
14136 * keyboard.c (test_undefined): New function (bug#9751).
14137 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14138
14139 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14140
14141 * sysdep.c (init_sys_modes): Fix the check for the controlling
14142 terminal (Bug#6649).
14143
14144 2011-10-20 Eli Zaretskii <eliz@gnu.org>
14145
14146 * dispextern.h (struct bidi_it): New member next_en_type.
14147
14148 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14149 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14150 current character, check also for next_en_type being WEAK_EN.
14151 (bidi_resolve_weak): Don't enter the expensive loop if the current
14152 position is before next_en_pos. Record the bidi type of the first
14153 non-ET, non-BN character we find, in addition to its position.
14154 (bidi_level_of_next_char): Invalidate next_en_type when
14155 next_en_pos is over-stepped.
14156
14157 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14158
14159 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14160 * editfns.c: Rewrite current-time-zone so that it invokes
14161 the equivalent of (format-time-string "%Z") to get the time zone name.
14162 This fixes a bug when the time zone name contains characters that
14163 need converting from the system time locale to Emacs internal format.
14164 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14165 that patch fixed format-time-string to do the conversion, but
14166 I forgot to fix current-time-zone.
14167 (format_time_string): New function, containing most of
14168 what Fformat_time_string used to contain.
14169 (Fformat_time_string): Rewrite in terms of format_time_string.
14170 This doesn't change this function's behavior.
14171 (current-time-zone): Rewrite to use format_time_string.
14172 This fixes the bug reported by Michael Schierl in
14173 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14174 Jason Rumney's 2007-06-07 change worked around this bug, but
14175 didn't fix it.
14176 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14177
14178 2011-10-19 Eli Zaretskii <eliz@gnu.org>
14179
14180 * xdisp.c (start_display): If the character at POS is displayed
14181 via a display vector, reset IT->current.dpvec_index to zero.
14182 (try_window_reusing_current_matrix): If a line ends in a display
14183 vector or the next line starts in a display vector, continue
14184 redrawing the window even though the character position of
14185 start_row was reached.
14186 (Bug#9771, part 2)
14187
14188 2011-10-18 Chong Yidong <cyd@gnu.org>
14189
14190 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14191 with nobreak-char-display too.
14192
14193 2011-10-18 Eli Zaretskii <eliz@gnu.org>
14194
14195 Fix part 3 of bug#9771.
14196 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14197 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14198 non-neutral characters if the current character is a paragraph
14199 separator (a.k.a. Newline). This avoids running the same
14200 expensive loop twice, once when we consume the preceding newline
14201 and the other time when the line actually needs to be displayed.
14202 Avoid the loop when we see neutrals on the base embedding level
14203 following a character whose directionality is the same as the
14204 paragraph's. This avoids running the expensive loop when a line
14205 ends in a long sequence of neutrals, like control characters.
14206 Add assertion against STRONG_AL type. Slightly rearrange code
14207 that determines the type of a neutral given the first non-neutral
14208 that follows it.
14209 (bidi_level_of_next_char): Set next_en_pos to zero when
14210 invalidating its info.
14211
14212 2011-10-17 Eli Zaretskii <eliz@gnu.org>
14213
14214 * xdisp.c (push_display_prop): Determine whether to record string
14215 or buffer position by IT->string, not by IT->method. Allow
14216 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
14217 (move_it_vertically_backward): Don't look for character position
14218 immediately after the newline when in a continuation line.
14219 (Bug#9771, part 1)
14220
14221 2011-10-15 Martin Rudalics <rudalics@gmx.at>
14222
14223 * window.c (coordinates_in_window): Rewrite and delabelize
14224 vertical border check. (Bug#5357) (Bug#9618)
14225
14226 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14227
14228 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14229 errors in XSetWindowBorder (bug#9310).
14230
14231 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14232
14233 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14234 avoid crash when xmalloc overrun checking is enabled.
14235
14236 2011-10-13 Eli Zaretskii <eliz@gnu.org>
14237
14238 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14239 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14240 cursor motion with <left> and <right> arrow keys.
14241
14242 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14243 some callers set that themselves.
14244
14245 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14246
14247 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14248 display string and the previous row comes from the same string and
14249 is empty. (Bug#9739) (Bug#9738)
14250
14251 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14252
14253 * doc.c (get_doc_string): Encode file name (bug#9735).
14254
14255 2011-10-12 Eli Zaretskii <eliz@gnu.org>
14256
14257 * bidi.c (bidi_level_of_next_char):
14258 * xdisp.c (get_visually_first_element): Remove old incorrect
14259 comments regarding the Unicode Line Separator character.
14260
14261 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14262
14263 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14264
14265 * alloc.c (Fgc_status): Do not access beyond zombies array
14266 boundary if nzombies > MAX_ZOMBIES.
14267 * alloc.c (dump_zombies): Add missing format specifier.
14268
14269 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14270
14271 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14272 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14273
14274 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14275 Some packages use them to denote characters with modifiers.
14276
14277 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14278
14279 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14280 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14281 matching a pp-number. Rename parameter var to var1.
14282
14283 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14284
14285 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14286
14287 2011-10-08 Glenn Morris <rgm@gnu.org>
14288
14289 * callint.c (Fcall_interactively): Give a more explicit error for the
14290 'c' case with a non-character input. (Bug#8479)
14291
14292 2011-10-08 Eli Zaretskii <eliz@gnu.org>
14293
14294 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14295 lines.
14296 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14297 lines that are hscrolled on the left.
14298
14299 * dispnew.c (buffer_posn_from_coords): Account for a possible
14300 presence of header-line. (Bug#4426)
14301
14302 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14303
14304 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14305 Don't advertise functionality which we discourage or doesn't work.
14306
14307 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14308
14309 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14310 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14311 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14312 this makes Emacs dump core during garbage collection on rare
14313 occasions. sizeof is obviously inferior to offsetof here, so
14314 stick with offsetof.
14315 (GC_POINTER_ALIGNMENT): New macro.
14316 (mark_memory): Omit 3rd (offset) arg; caller changed.
14317 Don't assume EMACS_INT alignment is the same as pointer alignment.
14318
14319 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14320
14321 * keyboard.c (read_key_sequence_remapped): New var.
14322 (read_key_sequence): Compute remapping in the right buffer.
14323 (command_loop_1): Use read_key_sequence's remapping directly.
14324
14325 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14326
14327 * dired.c (file_name_completion): Don't expand file name.
14328 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14329 before checking file name handler.
14330
14331 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14332 they've been requested explicitly (bug#9591).
14333
14334 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
14335
14336 * keymap.c (Fsingle_key_description): Use make_specified_string
14337 instead of build_string to build string from push_key_description.
14338 (Bug#5193)
14339
14340 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14341
14342 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14343 This fixes a Y2038 bug on 64-bit hosts.
14344 * buffer.c (reset_buffer):
14345 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14346 (Fclear_buffer_auto_save_failure):
14347 Use 0, not -1, to represent an unset failure time, since time_t
14348 might not be signed.
14349
14350 Remove dependency on glibc malloc internals.
14351 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14352 Move back here from lisp.h, but with their new implementations.
14353 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14354 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14355 * charset.c (charset_table_init): New static var.
14356 (syms_of_charset): Use it instead of xmalloc. This removes a
14357 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14358 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14359 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14360 Move back to alloc.c.
14361 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14362 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14363
14364 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14365
14366 * nsterm.m (windowDidResize): Call x_set_window_size only when
14367 ns_in_resize is true. Otherwise set pixelwidth/height and
14368 call change_frame_size (Bug#9628).
14369
14370 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14371
14372 Port --enable-checking=all to Fedora 14 x86-64.
14373 * charset.c (syms_of_charset): Also account for glibc malloc's
14374 internal overhead when calculating the initial malloc maximum.
14375
14376 Port --enable-checking=all to Fedora 14 x86.
14377 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14378 Move to lisp.h.
14379 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14380 (overrun_check_realloc, overrun_check_free):
14381 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14382 That way, xmalloc returns a properly-aligned pointer even if
14383 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14384 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14385 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14386 into account when calculating the initial malloc maximum.
14387 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14388 Move here from alloc.c, so that charset.c can use it too.
14389 Properly align; the old code wasn't right for common 32-bit hosts
14390 when configured with --enable-checking=all.
14391 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14392 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14393
14394 2011-09-29 Eli Zaretskii <eliz@gnu.org>
14395
14396 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
14397 use EDOM.
14398
14399 2011-09-28 Eli Zaretskii <eliz@gnu.org>
14400
14401 * xdisp.c (compute_display_string_end): If there's no display
14402 string at CHARPOS, return -1.
14403
14404 * bidi.c (bidi_fetch_char): When compute_display_string_end
14405 returns a negative value, treat the character as a normal
14406 character not covered by a display string. (Bug#9624)
14407
14408 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
14409
14410 * lread.c (Fread_from_string): Fix typo in docstring.
14411
14412 2011-09-27 Eli Zaretskii <eliz@gnu.org>
14413
14414 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14415 newline, reseat the iterator instead of bidi-iterating there one
14416 character at a time. (Bug#9610)
14417 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14418 TO_CHARPOS if the bidi iterator is at base embedding level.
14419
14420 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14421
14422 * lread.c (readevalloop): Use correct code for NBSP.
14423 (read1): Likewise. (Bug#9608)
14424
14425 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
14426
14427 * dbusbind.c (Fdbus_register_signal): When service is not
14428 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14429
14430 2011-09-25 Glenn Morris <rgm@gnu.org>
14431
14432 * buffer.c (truncate-lines): Doc fix.
14433
14434 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
14435
14436 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14437 (Fset_window_next_buffers): Doc fix.
14438
14439 2011-09-24 Glenn Morris <rgm@gnu.org>
14440
14441 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14442
14443 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14444
14445 Fix minor problems found by static checking.
14446 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
14447 * indent.c (Fvertical_motion): Fix == vs = typo.
14448
14449 2011-09-24 Eli Zaretskii <eliz@gnu.org>
14450
14451 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14452 Default value is now t. Doc fix.
14453
14454 * indent.c (Fvertical_motion): Compute and apply the overshoot
14455 logic when moving up, not only when moving down. Fix the
14456 confusing name and values of the it_overshoot_expected variable;
14457 logic changes accordingly. (Bug#9254) (Bug#9549)
14458
14459 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14460 CHARPOS is covered by a display string which includes newlines.
14461 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14462 is covered by a display string with embedded newlines.
14463
14464 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
14465
14466 * dbusbind.c (Fdbus_register_signal): Add match rule to
14467 Vdbus_registered_objects_table. (Bug#9581)
14468 (Fdbus_register_method, Vdbus_registered_objects_table):
14469 Fix docstring.
14470
14471 2011-09-24 Jim Meyering <meyering@redhat.com>
14472
14473 do not ignore write error for any output size
14474 The previous change was incomplete.
14475 While it makes emacs --batch detect the vast majority of stdout
14476 write failures, errors were still ignored whenever the output size is
14477 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14478 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14479 && echo FAIL: ignored write error
14480 FAIL: ignored write error
14481 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14482 && echo FAIL: ignored write error
14483 FAIL: ignored write error
14484 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14485
14486 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14487
14488 * emacs.c (Fkill_emacs): In noninteractive mode exit
14489 non-successfully if a write error occurred on stdout. (Bug#9574)
14490
14491 2011-09-21 Eli Zaretskii <eliz@gnu.org>
14492
14493 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14494 the xassert test.
14495
14496 * dispextern.h (struct it): Update the comment documenting what
14497 can it->OBJECT be.
14498
14499 2011-09-20 Eli Zaretskii <eliz@gnu.org>
14500
14501 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14502 a display string, extend search for cursor position to end of row.
14503 (find_row_edges): If the row ends in a newline from a display
14504 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14505 Handle the case of a display string with multiple newlines.
14506 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14507 non-empty line. Fixes confusing cursor motion with arrow keys at
14508 the beginning of a line that starts with whitespace.
14509
14510 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14511
14512 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14513 (bug#9493).
14514
14515 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
14516
14517 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14518 boolean (Bug#9154).
14519
14520 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14521
14522 * xdisp.c (display_line): Record maximum and minimum buffer
14523 positions even if no glyphs were produced (e.g., by a zero-width
14524 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14525 buffer positions that will be removed from the glyph row because
14526 they don't fit.
14527 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
14528 column is beyond frame width: don't subtract 1 "pixel" when
14529 computing width of the stretch.
14530 (reseat_at_next_visible_line_start): Undo the change made on
14531 2011-09-17 that saved paragraph information and restored it after
14532 the call to `reseat'. (Bug#9545)
14533
14534 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14535
14536 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
14537 and turn window cursor on if cleared (Bug#9415).
14538
14539 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
14540
14541 * search.c (boyer_moore): Take unibyte characters from pattern
14542 literally. (Bug#9458)
14543
14544 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14545
14546 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
14547
14548 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
14549
14550 Fix minor problem found by static checking.
14551 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14552 initialized, to pacify gcc -Wuninitialized.
14553
14554 * fileio.c: Report proper errno when syscall falls.
14555 (Finsert_file_contents): Save and restore errno,
14556 so that report_file_error outputs the correct diagnostic.
14557 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14558
14559 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14560
14561 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14562
14563 2011-09-17 Eli Zaretskii <eliz@gnu.org>
14564
14565 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14566 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14567
14568 2011-09-17 Eli Zaretskii <eliz@gnu.org>
14569
14570 * xdisp.c (reseat_at_next_visible_line_start): Keep information
14571 about the current paragraph and restore it after the call to reseat.
14572
14573 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14574 (bidi_find_paragraph_start): Search back for paragraph beginning
14575 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14576 (bidi_move_to_visually_next): Only trigger paragraph-related
14577 computations when the last character is a newline or at EOB, not
14578 just any NEUTRAL_B. (Bug#9470)
14579
14580 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
14581 truncated lines if point is covered by a display string. (Bug#9524)
14582
14583 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
14584
14585 * xselect.c: Relax test for outgoing X longs (Bug#9498).
14586 (cons_to_x_long): New function.
14587 (lisp_data_to_selection_data): Use it. Correct the test for
14588 short-versus-long data; it was negated. Break out of vector
14589 loop, for efficiency, when a long datum is discovered.
14590
14591 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
14592
14593 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
14594
14595 2011-09-16 Eli Zaretskii <eliz@gnu.org>
14596
14597 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
14598 GCC PR/17406) by declaring this function with external scope.
14599
14600 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14601
14602 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
14603 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
14604
14605 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
14606
14607 * editfns.c (Fformat): Correctly handle text properties on "%%".
14608
14609 2011-09-15 Eli Zaretskii <eliz@gnu.org>
14610
14611 * xterm.c (x_draw_composite_glyph_string_foreground):
14612 * w32term.c (x_draw_composite_glyph_string_foreground):
14613 * term.c (encode_terminal_code):
14614 * composite.c (composition_update_it, get_composition_id):
14615 * xdisp.c (get_next_display_element)
14616 (fill_composite_glyph_string): Add comments about special meaning
14617 of TAB characters in a composition.
14618
14619 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14620
14621 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
14622 This occurs when processing a multibyte format.
14623 Problem reported by Wolfgang Jenker.
14624
14625 2011-09-15 Johan Bockgård <bojohan@gnu.org>
14626
14627 * xdisp.c (try_cursor_movement): Only check for exact match if
14628 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
14629
14630 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14631
14632 Remove unused external symbols.
14633 * dispextern.h (calc_pixel_width_or_height): Remove decl.
14634 * xdisp.c (calc_pixel_width_or_height): Now static.
14635 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
14636 * indent.c (check_display_width):
14637 * w32term.c: Fix comment to match code.
14638 * xterm.c, xterm.h (x_catching_errors): Remove.
14639
14640 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14641
14642 * xselect.c: Use signed conversions more consistently (Bug#9498).
14643 (selection_data_to_lisp_data): Assume incoming selection data are
14644 signed integers, not unsigned. This is to be consistent with
14645 outgoing selection data, which was modified to use signed integers
14646 in as part of the fix to Bug#9196 in response to Jan D.'s comment
14647 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
14648 expects long, not unsigned long.
14649
14650 2011-09-14 Eli Zaretskii <eliz@gnu.org>
14651
14652 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
14653 computation of loop end. Reported by Johan Bockgård
14654 <bojohan@gnu.org>.
14655
14656 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
14657
14658 * frame.c (Fother_visible_frames_p): Function deleted.
14659
14660 2011-09-12 Eli Zaretskii <eliz@gnu.org>
14661
14662 * indent.c (compute_motion): Process display vector front to back
14663 rather than the other way around. (Bug#2496)
14664
14665 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
14666
14667 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
14668
14669 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
14670
14671 * minibuf.c (Fread_from_minibuffer): Doc fix.
14672
14673 2011-09-11 Eli Zaretskii <eliz@gnu.org>
14674
14675 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
14676 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
14677
14678 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14679
14680 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
14681 value for non-existent files.
14682
14683 2011-09-11 Eli Zaretskii <eliz@gnu.org>
14684
14685 * fileio.c (Finsert_file_contents): If the file cannot be opened,
14686 set its "size" to -1. This will set the modtime_size field of
14687 the corresponding buffer to -1, which is what
14688 verify-visited-file-modtime expects for files that do not exist.
14689 (Bug#9139)
14690
14691 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
14692
14693 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
14694 here ...
14695 * lisp.h: ... from here. push_key_description is no longer
14696 defined in keyboard.c, so its declaration should not be in
14697 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
14698 logically belongs with push_key_description.
14699
14700 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
14701
14702 * buffer.h: Include <sys/types.h> instead of <time.h>.
14703 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
14704 Problem reported by Herbert J. Skuhra.
14705
14706 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
14707
14708 * xml.c (parse_region): Make the parsing work for
14709 non-comment-starting XML files again (bug#9144).
14710
14711 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
14712
14713 * image.c (gif_load): Fix calculation of bottom and right corner.
14714 (Bug#9468)
14715
14716 2011-09-10 Eli Zaretskii <eliz@gnu.org>
14717
14718 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
14719 redisplay in small windows.
14720
14721 2011-09-09 Eli Zaretskii <eliz@gnu.org>
14722
14723 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
14724
14725 2011-09-08 Martin Rudalics <rudalics@gmx.at>
14726
14727 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
14728 Operate on live windows only.
14729
14730 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
14731
14732 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
14733
14734 2011-09-07 Eli Zaretskii <eliz@gnu.org>
14735
14736 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
14737 only under bidi iteration.
14738
14739 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
14740
14741 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
14742
14743 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14744
14745 isnan: Fix porting problem to Solaris 10 with bundled gcc.
14746 Without this fix, the command to link temacs failed due to an
14747 undefined symbol __builtin_isnan. This is because
14748 /usr/include/iso/math_c99.h #defines isnan(x) to
14749 __builtin_isnan(x), but the bundled gcc, which identifies itself
14750 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
14751 a __builtin_isnan.
14752 * floatfns.c (isnan): #undef, and then #define to a clone of
14753 what's in data.c.
14754 (Fisnan): Always define, since it's always available now.
14755 (syms_of_floatfns): Always define isnan at the Lisp level.
14756
14757 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14758
14759 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
14760
14761 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14762
14763 * fileio.c: Fix bugs with large file offsets (Bug#9428).
14764 The previous code assumed that file offsets (off_t values) fit in
14765 EMACS_INT variables, which is not true on typical 32-bit hosts.
14766 The code messed up by falsely reporting buffer overflow in cases
14767 such as (insert-file-contents "big" nil 1 2) into an empty buffer
14768 when "big" contains more than 2**29 bytes, even though this
14769 inserts just one byte and does not overflow the buffer.
14770 (Finsert_file_contents): Store file offsets as off_t
14771 values, not as EMACS_INT values. Check for overflow when
14772 converting between EMACS_INT and off_t. When checking for
14773 buffer overflow or for overlap, take the offsets into account.
14774 Don't use EMACS_INT for small values where int suffices.
14775 When checking for overlap, fix a typo: ZV was used where
14776 ZV_BYTE was intended.
14777 (Fwrite_region): Don't assume off_t fits into 'long'.
14778 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
14779
14780 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
14781
14782 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
14783
14784 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14785
14786 sprintf-related integer and memory overflow issues (Bug#9412).
14787
14788 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
14789 (esprintf, exprintf, evxprintf): New functions.
14790 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
14791 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
14792 (modify_event_symbol): Do not assume that the length of
14793 name_alist_or_stem is safe to alloca and fits in int.
14794 (Fexecute_extended_command): Likewise for function name and binding.
14795 (Frecursion_depth): Wrap around reliably on integer overflow.
14796 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
14797 since some callers pass EMACS_INT values.
14798 (Fsingle_key_description): Don't crash if symbol name contains more
14799 than MAX_ALLOCA bytes.
14800 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
14801 (get_minibuffer): Arg is now EMACS_INT, not int.
14802 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
14803 (esprintf, exprintf, evxprintf): New decls.
14804 * window.h (command_loop_level, minibuf_level): Reflect API changes.
14805
14806 * dbusbind.c (signature_cat): New function.
14807 (xd_signature, Fdbus_register_signal):
14808 Do not overrun buffer; instead, report string overflow.
14809
14810 * dispnew.c (add_window_display_history): Don't overrun buffer.
14811 Truncate instead; this is OK since it's just a log.
14812
14813 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
14814 even if the time zone offset is outlandishly large.
14815 Don't mishandle offset == INT_MIN.
14816
14817 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
14818 when creating daemon; the previous buffer-overflow check was incorrect.
14819
14820 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
14821 which has the guts of the old verror function.
14822
14823 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
14824 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
14825
14826 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
14827 (font_unparse_xlfd): Don't blindly alloca long strings.
14828 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
14829 fits in int, when using sprintf. Use single snprintf to count
14830 length of string rather than counting it via multiple sprintfs;
14831 that's simpler and more reliable.
14832 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
14833 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
14834 sprintf, in case result does not fit in int.
14835
14836 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
14837 (fontset_from_font): Print it.
14838
14839 * frame.c (tty_frame_count): Now printmax_t, not int.
14840 (make_terminal_frame, set_term_frame_name): Print it.
14841 (x_report_frame_params): In X, window IDs are unsigned long,
14842 not signed long, so print them as unsigned.
14843 (validate_x_resource_name): Check for implausibly long names,
14844 and don't assume name length fits in 'int'.
14845 (x_get_resource_string): Don't blindly alloca invocation name;
14846 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
14847 not fit in int.
14848
14849 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
14850 (xg_check_special_colors, xg_set_geometry):
14851 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
14852
14853 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
14854 Use esprintf, not sprintf, in case result does not fit in int.
14855
14856 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14857 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
14858 it as a large positive number.
14859 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
14860 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14861
14862 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14863 in case result does not fit in int.
14864
14865 * print.c (float_to_string): Detect width overflow more reliably.
14866 (print_object): Make sprintf buffer a bit bigger, to avoid potential
14867 buffer overrun. Don't assume list length fits in 'int'. Treat
14868 print length of 0 as 0, not as infinity; to be consistent with other
14869 uses of print length in this function. Don't overflow print length
14870 index. Don't assume hash table size fits in 'long', or that
14871 vectorlike size fits in 'unsigned long'.
14872
14873 * process.c (make_process): Use printmax_t, not int, to format
14874 process-name gensyms.
14875
14876 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
14877
14878 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
14879 to avoid potential buffer overrun.
14880
14881 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
14882 if X resource line is longer than 512 bytes.
14883
14884 * xfns.c (x_window): Make sprintf buffer a bit bigger
14885 to avoid potential buffer overrun.
14886
14887 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
14888
14889 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
14890
14891 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14892
14893 Integer overflow fixes for scrolling, etc.
14894 Without these, Emacs silently mishandles large integers sometimes.
14895 For example, "C-u 4294967297 M-x recenter" was treated as if
14896 it were "C-u 1 M-x recenter" on a typical 64-bit host.
14897
14898 * xdisp.c (try_window_id): Check Emacs fixnum range before
14899 converting to 'int'.
14900
14901 * window.c (window_scroll_line_based, Frecenter):
14902 Check that an Emacs fixnum is in range before assigning it to 'int'.
14903 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
14904 values converted from Emacs fixnums.
14905 (Frecenter): Don't wrap around a line count if it is out of 'int'
14906 range; instead, treat it as an extreme value.
14907 (Fset_window_configuration, compare_window_configurations):
14908 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
14909
14910 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14911 that can exceed INT_MAX. Check that EMACS_INT value is in range
14912 before assigning it to the (possibly-narrower) index.
14913 (match_limit): Don't assume that a fixnum can fit in 'int'.
14914
14915 * print.c (print_object): Use ptrdiff_t, not int, for index that can
14916 exceed INT_MAX.
14917
14918 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
14919 (Fvertical_motion): Don't wrap around LINES values that don't fit
14920 in 'int'. Instead, treat them as extreme values. This is good
14921 enough for windows, which can't have more than INT_MAX lines anyway.
14922
14923 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14924
14925 * Require libxml/parser.h to avoid compilation warning.
14926
14927 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14928
14929 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14930 since this reportedly can destroy thread storage.
14931
14932 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
14933
14934 * syntax.c (find_defun_start): Update all cache variables if
14935 exiting early (Bug#9401).
14936
14937 2011-08-30 Eli Zaretskii <eliz@gnu.org>
14938
14939 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
14940
14941 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
14942 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
14943 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
14944
14945 * term.c (tty_append_glyph): New function.
14946 (produce_stretch_glyph): Static function and its prototype deleted.
14947
14948 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
14949 Add prototypes.
14950
14951 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
14952
14953 * image.c (parse_image_spec): Check for nonnegative, not for positive,
14954 when checking :margin (Bug#9390).
14955 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
14956 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
14957 so that the name doesn't mislead. All uses changed.
14958
14959 2011-08-28 Johan Bockgård <bojohan@gnu.org>
14960
14961 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
14962 set_tty_hooks.
14963
14964 2011-08-27 Eli Zaretskii <eliz@gnu.org>
14965
14966 * xdisp.c (move_it_to): Don't bail out early when reaching
14967 position beyond to_charpos, if we are scanning backwards.
14968 (move_it_vertically_backward): When DY == 0, make sure we get to
14969 the first character in the line after the newline.
14970
14971 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
14972
14973 * ccl.c: Improve and simplify overflow checking (Bug#9196).
14974 (ccl_driver): Do not generate an out-of-range pointer.
14975 (Fccl_execute_on_string): Remove unnecessary check for
14976 integer overflow, noted by Stefan Monnier in
14977 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
14978 Remove a FIXME that didn't need fixing.
14979 Simplify the newly-introduced buffer reallocation code.
14980
14981 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
14982
14983 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
14984
14985 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
14986
14987 Integer and memory overflow issues (Bug#9196).
14988
14989 * doc.c (get_doc_string): Rework so that
14990 get_doc_string_buffer_size is the actual buffer size, rather than
14991 being 1 less than the actual buffer size; this makes xpalloc more
14992 convenient.
14993
14994 * image.c (x_allocate_bitmap_record, cache_image):
14995 * xselect.c (Fx_register_dnd_atom):
14996 Simplify previous changes by using xpalloc.
14997
14998 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
14999 since either will do and ptrdiff_t is convenient with xpalloc.
15000
15001 * charset.c (charset_table_size)
15002 (struct charset_sort_data.priority): Now ptrdiff_t.
15003 (charset_compare): Don't overflow if priorities differ greatly.
15004 (Fsort_charsets): Don't assume list length fits in int.
15005 Check for size-calculation overflow when allocating sort data.
15006 (syms_of_charset): Allocate an initial charset table that is
15007 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15008
15009 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15010
15011 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15012 The actual value is always <= INT_MAX, and leaving it unsigned made
15013 overflow checking harder.
15014
15015 * dispextern.h (struct glyph_matrix.rows_allocated)
15016 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15017 with xpalloc. The values are still always <= INT_MAX.
15018
15019 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15020
15021 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15022 (SAFE_NALLOCA): New macro.
15023
15024 * region-cache.c (struct boundary.pos, find_cache_boundary)
15025 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15026 (set_cache_region, invalidate_region_cache)
15027 (revalidate_region_cache, know_region_cache, region_cache_forward)
15028 (region_cache_backward, pp_cache):
15029 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15030 so that ptrdiff_t * can be passed to xpalloc.
15031 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15032 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15033 (pp_cache): Don't assume cache_len fits in int.
15034 * region-cache.h: Adjust extern decls to match.
15035
15036 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15037 EMACS_INT, since either will do, for xpalloc.
15038
15039 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15040 (xnmalloc, xnrealloc, xpalloc): New functions.
15041
15042 * bidi.c (bidi_shelve_header_size): New constant.
15043 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15044 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15045
15046 * bidi.c (bidi_cache_shrink):
15047 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15048 (overlay_strings):
15049 Don't update size of array until after memory allocation succeeds,
15050 because xmalloc/xrealloc may not return.
15051 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15052 now that we have proper integer overflow checking.
15053 (record_overlay_string, overlay_strings): Catch overflows when
15054 calculating size of overlay_str_buf.
15055
15056 * callproc.c (Fcall_process): Check for size overflow when
15057 calculating size of args2.
15058 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15059 Normally we prefer signed values, but sticking with ptrdiff_t would
15060 require adding more-complicated checks.
15061
15062 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15063 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15064 Redo buffer-overflow calculations to avoid integer overflow.
15065 Add a FIXME comment where memory seems to be over-allocated.
15066
15067 * character.c (Fstring): Check for size-calculation overflow.
15068
15069 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15070 unnecessary integer overflow. Check for size overflow.
15071 (encode_coding_object): Don't update size until xmalloc succeeds.
15072
15073 * composite.c (get_composition_id): Check for overflow in glyph
15074 length calculations.
15075
15076 Integer and memory overflow fixes for display code.
15077 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15078 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15079 (scrolling_window): Check for overflow in size calculations.
15080 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15081 Don't assume glyph table len fits in int.
15082 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15083 (row_table_size): Now ptrdiff_t, not int.
15084 (scrolling_window): Avoid overflow in size calculations.
15085 Don't update size until allocation succeeds.
15086 * fns.c (concat): Check for overflow in size calculations.
15087 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15088 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15089 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15090
15091 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15092 (get_doc_string): Check for size calculation overflow.
15093 Don't update size until allocation succeeds.
15094 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15095 EMACS_INT, where ptrdiff_t will do.
15096 (Fsubstitute_command_keys): Check for string overflow.
15097
15098 * editfns.c (set_time_zone_rule): Don't assume environment length
15099 fits in int.
15100 (message_length): Now ptrdiff_t, not int.
15101 (Fmessage_box): Don't update size until allocation succeeds.
15102 Don't assume message length fits in int.
15103 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15104
15105 * emacs.c (main): Do not reallocate argv, since there is a null at
15106 the end that can be overwritten, and this way there's no need to
15107 worry about size-calculation overflow.
15108 (sort_args): Check for size-calculation overflow.
15109
15110 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15111 alloc succeeds.
15112 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15113
15114 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15115 (x_set_scroll_bar_width, x_figure_window_size):
15116 Check for integer overflow.
15117 (x_set_alpha): Do not assume XINT fits in int.
15118
15119 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15120 This is for the members text_lines, text_cols, total_lines, total_cols,
15121 where the system imposes an 'int' limit.
15122
15123 * fringe.c (Fdefine_fringe_bitmap):
15124 Don't update size until alloc works.
15125
15126 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15127 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15128
15129 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15130 Check for size-calculation overflow.
15131 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15132 do, as we prefer signed integers.
15133 (id_to_widget.max_size, id_to_widget.used)
15134 (xg_store_widget_in_map, xg_remove_widget_from_map)
15135 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15136 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15137 Use and return ptrdiff_t, not int.
15138 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15139 * gtkutil.h: Change prototypes to match the above.
15140
15141 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15142 are duplicate now that they've been promoted to lisp.h.
15143 (x_allocate_bitmap_record, x_alloc_image_color)
15144 (make_image_cache, cache_image, xpm_load):
15145 Don't update size until alloc is done.
15146 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15147 (x_detect_edges):
15148 Check for size calculation overflow.
15149 (ct_colors_allocated_max): New constant.
15150 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15151 overflow.
15152
15153 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15154 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15155 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15156 Use ptrdiff_t, not int, to count maps.
15157 (read_char_minibuf_menu_prompt): Check for overflow in size
15158 calculations. Don't update size until allocation succeeds.
15159 Redo calculations to avoid overflow.
15160 * keyboard.h: Change prototypes to match the above.
15161
15162 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15163 to count maps.
15164 (current_minor_maps): Check for size calculation overflow.
15165 * keymap.h: Change prototypes to match the above.
15166
15167 * lread.c (read1, init_obarray): Don't update size until alloc done.
15168
15169 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15170 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15171
15172 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15173 Now ptrdiff_t, not int.
15174 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15175 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15176
15177 * process.c (Fnetwork_interface_list): Check for overflow
15178 in size calculation.
15179
15180 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15181
15182 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15183 overflow. Don't bother calling xmalloc when xrealloc will do.
15184
15185 * search.c (Freplace_match): Check for size calculation overflow.
15186 (Fset_match_data): Don't assume list lengths fit in 'int'.
15187
15188 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15189 for command line length. Do not attempt to address one before the
15190 beginning of an array, as that's not portable.
15191
15192 * term.c (max_frame_lines): Remove; unused.
15193 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15194 not int.
15195 (encode_terminal_code, calculate_costs): Check for size
15196 calculation overflow.
15197 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15198 table lengths and related sizes. Don't update size until alloc
15199 done. Redo calculations to avoid overflow.
15200 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15201
15202 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15203 subtracting pointers.
15204 (gobble_line): Check for overflow more carefully. Don't update size
15205 until alloc done.
15206
15207 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15208 Don't update size until alloc done.
15209 Redo size calculations to avoid overflow.
15210 Check for size calculation overflow.
15211 (main) [DEBUG]: Fix typo in invoking tparam1.
15212
15213 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15214 Use ptrdiff_t, not int, for sizes.
15215 (store_mode_line_noprop_char): Don't update size until alloc done.
15216
15217 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15218 Use ptrdiff_t, not int, for sizes.
15219 (Finternal_make_lisp_face, cache_face):
15220 Check for size calculation overflow.
15221 (cache_face): Treat size calculation overflows as if they were
15222 memory exhaustion (the usual treatment), rather than aborting.
15223
15224 * xfns.c (x_encode_text, x_set_name_internal)
15225 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15226 sizes, since they can exceed INT_MAX in size. Check for size
15227 calculation overflow.
15228
15229 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15230 (xg_select): Check for size calculation overflow.
15231 Don't update size until alloc done.
15232
15233 * xrdb.c (get_environ_db): Don't assume path length fits in int,
15234 as sprintf is limited to int lengths.
15235
15236 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15237 (X_LONG_MIN): New macros.
15238 Use them to make the following changes clearer.
15239 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15240 This change doesn't affect the value now, but it may help remind
15241 future maintainers not to raise the value too much later.
15242 (SELECTION_QUANTUM): Remove, replacing with ...
15243 (selection_quantum): ... new function, which avoids overflow.
15244 All uses changed.
15245 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15246 assumption that selection length fits in 'int'.
15247 (x_reply_selection_request, x_handle_selection_request)
15248 (x_get_window_property, receive_incremental_selection)
15249 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15250 (lisp_data_to_selection_data, clean_local_selection_data):
15251 Use ptrdiff_t, not int, to record length of selection.
15252 (x_reply_selection_request, x_get_window_property)
15253 (receive_incremental_selection, x_property_data_to_lisp):
15254 Redo calculations to avoid overflow.
15255 (x_reply_selection_request): When sending hint, ceiling it at
15256 X_LONG_MAX rather than relying on wraparound overflow to send
15257 something.
15258 (x_get_window_property, receive_incremental_selection)
15259 (lisp_data_to_selection_data, x_property_data_to_lisp):
15260 Check for size-calculation overflow.
15261 (x_get_window_property, receive_incremental_selection)
15262 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15263 Don't store size until memory allocation succeeds.
15264 (x_get_window_property): Plug memory leak on memory exhaustion.
15265 Don't double-block input; malloc is safe here. Don't assume 2**34
15266 - 4 fits in unsigned long. Add an xassert to check
15267 XGetWindowProperty overflow. Be more careful about overflow
15268 calculations, and distinguish size from memory overflow better.
15269 (receive_incremental_selection): When tracing, don't assume
15270 unsigned int is less than INT_MAX.
15271 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15272 harmful) conversions of unsigned short to int.
15273 (lisp_data_to_selection_data): Don't assume that integers
15274 in the range -65535 through -1 fit in an X unsigned short.
15275 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15276 result parameters unless successful. Rely on cons_to_unsigned
15277 to report problems with elements; the old code wasn't right anyway.
15278 (x_check_property_data): Check for int overflow; we cannot use
15279 a wider type due to X limits.
15280 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15281
15282 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
15283
15284 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15285 (x_term_init): Check for size calculation overflow.
15286 (x_color_cells): Don't store size until memory allocation succeeds.
15287 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
15288 Don't assume alloca size is less than MAX_ALLOCA.
15289 (x_term_init): Don't assume length fits in int (sprintf is limited
15290 to int size).
15291
15292 Use ptrdiff_t for composition IDs.
15293 * character.c (lisp_string_width):
15294 * composite.c (composition_table_size, n_compositions)
15295 (get_composition_id, composition_gstring_from_id):
15296 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15297 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15298 * window.c (Frecenter):
15299 Use ptrdiff_t, not int, for composition IDs.
15300 * composite.c (get_composition_id): Check for integer overflow.
15301 * composite.h: Adjust prototypes to match the above changes.
15302
15303 Use ptrdiff_t for hash table indexes.
15304 * category.c (hash_get_category_set):
15305 * ccl.c (ccl_driver):
15306 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15307 * coding.c (coding_system_charset_list, detect_coding_system):
15308 * coding.h (struct coding_system.id):
15309 * composite.c (get_composition_id, gstring_lookup_cache):
15310 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15311 * image.c (xpm_get_color_table_h):
15312 * lisp.h (hash_lookup, hash_put):
15313 * minibuf.c (Ftest_completion):
15314 Use ptrdiff_t for hash table indexes, not int (which is too
15315 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15316 32-bit --with-wide-int hosts).
15317
15318 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15319 Add a FIXME comment about memory leaks.
15320 (syms_of_charset): Don't assume xmalloc returns.
15321
15322 Don't assume that stated character widths fit in int.
15323 * character.c (Fchar_width, c_string_width, lisp_string_width):
15324 * character.h (CHAR_WIDTH):
15325 * indent.c (MULTIBYTE_BYTES_WIDTH):
15326 Use sanitize_char_width to avoid undefined and/or bad behavior
15327 with outlandish widths.
15328 * character.h (sanitize_tab_width): Rename from sanitize_width,
15329 now that we have two such functions. All uses changed.
15330 (sanitize_char_width): New inline function.
15331
15332 Don't assume that tab-width fits in int.
15333 * character.h (sanitize_width): New inline function.
15334 (SANE_TAB_WIDTH): New macro.
15335 (ASCII_CHAR_WIDTH): Use it.
15336 * indent.c (sane_tab_width): Remove. All uses replaced by
15337 SANE_TAB_WIDTH (current_buffer).
15338 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15339
15340 * fileio.c: Integer overflow issues with file modes.
15341 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15342
15343 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15344 Remove unreachable code.
15345 (read_hex, load_charset_map_from_file): Check for integer overflow.
15346
15347 * xterm.c: Don't go over XClientMessageEvent limit.
15348 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15349 (x_send_scroll_bar_event): Likewise. Check that the size does not
15350 exceed limits imposed by XClientMessageEvent, as well as the usual
15351 ptrdiff_t and size_t limits.
15352
15353 * keyboard.c: Overflow, signedness and related fixes.
15354 (make_lispy_movement): Use same integer type in forward decl
15355 that is used in the definition.
15356 (read_key_sequence, keyremap_step):
15357 Change bufsize argument back to int, undoing my 2011-03-30 change.
15358 We prefer signed types, and int is wide enough here.
15359 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15360 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15361 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15362 length, not size_t. Use ptrdiff_t for index, not int.
15363 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15364 possibility of integer overflow.
15365
15366 Overflow, signedness and related fixes for images.
15367
15368 * dispextern.h (struct it.stack[0].u.image.image_id)
15369 (struct_it.image_id, struct image.id, struct image_cache.size)
15370 (struct image_cache.used, struct image_cache.ref_count):
15371 * gtkutil.c (update_frame_tool_bar):
15372 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15373 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15374 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15375 * nsmenu.m (update_frame_tool_bar):
15376 * xdisp.c (calc_pixel_width_or_height):
15377 * xfns.c (image_cache_refcount):
15378 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15379 on typical 64-bit hosts.
15380
15381 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15382 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15383 Omit unnecessary casts to int.
15384 (parse_image_spec): Check that integers fall into 'int' range
15385 when the callers expect that.
15386 (image_ascent): Redo ascent calculation to avoid int overflow.
15387 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15388 (lookup_image): Remove unnecessary tests.
15389 (xbm_image_p): Locals are now of int, not EMACS_INT,
15390 since parse_image_check makes sure they fit into int.
15391 (png_load, gif_load, svg_load_image):
15392 Prefer int to unsigned where either will do.
15393 (tiff_handler): New function, combining the cores of the
15394 old tiff_error_handler and tiff_warning_handler.
15395 This function is rewritten to use vsnprintf and thereby avoid
15396 stack buffer overflows. It uses only the features of vsnprintf
15397 that are common to both POSIX and native Microsoft.
15398 (tiff_error_handler, tiff_warning_handler): Use it.
15399 (tiff_load, gif_load, imagemagick_load_image):
15400 Don't assume :index value fits in 'int'.
15401 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15402 (imagemagick_load_image): Check that crop parameters fit into
15403 the integer types that MagickCropImage accepts. Don't assume
15404 Vimagemagick_render_type has a nonnegative value. Don't assume
15405 size_t fits in 'long'.
15406 (gs_load): Use printmax_t to print the widest integers possible.
15407 Check for integer overflow when computing image height and width.
15408
15409 2011-08-26 Eli Zaretskii <eliz@gnu.org>
15410
15411 * xdisp.c (redisplay_window): Don't force window start if point
15412 will be invisible in the resulting window. (Bug#9324)
15413
15414 2011-08-25 Eli Zaretskii <eliz@gnu.org>
15415
15416 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15417 the display spec is of the form `(space ...)'.
15418 (handle_display_spec): Return the value returned by
15419 handle_single_display_spec, not just 1 or zero.
15420 (handle_single_display_spec): If the display spec is of the form
15421 `(space ...)', and specifies display in the text area, return 2
15422 rather than 1.
15423 (try_cursor_movement): Check for the need to scroll more
15424 accurately, and prefer exact match for point under bidi.
15425 Don't advance `row' beyond the last row of the window.
15426
15427 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15428 into disp_prop; all users changed.
15429
15430 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15431 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15432 for the text covered by the display property.
15433
15434 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
15435
15436 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15437 Change return value to nil.
15438 (Frecord_buffer): Delete unused function.
15439
15440 2011-08-24 Eli Zaretskii <eliz@gnu.org>
15441
15442 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15443 buffers, return left-to-right.
15444 (set_cursor_from_row): Consider candidate row a win if its glyph
15445 represents a newline and point is on that newline. Fixes cursor
15446 positioning on the newline at EOL of R2L text within L2R
15447 paragraph, and vice versa.
15448 (try_cursor_movement): Check continued rows, in addition to
15449 continuation rows. Fixes unwarranted scroll when point enters a
15450 continued line of R2L text within an L2R paragraph, or vice versa.
15451 (cursor_row_p): Consider the case of point being equal to
15452 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15453 from the end of a short line to the beginning of a continued line
15454 of R2L text within L2R paragraph.
15455 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15456 composed characters.
15457
15458 * bidi.c (bidi_check_type): Use xassert.
15459 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15460 members.
15461
15462 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15463
15464 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15465 a character.
15466
15467 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
15468
15469 * nsfont.m (ns_otf_to_script): Fix typo.
15470
15471 2011-08-22 Kenichi Handa <handa@m17n.org>
15472
15473 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15474 extra slot even if the purpose is char-code-property-table.
15475
15476 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15477
15478 * xdisp.c (redisplay_window): When computing centering_position,
15479 account for the height of the header line. (Bug#8874)
15480
15481 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15482 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15483 candidate is selected by the mouse, and that candidate has a
15484 composed character under the mouse.
15485
15486 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15487 coordinates reported by pos-visible-in-window-p for a composed
15488 character in column zero.
15489
15490 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15491
15492 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15493
15494 2011-08-22 Eli Zaretskii <eliz@gnu.org>
15495
15496 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15497 consider it a hit if to_charpos is anywhere in the range of the
15498 composed buffer positions.
15499
15500 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
15501
15502 * image.c (gif_load): Don't assume that each subimage has the same
15503 dimensions as the base image. Handle disposal method that is
15504 "undefined" by the gif spec (Bug#9335).
15505
15506 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
15507
15508 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
15509 (Fcondition_case): Document `debug' symbol in error handler.
15510
15511 2011-08-19 Eli Zaretskii <eliz@gnu.org>
15512
15513 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15514 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15515 from an Org mode buffer to a Speedbar frame.
15516
15517 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15518 a composition, take its buffer position from IT->cmp_it.charpos.
15519 Fixes cursor positioning at the beginning of a line that begins
15520 with a composed character.
15521
15522 2011-08-18 Eli Zaretskii <eliz@gnu.org>
15523
15524 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15525 character bidirectional type, use STRONG_L instead. Fixes crashes
15526 in a buffer produced by `describe-categories'.
15527
15528 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
15529 members before the level stack, so they would be saved and
15530 restored when copying iterator state. Fixes incorrect reordering
15531 around TABs covered by display properties.
15532
15533 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
15534
15535 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
15536
15537 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
15538
15539 * eval.c (internal_condition_case, internal_condition_case_1)
15540 (internal_condition_case_2, internal_condition_case_n):
15541 Remove unnecessary aborts (Bug#9081).
15542
15543 2011-08-17 Eli Zaretskii <eliz@gnu.org>
15544
15545 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
15546 has no `load' handler, try opening the file locally. (Bug#9311)
15547
15548 2011-08-16 Ken Brown <kbrown@cornell.edu>
15549
15550 * gmalloc.c: Expand comment.
15551
15552 2011-08-16 Eli Zaretskii <eliz@gnu.org>
15553
15554 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15555 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15556
15557 2011-08-16 Ken Brown <kbrown@cornell.edu>
15558
15559 Fix memory allocation problems in Cygwin build (Bug#9273).
15560
15561 * unexcw.c ( __malloc_initialized): Declare external variable.
15562 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15563
15564 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15565 New variables.
15566 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15567 dumped emacs.
15568 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15569 in the static heap.
15570 [CYGWIN] (special_realloc): New function.
15571 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15572 requests to realloc storage in the static heap.
15573
15574 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15575
15576 * bidi.c (bidi_initialize): Remove unused local.
15577
15578 2011-08-15 Eli Zaretskii <eliz@gnu.org>
15579
15580 * bidimirror.h:
15581 * biditype.h: Remove file.
15582 * makefile.w32-in ($(BLD)/bidi.$(O)):
15583 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
15584
15585 * dispextern.h: Fix a typo in the comment to bidi_type_t.
15586
15587 * chartab.c: Improve commentary for the uniprop_table API.
15588
15589 * bidi.c (bidi_paragraph_init): Support zero value of
15590 bidi_ignore_explicit_marks_for_paragraph_level.
15591 (bidi_initialize): Use uniprop_table instead of including
15592 biditype.h and bidimirror.h.
15593
15594 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
15595 coordinates of the iterator when restoring from ppos_it.
15596 (Bug#9296)
15597
15598 2011-08-14 Kenichi Handa <handa@m17n.org>
15599
15600 * process.c (create_process): Call setup_process_coding_systems
15601 after the pid of the process is set to -1 (Bug#8162).
15602
15603 2011-08-14 Eli Zaretskii <eliz@gnu.org>
15604
15605 * xdisp.c (move_it_in_display_line_to): Don't invoke
15606 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
15607 ppos_it. Fixes vertical cursor motion when line beginning is
15608 covered by an image. (Bug#9296)
15609
15610 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
15611
15612 * nsterm.h (ns_run_ascript): Declare.
15613 (NSAPP_DATA2_RUNASSCRIPT): Define.
15614
15615 * nsfns.m (as_script, as_result, as_status): New static variables.
15616 (ns_run_ascript): New function.
15617 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
15618 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
15619 the event loop. Get status from as_status (Bug#7276).
15620
15621 * nsterm.m (sendEvent): If event is NSApplicationDefined and
15622 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
15623 the event loop (Bug#7276).
15624
15625 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
15626
15627 * gnutls.c (QCgnutls_bootprop_priority)
15628 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
15629 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
15630 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
15631 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
15632 (QCgnutls_bootprop_verify_hostname_error)
15633 (QCgnutls_bootprop_callbacks_verify): Rename from
15634 Qgnutls_bootprop_..., all uses changed.
15635
15636 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
15637 uses changed.
15638
15639 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
15640
15641 * xfaces.c (Qframe_set_background_mode): Now static.
15642 * dispextern.h (Qframe_set_background_mode): Remove decl.
15643
15644 * process.c (Fnetwork_interface_info): Declare local only if needed.
15645
15646 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
15647
15648 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
15649 (Fnetwork_interface_list): Allocate in increments of bytes instead
15650 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
15651 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
15652 sockaddr.
15653 (struct ifflag_def): notrailers is smart on OSX.
15654 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
15655 Get hardware address with getifaddrs if available.
15656
15657 2011-08-12 Eli Zaretskii <eliz@gnu.org>
15658
15659 * xdisp.c (iterate_out_of_display_property): xassert that
15660 IT->position is set to within IT->object's boundaries. Break from
15661 the loop as soon as EOB is reached; avoids infloops in redisplay
15662 when IT->position is set up wrongly due to some bug.
15663 Set IT->current to match the bidi iterator unconditionally.
15664 (push_display_prop): Allow GET_FROM_STRING as IT->method on
15665 entry. Force push_it to save on the stack the current
15666 buffer/string position, to be restored by pop_it. Fix flags in
15667 the iterator structure wrt the object coming from a display
15668 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
15669 properties. (Bug#9284)
15670
15671 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
15672
15673 * fontset.c (fontset_get_font_group): Add proper type checks.
15674 (Bug#9172)
15675
15676 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15677
15678 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
15679 and LC_VERSION_MIN_MACOSX.
15680 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
15681 (dump_it) [LC_FUNCTION_STARTS]: Use it.
15682
15683 2011-08-08 Eli Zaretskii <eliz@gnu.org>
15684
15685 * xdisp.c (forward_to_next_line_start): Allow to use the
15686 no-display-properties-and-no-overlays under bidi display.
15687 Set disp_pos in the bidi iterator to avoid searches for display
15688 properties and overlays.
15689
15690 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
15691
15692 * editfns.c (Fset_time_zone_rule): Document relationship with the
15693 setenv function.
15694
15695 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
15696 the font entity extracted from the cache (Bug#8109).
15697
15698 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
15699
15700 * composite.c (autocmp_chars): Don't reset point. That is done by
15701 restore_point_unwind (Bug#5984).
15702
15703 2011-08-07 Juri Linkov <juri@jurta.org>
15704
15705 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
15706 to show the arg `TIME' instead of `TIMEVAL'.
15707
15708 2011-08-06 Eli Zaretskii <eliz@gnu.org>
15709
15710 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
15711 display property strides EOL and includes a newline, as in
15712 longlines-mode. (Bug#9254)
15713 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
15714 word-wrap under bidirectional display. (Bug#9224)
15715
15716 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
15717 is non-zero, even if the data buffer is NULL. Fixes a crash in
15718 vertical-motion with longlines-mode. (Bug#9254)
15719
15720 2011-08-05 Eli Zaretskii <eliz@gnu.org>
15721
15722 * bidi.c <bidi_cache_total_alloc>: Now static.
15723 (bidi_initialize): Initialize bidi_cache_total_alloc.
15724
15725 * xdisp.c (display_line): Release buffer allocated for shelved bidi
15726 cache. (Bug#9221)
15727
15728 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
15729 amount allocated this far in `bidi_cache_total_alloc'.
15730 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
15731 non-zero, only free the data buffer without restoring the cache
15732 contents. All callers changed.
15733
15734 * dispextern.h (bidi_unshelve_cache): Update prototype.
15735
15736 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
15737 (move_it_in_display_line, move_it_to)
15738 (move_it_vertically_backward, move_it_by_lines): Replace the call
15739 to xfree to an equivalent call to bidi_unshelve_cache.
15740 (move_it_in_display_line_to): Fix logic of returning
15741 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
15742
15743 2011-08-05 Eli Zaretskii <eliz@gnu.org>
15744
15745 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
15746 came from a string character with a `cursor' property. (Bug#9229)
15747
15748 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15749
15750 * Makefile.in (LIB_PTHREAD): New variable.
15751 (LIBES): Add LIB_PTHREAD (Bug#9216).
15752
15753 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
15754 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
15755
15756 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
15757
15758 * regex.c (re_iswctype): Remove some redundant boolean conversions.
15759
15760 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15761
15762 * xterm.c (x_find_topmost_parent): New function.
15763 (x_set_frame_alpha): Find topmost parent window with
15764 x_find_topmost_parent and set the property there also (bug#9181).
15765 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
15766
15767 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
15768
15769 * callproc.c (Fcall_process): Avoid vfork clobbering
15770 the local vars buffer, coding_systems, current_dir.
15771
15772 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
15773
15774 * keymap.c (Fmake_composed_keymap): Move to subr.el.
15775
15776 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
15777
15778 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
15779 so that it is not optimized away.
15780
15781 * xdisp.c (compute_display_string_pos): Remove unused local.
15782
15783 2011-08-02 Eli Zaretskii <eliz@gnu.org>
15784
15785 Fix slow cursor motion and scrolling in large buffers with
15786 selective display, like Org Mode buffers. (Bug#9218)
15787
15788 * dispextern.h (struct bidi_it): New member disp_prop_p.
15789
15790 * xdisp.c: Remove one-slot cache of display string positions.
15791 (compute_display_string_pos): Accept an additional argument
15792 DISP_PROP_P; callers changed. Scan at most 5K characters forward
15793 for a display string or property. If found, set DISP_PROP_P
15794 non-zero.
15795
15796 * bidi.c (bidi_fetch_char): Accept an additional argument
15797 DISP_PROP_P, and pass it to compute_display_string_pos.
15798 Only handle text covered by a display string if DISP_PROP_P is returned
15799 non-zero. All callers of bidi_fetch_char changed.
15800
15801 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
15802
15803 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
15804
15805 2010-12-03 Don March <don@ohspite.net>
15806
15807 * keymap.c (Fdefine_key): Fix non-prefix key error message when
15808 last character M-[char] is translated to ESC [char] (bug#7541).
15809
15810 2011-08-02 Kenichi Handa <handa@m17n.org>
15811
15812 * lisp.h (uniprop_table): Extern it.
15813
15814 * chartab.c (uniprop_table): Make it non-static.
15815
15816 2011-08-01 Eli Zaretskii <eliz@gnu.org>
15817
15818 * xdisp.c (forward_to_next_line_start): Accept additional argument
15819 BIDI_IT_PREV, and store into it the state of the bidi iterator had
15820 on the newline.
15821 (reseat_at_next_visible_line_start): Use the bidi iterator state
15822 returned by forward_to_next_line_start to restore the state of
15823 it->bidi_it after backing up to previous newline. (Bug#9212)
15824
15825 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
15826
15827 * regex.c (re_comp): Protoize.
15828 (re_exec): Fix return type.
15829 (regexec): Fix type of `ret'. (Bug#9203)
15830
15831 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15832
15833 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
15834 This is needed if max-image-size is a floating-point number.
15835
15836 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15837
15838 * print.c (print_object): Print empty symbol as ##.
15839
15840 * lread.c (read1): Read ## as empty symbol.
15841
15842 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15843
15844 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
15845 setting frame foreground color (Bug#9175).
15846 (x_set_background_color): Likewise.
15847
15848 * nsmenu.m (-setText): Size tooltip dimensions precisely to
15849 contents (Bug#9176).
15850 (EmacsTooltip -init): Remove bezels and add shadows to
15851 tooltip windows.
15852
15853 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
15854 or scroll bar (Bug#8470).
15855
15856 * nsfont.m (nsfont_open): Remove assignment to voffset and
15857 unnecessary vars hshink, expand, hd, full_height, min_height.
15858 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
15859
15860 * nsterm.h (nsfont_info): Remove voffset field.
15861
15862 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15863
15864 Implement strike-through and overline on NextStep (Bug#8863).
15865
15866 * nsfont.m (nsfont_open): Use underline position provided by font,
15867 instead of hard-coded value of 2.
15868 (nsfont_draw): Call ns_draw_text_decoration instead.
15869
15870 * nsterm.h: Add declaration for ns_draw_text_decoration.
15871
15872 * nsterm.m (ns_draw_text_decoration): New function for drawing
15873 underline, overline, and strike-through.
15874 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
15875 ns_draw_text_decoration. Change treatment of cursor drawing to
15876 accommodate underlining, etc.
15877
15878 2011-07-28 Eli Zaretskii <eliz@gnu.org>
15879
15880 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
15881 default.
15882
15883 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15884
15885 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
15886 Without this fix, if a signal arrives just after memory fills up,
15887 'malloc' might be invoked reentrantly.
15888
15889 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
15890 In other words, assume that every image size is allowed, on non-X
15891 hosts. This assumption is probably wrong, but it lets Emacs compile.
15892
15893 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15894
15895 * regex.c (re_iswctype): Convert return values to boolean.
15896
15897 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
15898
15899 * xdisp.c (compute_display_string_pos): Don't use cached display
15900 string position if the buffer had its restriction changed.
15901 (Bug#9184)
15902
15903 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15904
15905 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15906
15907 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15908
15909 Integer signedness and overflow and related fixes. (Bug#9079)
15910
15911 * bidi.c: Integer size and overflow fixes.
15912 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15913 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15914 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15915 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15916 (bidi_find_other_level_edge):
15917 Use ptrdiff_t instead of EMACS_INT where either will do.
15918 This works better on 32-bit hosts configured --with-wide-int.
15919 (bidi_cache_ensure_space): Check for size-calculation overflow.
15920 Use % rather than repeated addition, for better worst-case speed.
15921 Don't set bidi_cache_size until after xrealloc returns, because it
15922 might not return.
15923 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
15924 (bidi_cache_ensure_space): Also check that the bidi cache size
15925 does not exceed that of the largest Lisp string or buffer. See Eli
15926 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
15927
15928 * alloc.c (__malloc_size_t): Remove.
15929 All uses replaced by size_t. See Andreas Schwab's note
15930 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15931
15932 * image.c: Improve checking for integer overflow.
15933 (check_image_size): Assume that f is nonnull, since
15934 it is always nonnull in practice. This is one less thing to
15935 worry about when checking for integer overflow later.
15936 (x_check_image_size): New function, which checks for integer
15937 overflow issues inside X.
15938 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
15939 This removes the need for a memory_full check.
15940 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
15941 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
15942 (xbm_read_bitmap_data): Change locals back to 'int', since
15943 their values must fit in 'int'.
15944 (xpm_load_image, png_load, tiff_load):
15945 Invoke x_create_x_image_and_pixmap earlier,
15946 to avoid much needless work if the image is too large.
15947 (tiff_load): Treat overly large images as if
15948 x_create_x_image_and_pixmap failed, not as malloc failures.
15949 (gs_load): Use x_check_image_size.
15950
15951 * gtkutil.c: Omit integer casts.
15952 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
15953 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
15954
15955 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
15956
15957 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
15958 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
15959 would wrongly return t on a 64-bit host.
15960
15961 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
15962 The plain *_OVERFLOW macros run afoul of GCC bug 49705
15963 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
15964 and therefore cause GCC to emit a bogus diagnostic in some cases.
15965
15966 * image.c: Integer signedness and overflow and related fixes.
15967 This is not an exhaustive set of fixes, but it's time to
15968 record what I've got.
15969 (lookup_pixel_color, check_image_size): Remove redundant decls.
15970 (check_image_size): Don't assume that arbitrary EMACS_INT values
15971 fit in 'int', or that arbitrary 'double' values fit in 'int'.
15972 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
15973 (tiff_load, imagemagick_load_image):
15974 Check for overflow in size calculations.
15975 (x_create_x_image_and_pixmap): Remove unnecessary test for
15976 xmalloc returning NULL; that can't happen.
15977 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
15978 (xpm_color_bucket): Use better integer hashing function.
15979 (xpm_cache_color): Don't possibly over-allocate memory.
15980 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
15981 (gif_memory_source):
15982 Use ptrdiff_t, not int or size_t, to record sizes.
15983 (png_load): Don't assume values greater than 2**31 fit in 'int'.
15984 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
15985 either works, as we prefer signed integers.
15986 (tiff_read_from_memory, tiff_write_from_memory):
15987 Return tsize_t, not size_t, since that's what the TIFF API wants.
15988 (tiff_read_from_memory): Don't fail simply because the read would
15989 go past EOF; instead, return a short read.
15990 (tiff_load): Omit no-longer-needed casts.
15991 (Fimagemagick_types): Don't assume size fits into 'int'.
15992
15993 Improve hashing quality when configured --with-wide-int.
15994 * fns.c (hash_string): New function, taken from sxhash_string.
15995 Do not discard information about ASCII character case; this
15996 discarding is no longer needed.
15997 (sxhash-string): Use it. Change sig to match it. Caller changed.
15998 * lisp.h: Declare it.
15999 * lread.c (hash_string): Remove, since we now use fns.c's version.
16000 The fns.c version returns a wider integer if --with-wide-int is
16001 specified, so this should help the quality of the hashing a bit.
16002
16003 * emacs.c: Integer overflow minor fix.
16004 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16005 Define only if GNU_LINUX.
16006 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16007
16008 * dispnew.c: Integer signedness and overflow fixes.
16009 Remove unnecessary forward decls, that were a maintenance hassle.
16010 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16011 All uses changed.
16012 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16013 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16014 (prepare_desired_row, line_draw_cost):
16015 Use int, not unsigned, where either works.
16016 (save_current_matrix, restore_current_matrix):
16017 Use ptrdiff_t, not size_t, where either works.
16018 (init_display): Check for overflow more accurately, and without
16019 relying on undefined behavior.
16020
16021 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16022 Remove, replacing with the new symbols in lisp.h. All uses changed.
16023 * fileio.c (make_temp_name):
16024 * filelock.c (lock_file_1, lock_file):
16025 * xdisp.c (message_dolog):
16026 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16027 Use pMd etc. instead.
16028 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16029 replacing the pWIDE etc. symbols removed from editfns.c.
16030
16031 * keyboard.h (num_input_events): Now uintmax_t.
16032 This is (very slightly) less likely to mess up due to wraparound.
16033 All uses changed.
16034
16035 * buffer.c: Integer signedness fixes.
16036 (alloc_buffer_text, enlarge_buffer_text):
16037 Use ptrdiff_t rather than size_t when either will do, as we prefer
16038 signed integers.
16039
16040 * alloc.c: Integer signedness and overflow fixes.
16041 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16042 (__malloc_size_t): Default to size_t, not to int.
16043 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16044 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16045 Prefer ptrdiff_t to size_t when either would do, as we prefer
16046 signed integers.
16047 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16048 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16049 Now const. Initialize with values that are in range even if char
16050 is signed.
16051 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16052 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16053 These functions do the right thing with sizes > 2**32.
16054 (check_depth): Now ptrdiff_t, not int.
16055 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16056 Adjust to new way of storing sizes. Check for size overflow bugs
16057 in rest of code.
16058 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16059 slightly wrong anyway, as it missed one instance of
16060 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16061 (refill_memory_reserve): Omit needless cast to size_t.
16062 (mark_object_loop_halt): Mark as externally visible.
16063
16064 * xselect.c: Integer signedness and overflow fixes.
16065 (Fx_register_dnd_atom, x_handle_dnd_message):
16066 Use ptrdiff_t, not size_t, since we prefer signed.
16067 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16068 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16069 x_dnd_atoms_size and x_dnd_atoms_length.
16070
16071 * doprnt.c: Prefer signed to unsigned when either works.
16072 * eval.c (verror):
16073 * doprnt.c (doprnt):
16074 * lisp.h (doprnt):
16075 * xdisp.c (vmessage):
16076 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16077 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16078 prefer signed arithmetic to avoid comparison confusion.
16079 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16080 but is a bit tricky.
16081
16082 Assume freestanding C89 headers, string.h, stdlib.h.
16083 * data.c, doprnt.c, floatfns.c, print.c:
16084 Include float.h unconditionally.
16085 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16086 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16087 * regex.c: Likewise for stddef.h, string.h.
16088 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16089 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16090 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16091 (STDC_HEADERS): Remove obsolete defines.
16092 * sysdep.c: Include limits.h unconditionally.
16093
16094 Assume support for memcmp, memcpy, memmove, memset.
16095 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16096 * regex.c (memcmp, memcpy):
16097 Remove; we assume C89 now.
16098
16099 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16100 (__malloc_safe_bcopy): Remove; no longer needed.
16101
16102 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
16103 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16104 well either way, and we prefer signed to unsigned.
16105
16106 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16107
16108 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16109 closes the connection while we're reading (bug#9182).
16110
16111 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
16112
16113 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16114 are specified (Bug#9168).
16115
16116 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16117
16118 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16119 Found by GCC static checking and --with-wide-int on a 32-bit host.
16120
16121 2011-07-25 Eli Zaretskii <eliz@gnu.org>
16122
16123 * xdisp.c (compute_display_string_pos): Fix logic of caching
16124 previous display string position. Initialize cached_prev_pos to
16125 -1. Fixes slow-down at the beginning of a buffer.
16126
16127 2011-07-24 Eli Zaretskii <eliz@gnu.org>
16128
16129 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16130 for attrs[LFACE_FONTSET_INDEX].
16131
16132 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16133
16134 * xml.c (parse_region): Remove unused local
16135 that was recently introduced.
16136
16137 2011-07-23 Eli Zaretskii <eliz@gnu.org>
16138
16139 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16140 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16141
16142 * xdisp.c (move_it_in_display_line_to): Record the best matching
16143 position for TO_CHARPOS while scanning the line, and restore it on
16144 exit if none of the characters scanned was an exact match.
16145 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
16146 when exact match is impossible due to invisible text, and the
16147 lines are truncated.
16148
16149 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16150
16151 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16152 for OSX >= 10.7.
16153
16154 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16155
16156 Fix a significant slow-down of cursor motion with C-n, C-p,
16157 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16158 auto-repeat under bidi redisplay in fontified buffers.
16159 * xdisp.c (compute_stop_pos_backwards): New function.
16160 (next_element_from_buffer): Call compute_stop_pos_backwards to
16161 find a suitable prev_stop when we find ourselves before
16162 base_level_stop.
16163 (reseat): Don't look for prev_stop, as that could mean a very long
16164 run.
16165 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16166 <cached_disp_overlay_modiff>: Cache for last found display string
16167 position.
16168 (compute_display_string_pos): Return the cached position if asked
16169 about the same buffer in the same area of character positions, and
16170 the buffer wasn't changed since the time the display string
16171 position was cached.
16172
16173 2011-07-22 Eli Zaretskii <eliz@gnu.org>
16174
16175 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16176 is an integer, which is important for empty lines. (Bug#9149)
16177
16178 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
16179
16180 * frame.c (Fmodify_frame_parameters): In tty case, update the
16181 default face if necessary (Bug#4238).
16182
16183 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
16184
16185 * editfns.c (Fstring_to_char): No need to explain what a character
16186 is in the docstring (Bug#6576).
16187
16188 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16189
16190 * xml.c (parse_region): Make sure we always return a tree.
16191
16192 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16193
16194 * xml.c (parse_region): If a document contains only comments,
16195 return that, too.
16196
16197 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16198
16199 * xml.c (make_dom): Return comments, too.
16200
16201 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16202
16203 Port to OpenBSD.
16204 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16205 and the surrounding thread.
16206 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16207 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16208 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16209 timer goes off.
16210 * s/openbsd.h (BROKEN_SIGIO): Define.
16211 * unexelf.c (unexec) [__OpenBSD__]:
16212 Don't update the .mdebug section of the Alpha COFF symbol table.
16213
16214 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16215
16216 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16217 (bug#8460).
16218
16219 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16220
16221 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16222 This fixes some race conditions on the permissions of any newly
16223 created file.
16224
16225 * alloc.c (valid_pointer_p): Use pipe, not open.
16226 This fixes some permissions issues when debugging.
16227
16228 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16229 If fchown fails to set both uid and gid, try to set just gid,
16230 as that is sometimes allowed. Adjust the file's mode to eliminate
16231 setuid or setgid bits that are inappropriate if fchown fails.
16232
16233 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16234
16235 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16236 to compare Lisp_Objects.
16237 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16238 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16239 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16240
16241 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16242
16243 * lread.c (read_integer): Unread even EOF character.
16244 (read1): Likewise. Properly record start position of symbol.
16245
16246 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16247 symbol character follows.
16248
16249 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16250
16251 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16252 This works around a problem with the previous change to Fcopy_file.
16253 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16254 and without this change, GCC might complain about discarding
16255 fchown's return value.
16256
16257 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
16258
16259 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16260
16261 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16262
16263 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16264
16265 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16266
16267 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16268 it's used from the C level.
16269
16270 * process.c: Use the same condition for POLL_FOR_INPUT in both
16271 keyboard.c and process.c (bug#1858).
16272
16273 2011-07-09 Lawrence Mitchell <wence@gmx.li>
16274
16275 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16276 (Fgnutls_boot): Use it.
16277
16278 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16279
16280 * doc.c (Fsubstitute_command_keys): Revert last change.
16281
16282 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16283
16284 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16285 quotes the next character, and doesn't affect other longer
16286 sequences (bug#8935).
16287
16288 * lread.c (syms_of_lread): Clarify that is isn't only
16289 `eval-buffer' and `eval-defun' that's affected by
16290 `lexical-binding' (bug#8460).
16291
16292 2011-07-15 Eli Zaretskii <eliz@gnu.org>
16293
16294 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
16295 bidi redisplay when a line includes both an image and is truncated.
16296
16297 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16298
16299 Fix minor problems found by static checking.
16300 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16301 (elsz): Now a signed constant, not a size_t var. We prefer signed
16302 types to unsigned, to avoid integer comparison confusion. Without
16303 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16304 "cannot optimize loop, the loop counter may overflow", a symptom
16305 of the confusion.
16306 * indent.c (Fvertical_motion): Mark locals as initialized.
16307 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16308
16309 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16310
16311 * search.c (Fre_search_backward): Mention `case-fold-search' in
16312 all the re_search_* functions (bug#8138).
16313
16314 * keyboard.c (Fopen_dribble_file): Document when the file is
16315 closed (bug#8056).
16316
16317 2011-07-14 Eli Zaretskii <eliz@gnu.org>
16318
16319 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16320 bidi_cache_idx.
16321
16322 Support bidi reordering of display and overlay strings.
16323 * xdisp.c (compute_display_string_pos)
16324 (compute_display_string_end): Accept additional argument STRING.
16325 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16326 (reseat_to_string): Initialize bidi_it->string.s and
16327 bidi_it->string.schars.
16328 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
16329 NULL (avoids a crash in bidi_paragraph_init).
16330 Initialize itb.string.lstring.
16331 (init_iterator): Call bidi_init_it only of a valid
16332 buffer position was specified. Initialize paragraph_embedding to
16333 L2R.
16334 (reseat_to_string): Initialize the bidi iterator.
16335 (display_string): If we need to ignore text properties of
16336 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16337 original value of -1 will not work with bidi.)
16338 (compute_display_string_pos): First arg is now struct
16339 `text_pos *'; all callers changed. Support display properties on
16340 Lisp strings.
16341 (compute_display_string_end): Support display properties on Lisp
16342 strings.
16343 (init_iterator, reseat_1, reseat_to_string): Initialize the
16344 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16345 when iterating on a string not from display properties).
16346 (compute_display_string_pos, compute_display_string_end):
16347 Fix calculation of the object to scan. Fixes an error when using
16348 arrow keys.
16349 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
16350 base_level_stop; instead, set base_level_stop to BEGV.
16351 Fixes crashes in vertical-motion.
16352 (next_element_from_buffer): Improve commentary for when
16353 the iterator is before prev_stop.
16354 (init_iterator): Initialize bidi_p from the default value of
16355 bidi-display-reordering, not from buffer-local value. Use the
16356 buffer-local value only if initializing for buffer iteration.
16357 (handle_invisible_prop): Support invisible properties on strings
16358 that are being bidi-reordered.
16359 (set_iterator_to_next): Support bidi reordering of C strings and
16360 Lisp strings.
16361 (next_element_from_string): Support bidi reordering of Lisp
16362 strings.
16363 (handle_stop_backwards): Support Lisp strings as well.
16364 (display_string): Support display of R2L glyph rows.
16365 Use IT_STRING_CHARPOS when displaying from a Lisp string.
16366 (init_iterator): Don't initialize it->bidi_p for strings
16367 here.
16368 (reseat_to_string): Initialize it->bidi_p for strings here.
16369 (next_element_from_string, next_element_from_c_string)
16370 (next_element_from_buffer): Add xassert's for correspondence
16371 between IT's object being iterated and it->bidi_it.string
16372 structure.
16373 (face_before_or_after_it_pos): Support bidi iteration.
16374 (next_element_from_c_string): Handle the case of the first string
16375 character that is not the first one in the visual order.
16376 (get_visually_first_element): New function, refactored from common
16377 parts of next_element_from_buffer, next_element_from_string, and
16378 next_element_from_c_string.
16379 (tool_bar_lines_needed, redisplay_tool_bar)
16380 (display_menu_bar): Force left-to-right direction. Add a FIXME
16381 comment for making that be controlled by a user option.
16382 (push_it, pop_it): Save and restore the state of the
16383 bidi iterator. Save and restore the bidi_p flag.
16384 (pop_it): Iterate out of display property for string iteration as
16385 well.
16386 (iterate_out_of_display_property): Support iteration over strings.
16387 (handle_single_display_spec): Set up it->bidi_it for iteration
16388 over a display string, and call bidi_init_it.
16389 (handle_single_display_spec, next_overlay_string)
16390 (get_overlay_strings_1, push_display_prop): Set up the bidi
16391 iterator for displaying display or overlay strings.
16392 (forward_to_next_line_start): Don't use the shortcut if
16393 bidi-iterating.
16394 (back_to_previous_visible_line_start): If handle_display_prop
16395 pushed the iterator stack, restore the internal state of the bidi
16396 iterator by calling bidi_pop_it same number of times.
16397 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16398 and we are bidi-iterating, don't decrement the iterator position;
16399 instead, set the first_elt flag in the bidi iterator, to produce
16400 the same effect.
16401 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16402 (push_display_prop): xassert that we are iterating a buffer.
16403 (push_it, pop_it): Save and restore paragraph_embedding member.
16404 (handle_single_display_spec, next_overlay_string)
16405 (get_overlay_strings_1, reseat_1, reseat_to_string)
16406 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16407 correctly. Don't assume unibyte strings are not bidi-reordered.
16408 (compute_display_string_pos)
16409 (compute_display_string_end): Fix handling the case of C string.
16410 (push_it, pop_it): Save and restore from_disp_prop_p.
16411 (handle_single_display_spec, push_display_prop): Set the
16412 from_disp_prop_p flag.
16413 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16414 (pop_it): Call iterate_out_of_display_property only if we are
16415 popping after iteration over a string that came from a display
16416 property. Fix a typo in popping stretch info. Add an assertion
16417 for verifying that the iterator position is in sync with the bidi
16418 iterator.
16419 (handle_single_display_spec, get_overlay_strings_1)
16420 (push_display_prop): Fix initialization of paragraph direction for
16421 string when that of the parent object is not yet determined.
16422 (reseat_1): Call bidi_init_it to resync the bidi
16423 iterator with IT's position. (Bug#7616)
16424 (find_row_edges): If ROW->start.pos gives position
16425 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16426 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16427 Reset the from_disp_prop_p flag.
16428 (SAVE_IT, RESTORE_IT): New macros.
16429 (pos_visible_p, face_before_or_after_it_pos)
16430 (back_to_previous_visible_line_start)
16431 (move_it_in_display_line_to, move_it_in_display_line)
16432 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16433 (try_scrolling, redisplay_window, display_line): Use them when
16434 saving a temporary copy of the iterator and restoring it back.
16435 (back_to_previous_visible_line_start, reseat_1)
16436 (init_iterator): Empty the bidi cache "stack".
16437 (move_it_in_display_line_to): If iterator ended up at
16438 EOL, but we never saw any buffer positions smaller than
16439 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16440 motion in bidi-reordered lines.
16441 (move_it_in_display_line_to): Record prev_method and prev_pos
16442 immediately before the call to set_iterator_to_next. Fixes cursor
16443 motion in bidi-reordered lines with stretch glyphs and strings
16444 displayed in margins. (Bug#8133) (Bug#8867)
16445 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16446 TO_CHARPOS.
16447 (pos_visible_p): Support positions in bidi-reordered lines.
16448 Save and restore bidi cache.
16449
16450 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16451 (bidi_paragraph_info): Delete unused struct.
16452 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16453 (bidi_cache_start): New variable.
16454 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16455 to zero.
16456 (bidi_cache_fetch_state, bidi_cache_search)
16457 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16458 (bidi_cache_find, bidi_peek_at_next_level)
16459 (bidi_level_of_next_char, bidi_find_other_level_edge)
16460 (bidi_move_to_visually_next): Compare cache index with
16461 bidi_cache_start rather than with zero.
16462 (bidi_fetch_char): Accept new argument STRING; all callers
16463 changed. Support iteration over a string. Support strings with
16464 display properties. Support unibyte strings. Fix the type of
16465 `len' according to what STRING_CHAR_AND_LENGTH expects.
16466 (bidi_paragraph_init, bidi_resolve_explicit_1)
16467 (bidi_resolve_explicit, bidi_resolve_weak)
16468 (bidi_level_of_next_char, bidi_move_to_visually_next):
16469 Support iteration over a string.
16470 (bidi_set_sor_type, bidi_resolve_explicit_1)
16471 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16472 can now be zero (for strings); special values 0 and -1 were
16473 changed to -1 and -2, respectively.
16474 (bidi_char_at_pos): New function.
16475 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16476 Call it instead of FETCH_MULTIBYTE_CHAR.
16477 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16478 initialized to valid values.
16479 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16480 values.
16481 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16482 the test for valid cached positions. Fix the logic for looking up
16483 the sentinel state in the cache. GCPRO the Lisp string we are
16484 iterating.
16485 (bidi_push_it, bidi_pop_it): New functions.
16486 (bidi_initialize): Initialize the bidi cache start stack pointer.
16487 (bidi_cache_ensure_space): New function, refactored from part of
16488 bidi_cache_iterator_state. Don't assume the required size is just
16489 one BIDI_CACHE_CHUNK away.
16490 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16491 (bidi_count_bytes, bidi_char_at_pos): New functions.
16492 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16493 always valid if bidi_cache_idx is valid.
16494 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16495 is valid if it's going to be used.
16496 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16497 (bidi_cache_fetch_state, bidi_cache_search)
16498 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16499 (bidi_cache_iterator_state, bidi_cache_find)
16500 (bidi_find_other_level_edge, bidi_cache_start_stack):
16501 All variables related to cache indices are now EMACS_INT.
16502
16503 * dispextern.h (struct bidi_string_data): New structure.
16504 (struct bidi_it): New member `string'. Make flag members be 1-bit
16505 fields, and put them last in the struct.
16506 (compute_display_string_pos, compute_display_string_end):
16507 Update prototypes.
16508 (bidi_push_it, bidi_pop_it): Add prototypes.
16509 (struct iterator_stack_entry): New members bidi_p,
16510 paragraph_embedding, and from_disp_prop_p.
16511 (struct it): Member bidi_p is now a bit field 1 bit wide.
16512 (bidi_shelve_cache, bidi_unshelve_cache):
16513 Declare prototypes.
16514
16515 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16516 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16517 and vector-like objects.
16518
16519 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16520 cache around display iteration.
16521
16522 * window.c (Fwindow_end, window_scroll_pixel_based)
16523 (displayed_window_lines, Frecenter): Save and restore the bidi
16524 cache around display iteration.
16525
16526 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16527
16528 * editfns.c (Fdelete_region): Clarify the use of the named
16529 parameters (bug#6788).
16530
16531 2011-07-14 Martin Rudalics <rudalics@gmx.at>
16532
16533 * indent.c (Fvertical_motion): Set and restore w->pointm when
16534 saving and restoring the window's buffer (Bug#9006).
16535
16536 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
16537
16538 * editfns.c (Fstring_to_char): Clarify just what is returned
16539 (bug#6576). Text by Eli Zaretskii.
16540
16541 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
16542
16543 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
16544
16545 2011-07-13 Eli Zaretskii <eliz@gnu.org>
16546
16547 * buffer.c (mmap_find): Fix a typo.
16548
16549 2011-07-13 Johan Bockgård <bojohan@gnu.org>
16550
16551 Fix execution of x selection hooks.
16552 * xselect.c (Qx_lost_selection_functions)
16553 (Qx_sent_selection_functions): New vars.
16554 (syms_of_xselect): DEFSYM them.
16555 (x_handle_selection_request): Pass Qx_sent_selection_functions
16556 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16557 (x_handle_selection_clear,x_clear_frame_selections):
16558 Pass Qx_lost_selection_functions rather than
16559 Vx_lost_selection_functions to Frun_hook_with_args.
16560
16561 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16562
16563 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
16564 The old code sometimes used this field without initializing it.
16565
16566 * alloc.c (gc_sweep): Don't read past end of array.
16567 In theory, the old code could also have corrupted Emacs internals,
16568 though it'd be very unlikely.
16569
16570 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16571
16572 * character.c (Fcharacterp): Don't advertise optional ignored
16573 argument. (Bug#4026)
16574
16575 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16576
16577 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16578 key" (bug#4257).
16579
16580 * window.c (Fset_window_start): Doc fix (bug#4199).
16581 (Fset_window_hscroll): Ditto.
16582
16583 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
16584
16585 Fix minor new problems caught by GCC 4.6.1.
16586 * term.c (init_tty): Remove unused local.
16587 * xsettings.c (store_monospaced_changed): Define this function only
16588 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
16589 not used otherwise.
16590
16591 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
16592
16593 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
16594
16595 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16596
16597 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
16598 are the mini-buffer and the echo area (bug#3320).
16599
16600 * term.c (init_tty): Remove support for supdup, c10 and perq
16601 terminals, which are no longer supported (bug#1482).
16602
16603 2011-07-10 Johan Bockgård <bojohan@gnu.org>
16604
16605 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
16606
16607 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
16608
16609 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
16610 for non-popups (Bug#3642).
16611
16612 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
16613
16614 * alloc.c (reset_malloc_hooks): Protoize.
16615 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
16616 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
16617 * cm.c (losecursor): Likewise.
16618 * data.c (fmod): Likewise.
16619 * dispnew.c (swap_glyphs_in_rows): Likewise.
16620 * emacs.c (memory_warning_signal): Likewise.
16621 * floatfns.c (float_error): Likewise.
16622 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
16623 (otf_open, font_otf_capability, generate_otf_features)
16624 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
16625 Likewise.
16626 * image.c (pbm_read_file): Likewise.
16627 * indent.c (string_display_width): Likewise.
16628 * intervals.c (check_for_interval, search_for_interval)
16629 (inc_interval_count, count_intervals, root_interval)
16630 (adjust_intervals_for_insertion, make_new_interval): Likewise.
16631 * lread.c (defalias): Likewise.
16632 * ralloc.c (r_alloc_check): Likewise.
16633 * regex.c (set_image_of_range_1, set_image_of_range)
16634 (regex_grow_registers): Likewise.
16635 * sysdep.c (strerror): Likewise.
16636 * termcap.c (valid_filename_p, tprint, main): Likewise.
16637 * tparam.c (main): Likewise.
16638 * unexhp9k800.c (run_time_remap, save_data_space)
16639 (update_file_ptrs, read_header, write_header, calculate_checksum)
16640 (copy_file, copy_rest, display_header): Likewise.
16641 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
16642 Likewise.
16643 * xdisp.c (check_it): Likewise.
16644 * xfaces.c (register_color, unregister_color, unregister_colors):
16645 Likewise.
16646 * xfns.c (print_fontset_result): Likewise.
16647 * xrdb.c (member, fatal, main): Likewise.
16648
16649 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
16650
16651 Fix minor problems found by static checking (Bug#9031).
16652 * chartab.c (char_table_set_range, map_sub_char_table):
16653 Remove unused locals.
16654 (uniprop_table): Now static.
16655 * composite.c (_work_char): Remove unused static var.
16656
16657 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
16658
16659 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
16660
16661 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
16662
16663 * gtkutil.c (qttip_cb): Remove code without function.
16664
16665 2011-07-09 Eli Zaretskii <eliz@gnu.org>
16666
16667 * w32.c (pthread_sigmask): New stub.
16668
16669 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
16670
16671 Use pthread_sigmask, not sigprocmask (Bug#9010).
16672 sigprocmask is portable only for single-threaded applications, and
16673 Emacs can be multi-threaded when it uses GTK.
16674 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
16675 (LIBES): Use it.
16676 * callproc.c (Fcall_process):
16677 * process.c (create_process):
16678 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
16679 Use pthread_sigmask, not sigprocmask.
16680
16681 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16682
16683 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
16684 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
16685 wrong (Bug#8591).
16686
16687 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16688
16689 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
16690 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
16691 (xg_hide_tooltip): Fix comment.
16692
16693 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
16694 in registerServicesMenuSendTypes.
16695 (validRequestorForSendType): Don't check ns_return_types.
16696
16697 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
16698 ns_return_type.
16699
16700 2011-07-08 Jason Rumney <jasonr@gnu.org>
16701
16702 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
16703 SH_SHOW for hidden windows (Bug#5482).
16704
16705 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
16706 frame struct members of non-existent frames (Bug#6284).
16707
16708 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16709
16710 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
16711 variable firstTime not needed on OSX >= 10.6.
16712 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
16713 >= 10.5. Use setKnobProportion, setDoubleValue.
16714
16715 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
16716 (MAC_OS_X_VERSION_10_5): Define if not defined.
16717 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
16718 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
16719 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
16720
16721 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
16722 cString and lossyCString on OSX >= 10.4.
16723
16724 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
16725 sizeToFit on OSX >= 10.2.
16726
16727 * nsimage.m (allocInitFromFile): Don't use deprecated method
16728 bestRepresentationForDevice on OSX >= 10.6.
16729
16730 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
16731 to avoid warning.
16732
16733 * emacs.c: Declare unexec_init_emacs_zone.
16734
16735 * nsgui.h: Fix compiler warning about gnulib redefining verify.
16736
16737 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
16738
16739 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
16740 on svcsMenu (Bug#8842).
16741
16742 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
16743 ns_return_types.
16744 (Fns_list_services): Just return Qnil on 10.6, code not working there.
16745
16746 * nsterm.m (QUTF8_STRING): Declare.
16747 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
16748 (validRequestorForSendType): Return type is (id).
16749 Change indexOfObjectIdenticalTo to indexOfObject.
16750 Check if we have local selection before returning self (Bug#8842).
16751 (writeSelectionToPasteboard): Put local selection into paste board
16752 if we have a local selection (Bug#8842).
16753 (syms_of_nsterm): DEFSYM QUTF8_STRING.
16754
16755 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
16756 (ns_get_local_selection): Declare.
16757
16758 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
16759
16760 * keymap.c (describe_map_tree): Don't insert a double newline at
16761 the end of the buffer (bug#1169) and return whether we inserted
16762 something.
16763
16764 * callint.c (Fcall_interactively): Change "reading args" to
16765 "providing args" to try to clarify what it does (bug#1010).
16766
16767 2011-07-07 Kenichi Handa <handa@m17n.org>
16768
16769 * composite.c (composition_compute_stop_pos): Ignore a static
16770 composition starting before CHARPOS (Bug#8915).
16771
16772 * xdisp.c (handle_composition_prop): Likewise.
16773
16774 2011-07-07 Eli Zaretskii <eliz@gnu.org>
16775
16776 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
16777 (Bug#9015)
16778
16779 2011-07-07 Kenichi Handa <handa@m17n.org>
16780
16781 * character.h (unicode_category_t): New enum type.
16782
16783 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
16784 (Qchar_code_property_table): New variable.
16785 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
16786 (UNIPROP_COMPRESSED_FORM_P): New macros.
16787 (char_table_ascii): Uncompress the compressed values.
16788 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16789 Uncompress the compressed values.
16790 (sub_char_table_ref_and_range): Likewise.
16791 (char_table_ref_and_range): Uncompress the compressed values.
16792 (sub_char_table_set): New arg is_uniprop. Callers changed.
16793 Uncompress the compressed values.
16794 (sub_char_table_set_range): Args changed. Callers changed.
16795 (char_table_set_range): Adjuted for the above change.
16796 (map_sub_char_table): Delete args default_val and parent. Add arg
16797 top. Give decoded values to a Lisp function.
16798 (map_char_table): Adjust for the above change. Give decoded
16799 values to a Lisp function. Gcpro more variables.
16800 (uniprop_table_uncompress)
16801 (uniprop_decode_value_run_length): New functions.
16802 (uniprop_decoder, uniprop_decoder_count): New variables.
16803 (uniprop_get_decoder, uniprop_encode_value_character)
16804 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
16805 New functions.
16806 (uniprop_encoder, uniprop_encoder_count): New variables.
16807 (uniprop_get_encoder, uniprop_table)
16808 (Funicode_property_table_internal, Fget_unicode_property_internal)
16809 (Fput_unicode_property_internal): New functions.
16810 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
16811 Sunicode_property_table_internal, Sget_unicode_property_internal,
16812 and Sput_unicode_property_internal. Defvar_lisp
16813 char-code-property-alist.
16814
16815 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
16816 Vunicode_category_table.
16817
16818 * font.c (font_range): Adjust for the change of
16819 Vunicode_category_table.
16820
16821 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
16822
16823 * m/iris4d.h: Remove file, move contents ...
16824 * s/irix6-5.h: ... here.
16825
16826 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
16827
16828 Remove unportable assumption about struct layout (Bug#8884).
16829 * alloc.c (mark_buffer):
16830 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
16831 (clone_per_buffer_values): Don't assume that
16832 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
16833 This isn't true in general, and it's particularly not true
16834 if Emacs is configured with --with-wide-int.
16835 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
16836 New macros, used in the buffer.c change.
16837
16838 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
16839
16840 * xsettings.c: Use both GConf and GSettings if both are available.
16841 (store_config_changed_event): Add comment.
16842 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
16843 (store_tool_bar_style_changed): New functions.
16844 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
16845 (struct xsettings): Move font inside HAVE_XFT.
16846 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
16847 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
16848 Move inside HAVE_XFT.
16849 (something_changed_gsettingsCB): Rename from something_changedCB.
16850 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
16851 also.
16852 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
16853 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
16854 (something_changed_gconfCB): Rename from something_changedCB.
16855 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
16856 (parse_settings): Move check for font inside HAVE_XFT.
16857 (read_settings, apply_xft_settings): Add comment.
16858 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
16859 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
16860 call store_font_name_changed.
16861 (xft_settings_event): Add comment.
16862 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16863 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
16864 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
16865 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
16866 (xsettings_initialize): Call init_gsettings last.
16867 (xsettings_get_system_font, xsettings_get_system_normal_font):
16868 Add comment.
16869
16870 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
16871
16872 Random fixes. E.g., (random) never returned negative values.
16873 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
16874 subseconds part to the entropy, as that's a bit more random.
16875 Prefer signed to unsigned, since the signedness doesn't matter and
16876 in general we prefer signed. When given a limit, use a
16877 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
16878 latter isn't right if USE_2_TAGS_FOR_INTS.
16879 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
16880 not 0..VALMASK. Don't discard "excess" bits that random () returns.
16881
16882 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
16883
16884 * textprop.c (text_property_stickiness):
16885 Obey Vtext_property_default_nonsticky.
16886 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
16887 * w32fns.c (syms_of_w32fns):
16888 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
16889
16890 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16891
16892 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
16893 This is more efficient than Ffile_directory_p and avoids a minor race.
16894
16895 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
16896
16897 * buffer.c (Foverlay_put): Say what the return value is
16898 (bug#7835).
16899
16900 * fileio.c (barf_or_query_if_file_exists): Check first if the file
16901 is a directory before asking whether to use the file name
16902 (bug#7564).
16903 (barf_or_query_if_file_exists): Make the "File is a directory"
16904 error be more correct.
16905
16906 * fns.c (Frequire): Remove the mention of the .gz files, since
16907 that's installation-specific, but keep the mention of
16908 `get-load-suffixes'.
16909
16910 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16911
16912 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16913 Report string overflow if the output is too long.
16914
16915 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
16916
16917 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16918 (syms_of_gnutls): Remove duplicate DEFSYM for
16919 Qgnutls_bootprop_verify_hostname_error, an error for
16920 Qgnutls_bootprop_verify_error (which is no longer used).
16921
16922 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16923 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16924 Also (re)move comments that are misplaced or no longer relevant.
16925
16926 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16927
16928 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16929
16930 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
16931
16932 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
16933 and background color parameters if they have been changed.
16934
16935 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16936
16937 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
16938
16939 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
16940
16941 * xsettings.c (SYSTEM_FONT): Define only when used.
16942 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
16943
16944 * keymap.c (access_keymap_1): Now static.
16945
16946 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
16947
16948 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
16949 leave any prefix arg for the up event (Bug#1586).
16950
16951 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
16952
16953 * lread.c (syms_of_lread): Mention single symbols defined by
16954 `defvar' or `defconst' (bug#7154).
16955
16956 * fns.c (Frequire): Mention .el.gz files (bug#7314).
16957 (Frequire): Mention get-load-suffixes.
16958
16959 2011-07-02 Martin Rudalics <rudalics@gmx.at>
16960
16961 * window.h (window): Remove clone_number slot.
16962 * window.c (Fwindow_clone_number, Fset_window_clone_number):
16963 Remove.
16964 (make_parent_window, make_window, saved_window)
16965 (Fset_window_configuration, save_window_save): Don't deal with
16966 clone numbers.
16967 * buffer.c (Qclone_number): Remove declaration.
16968 (sort_overlays, overlay_strings): Don't deal with clone numbers.
16969
16970 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
16971
16972 Add multiple inheritance to keymaps.
16973 * keymap.c (Fmake_composed_keymap): New function.
16974 (Fset_keymap_parent): Simplify.
16975 (fix_submap_inheritance): Remove.
16976 (access_keymap_1): New function extracted from access_keymap to handle
16977 embedded parents and handle lists of maps.
16978 (access_keymap): Use it.
16979 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
16980 (Fcopy_keymap): Handle embedded parents.
16981 (Fcommand_remapping, define_as_prefix): Simplify.
16982 (Fkey_binding): Simplify.
16983 (syms_of_keymap): Move minibuffer-local-completion-map,
16984 minibuffer-local-filename-completion-map,
16985 minibuffer-local-must-match-map, and
16986 minibuffer-local-filename-must-match-map to Elisp.
16987 (syms_of_keymap): Defsubr make-composed-keymap.
16988 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
16989 (parse_menu_item): Trivial simplification.
16990
16991 2011-07-01 Glenn Morris <rgm@gnu.org>
16992
16993 * Makefile.in (SETTINGS_LIBS): Fix typo.
16994
16995 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
16996
16997 * coding.c (Fencode_coding_string): Record the last coding system
16998 used, as the function doc string says (bug#8738).
16999
17000 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17001
17002 * xsettings.c (store_monospaced_changed): Take new font as arg and
17003 check for change against current_mono_font.
17004 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17005 (emacs_settings_constructor, emacs_settings_get_property)
17006 (emacs_settings_set_property, emacs_settings_class_init)
17007 (emacs_settings_init, gsettings_obj): Remove.
17008 (something_changedCB): New function for HAVE_GSETTINGS.
17009 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17010 with value as argument.
17011 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17012 g_settings_new (Bug#8967). Do not create gsettings_obj.
17013 Remove calls to g_settings_bind. Connect something_changedCB to
17014 "changed".
17015
17016 * xgselect.c: Add defined (HAVE_GSETTINGS).
17017 (xgselect_initialize): Ditto.
17018
17019 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17020 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17021 xg_select.
17022
17023 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17024
17025 * eval.c (struct backtrace): Simplify and port the data structure.
17026 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17027 signed bit field, as this assumption is not portable and it makes
17028 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17029 "char debug_on_exit : 1" as this is not portable either; instead,
17030 use the portable "unsigned int debug_on_exit : 1". Remove unused
17031 member evalargs. Remove obsolete comments about cc bombing out.
17032
17033 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17034
17035 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17036 Let HAVE_GSETTINGS override HAVE_GCONF.
17037 (store_monospaced_changed): New function.
17038 (EMACS_SETTINGS): A new type derived from GObject to handle
17039 GSettings notifications.
17040 (emacs_settings_constructor, emacs_settings_get_property)
17041 (emacs_settings_set_property, emacs_settings_class_init):
17042 New functions.
17043 (gsettings_client, gsettings_obj): New variables.
17044 (GSETTINGS_SCHEMA): New define.
17045 (something_changedCB): Call store_monospaced_changed.
17046 (init_gsettings): New function.
17047 (xsettings_initialize): Call init_gsettings.
17048 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17049 to NULL.
17050
17051 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17052 GCONF_CFLAGS/LIBS.
17053
17054 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17055
17056 * window.c (resize_root_window, grow_mini_window)
17057 (shrink_mini_window): Rename Qresize_root_window to
17058 Qwindow_resize_root_window and Qresize_root_window_vertically to
17059 Qwindow_resize_root_window_vertically.
17060
17061 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17062
17063 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17064
17065 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17066
17067 * makefile.w32-in: Redesign dependencies so they reflect more
17068 clearly which files are directly included by each source file,
17069 and not through other includes.
17070
17071 2011-06-27 Martin Rudalics <rudalics@gmx.at>
17072
17073 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17074 (sort_overlays, overlay_strings): When an overlay's clone number
17075 matches the window's clone number process the overlay even if
17076 the overlay's window property doesn't match the current window.
17077
17078 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17079 (Fwindow_hchild): Rename to Fwindow_left_child.
17080 (Fwindow_next): Rename to Fwindow_next_sibling.
17081 (Fwindow_prev): Rename to Fwindow_prev_sibling.
17082 (resize_window_check): Rename to window_resize_check.
17083 (resize_window_apply): Rename to window_resize_apply.
17084 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17085 (Fdelete_other_windows_internal, resize_frame_windows)
17086 (Fsplit_window_internal, Fdelete_window_internal)
17087 (grow_mini_window, shrink_mini_window)
17088 (Fresize_mini_window_internal): Fix callers accordingly.
17089
17090 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17091
17092 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17093 (emacs_fixed_set_min_size): Remove.
17094 (emacs_fixed_new): Take frame as argument.
17095
17096 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17097 (_EmacsFixedPrivate): Remove minwidth/height.
17098 Add struct frame *f.
17099 (emacs_fixed_init): Initialize priv->f.
17100 (get_parent_class, emacs_fixed_set_min_size): Remove.
17101 (emacs_fixed_new): Set priv->f to argument.
17102 (emacs_fixed_get_preferred_width)
17103 (emacs_fixed_get_preferred_height): Use min_width/height from
17104 frames size_hint to set minimum and natural (Bug#8919).
17105 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17106 and use min_width/height from frames size_hint to set
17107 min_width/height (Bug#8919).
17108
17109 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
17110 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17111 Fix indentation.
17112
17113 2011-06-26 Eli Zaretskii <eliz@gnu.org>
17114
17115 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17116 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17117 called at ZV.
17118
17119 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
17120
17121 * process.c (wait_reading_process_output): Bypass select if
17122 waiting for a cell while ignoring keyboard input, and input is
17123 pending. Suggested by Jan Djärv (Bug#8869).
17124
17125 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17126
17127 Use gnulib's dup2 module instead of rolling our own.
17128 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17129
17130 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17131
17132 * dispnew.c (scrolling_window): Before scrolling, turn off a
17133 mouse-highlight in the window being scrolled.
17134
17135 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
17136
17137 Move DEFSYM to lisp.h and use everywhere.
17138
17139 * character.h (DEFSYM): Move declaration...
17140 * lisp.h (DEFSYM): ...here.
17141
17142 * gnutls.c:
17143 * minibuf.c:
17144 * w32menu.c:
17145 * w32proc.c:
17146 * w32select.c: Don't include character.h.
17147
17148 * alloc.c (syms_of_alloc):
17149 * buffer.c (syms_of_buffer):
17150 * bytecode.c (syms_of_bytecode):
17151 * callint.c (syms_of_callint):
17152 * casefiddle.c (syms_of_casefiddle):
17153 * casetab.c (init_casetab_once):
17154 * category.c (init_category_once, syms_of_category):
17155 * ccl.c (syms_of_ccl):
17156 * cmds.c (syms_of_cmds):
17157 * composite.c (syms_of_composite):
17158 * dbusbind.c (syms_of_dbusbind):
17159 * dired.c (syms_of_dired):
17160 * dispnew.c (syms_of_display):
17161 * doc.c (syms_of_doc):
17162 * editfns.c (syms_of_editfns):
17163 * emacs.c (syms_of_emacs):
17164 * eval.c (syms_of_eval):
17165 * fileio.c (syms_of_fileio):
17166 * fns.c (syms_of_fns):
17167 * frame.c (syms_of_frame):
17168 * fringe.c (syms_of_fringe):
17169 * insdel.c (syms_of_insdel):
17170 * keymap.c (syms_of_keymap):
17171 * lread.c (init_obarray, syms_of_lread):
17172 * macros.c (syms_of_macros):
17173 * msdos.c (syms_of_msdos):
17174 * print.c (syms_of_print):
17175 * process.c (syms_of_process):
17176 * search.c (syms_of_search):
17177 * sound.c (syms_of_sound):
17178 * syntax.c (init_syntax_once, syms_of_syntax):
17179 * terminal.c (syms_of_terminal):
17180 * textprop.c (syms_of_textprop):
17181 * undo.c (syms_of_undo):
17182 * w32.c (globals_of_w32):
17183 * window.c (syms_of_window):
17184 * xdisp.c (syms_of_xdisp):
17185 * xfaces.c (syms_of_xfaces):
17186 * xfns.c (syms_of_xfns):
17187 * xmenu.c (syms_of_xmenu):
17188 * xsettings.c (syms_of_xsettings):
17189 * xterm.c (syms_of_xterm): Use DEFSYM.
17190
17191 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17192
17193 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
17194
17195 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17196
17197 Integer and buffer overflow fixes (Bug#8873).
17198
17199 * print.c (printchar, strout): Check for string overflow.
17200 (PRINTPREPARE, printchar, strout):
17201 Don't set size unless allocation succeeds.
17202
17203 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17204 for sizes. Check for string overflow more accurately.
17205 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17206
17207 * macros.c: Integer and buffer overflow fixes.
17208 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17209 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17210 Use ptrdiff_t, not int, for sizes.
17211 Don't increment bufsize until after realloc succeeds.
17212 Check for size-calculation overflow.
17213 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17214
17215 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17216
17217 * lread.c: Integer overflow fixes.
17218 (read_integer): Radix is now EMACS_INT, not int,
17219 to improve quality of diagnostics for out-of-range radices.
17220 Calculate buffer size correctly for out-of-range radices.
17221 (read1): Check for integer overflow in radices, and in
17222 read-circle numbers.
17223 (read_escape): Avoid int overflow.
17224 (Fload, openp, read_buffer_size, read1)
17225 (substitute_object_recurse, read_vector, read_list, map_obarray):
17226 Use ptrdiff_t, not int, for sizes.
17227 (read1): Use EMACS_INT, not int, for sizes.
17228 Check for size overflow.
17229
17230 * image.c (cache_image): Check for size arithmetic overflow.
17231
17232 * lread.c: Integer overflow issues.
17233 (saved_doc_string_size, saved_doc_string_length)
17234 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17235 Now ptrdiff_t, not int.
17236 (read1): Don't assume doc string length fits in int. Check for
17237 out-of-range doc string lengths.
17238 (read_list): Don't assume file position fits in int.
17239 (read_escape): Check for hex character overflow.
17240
17241 2011-06-22 Leo Liu <sdl.web@gmail.com>
17242
17243 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17244 Move to minibuffer.el.
17245
17246 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17247
17248 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
17249 The following patches are for when GLYPH_DEBUG && !XASSERT.
17250 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17251 * dispnew.c (flush_stdout):
17252 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17253 Mark as externally visible.
17254 * dispnew.c (check_window_matrix_pointers): Now static.
17255 * dispnew.c (window_to_frame_vpos):
17256 * xfns.c (unwind_create_frame):
17257 * xterm.c (x_check_font): Remove unused local.
17258 * scroll.c (CHECK_BOUNDS):
17259 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17260 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17261 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17262 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17263 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17264 Now static.
17265 (debug_method_add): Use va_list and vsprintf rather than relying
17266 on undefined behavior with wrong number of arguments.
17267 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17268 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17269 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17270 since we're not interested in debugging glyphs with old libraries.
17271 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17272 GCC 4.6.0's static checking.
17273
17274 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17275
17276 Integer overflow and signedness fixes (Bug#8873).
17277 A few related buffer overrun fixes, too.
17278
17279 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17280
17281 * dispextern.h (struct face.stipple):
17282 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17283 (x_bitmap_mask, x_allocate_bitmap_record)
17284 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17285 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17286 (x_create_bitmap_from_xpm_data):
17287 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17288 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17289 (.bitmaps_last):
17290 * xfaces.c (load_pixmap):
17291 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17292 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17293 (.bitmaps_last, struct x_output.icon_bitmap):
17294 Use ptrdiff_t, not int, for bitmap indexes.
17295 (x_allocate_bitmap_record): Check for size overflow.
17296 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17297
17298 Use ptrdiff_t, not int, for overlay counts.
17299 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17300 * editfns.c (overlays_around, get_pos_property):
17301 * textprop.c (get_char_property_and_overlay):
17302 * xdisp.c (next_overlay_change, note_mouse_highlight):
17303 * xfaces.c (face_at_buffer_position):
17304 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17305 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17306 (Fnext_overlay_change, Fprevious_overlay_change)
17307 (mouse_face_overlay_overlaps, Foverlays_in):
17308 Use ptrdiff_t, not int, for sizes.
17309 (overlays_at, overlays_in): Check for size-calculation overflow.
17310
17311 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17312
17313 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17314 (x_session_initialize): Do not assume string length fits in int.
17315
17316 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17317 This is unlikely, but can occur if DPI is outlandish.
17318
17319 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
17320 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17321
17322 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17323 * xrdb.c (magic_file_p, search_magic_path):
17324 Omit last arg SUFFIX; it was always 0. All callers changed.
17325 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17326
17327 * xfont.c (xfont_match): Avoid need for strlen.
17328
17329 * xfns.c: Don't assume strlen fits in int.
17330 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17331
17332 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17333 not unsigned long, as we prefer signed integers. All callers changed.
17334 Detect integer overflow in repeat count.
17335 (message_dolog): Don't assume print length fits in 39 bytes.
17336 (display_mode_element): Don't assume strlen fits in int.
17337
17338 * termcap.c: Don't assume sizes fit in int and never overflow.
17339 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17340 (gobble_line): Check for size-calculation overflow.
17341
17342 * minibuf.c (Fread_buffer):
17343 * lread.c (intern, intern_c_string):
17344 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17345 Don't assume string length fits in int.
17346
17347 * keyboard.c (parse_tool_bar_item):
17348 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17349
17350 * font.c: Don't assume string length fits in int.
17351 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17352 Use ptrdiff_t, not int.
17353 (font_intern_prop): Don't assume string length fits in int.
17354 Don't assume integer property fits in fixnum.
17355 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
17356
17357 * filelock.c: Fix some buffer overrun and integer overflow issues.
17358 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
17359 Reformulate so as not to need the command string.
17360 Invoke gzip -cd rather than gunzip, as it's more portable.
17361 (lock_info_type, lock_file_1, lock_file):
17362 Don't assume pid_t and time_t fit in unsigned long.
17363 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17364 (current_lock_owner): Prefer signed type for sizes.
17365 Use memcpy, not strncpy, where memcpy is what is really wanted.
17366 Don't assume (via atoi) that time_t and pid_t fit in int.
17367 Check for time_t and/or pid_t out of range, e.g., via a network share.
17368 Don't alloca where an auto var works fine.
17369
17370 * fileio.c: Fix some integer overflow issues.
17371 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17372 Don't assume string length fits in int.
17373 (directory_file_name): Don't assume string length fits in long.
17374 (make_temp_name): Don't assume pid fits in int, or that its print
17375 length is less than 20.
17376
17377 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17378
17379 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17380
17381 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17382
17383 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17384 We prefer signed integers, even for size calculations.
17385
17386 * emacs.c: Don't assume string length fits in 'int'.
17387 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17388 (main): Don't invoke strlen when not needed.
17389
17390 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17391 (XD_DEBUG_MESSAGE): Don't waste a byte.
17392
17393 * callproc.c (getenv_internal_1, getenv_internal)
17394 (Fgetenv_internal):
17395 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17396
17397 * lread.c (invalid_syntax): Omit length argument.
17398 All uses changed. This doesn't fix a bug, but it simplifies the
17399 code away from its former Hollerith-constant appearance, and it's
17400 one less 'int' to worry about when looking at integer-overflow issues.
17401 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
17402
17403 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17404 This didn't break anything, but it didn't help either.
17405 It's confusing to put a bogus integer in a place where the actual
17406 value does not matter.
17407 (LIST_END_P): Remove unused macro and its bogus comment.
17408 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
17409
17410 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17411 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17412 implementation.
17413 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17414 We prefer signed types, and the value cannot exceed the EMACS_INT
17415 range anyway (because otherwise the length would not be representable).
17416 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17417 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17418 This avoids a GCC warning when WIDE_EMACS_INT.
17419
17420 * indent.c (sane_tab_width): New function.
17421 (current_column, scan_for_column, Findent_to, position_indentation)
17422 (compute_motion): Use it. This is just for clarity.
17423 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
17424
17425 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
17426
17427 * lisp.h (lint_assume): New macro.
17428 * composite.c (composition_gstring_put_cache):
17429 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17430
17431 * editfns.c, insdel.c:
17432 Omit unnecessary forward decls, to simplify future changes.
17433
17434 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17435
17436 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17437
17438 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
17439 Use much-faster test for byte-length change.
17440 Don't assume string byte-length fits in 'int'.
17441 Check that character arg fits in 'int'.
17442 (mapcar1): Declare byte as byte, for clarity.
17443
17444 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17445
17446 * fns.c (concat): Catch string overflow earlier.
17447 Do not rely on integer wraparound.
17448
17449 * dispextern.h (struct it.overlay_strings_charpos)
17450 (struct it.selective): Now EMACS_INT, not int.
17451 * xdisp.c (forward_to_next_line_start)
17452 (back_to_previous_visible_line_start)
17453 (reseat_at_next_visible_line_start, next_element_from_buffer):
17454 Don't arbitrarily truncate the value of 'selective' to int.
17455
17456 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17457
17458 * composite.c: Don't truncate sizes to 'int'.
17459 (composition_gstring_p, composition_reseat_it)
17460 (composition_adjust_point): Use EMACS_INT, not int.
17461 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17462 not EMACS_UINT, for indexes.
17463
17464 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17465
17466 * buffer.c: Include <verify.h>.
17467 (struct sortvec.priority, struct sortstr.priority):
17468 Now EMACS_INT, not int.
17469 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
17470 (struct sortstr.size, record_overlay_string)
17471 (struct sortstrlist.size, struct sortlist.used):
17472 Don't truncate size to int.
17473 (record_overlay_string): Check for size-calculation overflow.
17474 (init_buffer_once): Check at compile-time, not run-time.
17475
17476 2011-06-22 Jim Meyering <meyering@redhat.com>
17477
17478 Don't leak an XBM-image-sized buffer
17479 * image.c (xbm_load): Free the image buffer after using it.
17480
17481 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17482
17483 Port to Sun C.
17484 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17485 that Sun C diagnosed.
17486 * fns.c (secure_hash): Fix pointer signedness issue.
17487 * intervals.c (static_offset_intervals): New function.
17488 (offset_intervals): Use it.
17489
17490 2011-06-21 Leo Liu <sdl.web@gmail.com>
17491
17492 * deps.mk (fns.o):
17493 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17494 sha512.h.
17495
17496 * fns.c (secure_hash): Rename from crypto_hash_function and change
17497 the first arg to accept symbols.
17498 (Fsecure_hash): New primitive.
17499 (syms_of_fns): New symbols.
17500
17501 2011-06-20 Deniz Dogan <deniz@dogan.se>
17502
17503 * process.c (Fset_process_buffer): Clarify return value in
17504 docstring.
17505
17506 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
17507
17508 * dispnew.c (add_window_display_history): Use BVAR.
17509
17510 * xdisp.c (debug_method_add): Use BVAR.
17511 (check_window_end, dump_glyph_matrix, dump_glyph)
17512 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17513
17514 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17515 Likewise.
17516
17517 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17518 check till after the cache is created in init_frame_faces.
17519
17520 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17521
17522 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17523
17524 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17525
17526 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
17527 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
17528 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
17529
17530 Improve buffer-overflow checking (Bug#8873).
17531 * fileio.c (Finsert_file_contents):
17532 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
17533 Remove the old (too-loose) buffer overflow checks.
17534 They weren't needed, since make_gap checks for buffer overflow.
17535 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
17536 The old code merely checked for Emacs fixnum overflow, and relied
17537 on undefined (wraparound) behavior. The new code avoids undefined
17538 behavior, and also checks for ptrdiff_t and/or size_t overflow.
17539
17540 * editfns.c (Finsert_char): Don't dump core with very negative counts.
17541 Tune. Don't use wider integers than needed. Don't use alloca.
17542 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
17543
17544 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
17545
17546 * insdel.c, lisp.h (buffer_overflow): New function.
17547 (insert_from_buffer_1, replace_range, replace_range_2):
17548 * insdel.c (make_gap_larger):
17549 * editfns.c (Finsert_char):
17550 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17551
17552 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17553
17554 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17555
17556 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
17557
17558 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17559 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17560
17561 * fileio.c: Don't assume EMACS_INT fits in off_t.
17562 (emacs_lseek): New static function.
17563 (Finsert_file_contents, Fwrite_region): Use it.
17564 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17565
17566 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17567
17568 * fns.c: Don't overflow int when computing a list length.
17569 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17570 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17571 truncation on 64-bit hosts. Check for QUIT every
17572 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17573 faster and is responsive enough.
17574 (Flength): Report an error instead of overflowing an integer.
17575 (Fsafe_length): Return a float if the value is not representable
17576 as a fixnum. This shouldn't happen except in contrived situations.
17577 (Fnthcdr, Fsort): Don't assume list length fits in int.
17578 (Fcopy_sequence): Don't assume vector length fits in int.
17579
17580 * alloc.c: Check that resized vectors' lengths fit in fixnums.
17581 (header_size, word_size): New constants.
17582 (allocate_vectorlike): Don't check size overflow here.
17583 (allocate_vector): Check it here instead, since this is the only
17584 caller of allocate_vectorlike that could cause overflow.
17585 Check that the new vector's length is representable as a fixnum.
17586
17587 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
17588 The previous code was bogus. For example, next_almost_prime (32)
17589 returned 39, which is undesirable as it is a multiple of 3; and
17590 next_almost_prime (24) returned 25, which is a multiple of 5 so
17591 why was the code bothering to check for multiples of 7?
17592
17593 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
17594
17595 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
17596
17597 Variadic C functions now count arguments with ptrdiff_t.
17598 This partly undoes my 2011-03-30 change, which replaced int with size_t.
17599 Back then I didn't know that the Emacs coding style prefers signed int.
17600 Also, in the meantime I found a few more instances where arguments
17601 were being counted with int, which may truncate counts on 64-bit
17602 machines, or EMACS_INT, which may be unnecessarily wide.
17603 * lisp.h (struct Lisp_Subr.function.aMANY)
17604 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
17605 Arg counts are now ptrdiff_t, not size_t.
17606 All variadic functions and their callers changed accordingly.
17607 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
17608 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
17609 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
17610 * callint.c (Fcall_interactively): Check arg count for overflow,
17611 to avoid potential buffer overrun. Use signed char, not 'int',
17612 for 'varies' array, so that we needn't bother to check its size
17613 calculation for overflow.
17614 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
17615 * eval.c (apply_lambda):
17616 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
17617 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
17618 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
17619
17620 * callint.c (Fcall_interactively): Don't use index var as event count.
17621
17622 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
17623 * mem-limits.h (SIZE): Remove; no longer used.
17624
17625 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
17626
17627 Remove unnecessary casts.
17628 * xterm.c (x_term_init):
17629 * xfns.c (x_set_border_pixel):
17630 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
17631 These aren't needed now that we assume ANSI C.
17632
17633 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
17634 It's more likely to cause problems (due to unsigned overflow)
17635 than to cure them.
17636
17637 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
17638
17639 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
17640
17641 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
17642
17643 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
17644
17645 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
17646
17647 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
17648
17649 GLYPH_CODE_FACE returns EMACS_INT, not int.
17650 * dispextern.h (merge_faces):
17651 * xfaces.c (merge_faces):
17652 * xdisp.c (get_next_display_element, next_element_from_display_vector):
17653 Don't assume EMACS_INT fits in int.
17654
17655 * character.h (CHAR_VALID_P): Remove unused parameter.
17656 * fontset.c, lisp.h, xdisp.c: All uses changed.
17657
17658 * editfns.c (Ftranslate_region_internal): Omit redundant test.
17659
17660 * fns.c (concat): Minor tuning based on overflow analysis.
17661 This doesn't fix any bugs. Use int to hold character, instead
17662 of constantly refetching from Emacs object. Use XFASTINT, not
17663 XINT, for value known to be a character. Don't bother comparing
17664 a single byte to 0400, as it's always less.
17665
17666 * floatfns.c (Fexpt):
17667 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
17668
17669 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
17670 for characters.
17671
17672 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
17673
17674 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
17675 Without this fix, on a 64-bit host (aset S 0 4294967386) would
17676 incorrectly succeed when S was a string, because 4294967386 was
17677 truncated before it was used.
17678
17679 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
17680 Otherwise, an out-of-range integer could cause undefined behavior
17681 on a 64-bit host.
17682
17683 * composite.c: Use int, not EMACS_INT, for characters.
17684 (fill_gstring_body, composition_compute_stop_pos): Use int, not
17685 EMACS_INT, for values that are known to be in character range.
17686 This doesn't fix any bugs but is the usual style inside Emacs and
17687 may generate better code on 32-bit machines.
17688
17689 Make sure a 64-bit char is never passed to ENCODE_CHAR.
17690 This is for reasons similar to the recent CHAR_STRING fix.
17691 * charset.c (Fencode_char): Check that character arg is actually
17692 a character. Pass an int to ENCODE_CHAR.
17693 * charset.h (ENCODE_CHAR): Verify that the character argument is no
17694 wider than 'int', as a compile-time check to prevent future regressions
17695 in this area.
17696
17697 * character.c (char_string): Remove unnecessary casts.
17698
17699 Make sure a 64-bit char is never passed to CHAR_STRING.
17700 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
17701 by silently ignoring the top 32 bits, allowing some values
17702 that were far too large to be valid characters.
17703 * character.h: Include <verify.h>.
17704 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
17705 arguments are no wider than unsigned, as a compile-time check
17706 to prevent future regressions in this area.
17707 * data.c (Faset):
17708 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
17709 (Fsubst_char_in_region):
17710 * fns.c (concat):
17711 * xdisp.c (decode_mode_spec_coding):
17712 Adjust to CHAR_STRING's new requirement.
17713 * editfns.c (Finsert_char, Fsubst_char_in_region):
17714 * fns.c (concat): Check that character args are actually
17715 characters. Without this test, these functions did the wrong
17716 thing with wildly out-of-range values on 64-bit hosts.
17717
17718 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
17719 These casts should not be needed on 32-bit hosts, either.
17720 * keyboard.c (read_char):
17721 * lread.c (Fload): Remove casts to unsigned.
17722
17723 * lisp.h (UNSIGNED_CMP): New macro.
17724 This fixes comparison bugs on 64-bit hosts.
17725 (ASCII_CHAR_P): Use it.
17726 * casefiddle.c (casify_object):
17727 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
17728 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
17729 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
17730 * dispextern.h (FACE_FROM_ID):
17731 * keyboard.c (read_char): Use UNSIGNED_CMP.
17732
17733 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
17734 not to EMACS_INT, to avoid GCC warning.
17735
17736 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
17737
17738 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
17739 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
17740 isn't needed on 32-bit machines.
17741
17742 * buffer.c (Fgenerate_new_buffer_name):
17743 Use EMACS_INT for count, not int.
17744 (advance_to_char_boundary): Return EMACS_INT, not int.
17745
17746 * data.c (Qcompiled_function): Now static.
17747
17748 * window.c (window_body_lines): Now static.
17749
17750 * image.c (gif_load): Rename local to avoid shadowing.
17751
17752 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
17753 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
17754 * alloc.c (make_save_value): Integer argument is now of type
17755 ptrdiff_t, not int.
17756 (mark_object): Use ptrdiff_t, not int.
17757 * lisp.h (pD): New macro.
17758 * print.c (print_object): Use it.
17759
17760 * alloc.c: Use EMACS_INT, not int, to count objects.
17761 (total_conses, total_markers, total_symbols, total_vector_size)
17762 (total_free_conses, total_free_markers, total_free_symbols)
17763 (total_free_floats, total_floats, total_free_intervals)
17764 (total_intervals, total_strings, total_free_strings):
17765 Now EMACS_INT, not int. All uses changed.
17766 (Fgarbage_collect): Compute overall total using a double, so that
17767 integer overflow is less likely to be a problem. Check for overflow
17768 when converting back to an integer.
17769 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
17770 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
17771 These were 'int' variables that could overflow on 64-bit hosts;
17772 they were never used, so remove them instead of repairing them.
17773 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
17774 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
17775 Previously, this ceilinged at INT_MAX, but that doesn't work on
17776 64-bit machines.
17777 (allocate_pseudovector): Don't use EMACS_INT when int would do.
17778
17779 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
17780 (allocate_vectorlike): Check for ptrdiff_t overflow.
17781 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
17782 when a (possibly-narrower) signed value would do just as well.
17783 We prefer using signed arithmetic, to avoid comparison confusion.
17784
17785 * alloc.c: Catch some string size overflows that we were missing.
17786 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
17787 for convenience in STRING_BYTES_MAX.
17788 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
17789 The definition here is exact; the one in lisp.h was approximate.
17790 (allocate_string_data): Check for string overflow. This catches
17791 some instances we weren't catching before. Also, it catches
17792 size_t overflow on (unusual) hosts where SIZE_MAX <= min
17793 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
17794 and ptrdiff_t and EMACS_INT are both 64 bits.
17795
17796 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
17797 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
17798 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
17799
17800 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
17801
17802 * alloc.c (Fmake_string): Check for out-of-range init.
17803
17804 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
17805
17806 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
17807
17808 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
17809
17810 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
17811 xg_get_default_scrollbar_width.
17812
17813 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
17814 (int_gtk_range_get_value): Move to the scroll bar part of the file.
17815 (style_changed_cb): Call update_theme_scrollbar_width and call
17816 x_set_scroll_bar_default_width and xg_frame_set_char_size for
17817 all frames (Bug#8505).
17818 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
17819 Call gtk_window_set_resizable if HAVE_GTK3.
17820 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
17821 and height if HAVE_GTK3 (Bug#8505).
17822 (scroll_bar_width_for_theme): New variable.
17823 (update_theme_scrollbar_width): New function.
17824 (xg_get_default_scrollbar_width): Move code to
17825 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
17826 (xg_initialize): Call update_theme_scrollbar_width.
17827
17828 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
17829
17830 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
17831
17832 2011-06-12 Martin Rudalics <rudalics@gmx.at>
17833
17834 * frame.c (make_frame): Call other_buffer_safely instead of
17835 other_buffer.
17836
17837 * window.c (temp_output_buffer_show): Call display_buffer with
17838 second argument Vtemp_buffer_show_specifiers and reset latter
17839 immediately after the call.
17840 (Vtemp_buffer_show_specifiers): New variable.
17841 (auto_window_vscroll_p, next_screen_context_lines)
17842 (Vscroll_preserve_screen_position): Remove leading asterisks from
17843 doc-strings.
17844
17845 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
17846
17847 Fix minor problems found by GCC 4.6.0 static checking.
17848 * buffer.c (Qclone_number): Remove for now, as it's unused.
17849 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
17850 (record_buffer): Remove unused local.
17851 * frame.c (other_visible_frames, frame_buffer_list): Now static.
17852 (set_frame_buffer_list): Remove; unused.
17853 * frame.h (other_visible_frames): Remove decl.
17854 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
17855 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
17856 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
17857 if HAVE_GPM.
17858 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
17859 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
17860 Define only if HAVE_GPM.
17861 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
17862 (update_hints_inhibit): Remove; never set. All uses removed.
17863 * widgetprv.h (emacsFrameClassRec): Remove decl.
17864 * window.c (delete_deletable_window): Now returns void, since it
17865 wasn't returning anything.
17866 (compare_window_configurations): Remove unused locals.
17867 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
17868 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
17869 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
17870 the same widths as pointers. This follows up on the 2011-05-06 patch.
17871 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
17872 * xterm.h: Likewise.
17873 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
17874
17875 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
17876
17877 * makefile.w32-in: Update dependencies.
17878 (LISP_H): Add lib/intprops.h.
17879
17880 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
17881
17882 * image.c (gif_load): Add animation frame delay to the metadata.
17883 (syms_of_image): Use DEFSYM. New symbol `delay'.
17884
17885 2011-06-11 Martin Rudalics <rudalics@gmx.at>
17886
17887 * window.c (delete_deletable_window): Re-add.
17888 (Fset_window_configuration): Rewrite to handle dead buffers and
17889 consequently deletable windows.
17890 (window_tree, Fwindow_tree): Remove. Supply functionality in
17891 window.el.
17892 (compare_window_configurations): Simplify code.
17893
17894 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
17895
17896 * image.c (imagemagick_load_image): Fix type mismatch.
17897 (Fimagemagick_types): Likewise.
17898
17899 * window.h (replace_buffer_in_windows): Declare.
17900
17901 2011-06-11 Martin Rudalics <rudalics@gmx.at>
17902
17903 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
17904 Qclone_number. Remove external declaration of Qdelete_window.
17905 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
17906 code.
17907 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
17908 Run Qbuffer_list_update_hook if allowed.
17909 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17910 buffer list implementation.
17911 (other_buffer_safely): New function.
17912 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17913 calls to replace_buffer_in_windows and
17914 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17915 if allowed.
17916 (record_buffer): Inhibit quitting and rewrite using quittable
17917 functions. Run Qbuffer_list_update_hook if allowed.
17918 (Frecord_buffer, Funrecord_buffer): New functions.
17919 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17920 Move switch-to-buffer to window.el.
17921 (bury-buffer): Move to window.el.
17922 (Vbuffer_list_update_hook): New variable.
17923
17924 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17925 section.
17926
17927 * window.h (resize_frame_windows): Move up in code.
17928 (Fwindow_frame): Remove EXFUN.
17929 (replace_buffer_in_all_windows): Remove prototype.
17930 (replace_buffer_in_windows_safely): Add prototype.
17931
17932 * window.c: Declare Qdelete_window static again. Move down
17933 declaration of select_count.
17934 (Fnext_window, Fprevious_window): Rewrite doc-strings.
17935 (Fother_window): Move to window.el.
17936 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
17937 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
17938 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
17939 window.el.
17940 (replace_buffer_in_windows): Implement by calling
17941 Qreplace_buffer_in_windows.
17942 (replace_buffer_in_all_windows): Remove with some functionality
17943 moved into replace_buffer_in_windows_safely.
17944 (replace_buffer_in_windows_safely): New function.
17945 (select_window_norecord, select_frame_norecord): Move in front
17946 of run_window_configuration_change_hook. Remove now obsolete
17947 declarations.
17948 (Fset_window_buffer): Rewrite doc-string.
17949 Call Qrecord_window_buffer.
17950 (keys_of_window): Move binding for other-window to window.el.
17951
17952 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
17953
17954 * dispextern.h (struct image): Replace data member, whose int_val
17955 and ptr_val fields were not used by anything, with a single
17956 lisp_val object.
17957
17958 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
17959 (gif_clear_image, gif_load, imagemagick_load_image)
17960 (gs_clear_image, gs_load): Callers changed.
17961
17962 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
17963
17964 * buffer.h: Include <time.h>, for time_t.
17965 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
17966
17967 Fix minor problems found by static checking.
17968
17969 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
17970
17971 Make identifiers static if they are not used in other modules.
17972 * data.c (Qcompiled_function, Qframe, Qvector):
17973 * image.c (QimageMagick, Qsvg):
17974 * minibuf.c (Qmetadata):
17975 * window.c (resize_window_check, resize_root_window): Now static.
17976 * window.h (resize_window_check, resize_root_window): Remove decls.
17977
17978 * window.c (window_deletion_count, delete_deletable_window):
17979 Remove; unused.
17980 (window_body_lines): Now static.
17981 (Fdelete_other_windows_internal): Mark vars as initialized.
17982 Make sure 'resize_failed' is initialized.
17983 (run_window_configuration_change_hook): Rename local to avoid shadowing.
17984 (resize_window_apply): Remove unused local.
17985 * window.h (delete_deletable_window): Remove decl.
17986
17987 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
17988 (imagemagick_load_image): Fix pointer signedness problem by changing
17989 last arg from unsigned char * to char *. All uses changed.
17990 Also, fix a local for similar reasons.
17991 Remove unused locals. Remove locals to avoid shadowing.
17992 (fn_rsvg_handle_free): Remove; unused.
17993 (svg_load, svg_load_image): Fix pointer signedness problem.
17994 (imagemagick_load_image): Don't use garbage pointer image_wand.
17995
17996 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
17997
17998 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
17999
18000 * image.c (gif_load): Fix omitted cast error introduced by
18001 2011-06-06 change.
18002
18003 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18004
18005 * window.h (resize_proportionally, orig_total_lines)
18006 (orig_top_line): Remove from window structure.
18007 (set_window_height, set_window_width, change_window_heights)
18008 (Fdelete_window): Remove prototypes.
18009 (resize_frame_windows): Remove duplicate declaration.
18010
18011 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18012
18013 * window.h (resize_frame_windows, resize_window_check)
18014 (delete_deletable_window, resize_root_window)
18015 (resize_frame_windows): Declare prototypes.
18016
18017 * window.c (resize_window_apply): Make definition be "static" to
18018 match the prototype.
18019
18020 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18021
18022 * window.c: Remove declarations of Qwindow_size_fixed,
18023 window_min_size_1, window_min_size_2, window_min_size,
18024 size_window, window_fixed_size_p, enlarge_window, delete_window.
18025 Remove static from declaration of Qdelete_window, it's
18026 temporarily needed by Fbury_buffer.
18027 (replace_window): Don't assign orig_top_line and
18028 orig_total_lines.
18029 (Fdelete_window, delete_window): Remove. Window deletion is
18030 handled by window.el.
18031 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18032 Replace Fdelete_window calls with calls to Qdelete_window.
18033 (Fdelete_other_windows): Remove. Deleting other windows is
18034 handled by window.el.
18035 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18036 handled in window.el.
18037 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18038 Window minimum sizes are handled in window.el.
18039 (shrink_windows, size_window, set_window_height)
18040 (set_window_width, change_window_heights, window_height)
18041 (window_width, CURBEG, CURSIZE, enlarge_window)
18042 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18043 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18044 handled in window.el.
18045 (make_dummy_parent): Rename to make_parent_window and give it a
18046 second argument horflag.
18047 (make_window): Don't set resize_proportionally any more.
18048 (Fsplit_window): Remove. Windows are split in window.el.
18049 (save_restore_action, save_restore_orig_size)
18050 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18051 Resize mini windows in window.el.
18052 (grow_mini_window, shrink_mini_window): Implement by calling
18053 Qresize_root_window_vertically, resize_window_check and
18054 resize_window_apply.
18055 (saved_window, Fset_window_configuration, save_window_save):
18056 Do not handle orig_top_line, orig_total_lines, and
18057 resize_proportionally.
18058 (window_min_height, window_min_width): Move to window.el.
18059 (keys_of_window): Move bindings for delete-other-windows,
18060 split-window, delete-window and enlarge-window to window.el.
18061
18062 * buffer.c: Temporarily extern Qdelete_window.
18063 (Fbury_buffer): Temporarily call Qdelete_window instead of
18064 Fdelete_window (Fbury_buffer will move to window.el soon).
18065
18066 * frame.c (set_menu_bar_lines_1): Remove code handling
18067 orig_top_line and orig_total_lines.
18068
18069 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18070 set_window_height but set heights directly.
18071 (change_frame_size_1): Use resize_frame_windows.
18072
18073 * xdisp.c (init_xdisp): Don't use set_window_height but set
18074 heights directly.
18075
18076 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18077 Use resize_frame_windows instead of change_window_heights and run
18078 run_window_configuration_change_hook.
18079
18080 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18081 instead of change_window_heights and run
18082 run_window_configuration_change_hook.
18083
18084 2011-06-09 Martin Rudalics <rudalics@gmx.at>
18085
18086 * window.c (replace_window): Rename second argument REPLACEMENT to
18087 NEW. New third argument SETFLAG. Rewrite.
18088 (delete_window, make_dummy_parent): Call replace_window with
18089 third argument 1.
18090 (window_list_1): Move down in code.
18091 (run_window_configuration_change_hook): Move set_buffer part
18092 before select_frame_norecord part in order to unwind correctly.
18093 Rename count1 to count.
18094 (recombine_windows, delete_deletable_window, resize_root_window)
18095 (Fdelete_other_windows_internal)
18096 (Frun_window_configuration_change_hook, make_parent_window)
18097 (resize_window_check, resize_window_apply, Fresize_window_apply)
18098 (resize_frame_windows, Fsplit_window_internal)
18099 (Fdelete_window_internal, Fresize_mini_window_internal):
18100 New functions.
18101 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18102
18103 2011-06-08 Martin Rudalics <rudalics@gmx.at>
18104
18105 * window.h (window): Add some new members to window structure -
18106 normal_lines, normal_cols, new_total, new_normal, clone_number,
18107 splits, nest, prev_buffers, next_buffers.
18108 (WINDOW_TOTAL_SIZE): Move here from window.c.
18109 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
18110
18111 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18112 Remove.
18113 (make_dummy_parent): Set new members of windows structure.
18114 (make_window): Move down in code. Handle new members of window
18115 structure.
18116 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18117 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18118 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18119 (Fset_window_prev_buffers, Fwindow_next_buffers)
18120 (Fset_window_next_buffers, Fset_window_clone_number):
18121 New functions.
18122 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18123 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18124 Doc-string fixes.
18125 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18126 Argument WINDOW can be now internal window too.
18127 (Fwindow_use_time): Move up in code.
18128 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18129 Rewrite doc-string.
18130 (Fset_window_configuration, saved_window)
18131 (Fcurrent_window_configuration, save_window_save): Handle new
18132 members of window structure.
18133 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18134 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18135 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18136 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18137 Qget_mru_window, Qresize_root_window,
18138 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18139 Qauto_buffer_name; staticpro them.
18140
18141 2011-06-07 Martin Rudalics <rudalics@gmx.at>
18142
18143 * window.c (Fwindow_total_size, Fwindow_left_column)
18144 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18145 (Fwindow_list_1): New functions.
18146 (window_box_text_cols): Replace with window_body_cols.
18147 (Fwindow_width, Fscroll_left, Fscroll_right):
18148 Use window_body_cols instead of window_box_text_cols.
18149 (delete_window, Fset_window_configuration):
18150 Call delete_all_subwindows with window as argument.
18151 (delete_all_subwindows): Take a window as argument and not a
18152 structure. Rewrite.
18153 (window_loop): Remove handling of GET_LRU_WINDOW and
18154 GET_LARGEST_WINDOW.
18155 (Fget_lru_window, Fget_largest_window): Move to window.el.
18156
18157 * window.h: Extern window_body_cols instead of
18158 window_box_text_cols. delete_all_subwindows now takes a
18159 Lisp_Object as argument.
18160
18161 * indent.c (compute_motion, Fcompute_motion):
18162 Use window_body_cols instead of window_box_text_cols.
18163
18164 * frame.c (delete_frame): Call delete_all_subwindows with root
18165 window as argument.
18166
18167 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18168
18169 * fns.c (Fputhash): Document return value.
18170
18171 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
18172
18173 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18174
18175 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18176
18177 Cons<->int and similar integer overflow fixes (Bug#8794).
18178
18179 Check for overflow when converting integer to cons and back.
18180 * charset.c (Fdefine_charset_internal, Fdecode_char):
18181 Use cons_to_unsigned to catch overflow.
18182 (Fencode_char): Use INTEGER_TO_CONS.
18183 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18184 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18185 * data.c (long_to_cons, cons_to_long): Remove.
18186 (cons_to_unsigned, cons_to_signed): New functions.
18187 These signal an error for invalid or out-of-range values.
18188 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18189 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18190 * font.c (Ffont_variation_glyphs):
18191 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18192 * lisp.h: Include <intprops.h>.
18193 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18194 (cons_to_signed, cons_to_unsigned): New decls.
18195 (long_to_cons, cons_to_long): Remove decls.
18196 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18197 (Fprimitive_undo): Use CONS_TO_INTEGER.
18198 * xfns.c (Fx_window_property): Likewise.
18199 * xselect.c: Include <limits.h>.
18200 (x_own_selection, selection_data_to_lisp_data):
18201 Use INTEGER_TO_CONS.
18202 (x_handle_selection_request, x_handle_selection_clear)
18203 (x_get_foreign_selection, Fx_disown_selection_internal)
18204 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18205 (lisp_data_to_selection_data): Use cons_to_unsigned.
18206 (x_fill_property_data): Use cons_to_signed.
18207 Report values out of range.
18208
18209 Check for buffer and string overflow more precisely.
18210 * buffer.h (BUF_BYTES_MAX): New macro.
18211 * lisp.h (STRING_BYTES_MAX): New macro.
18212 * alloc.c (Fmake_string):
18213 * character.c (string_escape_byte8):
18214 * coding.c (coding_alloc_by_realloc):
18215 * doprnt.c (doprnt):
18216 * editfns.c (Fformat):
18217 * eval.c (verror):
18218 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18219 since they may not be the same number.
18220 * editfns.c (Finsert_char):
18221 * fileio.c (Finsert_file_contents):
18222 Likewise for BUF_BYTES_MAX.
18223
18224 * image.c: Use ptrdiff_t, not int, for sizes.
18225 (slurp_file): Switch from int to ptrdiff_t.
18226 All uses changed.
18227 (slurp_file): Check that file size fits in both size_t (for
18228 malloc) and ptrdiff_t (for sanity and safety).
18229
18230 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18231 if b->modtime has its maximal value.
18232
18233 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18234
18235 Don't assume time_t can fit into int.
18236 * buffer.h (struct buffer.modtime): Now time_t, not int.
18237 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18238 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18239
18240 Minor fixes for signed vs unsigned integers.
18241 * character.h (MAYBE_UNIFY_CHAR):
18242 * charset.c (maybe_unify_char):
18243 * keyboard.c (read_char, reorder_modifiers):
18244 XINT -> XFASTINT, since the integer must be nonnegative.
18245 * ftfont.c (ftfont_spec_pattern):
18246 * keymap.c (access_keymap, silly_event_symbol_error):
18247 XUINT -> XFASTINT, since the integer must be nonnegative.
18248 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18249 since it makes no difference and we prefer signed.
18250 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18251 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18252 nonnegative.
18253
18254 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18255
18256 * window.h (Fwindow_frame): Declare.
18257
18258 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18259
18260 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18261 (SPARE_MEMORY): Always define.
18262 (LARGE_REQUEST): Remove.
18263 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18264
18265 2011-06-06 Martin Rudalics <rudalics@gmx.at>
18266
18267 * lisp.h: Move EXFUNS for Fframe_root_window,
18268 Fframe_first_window and Fset_frame_selected_window to window.h.
18269
18270 * window.h: Move EXFUNS for Fframe_root_window,
18271 Fframe_first_window and Fset_frame_selected_window here from
18272 lisp.h.
18273
18274 * frame.c (Fwindow_frame, Fframe_first_window)
18275 (Fframe_root_window, Fframe_selected_window)
18276 (Fset_frame_selected_window): Move to window.c.
18277 (Factive_minibuffer_window): Move to minibuf.c.
18278 (Fother_visible_frames_p): New function.
18279
18280 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18281
18282 * window.c (decode_window, decode_any_window): Move up in code.
18283 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18284 (inhibit_frame_unsplittable): Remove unused variable.
18285 (Fwindow_buffer): Move up and rewrite doc-string.
18286 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18287 (Fwindow_prev): New functions.
18288 (Fwindow_frame): Move here from frame.c. Accept any window as
18289 argument.
18290 (Fframe_root_window, Fframe_first_window)
18291 (Fframe_selected_window): Move here from frame.c. Accept frame
18292 or arbitrary window as argument. Update doc-strings.
18293 (Fminibuffer_window): Move up in code.
18294 (Fwindow_minibuffer_p): Move up in code and simplify.
18295 (Fset_frame_selected_window): Move here from frame.c.
18296 Marginal rewrite.
18297 (Fselected_window, select_window, Fselect_window): Move up in
18298 code. Minor doc-string fixes.
18299
18300 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18301
18302 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18303 Do not assume that spare memory exists; that assumption is valid
18304 only if SYSTEM_MALLOC.
18305 (LARGE_REQUEST): New macro, so that the issue of large requests
18306 is separated from the issue of spare memory.
18307
18308 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18309
18310 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18311 format. (Bug#8806)
18312
18313 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18314
18315 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18316 before statements.
18317
18318 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18319
18320 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18321
18322 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18323
18324 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18325 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18326
18327 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
18328
18329 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18330
18331 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
18332
18333 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18334 (x_clipboard_manager_save): Add return value.
18335 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18336 New error handlers.
18337 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18338 Obey Vx_select_enable_clipboard_manager. Catch errors in
18339 x_clipboard_manager_save (Bug#8779).
18340 (Vx_select_enable_clipboard_manager): New variable.
18341 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
18342
18343 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
18344
18345 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18346
18347 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18348
18349 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18350 in the current matrix if keep_current_p is non-zero.
18351
18352 2011-06-04 Eli Zaretskii <eliz@gnu.org>
18353
18354 * bidi.c (bidi_level_of_next_char): Fix last change.
18355
18356 2011-06-03 Eli Zaretskii <eliz@gnu.org>
18357
18358 Support bidi reordering of text covered by display properties.
18359
18360 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18361 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18362 (bidi_cache_search, bidi_cache_iterator_state)
18363 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
18364 (bidi_level_of_next_char, bidi_move_to_visually_next):
18365 Support character positions inside a run of characters covered by a
18366 display string.
18367 (bidi_paragraph_init, bidi_resolve_explicit_1)
18368 (bidi_level_of_next_char): Call bidi_fetch_char and
18369 bidi_fetch_char_advance instead of FETCH_CHAR and
18370 FETCH_CHAR_ADVANCE.
18371 (bidi_init_it): Initialize new members.
18372 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18373 definitions.
18374 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18375 instead of using explicit *_CHAR codes.
18376 (bidi_resolve_explicit, bidi_resolve_weak):
18377 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
18378 bidirectional text is supported only in multibyte buffers.
18379 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18380 it to initialize the frame_window_p member of struct bidi_it.
18381 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18382 (bidi_resolve_explicit, bidi_resolve_weak)
18383 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18384 bidi_it->nchars is non-positive.
18385 (bidi_level_of_next_char): Don't try to lookup the cache for the
18386 next/previous character if nothing is cached there yet, or if we
18387 were just reseat()'ed to a new position.
18388
18389 * xdisp.c (set_cursor_from_row): Set start and stop points
18390 according to the row's direction when priming the loop that looks
18391 for the glyph on which to display cursor.
18392 (single_display_spec_intangible_p): Function deleted.
18393 (display_prop_intangible_p): Reimplement to call
18394 handle_display_spec instead of single_display_spec_intangible_p.
18395 Accept 3 additional arguments needed by handle_display_spec.
18396 This fixes incorrect cursor motion across display property with complex
18397 values: lists, `(when COND...)' forms, etc.
18398 (single_display_spec_string_p): Support property values that are
18399 lists with the argument STRING its top-level element.
18400 (display_prop_string_p): Fix the condition for processing a
18401 property that is a list to be consistent with handle_display_spec.
18402 (handle_display_spec): New function, refactored from the
18403 last portion of handle_display_prop.
18404 (compute_display_string_pos): Accept additional argument
18405 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18406 value of a `display' property is a "replacing spec".
18407 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18408 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18409 the display property, but just return a value indicating whether
18410 the display property will replace the characters it covers.
18411 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18412 frame_window_p members of struct bidi_it.
18413 (compute_display_string_pos, compute_display_string_end):
18414 New functions.
18415 (push_it): Accept second argument POSITION, where pop_it should
18416 jump to continue iteration.
18417 (reseat_1): Initialize bidi_it.disp_pos.
18418
18419 * keyboard.c (adjust_point_for_property): Adjust the call to
18420 display_prop_intangible_p to its new signature.
18421
18422 * dispextern.h (struct bidi_it): New member frame_window_p.
18423 (bidi_init_it): Update prototypes.
18424 (display_prop_intangible_p): Update prototype.
18425 (compute_display_string_pos, compute_display_string_end):
18426 Declare prototypes.
18427 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18428 EMACS_INT.
18429
18430 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
18431
18432 Malloc failure behavior now depends on size of allocation.
18433 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18434 * lisp.h: Change signatures accordingly.
18435 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18436 All callers changed. (Bug#8762)
18437
18438 * gnutls.c: Use Emacs's memory allocators.
18439 Without this change, the gnutls library would invoke malloc etc.
18440 directly, which causes problems on non-SYNC_INPUT hosts, and which
18441 runs afoul of improving memory_full behavior. (Bug#8761)
18442 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18443 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18444 xfree instead of the default malloc, realloc, free.
18445 (Fgnutls_boot): No need to check for memory allocation failure,
18446 since xmalloc does that for us.
18447
18448 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
18449 * category.c (hash_get_category_set):
18450 * ccl.c (ccl_driver):
18451 * charset.c (Fdefine_charset_internal):
18452 * charset.h (struct charset.hash_index):
18453 * composite.c (get_composition_id, gstring_lookup_cache)
18454 (composition_gstring_put_cache):
18455 * composite.h (struct composition.hash_index):
18456 * dispextern.h (struct image.hash):
18457 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18458 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18459 (hashfn_equal, hashfn_user_defined, make_hash_table)
18460 (maybe_resize_hash_table, hash_lookup, hash_put)
18461 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18462 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18463 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18464 * image.c (make_image, search_image_cache, lookup_image)
18465 (xpm_put_color_table_h):
18466 * lisp.h (struct Lisp_Hash_Table):
18467 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
18468 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
18469 for hashes and hash indexes, instead of 'unsigned' and 'int'.
18470 * alloc.c (allocate_vectorlike):
18471 Check for overflow in vector size calculations.
18472 * ccl.c (ccl_driver):
18473 Check for overflow when converting EMACS_INT to int.
18474 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18475 need to be updated by these changes.
18476 * fns.c (make_hash_table, maybe_resize_hash_table):
18477 Check for integer overflow with large hash tables.
18478 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18479 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18480 (SXHASH_REDUCE): New macro.
18481 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18482 Use it instead of discarding useful hash info with large hash values.
18483 (sxhash_float): New function.
18484 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18485 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
18486 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18487 Rewrite to use FIXNUM_BITS, as this simplifies things.
18488 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18489 Adjust signatures to match updated version of code.
18490 (consing_since_gc): Now EMACS_INT, since a single hash table can
18491 use more than INT_MAX bytes.
18492
18493 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18494
18495 Make it possible to build with GCC-4.6+ -O2 -flto.
18496
18497 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18498
18499 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18500
18501 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18502 Call minibuffer-inactive-mode.
18503
18504 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
18505
18506 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18507 Update dependencies.
18508
18509 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18510
18511 * data.c (init_data): Remove code for UTS, this system is not
18512 supported anymore.
18513
18514 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18515
18516 Don't force ./temacs to start in terminal mode.
18517
18518 * frame.c (make_initial_frame): Initialize faces in all cases, not
18519 only when CANNOT_DUMP is defined.
18520 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18521
18522 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18523
18524 * dispnew.c (add_window_display_history): Use const for the string
18525 pointer. Remove declaration, not needed.
18526
18527 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18528
18529 Use 'inline', not 'INLINE'.
18530 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
18531 * alloc.c, fontset.c (INLINE): Remove.
18532 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
18533 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
18534 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
18535 * gmalloc.c (register_heapinfo): Use inline unconditionally.
18536 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
18537
18538 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18539
18540 Make it possible to run ./temacs.
18541
18542 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
18543 syms_of_callproc does the same thing. Remove test for
18544 "initialized", do it in the caller.
18545 * emacs.c (main): Avoid calling set_initial_environment when dumping.
18546
18547 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18548
18549 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18550 (read_minibuf): Use get_minibuffer.
18551 (syms_of_minibuf): Use DEFSYM.
18552 (Qmetadata): New var.
18553 * data.c (Qbuffer): Don't make it static.
18554 (syms_of_data): Use DEFSYM.
18555
18556 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18557
18558 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18559 (CCL_CODE_MIN): New macro.
18560
18561 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18562
18563 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18564
18565 * eval.c (Qdebug): Now static.
18566 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18567 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18568 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18569
18570 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
18571
18572 * image.c: Various fixes to ImageMagick code comments.
18573 (Fimagemagick_types): Doc fix.
18574
18575 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18576
18577 Minor fixes prompted by GCC 4.6.0 warnings.
18578
18579 * xselect.c (converted_selections, conversion_fail_tag): Now static.
18580
18581 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
18582 (x_clipboard_manager_save_all): Move extern decl to ...
18583 * xterm.h: ... here, so that it can be checked for consistency.
18584
18585 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
18586
18587 * xselect.c (x_clipboard_manager_save_frame)
18588 (x_clipboard_manager_save_all): New functions.
18589 (Fx_clipboard_manager_save): Lisp function deleted.
18590
18591 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
18592 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
18593
18594 * xterm.h: Update prototype.
18595
18596 2011-05-28 William Xu <william.xwl@gmail.com>
18597
18598 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
18599 exiting (Bug#8239).
18600
18601 2011-05-28 Jim Meyering <meyering@redhat.com>
18602
18603 Avoid a sign-extension bug in crypto_hash_function.
18604 * fns.c (to_uchar): Define.
18605 (crypto_hash_function): Use it to convert some newly-signed
18606 variables to unsigned, to avoid sign-extension bugs. For example,
18607 without this change, (md5 "truc") would evaluate to
18608 45723a2aff78ff4fff7fff1114760e62 rather than the expected
18609 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
18610 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
18611
18612 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18613
18614 Integer overflow fixes.
18615
18616 * dbusbind.c: Serial number integer overflow fixes.
18617 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
18618 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
18619 to hold a serial number that is too large for a fixnum.
18620 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18621 Check for serial numbers out of range. Decode any serial number
18622 that was so large that it became a float. (Bug#8722)
18623
18624 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
18625 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18626 Use XFASTINT rather than XUINT when numbers are nonnegative.
18627 (xd_append_arg, Fdbus_method_return_internal):
18628 (Fdbus_method_error_internal): Likewise. Also, for unsigned
18629 arguments, check that Lisp number is nonnegative, rather than
18630 silently wrapping negative numbers around. (Bug#8722)
18631 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
18632 (Bug#8722)
18633
18634 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
18635
18636 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
18637
18638 ccl: Add integer overflow checks.
18639 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
18640 (IN_INT_RANGE): New macros.
18641 (ccl_driver): Use them to check for integer overflow when
18642 decoding a CCL program. Many of the new checks are whether XINT (x)
18643 fits in int; it doesn't always, on 64-bit hosts. The new version
18644 doesn't catch all possible integer overflows, but it's an
18645 improvement. (Bug#8719)
18646
18647 * alloc.c (make_event_array): Use XINT, not XUINT.
18648 There's no need for unsigned here.
18649
18650 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
18651 This follows up to the 2011-05-06 change that substituted uintptr_t
18652 for EMACS_INT. This case wasn't caught back then.
18653
18654 Rework Fformat to avoid integer overflow issues.
18655 * editfns.c: Include <float.h> unconditionally, as it's everywhere
18656 now (part of C89). Include <verify.h>.
18657 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
18658 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
18659 (Fformat): Avoid the prepass trying to compute sizes; it was only
18660 approximate and thus did not catch overflow reliably. Instead, walk
18661 through the format just once, formatting and computing sizes as we go,
18662 checking for integer overflow at every step, and allocating a larger
18663 buffer as needed. Keep track separately whether the format is
18664 multibyte. Keep only the most-recently calculated precision, rather
18665 than them all. Record whether each argument has been converted to
18666 string. Use EMACS_INT, not int, for byte and char and arg counts.
18667 Support field widths and precisions larger than INT_MAX. Avoid
18668 sprintf's undefined behavior with conversion specifications such as %#d
18669 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
18670 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
18671 formatting out-of-range floating point numbers with int
18672 formats. (Bug#8668)
18673
18674 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
18675
18676 * data.c: Avoid integer truncation in expressions involving floats.
18677 * data.c: Include <intprops.h>.
18678 (arith_driver): When there's an integer overflow in an expression
18679 involving floating point, convert the integers to floating point
18680 so that the resulting value does not suffer from catastrophic
18681 integer truncation. For example, on a 64-bit host (* 4
18682 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
18683 Do not rely on undefined behavior after integer overflow.
18684
18685 merge count_size_as_multibyte, parse_str_to_multibyte
18686 * character.c, character.h (count_size_as_multibyte):
18687 Rename from parse_str_to_multibyte; all uses changed.
18688 Check for integer overflow.
18689 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
18690 since it's now a duplicate of the other. This is more of
18691 a character than a buffer op, so better that it's in character.c.
18692 * fns.c, print.c: Adjust to above changes.
18693
18694 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
18695
18696 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
18697
18698 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18699
18700 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18701 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
18702 (x_clipboard_manager_save): Now static.
18703 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
18704
18705 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18706 (crypto_hash_function): Now static.
18707 Fix pointer signedness problems. Avoid unnecessary initializations.
18708
18709 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
18710
18711 * termhooks.h (Vselection_alist): Make it terminal-local.
18712
18713 * terminal.c (create_terminal): Initialize it.
18714
18715 * xselect.c: Support for clipboard managers.
18716 (Vselection_alist): Move to termhooks.h as terminal-local var.
18717 (LOCAL_SELECTION): New macro.
18718 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
18719 (symbol_to_x_atom): Remove gratuitous arg.
18720 (x_handle_selection_request, lisp_data_to_selection_data)
18721 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
18722 (x_own_selection, x_get_local_selection, x_convert_selection):
18723 New arg, specifying work frame. Use terminal-local Vselection_alist.
18724 (some_frame_on_display): Delete unused function.
18725 (Fx_own_selection_internal, Fx_get_selection_internal)
18726 (Fx_disown_selection_internal, Fx_selection_owner_p)
18727 (Fx_selection_exists_p): New optional frame arg.
18728 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
18729 (x_handle_selection_clear): Don't treat other terminals with the
18730 same keyboard specially. Use the terminal-local Vselection_alist.
18731 (x_clear_frame_selections): Use Frun_hook_with_args.
18732
18733 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
18734
18735 * xterm.h: Add support for those atoms.
18736
18737 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
18738
18739 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
18740 (converted_selections, conversion_fail_tag): New global variables.
18741 (x_selection_request_lisp_error): Free the above.
18742 (x_get_local_selection): Remove unnecessary code.
18743 (x_reply_selection_request): Args changed; handle arbitrary array
18744 of converted selections stored in converted_selections.
18745 Separate the XChangeProperty and SelectionNotify steps.
18746 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
18747 (x_convert_selection): New function.
18748 (x_handle_selection_event): Simplify.
18749 (x_get_foreign_selection): Don't ignore incoming requests while
18750 waiting for an answer; this will fail when we implement
18751 SAVE_TARGETS, and seems unnecessary anyway.
18752 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
18753 (Vx_sent_selection_functions): Doc fix.
18754
18755 2011-05-26 Leo Liu <sdl.web@gmail.com>
18756
18757 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
18758
18759 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18760
18761 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
18762
18763 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
18764 for fringe update if it has periodic bitmap.
18765 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
18766 and fringe_bitmap_periodic_p.
18767
18768 * fringe.c (get_fringe_bitmap_data): New function.
18769 (draw_fringe_bitmap_1, update_window_fringes): Use it.
18770 (update_window_fringes): Record periodicity of fringe bitmap in glyph
18771 row. Mark glyph row for fringe update if periodicity changed.
18772
18773 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
18774 for fringe update unless it has periodic bitmap.
18775
18776 2011-05-25 Kenichi Handa <handa@m17n.org>
18777
18778 * xdisp.c (get_next_display_element): Set correct it->face_id for
18779 a static composition.
18780
18781 2011-05-24 Leo Liu <sdl.web@gmail.com>
18782
18783 * deps.mk (fns.o):
18784 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
18785
18786 * fns.c (crypto_hash_function, Fsha1): New function.
18787 (Fmd5): Use crypto_hash_function.
18788 (syms_of_fns): Add Ssha1.
18789
18790 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18791
18792 * gnutls.c: Remove unused macros.
18793 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
18794 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
18795 Remove macros that are defined and never used.
18796 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
18797
18798 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
18799
18800 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
18801 (Fx_get_selection_internal): Minor cleanup.
18802 (Fx_own_selection_internal): Rename arguments for consistency with
18803 select.el.
18804
18805 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18806
18807 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
18808
18809 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
18810
18811 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
18812
18813 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18814
18815 * dispnew.c (scrolling_window): Don't exclude the case that the
18816 last enabled row in the desired matrix touches the bottom boundary.
18817
18818 2011-05-21 Glenn Morris <rgm@gnu.org>
18819
18820 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
18821 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
18822 and add some more files.
18823
18824 2011-05-20 Eli Zaretskii <eliz@gnu.org>
18825
18826 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
18827 report_file_error introduced by the change from 2011-05-07.
18828
18829 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
18830
18831 * systime.h (Time): Define only if emacs is defined.
18832 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
18833 where the include path doesn't have X11/X.h by default. See
18834 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
18835
18836 2011-05-20 Kenichi Handa <handa@m17n.org>
18837
18838 * composite.c (find_automatic_composition): Fix previous change.
18839
18840 2011-05-20 Glenn Morris <rgm@gnu.org>
18841
18842 * lisp.mk: New file, split from Makefile.in.
18843 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
18844 (shortlisp): Remove.
18845 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
18846
18847 2011-05-19 Glenn Morris <rgm@gnu.org>
18848
18849 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
18850 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
18851 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
18852 (lisp): Set the order to that of loadup.el.
18853 (shortlisp): Make it a copy of $lisp.
18854 (SOME_MACHINE_LISP): Remove.
18855 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
18856 Use just $shortlisp, not $SOME_MACHINE_LISP too.
18857
18858 2011-05-18 Kenichi Handa <handa@m17n.org>
18859
18860 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
18861 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
18862 (find_automatic_composition): Mostly rewrite for efficiency.
18863
18864 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
18865
18866 * makefile.w32-in: Update dependencies.
18867
18868 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
18869
18870 * menu.c: Include limits.h (fixes the MS-Windows build broken by
18871 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
18872
18873 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
18874
18875 Fix some integer overflow issues, such as string length overflow.
18876
18877 * insdel.c (count_size_as_multibyte): Check for string overflow.
18878
18879 * character.c (lisp_string_width): Check for string overflow.
18880 Use EMACS_INT, not int, for string indexes and lengths; in
18881 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
18882 the resulting string length overflows an EMACS_INT; instead,
18883 report a string overflow if no precision given. When checking for
18884 precision exhaustion, use a check that cannot possibly have
18885 integer overflow. (Bug#8675)
18886 * character.h (lisp_string_width): Adjust to new signature.
18887
18888 * alloc.c (string_overflow): New function.
18889 (Fmake_string): Use it. This doesn't change behavior, but saves
18890 a few bytes and will simplify future changes.
18891 * character.c (string_escape_byte8): Likewise.
18892 * lisp.h (string_overflow): New decl.
18893
18894 Fixups, following up to the user-interface timestamp change.
18895 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
18896 for UI timestamps, instead of unsigned long.
18897 * msdos.c (mouse_get_pos): Likewise.
18898 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
18899 * w32gui.h (Time): Define by including "systime.h" rather than by
18900 declaring it ourselves. (Bug#8664)
18901
18902 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
18903 * image.c (clear_image_cache): Likewise.
18904
18905 * term.c (term_mouse_position): Don't assume time_t wraparound.
18906
18907 Be more systematic about user-interface timestamps.
18908 Before, the code sometimes used 'Time', sometimes 'unsigned long',
18909 and sometimes 'EMACS_UINT', to represent these timestamps.
18910 This change causes it to use 'Time' uniformly, as that's what X uses.
18911 This makes the code easier to follow, and makes it easier to catch
18912 integer overflow bugs such as Bug#8664.
18913 * frame.c (Fmouse_position, Fmouse_pixel_position):
18914 Use Time, not unsigned long, for user-interface timestamps.
18915 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18916 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18917 * keyboard.h (last_event_timestamp): Likewise.
18918 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18919 * menu.h (xmenu_show): Likewise.
18920 * term.c (term_mouse_position): Likewise.
18921 * termhooks.h (struct input_event.timestamp): Likewise.
18922 (struct terminal.mouse_position_hook): Likewise.
18923 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18924 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18925 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18926 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18927 what it was before.
18928 * menu.h, termhooks.h: Include "systime.h", for Time.
18929
18930 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18931 Don't assume that the difference between two unsigned long values
18932 can fit into an integer. At this point, we know button_down_time
18933 <= event->timestamp, so the difference must be nonnegative, so
18934 there's no need to cast the result if double-click-time is
18935 nonnegative, as it should be; check that it's nonnegative, just in
18936 case. This bug is triggered when events are more than 2**31 ms
18937 apart (about 25 days). (Bug#8664)
18938
18939 * xselect.c (last_event_timestamp): Remove duplicate decl.
18940 (x_own_selection): Remove needless cast to unsigned long.
18941
18942 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
18943 that always fit in int. Use a sentinel instead of a counter, to
18944 avoid a temp and to allay GCC's concerns about possible int overflow.
18945 * frame.h (struct frame): Use int for menu_bar_items_used
18946 instead of EMACS_INT, since it always fits in int.
18947
18948 * menu.c (grow_menu_items): Check for int overflow.
18949
18950 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
18951
18952 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
18953 Before, the code was not consistent. These values cannot exceed
18954 2**31 - 1 so there's no need to make them unsigned.
18955 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
18956 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
18957 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
18958 as modifiers.
18959 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
18960
18961 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
18962 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
18963 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
18964 presumably because the widths might not match.
18965
18966 * window.c (size_window): Avoid needless test at loop start.
18967
18968 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
18969
18970 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
18971
18972 2011-05-12 Drew Adams <drew.adams@oracle.com>
18973
18974 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
18975
18976 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18977
18978 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
18979 `width' to `bar_area_x' and `bar_area_width', respectively.
18980 (x_scroll_run): Take account of fringe background extension.
18981
18982 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
18983 Rename local vars `left' and `width' to `bar_area_x' and
18984 `bar_area_width', respectively.
18985 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
18986 background extension.
18987
18988 2011-05-10 Jim Meyering <meyering@redhat.com>
18989
18990 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
18991
18992 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
18993
18994 * image.c (Finit_image_library): Return t for built-in image types,
18995 like pbm and xbm. (Bug#8640)
18996
18997 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
18998
18999 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19000
19001 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19002
19003 * w32console.c (Fset_screen_color): Doc fix.
19004 (Fget_screen_color): New function.
19005 (syms_of_ntterm): Defsubr it.
19006
19007 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19008 unlink the temporary file if Fcall_process didn't create it in the
19009 first place.
19010 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19011 child process will be redirected to a file specified with `:file'.
19012 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19013 cue to call_process_cleanup not to close that handle.
19014
19015 2011-05-07 Ben Key <bkey76@gmail.com>
19016
19017 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19018 one of two shell specific rules, either bootstrap-temacs-CMD or
19019 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19020 to the previous implementation of the bootstrap-temacs rule.
19021 The bootstrap-temacs-CMD rule is similar to the previous
19022 implementation of the bootstrap-temacs rule except that it
19023 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19024 variable.
19025
19026 These changes, along with some changes to nt/configure.bat,
19027 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19028 earlier fix to add support for --cflags and --ldflags options
19029 that include quotes so that it works whether make uses cmd or
19030 sh as the shell.
19031
19032 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19033
19034 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19035 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19036 is a constant.
19037 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19038 a string. Handle both cases.
19039 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19040 (Fdbus_register_method): Use Qinvalid_function.
19041
19042 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19043
19044 * makefile.w32-in: Update dependencies.
19045 (LISP_H): Add inttypes.h and stdin.h.
19046 (PROCESS_H): Add unistd.h.
19047
19048 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19049
19050 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19051 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19052
19053 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19054
19055 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19056
19057 * term.c (vfatal): Remove stray call to va_end.
19058 It's not needed and the C Standard doesn't allow it here anyway.
19059
19060 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19061 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19062
19063 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19064 bytes.
19065
19066 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19067
19068 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19069
19070 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19071
19072 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19073
19074 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19075
19076 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19077 * charset.c (Fdefine_charset_internal): Don't initialize
19078 charset.code_space[15]. The value was garbage, on hosts with
19079 32-bit int (Bug#8600).
19080
19081 * lread.c (read_integer): Be more consistent with string-to-number.
19082 Use string_to_number to do the actual conversion; this avoids
19083 rounding errors and fixes some other screwups. Without this fix,
19084 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19085 (digit_to_number): Move earlier, for benefit of read_integer.
19086 Return -1 if the digit is out of range for the base, -2 if it is
19087 not a digit in any supported base. (Bug#8602)
19088
19089 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19090
19091 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19092 to match comment at start of function. This also removes a
19093 GCC warning about overflow in a 32+64-bit port.
19094
19095 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19096
19097 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19098 Reported by Stefan Monnier in
19099 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
19100 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19101 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
19102
19103 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19104 (EMACS_UINTPTR): Likewise, with uintptr_t.
19105
19106 * lisp.h: Prefer 64-bit EMACS_INT if available.
19107 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19108 on 32-bit hosts that have 64-bit int, so that they can access
19109 large files.
19110 However, temporarily disable this change unless the temporary
19111 symbol WIDE_EMACS_INT is defined.
19112
19113 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19114
19115 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19116 This removes an assumption that EMACS_INT and long are the same
19117 width as pointers. The assumption is true for Emacs porting targets
19118 now, but we want to make other targets possible.
19119 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19120 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19121 In the rest of the code, change types of integers that hold casted
19122 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19123 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19124 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19125 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19126 No need to cast type when ORing.
19127 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19128 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19129 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19130 assume EMACS_INT is the same width as char *.
19131 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19132 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19133 Remove no-longer-needed casts.
19134 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19135 (xg_tool_bar_help_callback, xg_make_tool_item):
19136 Use EMACS_INTPTR to hold an integer
19137 that will be cast to void *; this can avoid a GCC warning
19138 if EMACS_INT is not the same width as void *.
19139 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19140 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19141 (current_message_1, set_message_1):
19142 Use a local to convert to proper width without a cast.
19143 * xmenu.c (dialog_selection_callback): Likewise.
19144
19145 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19146 Also, don't assume VALBITS / RAND_BITS is less than 5,
19147 and don't rely on undefined behavior when shifting a 1 left into
19148 the sign bit.
19149 * lisp.h (get_random): Change signature to match.
19150
19151 * lread.c (hash_string): Use size_t, not int, for hash computation.
19152 Normally we prefer signed values; but hashing is special, because
19153 it's better to use unsigned division on hash table sizes so that
19154 the remainder is nonnegative. Also, size_t is the natural width
19155 for hashing into memory. The previous code used 'int', which doesn't
19156 retain enough info to hash well into very large tables.
19157 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19158
19159 * dbusbind.c: Don't possibly lose pointer info when converting.
19160 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19161 Use XPNTR rather than XHASH, so that the high-order bits of
19162 the pointer aren't lost when converting through void *.
19163
19164 * eval.c (Fautoload): Don't double-shift a pointer.
19165
19166 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19167
19168 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19169
19170 * gnutls.c (DEF_GNUTLS_FN):
19171 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19172
19173 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19174
19175 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19176 marker. (Bug#8610)
19177
19178 2011-05-05 Eli Zaretskii <eliz@gnu.org>
19179
19180 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19181 New version that can reserve upto 2GB of heap space.
19182
19183 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
19184
19185 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19186
19187 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19188
19189 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19190 `gnutls_certificate_set_x509_key_file'.
19191
19192 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
19193
19194 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19195 Update dependencies.
19196
19197 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19198
19199 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19200 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19201 Remove unused parameter `fildes'.
19202 * process.c (read_process_output, send_process): Don't pass it.
19203
19204 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19205
19206 Fix previous change: the library cache is defined in w32.c.
19207 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19208 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19209
19210 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
19211
19212 Implement dynamic loading of GnuTLS on Windows.
19213
19214 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19215 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19216 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19217 Declare.
19218
19219 * gnutls.c (Qgnutls_dll): Define.
19220 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19221 (gnutls_*): Declare function pointers.
19222 (init_gnutls_functions): New function to initialize function pointers.
19223 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19224 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19225 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19226 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19227 (emacs_gnutls_write, emacs_gnutls_read)
19228 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19229 (Fgnutls_available_p): New function.
19230 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19231 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19232 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19233
19234 * image.c: Include w32.h.
19235 (Vimage_type_cache): Delete.
19236 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19237 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19238 (w32_delayed_load): Move to w32.c.
19239
19240 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19241
19242 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19243 (w32_delayed_load): Move from image.c. When loading a library, record
19244 its filename in the :loaded-from property of the library id.
19245 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19246 Initialize and staticpro them.
19247 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19248
19249 * process.c: Include lisp.h before w32.h, not after.
19250 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19251 instead of gnutls_record_check_pending.
19252
19253 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19254
19255 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19256
19257 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19258 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19259 as passed in.
19260
19261 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19262
19263 * xterm.c (x_set_frame_alpha): Do not set property on anything
19264 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19265
19266 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19267
19268 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19269
19270 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
19271
19272 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19273 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19274 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19275 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19276 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19277 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19278 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19279 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19280 (Qgnutls_bootprop_callbacks_verify): Make static.
19281
19282 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19283
19284 * callproc.c: Indentation fixup.
19285
19286 * sysdep.c (wait_for_termination_1): Make static.
19287 (wait_for_termination, interruptible_wait_for_termination):
19288 Move after wait_for_termination_1.
19289
19290 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19291
19292 * sysdep.c (interruptible_wait_for_termination): New function
19293 which is like wait_for_termination, but allows keyboard
19294 interruptions.
19295
19296 * callproc.c (Fcall_process): Add (:file "file") as an option for
19297 the STDOUT buffer.
19298 (Fcall_process_region): Ditto.
19299
19300 2011-04-30 Eli Zaretskii <eliz@gnu.org>
19301
19302 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19303 rather than `XVECTOR (FOO)->size'.
19304
19305 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19306 inttypes.h, as a gnulib replacement is used if it not available in
19307 system headers.
19308
19309 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19310
19311 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19312 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19313 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19314
19315 * coding.c (coding_alloc_by_realloc): Error out if destination
19316 will grow beyond MOST_POSITIVE_FIXNUM.
19317 (decode_coding_emacs_mule): Abort if there isn't enough place in
19318 charbuf for the composition carryover bytes. Reserve an extra
19319 space for up to 2 characters produced in a loop.
19320 (decode_coding_iso_2022): Abort if there isn't enough place in
19321 charbuf for the composition carryover bytes.
19322
19323 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19324
19325 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19326 aborting when %lld or %lll format is passed.
19327 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19328 %llo or %llx format is passed. (Bug#8545)
19329
19330 * window.c (window_scroll_line_based): Use a marker instead of
19331 simple variables to record original value of point. (Bug#7952)
19332
19333 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19334 produced by %s or %c overflows available buffer space. (Bug#8545)
19335
19336 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19337
19338 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
19339 (SIZE_MAX): Move defn after all includes, as they might #define it.
19340
19341 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19342
19343 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19344
19345 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19346
19347 * keyboard.c (Qdelayed_warnings_hook): Define.
19348 (command_loop_1): Run `delayed-warnings-hook'
19349 if Vdelayed_warnings_list is non-nil.
19350 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19351 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19352
19353 2011-04-28 Eli Zaretskii <eliz@gnu.org>
19354
19355 * doprnt.c (doprnt): Don't return value smaller than the buffer
19356 size if the message was truncated. (Bug#8545).
19357
19358 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19359
19360 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19361 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19362
19363 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19364
19365 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19366
19367 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
19368
19369 * makefile.w32-in: Update dependencies.
19370
19371 2011-04-27 Eli Zaretskii <eliz@gnu.org>
19372
19373 Improve `doprnt' and its usage. (Bug#8545)
19374 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19375 `format_end'. Remove support for %l as a conversion specifier.
19376 Don't use xrealloc. Improve diagnostics when the %l size modifier
19377 is used. Update the commentary.
19378
19379 * eval.c (verror): Simplify calculation of size_t.
19380
19381 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19382 messages.
19383
19384 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19385
19386 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19387 change.
19388
19389 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19390
19391 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19392 This makes this file independent of the recent pseudovector change.
19393
19394 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
19395
19396 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19397
19398 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
19399 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
19400 Remove unused local.
19401 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
19402
19403 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
19404 GCC 4.6.0 optimizes based on type-based alias analysis.
19405 For example, if b is of type struct buffer * and v of type struct
19406 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19407 != &v->size, and therefore "v->size = 1; b->size = 2; return
19408 v->size;" must therefore return 1. This assumption is incorrect
19409 for Emacs, since it type-puns struct Lisp_Vector * with many other
19410 types. To fix this problem, this patch adds a new type struct
19411 vectorlike_header that documents the constraints on layout of vectors
19412 and pseudovectors, and helps optimizing compilers not get fooled
19413 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19414 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
19415 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19416 the size member.
19417 (XSETPVECTYPE): Rewrite in terms of new macro.
19418 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19419 This is a bit clearer, and further avoids the possibility of
19420 undesirable aliasing.
19421 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
19422 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
19423 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19424 since Lisp_Subr is a special case (no "next" field).
19425 (ASIZE): Now uses header.size rather than size.
19426 All previous uses of XVECTOR (foo)->size replaced to use this macro,
19427 to avoid the hassle of writing XVECTOR (foo)->header.size.
19428 (struct vectorlike_header): New type.
19429 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19430 object, to help avoid aliasing.
19431 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19432 (SUBRP): Likewise, since Lisp_Subr is a special case.
19433 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19434 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19435 (struct Lisp_Hash_Table): Combine first two members into a single
19436 struct vectorlike_header member. All uses of "size" and "next" members
19437 changed to be "header.size" and "header.next".
19438 * buffer.h (struct buffer): Likewise.
19439 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19440 * frame.h (struct frame): Likewise.
19441 * process.h (struct Lisp_Process): Likewise.
19442 * termhooks.h (struct terminal): Likewise.
19443 * window.c (struct save_window_data, struct saved_window): Likewise.
19444 * window.h (struct window): Likewise.
19445 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19446 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19447 * buffer.c (init_buffer_once): Likewise.
19448 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19449 special case.
19450 * process.c (Fformat_network_address): Use local var for size,
19451 for brevity.
19452
19453 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19454
19455 Make the Lisp reader and string-to-float more consistent (Bug#8525)
19456 * data.c (atof): Remove decl; no longer used or needed.
19457 (digit_to_number): Move to lread.c.
19458 (Fstring_to_number): Use new string_to_number function, to be
19459 consistent with how the Lisp reader treats infinities and NaNs.
19460 Do not assume that floating-point numbers represent EMACS_INT
19461 without losing information; this is not true on most 64-bit hosts.
19462 Avoid double-rounding errors, by insisting on integers when
19463 parsing non-base-10 numbers, as the documentation specifies.
19464 * lisp.h (string_to_number): New decl, replacing ...
19465 (isfloat_string): Remove.
19466 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
19467 (read1): Do not accept +. and -. as integers; this
19468 appears to have been a coding error. Similarly, do not accept
19469 strings like +-1e0 as floating point numbers. Do not report
19470 overflow for integer overflows unless the base is not 10 which
19471 means we have no simple and reliable way to continue.
19472 Break out the floating-point parsing into a new
19473 function string_to_number, so that Fstring_to_number parses
19474 floating point numbers consistently with the Lisp reader.
19475 (digit_to_number): Move here from data.c. Make it static inline.
19476 (E_CHAR, EXP_INT): Remove, replacing with ...
19477 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19478 (string_to_number): New function, replacing isfloat_string.
19479 This function checks for valid syntax and produces the resulting
19480 Lisp float number too. Rework it so that string-to-number
19481 no longer mishandles examples like "1.0e+". Use strtoumax,
19482 so that overflow for non-base-10 numbers is reported only when
19483 there's no portable and simple way to convert to floating point.
19484
19485 * textprop.c (set_text_properties_1): Rewrite for clarity,
19486 and to avoid GCC warning about integer overflow.
19487
19488 * intervals.h (struct interval): Use EMACS_INT for members
19489 where EMACS_UINT might cause problems. See
19490 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19491 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19492 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19493 All uses changed.
19494 (offset_intervals): Tell GCC not to worry about length overflow
19495 when negating a negative length.
19496
19497 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19498 (overrun_check_free): Likewise.
19499
19500 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19501 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19502 word size.
19503
19504 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19505 (gnutls_make_error): Rename local to avoid shadowing.
19506 (gnutls_emacs_global_deinit): ifdef out; not used.
19507 (Fgnutls_boot): Use const for pointer to readonly storage.
19508 Comment out unused local. Fix pointer signedness problems.
19509
19510 * lread.c (openp): Don't stuff size_t into an 'int'.
19511 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19512 about possible signed overflow.
19513
19514 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19515 (GDK_KEY_g): Don't define if already defined.
19516 (xg_prepare_tooltip): Avoid pointer signedness problem.
19517 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19518
19519 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19520 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19521
19522 * xfns.c (Fx_window_property): Simplify a bit,
19523 to make a bit faster and to avoid GCC 4.6.0 warning.
19524 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19525
19526 * fns.c (internal_equal): Don't assume size_t fits in int.
19527
19528 * alloc.c (compact_small_strings): Tighten assertion a little.
19529
19530 Replace pEd with more-general pI, and fix some printf arg casts.
19531 * lisp.h (pI): New macro, generalizing old pEd macro to other
19532 conversion specifiers. For example, use "...%"pI"d..." rather
19533 than "...%"pEd"...".
19534 (pEd): Remove. All uses replaced with similar uses of pI.
19535 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
19536 * alloc.c (check_pure_size): Don't overflow by converting size to int.
19537 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
19538 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
19539 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
19540 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
19541 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
19542 64-bit hosts.
19543 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
19544 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
19545 * print.c (safe_debug_print, print_object): Likewise.
19546 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
19547 to int.
19548 Use pI instead of if-then-else-abort. Use %p to avoid casts,
19549 avoiding the 0 flag, which is not portable.
19550 * process.c (Fmake_network_process): Use pI to avoid cast.
19551 * region-cache.c (pp_cache): Likewise.
19552 * xdisp.c (decode_mode_spec): Likewise.
19553 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19554 behavior on 64-bit hosts with printf arg.
19555 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
19556 (x_stop_queuing_selection_requests): Likewise.
19557 (x_get_window_property): Don't truncate byte count to an 'int'
19558 when tracing.
19559
19560 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19561 here, since it parses constructs like leading '-' and spaces,
19562 which are not wanted; and it overflows with large numbers.
19563 Instead, simply match F[0-9]+, which is what is wanted anyway.
19564
19565 * alloc.c: Remove unportable assumptions about struct layout.
19566 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19567 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19568 (allocate_vectorlike, make_pure_vector): Use the new macros,
19569 plus offsetof, to remove unportable assumptions about struct layout.
19570 These assumptions hold on all porting targets that I know of, but
19571 they are not guaranteed, they're easy to remove, and removing them
19572 makes further changes easier.
19573
19574 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19575 This doesn't fix a bug but makes the code clearer.
19576 (string_overrun_cookie): Now const. Use initializers that
19577 don't formally overflow signed char, to avoid warnings.
19578 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19579 can cause Emacs to crash when string overrun checking is enabled.
19580 (allocate_buffer): Don't assume sizeof (struct buffer) is a
19581 multiple of sizeof (EMACS_INT); it need not be, if
19582 alignof(EMACS_INT) < sizeof (EMACS_INT).
19583 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
19584
19585 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
19586
19587 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
19588
19589 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
19590
19591 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
19592 supposed to be handshaking. (Bug#8556)
19593 Reported by Paul Eggert <eggert@cs.ucla.edu>.
19594
19595 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
19596
19597 * lisp.h (Qdebug): List symbol.
19598 * eval.c (Qdebug): Restore global linkage.
19599 * keyboard.c (debug-on-event): New variable.
19600 (handle_user_signal): Break into debugger when debug-on-event
19601 matches the current signal symbol.
19602
19603 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
19604
19605 * alloc.c (check_sblock, check_string_bytes)
19606 (check_string_free_list): Convert to standard C.
19607
19608 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
19609
19610 * w32.c (emacs_gnutls_push): Fix typo.
19611
19612 2011-04-25 Eli Zaretskii <eliz@gnu.org>
19613
19614 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
19615 "cast to pointer from integer of different size".
19616
19617 Improve doprnt and its use in verror. (Bug#8545)
19618 * doprnt.c (doprnt): Document the set of format control sequences
19619 supported by the function. Use SAFE_ALLOCA instead of always
19620 using `alloca'.
19621
19622 * eval.c (verror): Don't limit the buffer size at size_max-1, that
19623 is one byte too soon. Don't use xrealloc; instead xfree and
19624 xmalloc anew.
19625
19626 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
19627
19628 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
19629 callbacks stage.
19630
19631 * gnutls.c: Renamed global_initialized to
19632 gnutls_global_initialized. Added internals for the
19633 :verify-hostname-error, :verify-error, and :verify-flags
19634 parameters of `gnutls-boot' and documented those parameters in the
19635 docstring. Start callback support.
19636 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
19637 unless a fatal error occurred. Call gnutls_alert_send_appropriate
19638 on error. Return error code.
19639 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
19640 (emacs_gnutls_read): Likewise.
19641 (Fgnutls_boot): Return handshake error code.
19642 (emacs_gnutls_handle_error): New function.
19643 (wsaerror_to_errno): Likewise.
19644
19645 * w32.h (emacs_gnutls_pull): Add prototype.
19646 (emacs_gnutls_push): Likewise.
19647
19648 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
19649 (emacs_gnutls_push): Likewise.
19650
19651 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
19652
19653 * process.c (wait_reading_process_output): Check if GnuTLS
19654 buffered some data internally if no FDs are set for TLS
19655 connections.
19656
19657 * makefile.w32-in (OBJ2): Add gnutls.$(O).
19658 (LIBS): Link to USER_LIBS.
19659 ($(BLD)/gnutls.$(0)): New target.
19660
19661 2011-04-24 Eli Zaretskii <eliz@gnu.org>
19662
19663 * xdisp.c (handle_single_display_spec): Rename the
19664 display_replaced_before_p argument into display_replaced_p, to
19665 make it consistent with the commentary. Fix typos in the
19666 commentary.
19667
19668 * textprop.c (syms_of_textprop): Remove dead code.
19669 (copy_text_properties): Delete obsolete commentary about an
19670 interface that was deleted long ago. Fix typos in the description
19671 of arguments.
19672
19673 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
19674 to changes in oldXMenu/XMenu.h from 2011-04-16.
19675 <menu_help_message, prev_menu_help_message>: Constify.
19676 (IT_menu_make_room): menu->help_text is now `const char **';
19677 adjust.
19678
19679 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
19680 to changes in oldXMenu/XMenu.h from 2011-04-16.
19681 (struct XMenu): Declare `help_text' `const char **'.
19682
19683 * xfaces.c <Qunspecified>: Make extern again.
19684
19685 * syntax.c: Include sys/types.h before including regex.h, as
19686 required by POSIX.
19687
19688 * doc.c (get_doc_string): Improve the format passed to `error'.
19689
19690 * doprnt.c (doprnt): Improve commentary.
19691
19692 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
19693
19694 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
19695 them with etags.
19696
19697 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
19698 changes in globals.h immediately force recompilation.
19699 (TAGS): Depend on $(CURDIR)/m/intel386.h and
19700 $(CURDIR)/s/ms-w32.h.
19701 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
19702
19703 * character.c (Fchar_direction): Function deleted.
19704 (syms_of_character): Don't defsubr it.
19705 <char-direction-table>: Deleted.
19706
19707 2011-04-23 Eli Zaretskii <eliz@gnu.org>
19708
19709 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
19710 * doprnt.c: Include limits.h.
19711 (SIZE_MAX): New macro.
19712 (doprnt): Return a size_t value. 2nd arg is now size_t.
19713 Many local variables are now size_t instead of int or unsigned.
19714 Improve overflow protection. Support `l' modifier for integer
19715 conversions. Support %l conversion. Don't assume an EMACS_INT
19716 argument for integer conversions and for %c.
19717
19718 * lisp.h (doprnt): Restore prototype.
19719
19720 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
19721 $(SRC)/character.h.
19722
19723 * Makefile.in (base_obj): Add back doprnt.o.
19724
19725 * deps.mk (doprnt.o): Add back prerequisites.
19726 (callint.o): Depend on character.h.
19727
19728 * eval.c (internal_lisp_condition_case): Include the handler
19729 representation in the error message.
19730 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
19731 when breaking from the loop.
19732
19733 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
19734
19735 * callint.c (Fcall_interactively): When displaying error message
19736 about invalid control letter, pass the character's codepoint, not
19737 a pointer to its multibyte form. Improve display of the character
19738 in octal and display also its hex code.
19739
19740 * character.c (char_string): Use %x to display the (unsigned)
19741 codepoint of an invalid character, to avoid displaying a bogus
19742 negative value.
19743
19744 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
19745 `error', not SYMBOL_NAME itself.
19746
19747 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
19748 character arguments to `error'.
19749
19750 * charset.c (check_iso_charset_parameter): Fix incorrect argument
19751 to `error' in error message about FINAL_CHAR argument. Make sure
19752 FINAL_CHAR is a character, and use %c when it is passed as
19753 argument to `error'.
19754
19755 2011-04-23 Eli Zaretskii <eliz@gnu.org>
19756
19757 * s/ms-w32.h (localtime): Redirect to sys_localtime.
19758
19759 * w32.c: Include <time.h>.
19760 (sys_localtime): New function.
19761
19762 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
19763
19764 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
19765
19766 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
19767
19768 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
19769
19770 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
19771 zombies (Bug#8467).
19772
19773 2011-04-19 Eli Zaretskii <eliz@gnu.org>
19774
19775 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
19776 gl_state.e_property when gl_state.object is Qt.
19777
19778 * insdel.c (make_gap_larger): Remove limitation of buffer size
19779 to <= INT_MAX.
19780
19781 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
19782
19783 * xdisp.c (lookup_glyphless_char_display)
19784 (produce_glyphless_glyph): Handle cons cell entry in
19785 glyphless-char-display.
19786 (Vglyphless_char_display): Document it.
19787
19788 * term.c (produce_glyphless_glyph): Handle cons cell entry in
19789 glyphless-char-display.
19790
19791 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
19792
19793 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
19794
19795 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
19796
19797 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
19798 definition for no-X builds.
19799
19800 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
19801
19802 Static checks with GCC 4.6.0 and non-default toolkits.
19803
19804 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
19805
19806 * process.c (keyboard_bit_set): Define only if SIGIO.
19807 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
19808 (send_process): Repair possible setjmp clobbering.
19809
19810 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
19811
19812 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
19813
19814 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
19815
19816 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
19817 Define only if needed.
19818
19819 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
19820 by pacifying GCC about it. Maybe it's time to retire it?
19821 * xfaces.c (USG, __TIMEVAL__): Likewise.
19822
19823 * dispextern.h (struct redisplay_interface): Rename param
19824 to avoid shadowing.
19825 * termhooks.h (struct terminal): Likewise.
19826 * xterm.c (xembed_send_message): Likewise.
19827
19828 * insdel.c (make_gap_smaller): Define only if
19829 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
19830
19831 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
19832 it.
19833
19834 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
19835 so that we aren't warned about unused symbols.
19836
19837 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
19838
19839 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
19840
19841 * xfns.c (x_real_positions): Mark locals as initialized.
19842
19843 * xmenu.c (xmenu_show): Don't use uninitialized vars.
19844
19845 * xterm.c: Fix problems found by static analysis with other toolkits.
19846 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
19847 (x_dispatch_event): Declare static if USE_GTK, and
19848 define if USE_GTK || USE_X_TOOLKIT.
19849 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
19850 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
19851 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
19852 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
19853
19854 * xmenu.c (menu_help_callback): Pointer type fixes.
19855 Use const pointers when pointing at readonly data. Avoid pointer
19856 signedness clashes.
19857 (FALSE): Remove unused macro.
19858 (update_frame_menubar): Remove unused decl.
19859
19860 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
19861
19862 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19863 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
19864 (single_menu_item): Rename local to avoid shadowing.
19865
19866 * keyboard.c (make_lispy_event): Remove unused local var.
19867
19868 * frame.c, frame.h (x_get_resource_string): Bring this back, but
19869 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
19870
19871 * bitmaps: Change bitmaps from unsigned char back to the X11
19872 compatible char. Avoid the old compiler warnings about
19873 out-of-range initializers by using, for example, '\xab' rather
19874 than 0xab.
19875
19876 * xgselect.c (xgselect_initialize): Check vs interface
19877 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
19878
19879 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
19880
19881 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
19882 to read-only memory.
19883
19884 * fns.c (vector): Remove; this old hack is no longer needed.
19885
19886 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
19887 Remove unused var.
19888 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
19889
19890 * xrdb.c (x_load_resources): Omit unused local.
19891
19892 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
19893 (x_window): Rename locals to avoid shadowing.
19894 (USG): Use the kludged USG macro, to pacify gcc.
19895
19896 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
19897 (x_term_init): Remove local to avoid shadowing.
19898
19899 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
19900
19901 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
19902 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
19903
19904 2011-04-16 Eli Zaretskii <eliz@gnu.org>
19905
19906 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
19907
19908 Fix regex.c, syntax.c and friends for buffers > 2GB.
19909 * syntax.h (struct gl_state_s): Declare character position members
19910 EMACS_INT.
19911
19912 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19913
19914 * textprop.c (verify_interval_modification, interval_of):
19915 Declare arguments EMACS_INT.
19916
19917 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19918 EMACS_INT.
19919
19920 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19921
19922 * indent.c (Fvertical_motion): Local variable it_start is now
19923 EMACS_INT.
19924
19925 * regex.c (re_match, re_match_2, re_match_2_internal)
19926 (bcmp_translate, regcomp, regexec, print_double_string)
19927 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19928 (re_compile_pattern, re_exec): Declare arguments and local
19929 variables `size_t' and `ssize_t' and return values `regoff_t', as
19930 appropriate.
19931 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
19932 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
19933 <compile_stack_type>: `size' and `avail' are now `size_t'.
19934
19935 * regex.h <regoff_t>: Use ssize_t, not int.
19936 (re_search, re_search_2, re_match, re_match_2): Arguments that
19937 specify buffer/string position and length are now ssize_t and
19938 size_t. Return type is regoff_t.
19939
19940 2011-04-16 Ben Key <bkey76@gmail.com>
19941
19942 * nsfont.m: Fixed bugs in ns_get_family and
19943 ns_descriptor_to_entity that were caused by using free to
19944 deallocate memory blocks that were allocated by xmalloc (via
19945 xstrdup). This caused Emacs to crash when compiled with
19946 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
19947 --enable-checking=xmallocoverrun). xfree is now used to
19948 deallocate these memory blocks.
19949
19950 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
19951
19952 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
19953
19954 emacs_write: Accept and return EMACS_INT for sizes.
19955 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
19956 et seq.
19957 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
19958 Accept and return EMACS_INT.
19959 (emacs_gnutls_write): Return the number of bytes written on
19960 partial writes.
19961 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
19962 (emacs_read, emacs_write): Remove check for negative size, as the
19963 Emacs source code has been audited now.
19964 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
19965 (emacs_read, emacs_write): Use it.
19966 * process.c (send_process): Adjust to the new signatures of
19967 emacs_write and emacs_gnutls_write. Do not attempt to store
19968 a byte offset into an 'int'; it might overflow.
19969 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
19970
19971 * sound.c: Don't assume sizes fit in 'int'.
19972 (struct sound_device.period_size, alsa_period_size):
19973 Return EMACS_INT, not int.
19974 (struct sound_device.write, vox_write, alsa_write):
19975 Accept EMACS_INT, not int.
19976 (wav_play, au_play): Use EMACS_INT to store sizes and to
19977 record read return values.
19978
19979 2011-04-15 Ben Key <bkey76@gmail.com>
19980
19981 * keyboard.c (Qundefined): Don't declare static since it is used
19982 in nsfns.m.
19983 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
19984 static since they are used in nsfont.m.
19985
19986 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
19987
19988 * process.c (Qprocessp): Don't declare static.
19989 * lisp.h (Qprocessp): Declare again.
19990
19991 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
19992
19993 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
19994
19995 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
19996
19997 Improve C-level modularity by making more things 'static'.
19998
19999 Don't publish debugger-only interfaces to other modules.
20000 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20001 (verify_bytepos, count_markers): Move decls to the only modules
20002 that need them.
20003 * region-cache.h (pp_cache): Likewise.
20004 * window.h (check_all_windows): Likewise.
20005 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20006
20007 * sysdep.c (croak): Now static, if
20008 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20009 * syssignal.h (croak): Declare only if not static.
20010
20011 * alloc.c (refill_memory_reserve): Now static if
20012 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20013 * lisp.h (refill_memory_reserve): Declare only if not static.
20014
20015 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20016 Define only if USE_LUCID.
20017
20018 * xrdb.c (x_customization_string, x_rm_string): Now static.
20019
20020 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20021 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20022
20023 * xdisp.c (draw_row_with_mouse_face): Now static.
20024 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20025
20026 * window.h (check_all_windows): Mark externally visible.
20027
20028 * window.c (window_deletion_count): Now static.
20029
20030 * undo.c: Make symbols static if they're not exported.
20031 (last_undo_buffer, last_boundary_position, pending_boundary):
20032 Now static.
20033
20034 * textprop.c (interval_insert_behind_hooks): Now static.
20035 (interval_insert_in_front_hooks): Likewise.
20036
20037 * term.c: Make symbols static if they're not exported.
20038 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20039 (max_frame_lines, tty_set_terminal_modes):
20040 (tty_reset_terminal_modes, tty_turn_off_highlight):
20041 (get_tty_terminal): Now static.
20042 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20043 * termhooks.h (term_mouse_moveto): Do not declare if
20044 HAVE_WINDOW_SYSTEM.
20045 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20046 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20047
20048 * sysdep.c: Make symbols static if they're not exported.
20049 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20050 Now static.
20051 (sigprocmask_set, full_mask): Remove; unused.
20052 (wait_debugging): Mark as visible.
20053 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20054 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20055
20056 * syntax.c (syntax_temp): Define only if !__GNUC__.
20057
20058 * sound.c (current_sound_device, current_sound): Now static.
20059
20060 * search.c (searchbufs, searchbuf_head): Now static.
20061
20062 * scroll.c (scroll_cost): Remove; unused.
20063 * dispextern.h (scroll_cost): Remove decl.
20064
20065 * region-cache.h (pp_cache): Mark as externally visible.
20066
20067 * process.c: Make symbols static if they're not exported.
20068 (process_tick, update_tick, create_process, chan_process):
20069 (Vprocess_alist, proc_buffered_char, datagram_access):
20070 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20071 (deactivate_process): Mark defn as static, as well as decl.
20072 * lisp.h (create_process): Remove decl.
20073 * process.h (chan_process, Vprocess_alist): Remove decls.
20074
20075 * print.c: Make symbols static if they're not exported.
20076 (print_depth, new_backquote_output, being_printed, print_buffer):
20077 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20078 (print_interval, print_number_index, initial_stderr_stream):
20079 Now static.
20080 * lisp.h (Fprinc): Remove decl.
20081 (debug_output_compilation_hack): Mark as externally visible.
20082
20083 * sysdep.c (croak): Move decl from here to syssignal.h.
20084 * syssignal.h (croak): Put it here, so the API can be checked when
20085 'croak' is called from dissociate_if_controlling_tty.
20086
20087 * minibuf.c: Make symbols static if they're not exported.
20088 (minibuf_save_list, choose_minibuf_frame): Now static.
20089 * lisp.h (choose_minibuf_frame): Remove decl.
20090
20091 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20092
20093 * lread.c: Make symbols static if they're not exported.
20094 (read_objects, initial_obarray, oblookup_last_bucket_number):
20095 Now static.
20096 (make_symbol): Remove; unused.
20097 * lisp.h (initial_obarray, make_symbol): Remove decls.
20098
20099 * keyboard.c: Make symbols static if they're not exported.
20100 (single_kboard, recent_keys_index, total_keys, recent_keys):
20101 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20102 (this_single_command_key_start, echoing, last_auto_save):
20103 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20104 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20105 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20106 (Vlispy_mouse_stem, double_click_count):
20107 Now static.
20108 (force_auto_save_soon): Define only if SIGDANGER.
20109 (ignore_mouse_drag_p): Now static if
20110 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20111 (print_help): Remove; unused.
20112 (stop_character, last_timer_event): Mark as externally visible.
20113 * keyboard.h (ignore_mouse_drag_p): Declare only if
20114 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20115 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20116 * lisp.h (echoing): Remove decl.
20117 (force_auto_save_soon): Declare only if SIGDANGER.
20118 * xdisp.c (redisplay_window): Simplify code, to make it more
20119 obvious that ignore_mouse_drag_p is not accessed if !defined
20120 USE_GTK && !defined HAVE_NS.
20121
20122 * intervals.c: Make symbols static if they're not exported.
20123 (merge_properties_sticky, merge_interval_right, delete_interval):
20124 Now static.
20125 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20126
20127 * insdel.c: Make symbols static if they're not exported.
20128 However, leave prepare_to_modify_buffer alone. It's never
20129 called from outside this function, but that appears to be a bug.
20130 (combine_after_change_list, combine_after_change_buffer):
20131 (adjust_after_replace, signal_before_change): Now static.
20132 (adjust_after_replace_noundo): Remove; unused.
20133 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
20134 (signal_before_change): Remove decls.
20135
20136 * indent.c (val_compute_motion, val_vmotion): Now static.
20137
20138 * image.c: Make symbols static if they're not exported.
20139 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20140 if USE_GTK.
20141 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20142 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20143
20144 * fringe.c (standard_bitmaps): Now static.
20145 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20146
20147 * frame.c: Make symbols static if they're not exported.
20148 (x_report_frame_params, make_terminal_frame): Now static.
20149 (get_frame_param): Now static, unless HAVE_NS.
20150 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20151 (x_get_resource_string): Remove; not used.
20152 * frame.h (make_terminal_frame, x_report_frame_params):
20153 (x_get_resource_string); Remove decls.
20154 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20155 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20156
20157 * font.c, fontset.c: Make symbols static if they're not exported.
20158 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20159 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20160 * font.c (font_close_object): Now static.
20161 * font.h (font_close_object): Remove.
20162 * fontset.c (FONTSET_OBJLIST): Remove.
20163 (free_realized_fontset) #if-0 the body, which does nothing.
20164 (face_suitable_for_char_p): #if-0, as it's never called.
20165 * fontset.h (face_suitable_for_char_p): Remove decl.
20166 * xfaces.c (face_at_string_position):
20167 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
20168 since 0 is always ASCII.
20169
20170 * fns.c (weak_hash_tables): Now static.
20171
20172 * fileio.c: Make symbols static if they're not exported.
20173 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20174 (Vwrite_region_annotation_buffers): Now static.
20175
20176 * eval.c: Make symbols static if they're not exported.
20177 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20178 * lisp.h (backtrace_list): Remove decl.
20179
20180 * emacs.c: Make symbols static if they're not exported.
20181 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20182 (fatal_error_code, fatal_error_signal_hook, standard_args):
20183 Now static.
20184 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20185 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20186 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20187 * lisp.h (fatal_error_signal_hook): Remove decl.
20188 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20189
20190 * editfns.c: Move a (normally-unused) function to its only use.
20191 * editfns.c, lisp.h (get_operating_system_release): Remove.
20192 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20193 worth the hassle of breaking this out.
20194
20195 * xterm.c: Make symbols static if they're not exported.
20196 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20197 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20198 (x_destroy_window, x_delete_display):
20199 Now static.
20200 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20201 (x_mouse_leave): Remove; unused.
20202 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20203 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20204 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20205 Remove decls.
20206 (x_mouse_leave): Declare only if WINDOWSNT.
20207 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20208 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20209 USE_X_TOOLKIT.
20210
20211 * ftxfont.c: Make symbols static if they're not exported.
20212 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20213 HAVE_FREETYPE.
20214 * font.h (ftxfont_driver): Likewise.
20215
20216 * xfns.c: Make symbols static if they're not exported.
20217 (x_last_font_name, x_display_info_for_name):
20218 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20219 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20220 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20221 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20222 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20223 (last_show_tip_args): Now static.
20224 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20225 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20226 (x_screen_planes): Remove; unused.
20227 * dispextern.h (x_screen_planes): Remove decl.
20228
20229 * dispnew.c: Make symbols static if they're not exported.
20230 * dispextern.h (redraw_garbaged_frames, scrolling):
20231 (increment_row_positions): Remove.
20232 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20233 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20234 Now static.
20235 (redraw_garbaged_frames): Remove; unused.
20236
20237 * xfaces.c: Make symbols static if they're not exported.
20238 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20239 Remove decls.
20240 * xterm.h (defined_color): Remove decls.
20241 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20242 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20243 (menu_face_changed_default, defined_color, free_realized_face):
20244 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20245 (ascii_face_of_lisp_face): Remove; unused.
20246
20247 * xdisp.c: Make symbols static if they're not exported.
20248 * dispextern.h (scratch_glyph_row, window_box_edges):
20249 (glyph_to_pixel_coords, set_cursor_from_row):
20250 (get_next_display_element, set_iterator_to_next):
20251 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20252 (show_mouse_face): Remove decls
20253 * frame.h (message_buf_print): Likewise.
20254 * lisp.h (pop_message, set_message, check_point_in_composition):
20255 Likewise.
20256 * xterm.h (set_vertical_scroll_bar): Likewise.
20257 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20258 (message_buf_print, scratch_glyph_row, displayed_buffer):
20259 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20260 (get_next_display_element, show_mouse_face, window_box_edges):
20261 (frame_to_window_pixel_xy, check_point_in_composition):
20262 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20263 (glyph_to_pixel_coords): Remove; unused.
20264
20265 * dired.c (file_name_completion): Now static.
20266
20267 * dbusbind.c (xd_in_read_queued_messages): Now static.
20268
20269 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20270 * data.c (circular_list_error): Remove.
20271
20272 * commands.h (last_point_position, last_point_position_buffer):
20273 (last_point_position_window): Remove decls.
20274 * keyboard.c: Make these variables static.
20275
20276 * coding.h (coding, code_convert_region, encode_coding_gap):
20277 Remove decls.
20278 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20279 (iso_code_class, detect_coding, code_convert_region): Now static.
20280 (encode_coding_gap): Remove; unused.
20281
20282 * chartab.c (chartab_chars, chartab_bits): Now static.
20283
20284 * charset.h (charset_iso_8859_1): Remove decl.
20285 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20286 Now static.
20287
20288 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20289 * ccl.c (Vccl_program_table): Now static.
20290 (check_ccl_update): Remove; unused.
20291
20292 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20293 * category.h: ... from here.
20294 * category.c (check_category_table, set_category_set): Now static.
20295
20296 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20297 * lisp.h: Remove these decls.
20298
20299 * buffer.c (buffer_count): Remove unused var.
20300
20301 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20302 so that it's not optimized away.
20303 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20304 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20305 exported only to the debugger.
20306
20307 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
20308 * atimer.h (run_all_atimers): Remove; not exported.
20309
20310 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20311 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20312 was inaccessible from Lisp.
20313 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20314 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20315
20316 alloc.c: Import and export fewer symbols, and remove unused items.
20317 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20318 is defined.
20319 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20320 it's not optimized away by whole-program optimization.
20321 (message_enable_multibyte, free_misc): Remove.
20322 (catchlist, handlerlist, mark_backtrace):
20323 Declare only if BYTE_MARK_STACK.
20324 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20325 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20326 (message_enable_multibyte): Remove decl.
20327 (free_misc, interval_free_list, float_block, float_block_index):
20328 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20329 (cons_free_list, last_marked_index):
20330 Now static.
20331 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20332 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20333 (mark_backtrace): Define only if BYTE_MARK_STACK.
20334 * xdisp.c (message_enable_multibyte): Now static.
20335
20336 Declare Lisp_Object Q* variables to be 'static' if not exported.
20337 This makes it easier for human readers (and static analyzers)
20338 to see whether these variables are used from other modules.
20339 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20340 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20341 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20342 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20343 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20344 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20345 * xmenu.c, xselect.c:
20346 Declare Q* vars static if they are not used in other modules.
20347 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20348 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20349 Remove decls of unexported vars.
20350 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20351
20352 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20353
20354 Make Emacs functions such as Fatom 'static' by default.
20355 This makes it easier for human readers (and static analyzers)
20356 to see whether these functions can be called from other modules.
20357 DEFUN now defines a static function. To make the function external
20358 so that it can be used in other C modules, use the new macro DEFUE.
20359 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20360 (Finit_image_library):
20361 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20362 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20363 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20364 Remove decls, since these functions are now static.
20365 (Funintern, Fget_internal_run_time): New decls, since these functions
20366 were already external.
20367
20368 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20369 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20370 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20371 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20372 * keyboard.c, keymap.c, lread.c:
20373 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20374 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20375 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20376 Mark functions with DEFUE instead of DEFUN,
20377 if they are used in other modules.
20378 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20379 decls for now-static functions.
20380 * buffer.h (Fdelete_overlay): Remove decl.
20381 * callproc.c (Fgetenv_internal): Mark as internal.
20382 * composite.c (Fremove_list_of_text_properties): Remove decl.
20383 (Fcomposition_get_gstring): New forward static decl.
20384 * composite.h (Fcomposite_get_gstring): Remove decl.
20385 * dired.c (Ffile_attributes): New forward static decl.
20386 * doc.c (Fdocumntation_property): New forward static decl.
20387 * eval.c (Ffetch_bytecode): New forward static decl.
20388 (Funintern): Remove extern decl; now in .h file where it belongs.
20389 * fileio.c (Fmake_symbolic_link): New forward static decl.
20390 * image.c (Finit_image_library): New forward static decl.
20391 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20392 * intervals.h (Fprevious_property_change):
20393 (Fremove_list_of_text_properties): Remove decls.
20394 * keyboard.c (Fthis_command_keys): Remove decl.
20395 (Fcommand_execute): New forward static decl.
20396 * keymap.c (Flookup_key): New forward static decl.
20397 (Fcopy_keymap): Now static.
20398 * keymap.h (Flookup_key): Remove decl.
20399 * process.c (Fget_process): New forward static decl.
20400 (Fprocess_datagram_address): Mark as internal.
20401 * syntax.c (Fsyntax_table_p): New forward static decl.
20402 (skip_chars): Remove duplicate decl.
20403 * textprop.c (Fprevious_property_change): New forward static decl.
20404 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20405 Now internal.
20406 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20407 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20408
20409 * editfns.c (Fformat): Remove unreachable code.
20410
20411 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20412
20413 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20414 change. (Bug#8496)
20415
20416 2011-04-13 Eli Zaretskii <eliz@gnu.org>
20417
20418 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20419 when at ZV. (Bug#8487)
20420
20421 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20422
20423 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20424 (Bug#8437)
20425 * keyboard.c (parse_tool_bar_item): Likewise.
20426 * sound.c (sound_cleanup, alsa_close): Likewise.
20427 * termcap.c (tgetent): Likewise.
20428 * xfns.c (x_default_font_parameter): Likewise.
20429 * xsettings.c (read_and_apply_settings): Likewise.
20430
20431 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20432 (overrun_check_free): Protoize.
20433
20434 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20435
20436 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20437 since callers should never pass a negative size.
20438 Change the signature to match that of plain 'read' and 'write'; see
20439 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20440 * lisp.h: Update prototypes of emacs_write and emacs_read.
20441
20442 2011-04-11 Eli Zaretskii <eliz@gnu.org>
20443
20444 * xdisp.c (redisplay_window): Don't try to determine the character
20445 position of the scroll margin if the window start point w->startp
20446 is outside the buffer's accessible region. (Bug#8468)
20447
20448 2011-04-10 Eli Zaretskii <eliz@gnu.org>
20449
20450 Fix write-region and its subroutines for buffers > 2GB.
20451 * fileio.c (a_write, e_write): Modify declaration of arguments and
20452 local variables to support buffers larger than 2GB.
20453 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20454
20455 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20456 argument, local variables, and return value.
20457
20458 * lisp.h: Update prototypes of emacs_write and emacs_read.
20459
20460 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20461
20462 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
20463
20464 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20465
20466 Fix more problems found by GCC 4.6.0's static checks.
20467
20468 * xdisp.c (vmessage): Use a better test for character truncation.
20469
20470 * charset.c (load_charset_map): <, not <=, for optimization,
20471 and to avoid potential problems with integer overflow.
20472 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
20473 * casetab.c (set_identity, shuffle): Likewise.
20474 * editfns.c (Fformat): Likewise.
20475 * syntax.c (skip_chars): Likewise.
20476
20477 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20478 This also lets GCC 4.6.0 generate slightly better loop code.
20479
20480 * callint.c (Fcall_interactively): <, not <=, for optimization.
20481 (Fcall_interactively): Count the number of arguments produced,
20482 not the number of arguments given. This is simpler and lets GCC
20483 4.6.0 generate slightly better code.
20484
20485 * ftfont.c: Distingish more carefully between FcChar8 and char.
20486 The previous code passed unsigned char * to a functions like
20487 strlen and xstrcasecmp that expect char *, which does not
20488 conform to the C standard.
20489 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20490 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20491 char * when the C standard requires it.
20492
20493 * keyboard.c (read_char): Remove unused var.
20494
20495 * eval.c: Port to Windows vsnprintf (Bug#8435).
20496 Include <limits.h>.
20497 (SIZE_MAX): Define if the headers do not.
20498 (verror): Do not give up if vsnprintf returns a negative count.
20499 Instead, grow the buffer. This ports to Windows vsnprintf, which
20500 does not conform to C99. Problem reported by Eli Zaretskii.
20501 Also, simplify the allocation scheme, by avoiding the need for
20502 calling realloc, and removing the ALLOCATED variable.
20503
20504 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20505
20506 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20507 But keep the doprint source code for now, as we might revamp it
20508 and use it again (Bug#8435).
20509 * lisp.h (doprnt): Remove.
20510 * Makefile.in (base_obj): Remove doprnt.o.
20511 * deps.mk (doprnt.o): Remove.
20512
20513 error: Print 32- and 64-bit integers portably (Bug#8435).
20514 Without this change, on typical 64-bit hosts error ("...%d...", N)
20515 was used to print both 32- and 64-bit integers N, which relied on
20516 undefined behavior.
20517 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
20518 * lisp.h (error, verror): Mark as printf-like functions.
20519 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20520 Report overflow in size calculations when allocating printf buffer.
20521 Do not truncate output string at its first null byte.
20522 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20523 Truncate the output at a character boundary, since vsnprintf does not
20524 do that.
20525 * charset.c (check_iso_charset_parameter): Convert internal
20526 character to string before calling 'error', since %c now has the
20527 printf meaning.
20528 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
20529 overflow when computing char to be passed to 'error'. Do not
20530 pass Lisp_Object to 'error'; pass the integer instead.
20531 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
20532 formatted with plain %d.
20533
20534 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
20535
20536 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
20537
20538 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
20539
20540 * xterm.c (x_catch_errors): Remove duplicate declaration.
20541
20542 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
20543
20544 * xdisp.c, lisp.h (message_nolog): Remove; unused.
20545
20546 2011-04-10 Jim Meyering <meyering@redhat.com>
20547
20548 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
20549 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20550 return ssize_t not "int", and use size_t as the buffer length.
20551 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20552 * gnutls.h: Update declarations.
20553 * process.c (read_process_output): Use ssize_t, to match.
20554 (send_process): Likewise.
20555
20556 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
20557
20558 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20559
20560 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
20561
20562 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20563 Use unsigned char, to match FcChar8 type definition.
20564
20565 * xterm.c (handle_one_xevent):
20566 * xmenu.c (create_and_show_popup_menu):
20567 * xselect.c (x_decline_selection_request)
20568 (x_reply_selection_request): Avoid type-punned deref of X events.
20569
20570 2011-04-09 Eli Zaretskii <eliz@gnu.org>
20571
20572 Fix some uses of `int' instead of EMACS_INT.
20573 * search.c (string_match_1, fast_string_match)
20574 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20575 (scan_buffer, find_next_newline_no_quit)
20576 (find_before_next_newline, search_command, Freplace_match)
20577 (Fmatch_data): Make some `int' variables be EMACS_INT.
20578
20579 * xdisp.c (display_count_lines): 3rd argument and return value now
20580 EMACS_INT. All callers changed.
20581 (pint2hrstr): Last argument is now EMACS_INT.
20582
20583 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
20584 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
20585 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
20586 (decode_coding_utf_16, decode_coding_emacs_mule)
20587 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
20588 (decode_coding_ccl, decode_coding_charset)
20589 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
20590 (decode_coding_iso_2022, decode_coding_emacs_mule)
20591 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
20592 <char_offset, last_offset>: Declare EMACS_INT.
20593 (encode_coding_utf_8, encode_coding_utf_16)
20594 (encode_coding_emacs_mule, encode_invocation_designation)
20595 (encode_designation_at_bol, encode_coding_iso_2022)
20596 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
20597 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
20598 Declare EMACS_INT.
20599 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
20600 (encode_invocation_designation): Last argument P_NCHARS is now
20601 EMACS_INT.
20602 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
20603 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
20604
20605 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
20606 All users changed.
20607
20608 * ccl.c (Fccl_execute_on_string): Declare some variables
20609 EMACS_INT.
20610
20611 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
20612
20613 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
20614
20615 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
20616
20617 * process.c (Fformat_network_address): Doc fix.
20618
20619 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
20620
20621 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
20622
20623 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
20624
20625 * keyboard.c (read_char): Call Lisp function help-form-show,
20626 instead of using internal_with_output_to_temp_buffer.
20627 (Qhelp_form_show): New var.
20628 (syms_of_keyboard): Use DEFSYM macro.
20629
20630 * print.c (internal_with_output_to_temp_buffer): Function deleted.
20631
20632 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
20633
20634 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
20635
20636 * process.c (Flist_processes): Remove to Lisp.
20637 (list_processes_1): Delete.
20638
20639 2011-04-06 Eli Zaretskii <eliz@gnu.org>
20640
20641 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
20642
20643 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
20644
20645 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
20646
20647 Fix more problems found by GCC 4.6.0's static checks.
20648
20649 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
20650
20651 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
20652
20653 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
20654
20655 * xdisp.c (vmessage): Mark as a printf-like function.
20656
20657 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
20658
20659 * sound.c (sound_warning): Don't crash if arg contains a printf format.
20660
20661 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
20662 printf-like functions.
20663 (tiff_load): Add casts to remove these marks before passing them
20664 to system-supplied API.
20665
20666 * eval.c (Fsignal): Remove excess argument to 'fatal'.
20667
20668 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
20669 This avoids several warnings with gcc -Wstrict-overflow.
20670 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
20671 directly, rather than having caller test rule sign. This avoids
20672 some unnecessary tests.
20673 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
20674 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
20675 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
20676
20677 * xfont.c (xfont_text_extents): Remove var that was set but not used.
20678 (xfont_open): Avoid unnecessary tests.
20679
20680 * composite.c (composition_gstring_put_cache): Use unsigned integer.
20681
20682 * composite.h, composite.c (composition_gstring_put_cache):
20683 Use EMACS_INT, not int, for length.
20684
20685 * composite.h (COMPOSITION_DECODE_REFS): New macro,
20686 breaking out part of COMPOSITION_DECODE_RULE.
20687 (COMPOSITION_DECODE_RULE): Use it.
20688 * composite.c (get_composition_id): Remove unused local vars,
20689 by using the new macro.
20690
20691 * textprop.c (set_text_properties_1): Change while to do-while,
20692 since the condition is always true at first.
20693
20694 * intervals.c (graft_intervals_into_buffer): Mark var as used.
20695 (interval_deletion_adjustment): Return unsigned value.
20696 All uses changed.
20697
20698 * process.c (list_processes_1, create_pty, read_process_output):
20699 (exec_sentinel): Remove vars that were set but not used.
20700 (create_pty): Remove unnecessary "volatile"s.
20701 (Fnetwork_interface_info): Avoid possibility of int overflow.
20702 (read_process_output): Do adaptive read buffering even if carryover.
20703 (read_process_output): Simplify nbytes computation if buffered.
20704
20705 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
20706
20707 * syntax.c (scan_words): Remove var that was set but not used.
20708 (update_syntax_table): Use unsigned instead of int.
20709
20710 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
20711 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
20712 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
20713
20714 * print.c (print_error_message): Avoid int overflow.
20715
20716 * font.c (font_list_entities): Redo for clarity,
20717 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
20718
20719 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
20720 (font_score): Avoid potential overflow in diff calculation.
20721
20722 * fns.c (substring_both): Remove var that is set but not used.
20723 (sxhash): Redo loop for clarity and to avoid wraparound warning.
20724
20725 * eval.c (funcall_lambda): Rename local to avoid shadowing.
20726
20727 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
20728 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
20729 can always succeed if overflow has undefined behavior.
20730
20731 * search.c (boyer_moore, wordify): Remove vars set but not used.
20732 (wordify): Omit three unnecessary tests.
20733
20734 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
20735 All callers changed. This avoids the need for an unused var.
20736
20737 * casefiddle.c (casify_region): Remove var that is set but not used.
20738
20739 * dired.c (file_name_completion): Remove var that is set but not used.
20740
20741 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
20742
20743 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
20744 (Finsert_file_contents): Remove unnecessary code checking fd.
20745
20746 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
20747 Check for integer overflow on size calculations.
20748
20749 * buffer.c (Fprevious_overlay_change): Remove var that is set
20750 but not used.
20751
20752 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
20753 Remove vars that are set but not used.
20754 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
20755 (timer_check_2): Mark vars as initialized.
20756
20757 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
20758
20759 * image.c (lookup_image): Remove var that is set but not used.
20760 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
20761
20762 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
20763 that are set but not used.
20764
20765 * xfns.c (make_invisible_cursor): Don't return garbage
20766 if XCreateBitmapFromData fails (Bug#8410).
20767
20768 * xselect.c (x_get_local_selection, x_handle_property_notify):
20769 Remove vars that are set but not used.
20770
20771 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
20772 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
20773
20774 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
20775 Remove var that is set but not used.
20776 (scroll_bar_windows_size): Now size_t, not int.
20777 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
20778 Check for overflow.
20779
20780 * xfaces.c (realize_named_face): Remove vars that are set but not used.
20781 (map_tty_color) [!defined MSDOS]: Likewise.
20782
20783 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
20784
20785 * coding.c: Remove vars that are set but not used.
20786 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
20787 All callers changed.
20788 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
20789 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
20790 (decode_coding_charset): Remove vars that are set but not used.
20791
20792 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
20793 that is set but not used.
20794
20795 * print.c (print_object): Remove var that is set but not used.
20796
20797 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
20798 The gnulib version avoids calling malloc in the usual case,
20799 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
20800 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
20801 * filelock.c (current_lock_owner): Likewise.
20802 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
20803 * sysdep.c: Include allocator.h, careadlinkat.h.
20804 (emacs_no_realloc_allocator): New static constant.
20805 (emacs_readlink): New function.
20806 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
20807 ../lib/careadlinkat.h.
20808
20809 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
20810
20811 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
20812 first non-nil return value).
20813
20814 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
20815
20816 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
20817 if not defined (Bug#8403).
20818
20819 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
20820
20821 * xdisp.c (display_count_lines): Remove parameter `start',
20822 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20823 (get_char_face_and_encoding): Remove parameter `multibyte_p',
20824 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20825 (fill_stretch_glyph_string): Remove parameters `row' and `area',
20826 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
20827 and thereabouts. All callers changed.
20828 (get_per_char_metric): Remove parameter `f', unused since
20829 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20830
20831 2011-04-02 Jim Meyering <meyering@redhat.com>
20832
20833 do not dereference NULL upon failed strdup
20834 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
20835 (ns_get_family): Likewise.
20836
20837 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
20838
20839 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
20840
20841 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
20842
20843 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
20844 later (Bug#8403).
20845
20846 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
20847
20848 Add lexical binding.
20849
20850 * window.c (Ftemp_output_buffer_show): New fun.
20851 (Fsave_window_excursion):
20852 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
20853
20854 * lread.c (lisp_file_lexically_bound_p): New function.
20855 (Fload): Bind Qlexical_binding.
20856 (readevalloop): Remove `evalfun' arg.
20857 Bind Qinternal_interpreter_environment.
20858 (Feval_buffer): Bind Qlexical_binding.
20859 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
20860 Mark as dynamic.
20861 (syms_of_lread): Declare `lexical-binding'.
20862
20863 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
20864
20865 * keyboard.c (eval_dyn): New fun.
20866 (menu_item_eval_property): Use it.
20867
20868 * image.c (parse_image_spec): Use Ffunctionp.
20869
20870 * fns.c (concat, mapcar1): Accept byte-code-functions.
20871
20872 * eval.c (Fsetq): Handle lexical vars.
20873 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
20874 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
20875 (FletX, Flet): Obey lexical binding.
20876 (Fcommandp): Handle closures.
20877 (Feval): New `lexical' arg.
20878 (eval_sub): New function extracted from Feval. Use it almost
20879 everywhere where Feval was used. Look up vars in lexical env.
20880 Handle closures.
20881 (Ffunctionp): Move from subr.el.
20882 (Ffuncall): Handle closures.
20883 (apply_lambda): Remove `eval_flags'.
20884 (funcall_lambda): Handle closures and new byte-code-functions.
20885 (Fspecial_variable_p): New function.
20886 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
20887 but without exporting it to Lisp.
20888
20889 * doc.c (Fdocumentation, store_function_docstring):
20890 * data.c (Finteractive_form): Handle closures.
20891
20892 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
20893 interactive spec.
20894
20895 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
20896 New byte-codes.
20897 (exec_byte_code): New function extracted from Fbyte_code to handle new
20898 calling convention for byte-code-functions. Add new byte-codes.
20899
20900 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
20901
20902 * alloc.c (Fmake_symbol): Init new `declared_special' field.
20903
20904 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
20905
20906 * xdisp.c (redisplay_internal): Fix prototype.
20907
20908 2011-03-31 Eli Zaretskii <eliz@gnu.org>
20909
20910 * xdisp.c (SCROLL_LIMIT): New macro.
20911 (try_scrolling): Use it when setting scroll_limit.
20912 Limit scrolling to 100 screen lines.
20913 (redisplay_window): Even when falling back on "recentering",
20914 position point in the window according to scroll-conservatively,
20915 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20916
20917 (try_scrolling): When point is above the window, allow searching
20918 as far as scroll_max, or one screenful, to compute vertical
20919 distance from PT to the scroll margin position. This prevents
20920 try_scrolling from unnecessarily failing when
20921 scroll-conservatively is set to a value slightly larger than the
20922 window height. Clean up the case of PT below the margin at bottom
20923 of window: scroll_max can no longer be INT_MAX. When aggressive
20924 scrolling is in use, don't let point enter the opposite scroll
20925 margin as result of the scroll.
20926 (syms_of_xdisp) <scroll-conservatively>: Document the
20927 threshold of 100 lines for never-recentering scrolling.
20928
20929 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
20930
20931 * dispextern.h (move_it_by_lines):
20932 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
20933 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
20934 (message_log_check_duplicate): Remove parameters `prev_bol' and
20935 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20936 (redisplay_internal): Remove parameter `preserve_echo_area',
20937 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
20938
20939 * indent.c (Fvertical_motion):
20940 * window.c (window_scroll_pixel_based, Frecenter):
20941 Don't pass `need_y_p' to `move_it_by_lines'.
20942
20943 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
20944
20945 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
20946 steal a few bits to be more compact.
20947 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
20948 Remove unneeded casts.
20949
20950 * bytecode.c (Fbyte_code): CAR and CDR can GC.
20951
20952 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
20953
20954 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
20955 binding" message (bug#7967).
20956
20957 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
20958
20959 Fix more problems found by GCC 4.6.0's static checks.
20960
20961 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
20962 Remove unused local var.
20963
20964 * editfns.c (Fmessage_box): Remove unused local var.
20965
20966 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
20967 (note_mode_line_or_margin_highlight, note_mouse_highlight):
20968 Omit unused local vars.
20969 * window.c (shrink_windows): Omit unused local var.
20970 * menu.c (digest_single_submenu): Omit unused local var.
20971 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
20972 Omit unused local var.
20973
20974 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
20975 Don't assume string length fits in int.
20976 (keyremap_step, read_key_sequence): Use size_t for sizes.
20977 (read_key_sequence): Don't check last_real_key_start redundantly.
20978
20979 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
20980 instead of alloca (Bug#8344).
20981
20982 * eval.c (Fbacktrace): Don't assume nargs fits in int.
20983 (Fbacktrace_frame): Don't assume nframes fits in int.
20984
20985 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
20986
20987 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
20988 concerns.
20989
20990 * term.c (produce_glyphless_glyph): Remove unnecessary test.
20991
20992 * cm.c (calccost): Turn while-do into do-while, for clarity.
20993
20994 * keyboard.c (syms_of_keyboard): Use the same style as later
20995 in this function when indexing through an array. This also
20996 works around GCC bug 48267.
20997
20998 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
20999
21000 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21001
21002 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21003 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21004
21005 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21006 This avoids undefined behavior on integer overflow, and is a bit
21007 more convenient anyway since it is compared to a size_t variable.
21008
21009 Variadic C functions now count arguments with size_t, not int.
21010 This avoids an unnecessary limitation on 64-bit machines, which
21011 caused (substring ...) to crash on large vectors (Bug#8344).
21012 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21013 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21014 All variadic functions and their callers changed accordingly.
21015 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21016 * data.c (arith_driver, float_arith_driver): Likewise.
21017 * editfns.c (general_insert_function): Likewise.
21018 * eval.c (struct backtrace.nargs, interactive_p)
21019 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21020 (funcall_lambda, mark_backtrace): Likewise.
21021 * fns.c (concat): Likewise.
21022 * frame.c (x_set_frame_parameters): Likewise.
21023 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21024 0 if not found, not -1. All callers changed.
21025
21026 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21027 (stack_copy_size): Now size_t, not int.
21028 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21029
21030 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21031
21032 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21033 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21034 All callers changed.
21035
21036 * lisp.h (multibyte_char_to_unibyte):
21037 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21038 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21039 * character.h (CHAR_TO_BYTE8):
21040 * cmds.c (internal_self_insert):
21041 * editfns.c (general_insert_function):
21042 * keymap.c (push_key_description):
21043 * search.c (Freplace_match):
21044 * xdisp.c (message_dolog, set_message_1): All callers changed.
21045
21046 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21047
21048 * keyboard.c (safe_run_hook_funcall): New function.
21049 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21050 don't set the hook to nil, but remove the offending function instead.
21051 (Qcommand_hook_internal): Remove, unused.
21052 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21053 Vcommand_hook_internal.
21054
21055 * eval.c (enum run_hooks_condition): Remove.
21056 (funcall_nil, funcall_not): New functions.
21057 (run_hook_with_args): Call each function through a `funcall' argument.
21058 Remove `cond' argument, now redundant.
21059 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21060 (Frun_hook_with_args_until_failure): Adjust accordingly.
21061 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21062
21063 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21064
21065 * dispextern.h (string_buffer_position): Remove declaration.
21066
21067 * print.c (strout): Remove parameter `multibyte', unused since
21068 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21069
21070 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21071 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21072 All callers changed.
21073
21074 * w32.c (_wsa_errlist): Use braces for struct initializers.
21075
21076 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21077 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21078 All callers changed.
21079 (string_buffer_position): Likewise. Also, make static (it's never
21080 used outside xdisp.c).
21081 (cursor_row_p): Remove parameter `w', unused since
21082 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21083 (decode_mode_spec): Remove parameter `precision', introduced during
21084 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21085 All callers changed.
21086
21087 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21088
21089 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21090
21091 2011-03-27 Anders Lindgren <andlind@gmail.com>
21092
21093 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21094 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21095 (ns_update_auto_hide_menu_bar): New functions.
21096 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21097 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21098 ns_constrain_all_frames.
21099 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21100 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21101
21102 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21103
21104 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21105
21106 2011-03-27 Glenn Morris <rgm@gnu.org>
21107
21108 * syssignal.h: Replace RETSIGTYPE with void.
21109 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21110 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21111 Replace SIGTYPE with void everywhere.
21112 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21113 * s/template.h (SIGTYPE): Remove commented out definition.
21114
21115 2011-03-26 Eli Zaretskii <eliz@gnu.org>
21116
21117 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21118 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21119
21120 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
21121
21122 * w32.c (read_unc_volume): Use parameter `henum', instead of
21123 global variable `wget_enum_handle'.
21124
21125 * keymap.c (describe_vector): Remove parameters `indices' and
21126 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21127 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21128
21129 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21130
21131 * keyboard.c (timer_check): Remove parameter `do_it_now',
21132 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21133 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21134 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21135
21136 * keyboard.c (read_char):
21137 * w32menu.c (w32_menu_display_help):
21138 * xmenu.c (show_help_event, menu_help_callback):
21139 Adjust calls to `show_help_echo'.
21140
21141 * gtkutil.c (xg_maybe_add_timer):
21142 * keyboard.c (readable_events):
21143 * process.c (wait_reading_process_output):
21144 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21145
21146 * insdel.c (adjust_markers_gap_motion):
21147 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21148 (gap_left, gap_right): Don't call it.
21149
21150 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
21151
21152 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21153 incurred during fontification.
21154
21155 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21156
21157 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21158 (DEFVAR_PER_BUFFER): Don't pass it.
21159
21160 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21161 (scrolling_window): Don't pass it.
21162
21163 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
21164
21165 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21166
21167 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21168 and `suffix'.
21169 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21170 of variables specific to SELinux and computation of `encoded_absname'.
21171
21172 * image.c (XPutPixel): Remove unused variable `height'.
21173
21174 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21175
21176 * unexw32.c (get_section_info): Remove unused variable `section'.
21177
21178 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21179 (system_process_attributes): Remove unused variable `sess'.
21180 (sys_read): Remove unused variable `err'.
21181
21182 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21183 (w32_wnd_proc): Remove unused variable `isdead'.
21184 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21185 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21186 (x_create_tip_frame): Remove unused variable `tem'.
21187
21188 * w32inevt.c (w32_console_read_socket):
21189 Remove unused variable `no_events'.
21190
21191 * w32term.c (x_draw_composite_glyph_string_foreground):
21192 Remove unused variable `width'.
21193
21194 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
21195
21196 * w32term.c (x_set_glyph_string_clipping):
21197 Don't pass uninitialized region to CombineRgn.
21198
21199 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
21200
21201 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21202 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21203 (Fx_close_connection): Remove unused variable `i'.
21204
21205 * w32font.c (w32font_draw): Return number of glyphs.
21206 (w32font_open_internal): Remove unused variable `i'.
21207 (w32font_driver): Add missing initializer.
21208
21209 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21210 (fill_in_menu): Remove unused variable `items_added'.
21211
21212 * w32term.c (last_mouse_press_frame): Remove static global variable.
21213 (w32_clip_to_row): Remove unused variable `f'.
21214 (x_delete_terminal): Remove unused variable `i'.
21215
21216 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21217 (NOTHING): Remove unused static global variable.
21218 (uniscribe_check_otf): Remove unused variable `table'.
21219 (uniscribe_font_driver): Add missing initializers.
21220
21221 2011-03-23 Julien Danjou <julien@danjou.info>
21222
21223 * term.c (Fsuspend_tty, Fresume_tty):
21224 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21225 * window.c (temp_output_buffer_show):
21226 * insdel.c (signal_before_change):
21227 * frame.c (Fhandle_switch_frame):
21228 * fileio.c (Fdo_auto_save):
21229 * emacs.c (Fkill_emacs):
21230 * editfns.c (save_excursion_restore):
21231 * cmds.c (internal_self_insert):
21232 * callint.c (Fcall_interactively):
21233 * buffer.c (Fkill_all_local_variables):
21234 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21235 Use Frun_hooks.
21236 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
21237 unconditionally since it does the check itself.
21238
21239 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
21240
21241 Fix more problems found by GCC 4.5.2's static checks.
21242
21243 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21244 the first time through the loop, since we know p0 < p1 then.
21245 This also avoids a gcc -Wstrict-overflow warning.
21246
21247 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21248 leading to a memory leak, possible in functions like
21249 load_charset_map_from_file that can allocate an unbounded number
21250 of objects (Bug#8318).
21251
21252 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21253 that could (at least in theory) be that large.
21254
21255 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21256 This is less likely to overflow, and avoids undefined behavior if
21257 overflow does occur. All callers changed. Use strtoul to scan
21258 for the unsigned long integer.
21259 (pint2hrstr): Simplify and tune code slightly.
21260 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
21261
21262 * scroll.c (do_scrolling): Work around GCC bug 48228.
21263 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21264
21265 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21266 This also avoids a warning with gcc -Wstrict-overflow.
21267 (validate_x_resource_name): Simplify count usage.
21268 This also avoids a warning with gcc -Wstrict-overflow.
21269
21270 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21271 fail (Bug#8306).
21272
21273 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
21274
21275 * process.c (Fmake_network_process): Use socklen_t, not int,
21276 where POSIX says socklen_t is required in portable programs.
21277 This fixes a porting bug on hosts like 64-bit HP-UX, where
21278 socklen_t is wider than int (Bug#8277).
21279 (Fmake_network_process, server_accept_connection):
21280 (wait_reading_process_output, read_process_output):
21281 Likewise.
21282
21283 * process.c: Rename or move locals to avoid shadowing.
21284 (list_processes_1, Fmake_network_process):
21285 (read_process_output_error_handler, exec_sentinel_error_handler):
21286 Rename or move locals.
21287 (Fmake_network_process): Define label "retry_connect" only if needed.
21288 (Fnetwork_interface_info): Fix pointer signedness.
21289 (process_send_signal): Add cast to avoid pointer signedness problem.
21290 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
21291 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
21292
21293 Make tparam.h and terminfo.c consistent.
21294 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21295 Include tparam.h instead, since it declares them.
21296 * cm.h (PC): Remove extern decl; tparam.h now does this.
21297 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21298 * terminfo.c: Include tparam.h, to check interfaces.
21299 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21300 (tparam): Adjust signature to match interface in tparam.h;
21301 this removes some undefined behavior. Check that outstring and len
21302 are zero, which they always are with Emacs.
21303 * tparam.h (PC, BC, UP): New extern decls.
21304
21305 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
21306 (xftfont_open): Rename locals to avoid shadowing.
21307
21308 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
21309 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21310 (OTF_TAG_SYM): Omit macro if not needed.
21311 (ftfont_list): Remove unused local.
21312 (get_adstyle_property, ftfont_pattern_entity):
21313 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21314 Rename locals to avoid shadowing.
21315
21316 * xfont.c (xfont_list_family): Mark var as initialized.
21317
21318 * xml.c (make_dom): Now static.
21319
21320 * composite.c (composition_compute_stop_pos): Rename local to
21321 avoid shadowing.
21322 (composition_reseat_it): Remove unused locals.
21323 (find_automatic_composition, composition_adjust_point): Likewise.
21324 (composition_update_it): Mark var as initialized.
21325 (find_automatic_composition): Mark vars as initialized,
21326 with a FIXME (Bug#8290).
21327
21328 character.h: Rename locals to avoid shadowing.
21329 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21330 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21331 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21332 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21333 to avoid shadowing.
21334
21335 * textprop.c (property_change_between_p): Remove; unused.
21336
21337 * intervals.c (interval_start_pos): Now static.
21338
21339 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21340
21341 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21342 Rename locals to avoid shadowing.
21343
21344 * sound.c (wav_play, au_play, Fplay_sound_internal):
21345 Fix pointer signedness.
21346 (alsa_choose_format): Remove unused local var.
21347 (wav_play): Initialize a variable to 0, to prevent undefined
21348 behavior (Bug#8278).
21349
21350 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21351
21352 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21353
21354 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21355 clobbering (Bug#8298).
21356 * sysdep.c (sys_subshell): Likewise.
21357 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
21358
21359 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21360 This should get cleaned up, so that child_setup has the
21361 same signature on all platforms.
21362
21363 * callproc.c (call_process_cleanup): Now static.
21364 (relocate_fd): Rename locals to avoid shadowing.
21365
21366 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
21367
21368 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21369 not to be necessary, and produces flickering.
21370
21371 2011-03-20 Glenn Morris <rgm@gnu.org>
21372
21373 * config.in: Remove file.
21374
21375 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
21376
21377 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21378 are now in src/globals.h.
21379 (syms_of_minibuf): Remove spurious & from previous change.
21380
21381 2011-03-20 Leo Liu <sdl.web@gmail.com>
21382
21383 * minibuf.c (completing-read-function): New variable.
21384 (completing-read-default): Rename from completing-read.
21385 (completing-read): Call completing-read-function.
21386
21387 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21388
21389 * xfaces.c (Fx_load_color_file):
21390 Read color file from absolute filename (bug#8250).
21391
21392 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21393
21394 * makefile.w32-in: Update dependencies.
21395
21396 2011-03-17 Eli Zaretskii <eliz@gnu.org>
21397
21398 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21399
21400 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21401
21402 Fix more problems found by GCC 4.5.2's static checks.
21403
21404 * process.c (make_serial_process_unwind, send_process_trap):
21405 (sigchld_handler): Now static.
21406
21407 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21408 That way, the code declares only the vars that it needs.
21409 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21410 * s/cygwin.h (PTY_ITERATION): Likewise.
21411 * s/darwin.h (PTY_ITERATION): Likewise.
21412 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21413
21414 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21415 * process.c (allocate_pty): Don't declare stb unless it's needed.
21416
21417 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
21418 (CONSTANTLIM): Remove; unused.
21419 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21420 Define only if needed.
21421
21422 * unexelf.c (unexec): Name an expression,
21423 to avoid gcc -Wbad-function-cast warning.
21424 Use a different way to cause a compilation error if anyone uses
21425 n rather than nn, a way that does not involve shadowing.
21426 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
21427
21428 * deps.mk (unexalpha.o): Remove; unused.
21429
21430 New file unexec.h, the (simple) interface for unexec (Bug#8267).
21431 * unexec.h: New file.
21432 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21433 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21434 Depend on unexec.h.
21435 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21436 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21437 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
21438 Change as necessary to match prototype in unexec.h.
21439
21440 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21441 shadowing.
21442 (back_comment, skip_chars): Mark vars as initialized.
21443
21444 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21445 Rename locals to avoid shadowing.
21446
21447 * lread.c (read1): Rewrite so as not to use empty "else".
21448 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
21449
21450 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21451
21452 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21453 warning when compiling print.c.
21454
21455 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21456 instead of using an uninitialized var.
21457 (font_sort_entities): Mark var as initialized.
21458
21459 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21460
21461 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21462 pointers to constants.
21463 (font_parse_fcname): Remove unused vars.
21464 (font_delete_unmatched): Now static.
21465 (font_get_spec): Remove; unused.
21466 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21467 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21468 Rename or move locals to avoid shadowing.
21469
21470 * fns.c (require_nesting_list, require_unwind): Now static.
21471 (Ffillarray): Rename locals to avoid shadowing.
21472
21473 * floatfns.c (domain_error2): Define only if needed.
21474 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
21475
21476 * alloc.c (mark_backtrace): Move decl from here ...
21477 * lisp.h: ... to here, so that it can be checked.
21478
21479 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
21480 (Fdefvar): Rewrite so as not to use empty "else".
21481 (lisp_indirect_variable): Name an expression,
21482 to avoid gcc -Wbad-function-cast warning.
21483 (Fdefvar): Rename locals to avoid shadowing.
21484
21485 * callint.c (quotify_arg, quotify_args): Now static.
21486 (Fcall_interactively): Rename locals to avoid shadowing.
21487 Use const pointer when appropriate.
21488
21489 * lisp.h (get_system_name, get_operating_system_release):
21490 Move decls here, to check interfaces.
21491 * process.c (get_operating_system_release): Move decl to lisp.h.
21492 * xrdb.c (get_system_name): Likewise.
21493 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21494 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21495 some of which prompt warnings from gcc -Wbad-function-cast.
21496 (Fformat_time_string, Fencode_time, Finsert_char):
21497 (Ftranslate_region_internal, Fformat):
21498 Rename or remove local vars to avoid shadowing.
21499 (Ftranslate_region_internal): Mark var as initialized.
21500
21501 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21502 avoid shadowing.
21503
21504 * lisp.h (eassert): Check that the argument compiles, even if
21505 ENABLE_CHECKING is not defined.
21506
21507 * data.c (Findirect_variable): Name an expression, to avoid
21508 gcc -Wbad-function-cast warning.
21509 (default_value, arithcompare, arith_driver, arith_error): Now static.
21510 (store_symval_forwarding): Rename local to avoid shadowing.
21511 (Fmake_variable_buffer_local, Fmake_local_variable):
21512 Mark variables as initialized.
21513 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
21514
21515 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
21516 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21517 Rename locals to avoid shadowing.
21518 (mark_stack): Move local variables into the #ifdef region where
21519 they're used.
21520 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21521 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21522 needed otherwise.
21523 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21524 (GC_STRING_CHARS): Remove; not used.
21525 (Fmemory_limit): Cast sbrk's returned value to char *.
21526
21527 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
21528 avoids undefined behavior in theory.
21529
21530 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
21531
21532 Use functions, not macros, for up- and down-casing (Bug#8254).
21533 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21534 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
21535 to use the following functions instead of these macros.
21536 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
21537 EMACS_INT, since callers assume the returned value fits in int.
21538 (upcase1): Likewise, for UPCASE_TABLE.
21539 (uppercasep, lowercasep, upcase): New static inline functions.
21540 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
21541 the race-condition problem in the old DOWNCASE.
21542
21543 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
21544 Rename locals to avoid shadowing.
21545 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
21546 (regex_compile, re_search_2, re_match_2_internal):
21547 Remove unused local vars.
21548 (FREE_VAR): Rewrite so as not to use empty "else",
21549 which gcc can warn about.
21550 (regex_compile, re_match_2_internal): Mark locals as initialized.
21551 (RETALLOC_IF): Define only if needed.
21552 (WORDCHAR_P): Likewise. This one is never needed, but is used
21553 only in a comment talking about a compiler bug, so put inside
21554 the #if 0 of that comment.
21555 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21556 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21557 Remove; unused.
21558
21559 * search.c (boyer_moore): Rename locals to avoid shadowing.
21560 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21561 (PREV_CHAR_BOUNDARY): Likewise.
21562
21563 * search.c (simple_search): Remove unused var.
21564
21565 * dired.c (compile_pattern): Move decl from here ...
21566 * lisp.h: ... to here, so that it can be checked.
21567 (struct re_registers): New forward decl.
21568
21569 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21570
21571 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21572 All uses changed.
21573 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21574 Rename locals to avoid shadowing.
21575 (Fvertical_motion): Mark locals as initialized.
21576
21577 * casefiddle.c (casify_object, casify_region): Now static.
21578 (casify_region): Mark local as initialized.
21579
21580 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
21581
21582 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
21583 New macros, so that the caller can use some names other than
21584 gcpro1, gcpro2, etc.
21585 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
21586 of the new macros.
21587 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
21588 argument, for consistency with GCPRO2_VAR, etc: it is now the
21589 prefix of the variable, not the variable itself. All uses
21590 changed.
21591 * dired.c (directory_files_internal, file_name_completion):
21592 Rename locals to avoid shadowing.
21593
21594 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
21595 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
21596 dired.c's scmp function, had undefined behavior.
21597 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21598 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
21599 * buffer.h: ... to here, because these macros use current_buffer,
21600 and the new implementation with inline functions needs to have
21601 current_buffer in scope now, rather than later when the macros
21602 are used.
21603 (downcase, upcase1): New static inline functions.
21604 (DOWNCASE, UPCASE1): Reimplement using these functions.
21605 This avoids undefined behavior in expressions like
21606 DOWNCASE (x) == DOWNCASE (y), which previously suffered
21607 from race conditions in accessing the global variables
21608 case_temp1 and case_temp2.
21609 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
21610 * lisp.h (case_temp1, case_temp2): Remove their decls.
21611 * character.h (ASCII_CHAR_P): Move from here ...
21612 * lisp.h: ... to here, so that the inline functions mentioned
21613 above can use them.
21614
21615 * dired.c (directory_files_internal_unwind): Now static.
21616
21617 * fileio.c (file_name_as_directory, directory_file_name):
21618 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
21619 Now static.
21620 (file_name_as_directory): Use const pointers when appropriate.
21621 (Fexpand_file_name): Likewise. In particular, newdir might
21622 point at constant storage, so make it a const pointer.
21623 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
21624 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
21625 signedness issues.
21626 (Fset_file_times, Finsert_file_contents, auto_save_error):
21627 Rename locals to avoid shadowing.
21628
21629 * minibuf.c (choose_minibuf_frame_1): Now static.
21630 (Ftry_completion, Fall_completions): Rename or remove locals
21631 to avoid shadowing.
21632
21633 * marker.c (bytepos_to_charpos): Remove; unused.
21634
21635 * lisp.h (verify_bytepos, count_markers): New decls,
21636 so that gcc does not warn that these functions aren't declared.
21637
21638 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
21639 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
21640 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
21641 (copy_text): Remove unused local var.
21642
21643 * filelock.c (within_one_second): Now static.
21644 (lock_file_1): Rename local to avoid shadowing.
21645
21646 * buffer.c (fix_overlays_before): Mark locals as initialized.
21647 (fix_start_end_in_overlays): Likewise. This function should be
21648 simplified by using pointers-to-pointers, but that's a different
21649 matter.
21650 (switch_to_buffer_1): Now static.
21651 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
21652 (report_overlay_modification): Rename locals to avoid shadowing.
21653
21654 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
21655 Fix pointer signedness issue.
21656 (sys_subshell): Mark local as volatile if checking for lint,
21657 to suppress a gcc -Wclobbered warning that does not seem to be right.
21658 (MAXPATHLEN): Define only if needed.
21659
21660 * process.c (serial_open, serial_configure): Move decls from here ...
21661 * systty.h: ... to here, so that they can be checked.
21662
21663 * fns.c (get_random, seed_random): Move extern decls from here ...
21664 * lisp.h: ... to here, so that they can be checked.
21665
21666 * sysdep.c (reset_io): Now static.
21667 (wait_for_termination_signal): Remove; unused.
21668
21669 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
21670 (copy_keymap_item, append_key, push_text_char_description):
21671 Now static.
21672 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
21673 (DENSE_TABLE_SIZE): Remove; unused.
21674 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
21675 (describe_map_tree):
21676 Rename locals to avoid shadowing.
21677
21678 * keyboard.c: Declare functions static if they are not used elsewhere.
21679 (echo_char, echo_dash, cmd_error, top_level_2):
21680 (poll_for_input, handle_async_input): Now static.
21681 (read_char, kbd_buffer_get_event, make_lispy_position):
21682 (make_lispy_event, make_lispy_movement, apply_modifiers):
21683 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
21684 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
21685 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
21686 (read_key_sequence, read_char): Mark locals as initialized.
21687 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
21688
21689 * keyboard.h (make_ctrl_char): New decl.
21690 (mark_kboards): Move decl here ...
21691 * alloc.c (mark_kboards): ... from here.
21692
21693 * lisp.h (force_auto_save_soon): New decl.
21694
21695 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
21696 (DEFINE_DUMMY_FUNCTION): New macro.
21697 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
21698 Use it.
21699 (main): Add casts to avoid warnings
21700 if GCC considers string literals to be constants.
21701
21702 * lisp.h (fatal_error_signal): Add decl, since it's exported.
21703
21704 * dbusbind.c: Pointer signedness fixes.
21705 (xd_signature, xd_append_arg, xd_initialize):
21706 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21707 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21708 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
21709 (Fdbus_register_signal): Use SSDATA when the context wants char *.
21710
21711 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
21712 if GCC considers string literals to be constants.
21713 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
21714
21715 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
21716
21717 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
21718 (print_preprocess, print_object): New macro to fix last change.
21719
21720 * print.c (print_preprocess): Don't forget font objects.
21721
21722 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
21723
21724 * emacs.c (USAGE3): Doc fixes.
21725
21726 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
21727
21728 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
21729 structure.
21730
21731 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
21732
21733 * lisp.h (VWindow_system, Qfile_name_history):
21734 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
21735 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
21736 (w32_system_caret_x, w32_system_caret_y): Declare extern.
21737
21738 * w32select.c: Don't #include "keyboard.h".
21739 (run_protected): Add extern declaration for waiting_for_input.
21740
21741 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
21742 * w32console.c (detect_input_pending, read_input_pending)
21743 (encode_terminal_code):
21744 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
21745 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
21746 (w32_system_caret_y, Qfile_name_history):
21747 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
21748 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
21749 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
21750 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
21751 * w32proc.c (Qlocal, report_file_error):
21752 * w32term.c (Vwindow_system, updating_frame):
21753 * w32uniscribe.c (initialized, uniscribe_font_driver):
21754 Remove unneeded extern declarations.
21755
21756 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
21757
21758 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
21759
21760 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
21761
21762 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
21763 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
21764 These macros can no longer be used for assignment.
21765
21766 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
21767 Assign struct members directly, instead of using BUF_BEGV etc.
21768 (record_buffer_markers, fetch_buffer_markers): New functions for
21769 recording and fetching special buffer markers.
21770 (set_buffer_internal_1, set_buffer_temp): Use them.
21771
21772 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
21773
21774 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
21775
21776 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
21777 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
21778
21779 * xdisp.c (hscroll_window_tree):
21780 (reconsider_clip_changes): Use PT instead of BUF_PT.
21781
21782 2011-03-13 Eli Zaretskii <eliz@gnu.org>
21783
21784 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
21785 $(EMACS_ROOT)/lib/intprops.h.
21786
21787 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
21788
21789 Fix more problems found by GCC 4.5.2's static checks.
21790
21791 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
21792 to unsigned char * to avoid compiler diagnostic.
21793 (xg_free_frame_widgets): Make it clear that a local variable is
21794 needed only if USE_GTK_TOOLTIP.
21795 (gdk_window_get_screen): Make it clear that this macro is needed
21796 only if USE_GTK_TOOLTIP.
21797 (int_gtk_range_get_value): New function, which avoids a diagnostic
21798 from gcc -Wbad-function-cast.
21799 (xg_set_toolkit_scroll_bar_thumb): Use it.
21800 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
21801 diagnostic from gcc -Wbad-function-cast.
21802 (get_utf8_string, xg_get_file_with_chooser):
21803 Rename locals to avoid shadowing.
21804 (create_dialog): Move locals to avoid shadowing.
21805
21806 * xgselect.c (xg_select): Remove unused var.
21807
21808 * image.c (four_corners_best): Mark locals as initialized.
21809 (gif_load): Initialize transparent_p to zero (Bug#8238).
21810 Mark another local as initialized.
21811 (my_png_error, my_error_exit): Mark with NO_RETURN.
21812
21813 * image.c (clear_image_cache): Now static.
21814 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
21815 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
21816 (x_edge_detection): Remove unnecessary cast that
21817 gcc -Wbad-function-cast diagnoses.
21818 (gif_load): Fix pointer signedness.
21819 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
21820 (jpeg_load, gif_load): Rename locals to avoid shadowing.
21821
21822 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
21823
21824 Improve quality of tests for time stamp overflow.
21825 For example, without this patch (encode-time 0 0 0 1 1
21826 1152921504606846976) returns the obviously-bogus value (-948597
21827 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
21828 reports time overflow. See
21829 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
21830 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
21831 * editfns.c: Include limits.h and intprops.h.
21832 (TIME_T_MIN, TIME_T_MAX): New macros.
21833 (time_overflow): Move earlier, to before first use.
21834 (hi_time, lo_time): New functions, for an accurate test for
21835 out-of-range times.
21836 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
21837 (Fget_internal_run_time): Don't assume time_t fits in int.
21838 (make_time): Use list2 instead of Fcons twice.
21839 (Fdecode_time): More accurate test for out-of-range times.
21840 (check_tm_member): New function.
21841 (Fencode_time): Use it, to test for out-of-range times.
21842 (lisp_time_argument): Don't rely on undefined left-shift and
21843 right-shift behavior when checking for time stamp overflow.
21844
21845 * editfns.c (time_overflow): New function, refactoring common code.
21846 (Fformat_time_string, Fdecode_time, Fencode_time):
21847 (Fcurrent_time_string): Use it.
21848
21849 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
21850 * dired.c (make_time): Move to ...
21851 * editfns.c (make_time): ... here.
21852 * systime.h: Note the move.
21853
21854 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21855
21856 * fringe.c (update_window_fringes): Remove unused variables.
21857
21858 * unexmacosx.c (copy_data_segment): Also copy __got section.
21859 (Bug#8223)
21860
21861 2011-03-12 Eli Zaretskii <eliz@gnu.org>
21862
21863 * termcap.c [MSDOS]: Include "msdos.h".
21864 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
21865 Constify `char *' arguments and their references according to
21866 prototypes in tparam.h.
21867
21868 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
21869
21870 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
21871 Adapt all references accordingly.
21872
21873 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
21874
21875 2011-03-11 Tom Tromey <tromey@redhat.com>
21876
21877 * buffer.c (syms_of_buffer): Remove obsolete comment.
21878
21879 2011-03-11 Eli Zaretskii <eliz@gnu.org>
21880
21881 * termhooks.h (encode_terminal_code): Declare prototype.
21882
21883 * msdos.c (encode_terminal_code): Don't declare prototype.
21884
21885 * term.c (encode_terminal_code): Now external again, used by
21886 w32console.c and msdos.c.
21887
21888 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
21889 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
21890
21891 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
21892
21893 Fix some minor problems found by GCC 4.5.2's static checks.
21894
21895 * fringe.c (update_window_fringes): Mark locals as initialized
21896 (Bug#8227).
21897 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
21898
21899 * alloc.c (mark_fringe_data): Move decl from here ...
21900 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
21901 to check its interface.
21902 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
21903
21904 * fontset.c (free_realized_fontset): Now static.
21905 (Fset_fontset_font): Rename local to avoid shadowing.
21906 (fontset_font): Mark local as initialized.
21907 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
21908
21909 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21910
21911 * xselect.c (x_disown_buffer_selections): Remove; not used.
21912 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
21913 (x_own_selection, Fx_disown_selection_internal): Rename locals
21914 to avoid shadowing.
21915 (x_handle_dnd_message): Remove local to avoid shadowing.
21916
21917 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21918 so that the caller can use some name other than gcpro1.
21919 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
21920 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21921 (Fx_backspace_delete_keys_p):
21922 Use them to avoid shadowing, and rename vars to avoid shadowing.
21923 (x_decode_color, x_set_name, x_window): Now static.
21924 (Fx_create_frame): Add braces to silence GCC warning.
21925 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
21926 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21927 Remove unused locals.
21928 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21929 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21930 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21931 macros.
21932
21933 * xterm.h (x_mouse_leave): New decl.
21934
21935 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
21936 Remove unused functions.
21937 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
21938 (x_calc_absolute_position): Now static.
21939 (XTread_socket): Don't define label "out" unless it's used.
21940 Don't declare local "event" unless it's used.
21941 (x_iconify_frame, x_free_frame_resources): Don't declare locals
21942 unless they are used.
21943 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
21944 (x_fatal_error_signal): Remove; not used.
21945 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
21946 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
21947 (x_error_catcher, x_connection_closed, x_error_handler):
21948 (x_error_quitter, xembed_send_message, x_iconify_frame):
21949 (my_log_handler): Rename locals to avoid shadowing.
21950 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
21951 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
21952
21953 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
21954 Rename or move locals to avoid shadowing.
21955 (tty_defined_color, merge_face_heights): Now static.
21956 (free_realized_faces_for_fontset): Remove; not used.
21957 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
21958 does not deduce is never used uninitialized.
21959 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
21960 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
21961
21962 * terminal.c (store_terminal_param): Now static.
21963
21964 * xmenu.c (menu_highlight_callback): Now static.
21965 (set_frame_menubar): Remove unused local.
21966 (xmenu_show): Rename parameter to avoid shadowing.
21967 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
21968 since they might point to immutable storage.
21969 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
21970 since it's unused otherwise.
21971
21972 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
21973 Add a FIXME, since the code still doesn't look right. (Bug#8215)
21974 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
21975 avoids a gcc -Wuninitialized diagnostic.
21976 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
21977 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
21978 does not deduce are never used uninitialized.
21979
21980 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
21981
21982 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
21983 * window.c (window_loop, size_window):
21984 (run_window_configuration_change_hook, enlarge_window): Likewise.
21985
21986 * window.c (display_buffer): Now static.
21987 (size_window): Mark variables that gcc -Wuninitialized
21988 does not deduce are never used uninitialized.
21989 * window.h (check_all_windows): New decl, to forestall
21990 gcc -Wmissing-prototypes diagnostic.
21991 * dispextern.h (bidi_dump_cached_states): Likewise.
21992
21993 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
21994 shadowing.
21995 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
21996 Include <limits.h>.
21997 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
21998 and to avoid gcc -Wuninitialized warning.
21999 (load_charset_map): Mark variables that gcc -Wuninitialized
22000 does not deduce are never used uninitialized.
22001 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22002
22003 * coding.c (coding_set_source, coding_set_destination):
22004 Use "else { /* comment */ }" rather than "else /* comment */;"
22005 for clarity, and to avoid gcc -Wempty-body warning.
22006 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22007 a block, when the outer 'i' will do.
22008 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22009 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22010 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22011 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22012 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22013 Rename locals to avoid shadowing.
22014 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22015 * coding.c (emacs_mule_char, encode_invocation_designation):
22016 Now static, since they're not used elsewhere.
22017 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22018 (decode_coding_object, encode_coding_object, detect_coding_system):
22019 (decode_coding_emacs_mule): Mark variables that gcc
22020 -Wuninitialized does not deduce are never used uninitialized.
22021 (detect_coding_iso_2022): Initialize a local variable that might
22022 be used uninitialized. Leave a FIXME because it's not clear that
22023 this initialization is needed. (Bug#8211)
22024 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22025 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22026 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22027 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22028 Remove unused macros.
22029
22030 * category.c (hash_get_category_set): Remove unused local var.
22031 (copy_category_table): Now static, since it's not used elsewhere.
22032 * character.c (string_count_byte8): Likewise.
22033
22034 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22035 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22036
22037 * chartab.c (copy_sub_char_table): Now static, since it's not used
22038 elsewhere.
22039 (sub_char_table_ref_and_range, char_table_ref_and_range):
22040 Rename locals to avoid shadowing.
22041 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22042
22043 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22044 (BIDI_BOB): Remove unused macro.
22045
22046 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22047 deduce are never used uninitialized.
22048 * term.c (encode_terminal_code): Likewise.
22049
22050 * term.c (encode_terminal_code): Now static. Remove unused local.
22051
22052 * tparam.h: New file.
22053 * term.c, tparam.h: Include it.
22054 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22055 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22056 Move these decls to tparam.h, and make them agree with what
22057 is actually in tparam.c. The previous trick of using incompatible
22058 decls in different modules does not conform to the C standard.
22059 All callers of tparam changed to use tparam's actual API.
22060 * tparam.c (tparam1, tparam, tgoto):
22061 Use const pointers where appropriate.
22062
22063 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22064 * cm.h (struct cm): Likewise.
22065 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22066 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22067 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22068 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22069 (turn_on_face, init_tty): Likewise.
22070 * termchar.h (struct tty_display_info): Likewise.
22071
22072 * term.c (term_mouse_position): Rename local to avoid shadowing.
22073
22074 * alloc.c (mark_ttys): Move decl from here ...
22075 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22076
22077 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22078
22079 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22080
22081 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
22082
22083 * search.c (compile_pattern_1): Remove argument regp, unused since
22084 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22085 (compile_pattern): Don't pass it.
22086
22087 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22088
22089 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22090 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22091 for ! HAVE_GTK3.
22092 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22093
22094 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22095
22096 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22097 gdk_window_get_screen, gdk_window_get_geometry,
22098 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22099 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22100 (xg_get_pixbuf_from_pixmap): New function.
22101 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22102 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22103 Call xg_get_pixbuf_from_pixmap instead of
22104 gdk_pixbuf_get_from_drawable.
22105 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22106 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22107 (xg_check_special_colors): Use GtkStyleContext and its functions
22108 for HAVE_GTK3.
22109 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22110 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22111 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
22112 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22113 Call gtk_widget_get_preferred_size.
22114 (xg_frame_resized): gdk_window_get_geometry only takes 5
22115 parameters.
22116 (xg_win_to_widget, xg_event_is_for_menubar):
22117 Call gdk_x11_window_lookup_for_display.
22118 (xg_set_widget_bg): New function.
22119 (delete_cb): New function.
22120 (xg_create_frame_widgets): Connect delete-event to delete_cb.
22121 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
22122 (xg_set_background_color): Call xg_set_widget_bg.
22123 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22124 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22125 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22126 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22127 if ! HAVE_GTK3.
22128 (update_frame_tool_bar): Call gtk_widget_hide.
22129 (xg_initialize): Use GDK_KEY_g.
22130
22131 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22132 if ! HAVE_GTK3
22133 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22134
22135 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22136 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22137 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22138
22139 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
22140
22141 * w32xfns.c (select_palette): Check success of RealizePalette against
22142 GDI_ERROR, not zero.
22143
22144 See ChangeLog.11 for earlier changes.
22145
22146 ;; Local Variables:
22147 ;; coding: utf-8
22148 ;; End:
22149
22150 Copyright (C) 2011-2013 Free Software Foundation, Inc.
22151
22152 This file is part of GNU Emacs.
22153
22154 GNU Emacs is free software: you can redistribute it and/or modify
22155 it under the terms of the GNU General Public License as published by
22156 the Free Software Foundation, either version 3 of the License, or
22157 (at your option) any later version.
22158
22159 GNU Emacs is distributed in the hope that it will be useful,
22160 but WITHOUT ANY WARRANTY; without even the implied warranty of
22161 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22162 GNU General Public License for more details.
22163
22164 You should have received a copy of the GNU General Public License
22165 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.