]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Merge from emacs-24; up to 2012-12-13T00:52:17Z!yamaoka@jpl.org
[gnu-emacs] / src / ChangeLog
1 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (sys_open): Zero out the flags for the new file descriptor.
4 (sys_close): Zero out the flags for the file descriptor before
5 closing it. (Bug#13546)
6
7 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
8 (logon_network_drive, stat_worker, symlink, chase_symlinks): Use
9 CharNextExA and CharPrevExA to iterate over file names encoded in
10 DBCS. (Bug#13553)
11
12 * w32.c (w32_get_long_filename, init_environment, readlink):
13 Support file names encoded in DBCS codepages.
14 (readlink): Use the current file-name-coding-system, not the ANSI
15 codepage, to decode and handle targets of symlinks.
16
17 2013-01-28 Eli Zaretskii <eliz@gnu.org>
18
19 * w32.c (opendir): Now accepts a 'const char *'.
20
21 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
22
23 Remove obsolete redisplay code. See the discussion at
24 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
25 * dispnew.c (preemption_period, preemption_next_check): Remove.
26 (Vredisplay_preemption_period): Likewise.
27 (update_frame, update_single_window, update_window, update_frame_1):
28 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
29 used, following the 2012-06-22 change.
30
31 2013-01-25 Eli Zaretskii <eliz@gnu.org>
32
33 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
34
35 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
36
37 * font.c (num_fonts): Remove the leftover from old
38 debugging code. Adjust comment style here and there.
39 * insdel.c (insert_1): Remove.
40 * lisp.h (insert_1): Remove prototype.
41 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
42
43 2013-01-25 Eli Zaretskii <eliz@gnu.org>
44
45 * w32.c (max_filename_mbslen): New function.
46 (normalize_filename, readdir): Use it to detect locales where ANSI
47 encoding of file names uses a double-byte character set (DBCS).
48 If a DBCS encoding is used, advance by characters using
49 CharNextExA, instead of incrementing a 'char *' pointer. Use
50 _mbslwr instead of _strlwr. (Bug#13515)
51
52 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
53 request of memory reservation to 1.7GB. (Bug#13065)
54
55 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
56
57 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
58 at check_extra_latin label. (Bug#13505)
59
60 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
61
62 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
63 Avoid redundant calls to strlen.
64
65 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
66
67 Drop async_visible and async_iconified fields of struct frame.
68 This is possible because async input is gone; for details, see
69 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
70 * frame.h (struct frame): Remove async_visible and async_iconified
71 members, convert garbaged to unsigned bitfield. Adjust comments.
72 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
73 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
74 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
75 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
76 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
77 * w32term.c: Ditto.
78 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
79 properly. Likewise for obscured.
80 * xterm.c: Ditto.
81 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
82 properly.
83 * nsterm.m: Ditto.
84 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
85
86 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
87
88 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
89 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
90
91 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
92
93 * xdisp.c (message2, message2_nolog): Remove functions.
94 (message3, message3_nolog): Extract nbytes and multibyteness directly
95 from the string. Change all callers.
96 (message3_nolog): Don't set message_enable_multibyte since set_message
97 will reset it anyway.
98 (message1, message1_nolog): Use message3.
99 (vmessage): Use a stack allocated buffer rather than f->message_buf.
100 (with_echo_area_buffer): Remove last two arguments. Update all callers.
101 (set_message): Drop all but the second arg, which has to be a string.
102 (set_message_1): Simplify now that we know that a1 is NULL and the
103 second arg is a string.
104 * frame.h (struct frame): Remove `message_buf' field.
105 Use glyphs_initialized_p instead.
106 (FRAME_MESSAGE_BUF): Remove macro.
107 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
108 * lisp.h (message2, message2_nolog): Remove declarations.
109 (message3, message3_nolog): Update declarations.
110 * keyboard.c (read_char_minibuf_menu_text)
111 (read_char_minibuf_menu_width): Remove vars.
112 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
113 to correctly handle multibyte strings.
114 * frame.c (delete_frame): Don't free message_buf any more.
115 * editfns.c (message_text, message_length): Remove vars.
116 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
117 * fileio.c (auto_save_error): Use message3 instead of message2.
118 * dispnew.c (adjust_frame_message_buffer): Remove function.
119
120 2013-01-23 Eli Zaretskii <eliz@gnu.org>
121
122 * w32term.c (w32fullscreen_hook): Account correctly for the screen
123 real estate used for the tool bar and the menu bar.
124
125 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
126
127 * insdel.c (prepare_to_modify_buffer): Force redisplay if
128 hidden buffer is prepared to modification (Bug#13164).
129
130 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
131
132 * window.h (struct window): Change window_end_valid member from
133 Lisp_Object to a bitfield. Adjust comments.
134 (wset_window_end_valid): Remove.
135 * window.c (adjust_window_count): Clear window_end_valid.
136 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
137 (Fwindow_line_height, set_window_buffer, Frecenter)
138 (Fsplit_window_internal, Fdelete_other_windows_internal)
139 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
140 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
141 * xdisp.c (check_window_end, reconsider_clip_changes)
142 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
143 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
144 (find_first_unchanged_at_end_row, try_window_id): Likewise.
145
146 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
147
148 * xdisp.c (mark_window_display_accurate): Simplify the loop
149 assuming that the only one of vchild, hchild or buffer window
150 slots is non-nil. Call mark_window_display_accurate_1 for
151 the leaf windows only.
152 (mark_window_display_accurate_1): Always assume leaf window.
153 Adjust comment.
154
155 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
156
157 * emacs.c (Qkill_emacs_hook): Now static.
158
159 * fileio.c (Finsert_file_contents): Simplify.
160 Remove unnecessary assignments and tests.
161
162 2013-01-21 Eli Zaretskii <eliz@gnu.org>
163
164 * w32.c (acl_set_file): Don't test for errors unless
165 set_file_security returns FALSE. Avoids spurious errors when
166 saving files.
167
168 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
169
170 * fileio.c (Finsert_file_contents): Revert code introduced at
171 2013-01-18 in favor of the simpler and generally better fix.
172 Save stack space by removing 'buffer' and reusing 'read_buf'
173 where appropriate.
174
175 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
176
177 * lisp.h (eabs): Define unconditionally (Bug#13419).
178 The old "#if !defined (eabs)" was an unnecessary revenant of back
179 when this macro was called "abs". Document 'eabs' better.
180
181 2013-01-19 Glenn Morris <rgm@gnu.org>
182
183 * fns.c (Frandom): Doc fix.
184
185 2013-01-19 Eli Zaretskii <eliz@gnu.org>
186
187 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
188 segfault when there are lots of overlays.
189
190 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
191 when there are lots of overlays. See
192 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
193 for the details and a way to reproduce.
194
195 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
196
197 * fileio.c: Use O_APPEND to append.
198 This corresponds better to the natural interpretation of "append",
199 and avoids the need to open the output file twice, or to invoke
200 lseek when APPEND is neither nil nor a number.
201 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
202 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
203 file possibly twice, and lseeking to its end; this avoids the
204 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
205 at the same time: the combination is never needed and apparently
206 it doesn't work with DOS_NT.
207
208 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
209 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
210
211 Allow floating-point file offsets.
212 Problem reported by Vitalie Spinu in
213 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
214 * fileio.c (emacs_lseek): Remove.
215 (file_offset): New function.
216 (Finsert_file_contents, Fwrite_region): Use it.
217
218 2013-01-19 Chong Yidong <cyd@gnu.org>
219
220 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
221 aborting on Fsignal (Bug#13289).
222
223 2013-01-19 Eli Zaretskii <eliz@gnu.org>
224
225 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
226 set_file_security as failure due to insufficient privileges.
227 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
228 (fstat): Return owner and group like 'stat' and 'lstat' do.
229
230 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
231
232 Work around bug in CIFS and vboxsf file systems (Bug#13149).
233 The bug was observed on Ubuntu operating inside a virtual machine,
234 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
235 The workaround introduces a race condition on non-buggy hosts,
236 but it's an unlikely race and anyway there's a nearly identical
237 nearby race that can't be fixed.
238 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
239 New static vars.
240 (Fwrite_region): Test for file system time stamp bug.
241 (init_fileio): New function.
242 * lisp.h (init_fileio): Declare it.
243 * emacs.c (main): Call it.
244
245 * fileio.c (Finsert_file_contents): Simplify new diagnostic
246 and make it more consistent with other stat-failure diagnostics.
247
248 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
249
250 Fix crash when inserting data from non-regular files. See
251 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
252 for the error description produced by valgrind.
253 * fileio.c (read_non_regular): Rename to read_contents.
254 Free Lisp_Save_Value object used to pass parameters.
255 (read_non_regular_quit): Rename to read_contents_quit.
256 (Finsert_file_contents): Redesign internal file reading loop to adjust
257 gap and end positions after each read and so help make_gap to work
258 properly. Do not signal an I/O error too early and so do not leave
259 not yet decoded characters in a buffer, which was the reason of
260 redisplay crash. Use list2 to build return value. Adjust comments.
261
262 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
263
264 Close a race when statting and reading files (Bug#13149).
265 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
266 This avoids a race if the file is renamed between stat and open.
267 This race is not the problem originally noted in Bug#13149;
268 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
269
270 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
271
272 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
273 objects, related functions and macros.
274 (make_save_value): Adjust prototype.
275 (make_save_pointer): New prototype.
276 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
277 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
278 * alloc.c (format_save_value): Rename to make_save_value.
279 (make_save_pointer): New function.
280 (record_xmalloc): Use make_save_pointer.
281 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
282 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
283 Change users of make_save_value to make_save_pointer.
284 Likewise for format_save_value and make_save_value.
285
286 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
287
288 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
289 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
290 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
291 debugging stubs.
292
293 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
294
295 * alloc.c (free_save_value): Now static.
296
297 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
298
299 * keymap.c (map_keymap_internal): Use format_save_value.
300 (map_keymap_char_table_item): Adjust accordingly.
301 * fileio.c (non_regular_fd, non_regular_inserted)
302 (non_regular_nbytes): Remove.
303 (Finsert_file_contents): Convert trytry to ptrdiff_t. Use
304 format_save_value to pass parameters to read_non_regular.
305 (read_non_regular): Use XSAVE_ macros to extract parameters.
306 Adjust comment.
307 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
308 format_save_value.
309 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
310
311 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
312
313 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
314 extraction from any Lisp_Save_Value slot. Add type checking.
315 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
316 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
317 * xselect.c: All users changed.
318
319 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
320
321 Some convenient bits to deal with Lisp_Save_Values.
322 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
323 (allocate_misc): Remove prototype.
324 (format_save_value): New prototype.
325 * alloc.c (allocate_misc): Revert back to static.
326 (format_save_value): New function to build Lisp_Save_Value
327 object with the specified internal structure.
328 (make_save_value): Reimplement using format_save_value.
329 * editfns.c (save_excursion_save): Use format_save_value.
330 (save_excursion_restore): Use XSAVE_OBJECT.
331
332 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
333
334 Avoid needless casts with XSAVE_POINTER.
335 * alloc.c (mark_object) [GC_MARK_STACK]:
336 * dired.c (directory_files_internal_unwind):
337 * fileio.c (do_auto_save_unwind):
338 * gtkutil.c (pop_down_dialog):
339 * keymap.c (map_keymap_char_table_item):
340 * lread.c (load_unwind):
341 * nsmenu.m (pop_down_menu):
342 * print.c (print_object) [GC_MARK_STACK]:
343 * xfns.c (clean_up_file_dialog):
344 * xmenu.c (cleanup_widget_value_tree):
345 Omit casts between XSAVE_POINTER and a pointer type.
346
347 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
348
349 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
350 * eval.c (eval_sub): Protect `form' from being GCed before its
351 car and cdr becomes protected with the backtrace entry.
352
353 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
354
355 Make Lisp_Save_Value more versatile storage for up to four objects.
356 * lisp.h (toplevel): Enumeration to describe types of saved objects.
357 (struct Lisp_Save_Value): New layout. Adjust comments.
358 (XSAVE_POINTER): New macro.
359 (XSAVE_INTEGER): Likewise.
360 (allocate_misc): Add prototype.
361 (free_misc): Likewise.
362 * alloc.c (allocate_misc): Now global.
363 (free_misc): Likewise. Adjust comment.
364 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
365 (free_save_value): Likewise.
366 (mark_object): Likewise.
367 * editfns.c (save_excursion_save): Pack everything within
368 Lisp_Save_Value and so avoid xmalloc.
369 (save_excursion_restore): Adjust to match new layout. Use free_misc
370 because we do not allocate extra memory any more. Add eassert.
371 * print.c (print_object): New code to print Lisp_Save_Value. Do not
372 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
373 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
374 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
375 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
376
377 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
378
379 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
380 (nsfont_draw): Remove disabling of LCD smoothing.
381 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
382 Bug#11484 with LCD smoothing on.
383
384 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
385
386 Fix SIGDANGER handlers, for AIX (Bug#13408).
387 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
388 Move handlers here from emacs.c; they were out of place.
389
390 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
391
392 * xterm.c (syms_of_xterm): Adjust documentation for
393 scroll-bar-adjust-thumb-portion.
394
395 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
396
397 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
398 determine whether scroll bar thumb size should be adjusted or
399 not. Use variable for MOTIF.
400
401 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
402 GTK.
403
404 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
405
406 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
407 event is generated.
408 (doCommandBySelector:): Set processingCompose to NO.
409
410 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
411 Remove check for fkeys count > zero, block/unblock fixes the real bug.
412 (nsfont_list_family): Add block/unblock_input calls.
413 (nsfont_open): Move block_input earlier. Add unblock_input before early
414 return.
415 (nsfont_draw): Add block/unblock_input calls.
416
417 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
418
419 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
420 for old_charpos and old_bytepos.
421
422 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
423
424 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
425 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
426 Clear tzvalbuf_in_environ if this workaround is in effect.
427 Problem and fix reported by Kazuhiro Ito.
428
429 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
430
431 * insdel.c (Fcombine_after_change_execute, syms_of_insdel): Fix
432 ambiguous doc string cross-reference(s).
433
434 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
435 doc string cross-reference(s).
436
437 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
438 string cross-reference(s).
439
440 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
441
442 Avoid unnecessary byte position calculation for the gap movement.
443 Since all users of move_gap do CHAR_TO_BYTE for other purposes
444 anyway, all of them should use move_gap_both instead.
445 * lisp.h (move_gap): Remove prototype.
446 * insdel.c (move_gap): Remove.
447 (move_gap_both): Add eassert.
448 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
449 * xml.c (parse_region): Likewise.
450
451 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
452
453 emacsclient -t should not suspend Emacs server (Bug#13387)
454 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
455 New functions.
456 * term.c (init_tty): Use them instead of rolling our own code.
457 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
458 switches from 'signal' to 'pthread_sigmask', which is safer in
459 multithreaded applications.
460 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
461 which has already arranged for that.
462 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
463 This is the main part of the bug fix.
464
465 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
466
467 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
468 x_last_font_name (Bug#13403).
469
470 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
471
472 Omit buffer_slot_type_mismatch and use generic predicates to enforce
473 the type of per-buffer values where appropriate.
474 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
475 predicate, which is how it's really used now. Adjust comment.
476 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
477 * buffer.c (buffer_slot_type_mismatch): Remove.
478 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
479 predicate. Adjust comment.
480 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
481 fill-column, left-margin, tab-width, buffer-saved-size,
482 left-margin-width, right-margin-width, left-fringe-width,
483 right-fringe-width, scroll-bar-width and buffer-display-count.
484 Use Qstringp for default-directory, buffer-file-name,
485 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
486 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
487 line-spacing.
488 * data.c (store_symval_forwarding): Adjust to call the predicate.
489
490 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
491
492 * w32.c (get_name_and_id, acl_set_file):
493 * w32term.c (w32fullscreen_hook): Remove unused local variables.
494
495 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
496
497 * lisp.h (make_gap_1): New prototype.
498 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
499 gap size values.
500 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
501 naming convention.
502 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
503 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
504 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
505 (make_gap_1): New function to adjust the gap of any buffer.
506 * coding.c (coding_alloc_by_making_gap): Use it.
507 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
508 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
509
510 2013-01-08 Juri Linkov <juri@jurta.org>
511
512 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
513 of (supports :underline (:style wave)). (Bug#13000)
514
515 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
516
517 * undo.c (Fprimitive_undo): Move to simple.el.
518 (syms_of_undo): Remove declarations for Sprimitive_undo.
519
520 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
521
522 * keyboard.c (echo_add_key): Rename from echo_add_char.
523
524 2013-01-06 Chong Yidong <cyd@gnu.org>
525
526 * keyboard.c (echo_add_char): New function, factored out from
527 echo_char. Don't add a space if the previous echo string was
528 empty (Bug#13255).
529 (echo_char): Use it.
530 (read_key_sequence): When echoing mock input, ensure that the
531 trailing dash is properly added.
532
533 2013-01-05 Eli Zaretskii <eliz@gnu.org>
534
535 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
536 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
537 digits for buffer positions, before misalignment starts.
538 Display "0" for integer "object" field.
539 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
540 Display the newline glyph more unambiguously.
541
542 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
543
544 * nsterm.m (ns_draw_underwave):
545 * w32term.c (w32_draw_underwave):
546 * xterm.c (x_draw_underwave): Make underwave look more triangular
547 and also degrade gracefully for small fonts. (Bug#13000)
548
549 * nsterm.m (ns_draw_text_decoration):
550 * w32term.c (x_draw_glyph_string):
551 * xterm.c (x_draw_glyph_string): Don't use previous underline
552 thickness and position if previous underline type is underwave.
553
554 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
555
556 * fileio.c (Ffile_acl): Undocument return format.
557
558 2013-01-02 Glenn Morris <rgm@gnu.org>
559
560 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
561
562 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
563
564 Simplify via eabs.
565 * dired.c (file_name_completion):
566 * doc.c (get_doc_string):
567 * floatfns.c (round2):
568 * font.c (font_score, font_delete_unmatched):
569 * fringe.c (compute_fringe_widths):
570 * lread.c (read_list):
571 * minibuf.c (Ftry_completion):
572 * term.c (tty_ins_del_lines):
573 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
574 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
575
576 2012-12-31 Eli Zaretskii <eliz@gnu.org>
577
578 * w32.c (unsetenv): Set up the string passed to _putenv
579 correctly.
580 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
581 for the bug this caused.
582
583 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
584
585 * coding.c (Qmac): Now static.
586
587 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
588
589 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
590 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
591 handlebox_widget. Set toolbar_in_hbox to false/true, set
592 toolbar_is_packed to true.
593 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
594 (update_frame_tool_bar): Check toolbar_is_packed for packing.
595 Show all on TOOLBAR_TOP_WIDGET.
596 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
597 by TOOLBAR_TOP_WIDGET.
598 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
599 Check toolbar_is_packed.
600 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
601 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
602 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
603 false.
604 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
605 (xg_update_menubar): Update title only if
606 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
607 (xg_update_submenu): Skip tearoff only if
608 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
609 (xg_initialize): Initialize xg_detached_menus only if
610 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
611
612 * xterm.h (struct x_output): Surround handlebox_widget with
613 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
614 toolbar_in_hbox is bool.
615
616 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
617
618 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
619 (LIBS_GNUSTEP): Define.
620 (LIBES): Add $(LIBS_GNUSTEP).
621 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
622
623 2012-12-30 Eli Zaretskii <eliz@gnu.org>
624
625 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
626 continuation glyph on a TTY with an indication of an empty line.
627 (Bug#13277)
628
629 2012-12-29 Eli Zaretskii <eliz@gnu.org>
630
631 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
632 file's SELinux context or ACLs successfully set, nil otherwise.
633 (Bug#13298)
634 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
635
636 * w32proc.c (reader_thread): Avoid passing NULL handles to
637 SetEvent and WaitForSingleObject.
638
639 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
640
641 Port EXTERNALLY_VISIBLE to Clang 3.2.
642 * conf_post.h (__has_attribute): New macro.
643 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
644
645 2012-12-27 Glenn Morris <rgm@gnu.org>
646
647 * cygw32.c (Fcygwin_convert_file_name_to_windows)
648 (Fcygwin_convert_file_name_from_windows): Doc fixes.
649
650 2012-12-27 Eli Zaretskii <eliz@gnu.org>
651
652 * fileio.c (file_name_as_directory, directory_file_name):
653 Accept an additional argument MULTIBYTE to indicate whether the input C
654 came from a multibyte or a unibyte Lisp string; all callers
655 adjusted. Don't assume the input string is always multibyte.
656 (Bug#13262)
657 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
658 don't ENCODE_FILE them, and return a unibyte string if the input
659 was unibyte.
660 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
661 don't assume the input strings will always be multibyte. If the
662 input strings are multibyte, decode strings obtained from C
663 library functions.
664
665 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
666
667 * lisp.h (toplevel): Add two notices to the comment about
668 defining a new Lisp data type.
669 * print.c (print_object): If Lisp_Save_Value object's pointer
670 is the address of a memory area containing Lisp_Objects, try
671 to print them.
672 * alloc.c (valid_lisp_object_p): Adjust comment.
673
674 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
675
676 * keyboard.c (record_asynch_buffer_change): Initialize an event
677 only if it's really needed.
678 * frame.h (enum output_method): Remove output_mac member since
679 it's a leftover from the deleted code.
680 * frame.c (Fframep): Adjust user here ...
681 * terminal.c (Fterminal_live_p): ... and here.
682 * coding.c (Qmac): Now here because it's only used to denote
683 end-of-line encoding type.
684 (syms_of_coding): DEFSYM it.
685 * frame.h (Qmac): Remove duplicated declaration.
686
687 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
688
689 * window.c (select_window_1): Now static, since it's used only here.
690
691 2012-12-25 Eli Zaretskii <eliz@gnu.org>
692
693 * window.c (window_body_cols): Subtract display margins from the
694 window body width on TTYs as well. See
695 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
696 for the original report.
697
698 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
699
700 * xdisp.c (redisplay_window): Remove inner local variable
701 because the outer shadowed one has the same meaning.
702 * xterm.h (struct x_output): Remove toolbar_detached member since it's
703 set but never used.
704 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
705 (xg_create_tool_bar): Adjust users.
706
707 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
708
709 * buffer.h (BUF_COMPACT): New macro to follow the common style.
710 * buffer.c (Fget_buffer_create): Use it to set compact field of
711 struct buffer_text to avoid accessing an uninitialized value
712 when compact_buffer is called for the first time.
713 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
714 (Fset_buffer_modified_p): Use buffer_window_count to check
715 whether the buffer is displayed in some window.
716 * xdisp.c (message_dolog): Likewise.
717
718 2012-12-23 Eli Zaretskii <eliz@gnu.org>
719
720 * w32.c (acl_set_file): If setting the file security descriptor
721 fails, and the new DACL is identical to the existing one, silently
722 return success. This fixes problems for users backing up their
723 own files without having the necessary privileges for setting
724 security descriptors.
725
726 * w32proc.c (reader_thread): Do not index fd_info[] with negative
727 values.
728 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
729 after WaitForSingleObject returns normally. This expedites reader
730 thread shutdown when delete_child triggers it.
731 (reap_subprocess): More accurate commentary for why we call
732 delete_child only when cp->fd is negative.
733
734 * w32.c (sys_close): Do not call delete_child on a subprocess
735 whose handle is not yet closed. Instead, set its file descriptor
736 to a negative value, so that reap_subprocess will call
737 delete_child on that subprocess when its SIGCHLD arrives.
738 This avoids closing handles used for communications between sys_select
739 and reader_thread, which doesn't give sys_select a chance to
740 notice that the process exited and invoke the SIGCHLD handler for
741 it.
742
743 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
744
745 * nsfns.m (Fns_do_applescript): Run event loop until script has
746 been executed (Bug#12969).
747 (ns_run_ascript): Chech as_script for nil, set to nil after
748 executing script.
749
750 2012-12-22 Martin Rudalics <rudalics@gmx.at>
751
752 * window.c (Fselect_window): Reword doc-string (Bug#13248).
753
754 2012-12-22 Eli Zaretskii <eliz@gnu.org>
755
756 * w32term.c (w32fullscreen_hook): New function.
757 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
758
759 2012-12-21 Eli Zaretskii <eliz@gnu.org>
760
761 * fileio.c (Finsert_file_contents): Doc fix.
762
763 * w32proc.c (new_child, delete_child, find_child_pid): For a
764 subprocess, consider its slot being in use as long as its process
765 handle (procinfo.hProcess) is not NULL. This avoids reusing the
766 slot when a new process is started immediately after killing
767 another one, without waiting enough time for the first process to
768 be reaped and resources allocated for it be orderly freed.
769 (Bug#13086)
770 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
771
772 2012-12-21 Chong Yidong <cyd@gnu.org>
773
774 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
775
776 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
777
778 2012-12-21 Eli Zaretskii <eliz@gnu.org>
779
780 * w32.c (get_name_and_id): Always pass NULL as the first argument
781 of lookup_account_sid. Avoids crashes with UNC file names that
782 refer to DFS domains, not to specific machine names. (Bug#12621)
783 Remove now unused argument FNAME; all callers changed.
784 (get_file_owner_and_group): Remove now unused argument FNAME; all
785 callers changed.
786
787 2012-12-21 Chong Yidong <cyd@gnu.org>
788
789 * editfns.c (Finsert_char): Since read-char-by-name now signals an
790 error for invalid chars, don't check for a nil return value.
791
792 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
793
794 Avoid calls to CHAR_TO_BYTE if byte position is known.
795 * editfns.c (make_buffer_string_both): Use move_gap_both.
796 (Fbuffer_string): Use make_buffer_string_both.
797 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
798 Adjust comment.
799 (buf_bytepos_to_charpos): Likewise.
800 (charpos_to_bytepos): Remove.
801 * fileio.c (Finsert_file_contents): Use move_gap_both.
802 * search.c (Freplace_match): Likewise.
803 * process.c (process_send_region): Likewise. Use convenient
804 names for byte positions.
805 * lisp.h (charpos_to_bytepos): Remove prototype.
806 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
807 * insdel.c (move_gap): Likewise.
808
809 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
810
811 * xdisp.c (redisplay_internal): Remove now-unused local.
812
813 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
814
815 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
816 (redisplay_internal): Don't bother selecting the frame to get the
817 proper value of frame-local variables (bug#13225).
818
819 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
820
821 * textprop.c (set_text_properties_1): Do not allow NULL interval.
822 Rename 4th argument since it may be buffer or string. Adjust comment.
823 * intervals.c (graft_intervals_info_buffer): Find an interval here.
824
825 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
826
827 * coding.c (Fdetect_coding_region): Do not check start and end with
828 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
829 (code_convert_region): Likewise.
830
831 2012-12-18 Eli Zaretskii <eliz@gnu.org>
832
833 * w32.c (acl_get_file, acl_set_file): Run the file name through
834 map_w32_filename, and resolve any symlinks in the file name, like
835 Posix platforms do.
836 (acl_set_file): Call revert_to_self, if any privileges were
837 enabled.
838
839 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
840
841 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
842 ($(BLD)/w32.$(O)): Update dependencies.
843
844 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
845
846 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
847 propagate redisplay's scrolling (if any) to the right window.
848 (redisplay_internal): Use ensure_selected_frame.
849 (display_mode_lines): Complete last fix.
850 * window.c (select_window_1): New func, extracted from select_window.
851 (select_window): Use it.
852 * window.h (select_window_1): Declare.
853
854 2012-12-17 Eli Zaretskii <eliz@gnu.org>
855
856 Emulate Posix ACL APIs on MS-Windows.
857 * w32.c: Include sddl.h and sys/acl.h.
858 (SDDL_REVISION_1): Define if not already defined.
859 (g_b_init_get_security_descriptor_dacl)
860 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
861 (g_b_init_is_valid_security_descriptor)
862 (g_b_init_set_file_security): New static flags.
863 (globals_of_w32): Initialize them to zero.
864 (SetFileSecurity_Name): New string constant.
865 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
866 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
867 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
868 (IsValidSecurityDescriptor_Proc): New typedefs.
869 (get_file_security, get_security_descriptor_owner)
870 (get_security_descriptor_group): Set errno to ENOTSUP.
871 (set_file_security, get_security_descriptor_dacl)
872 (is_valid_security_descriptor, convert_sd_to_sddl)
873 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
874 (acl_free, acl_get_file, acl_set_file): New functions.
875
876 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
877
878 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
879
880 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
881 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
882 for some of that bug's symptoms can now cause Emacs to abort.
883 Remove the workaround.
884 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
885 The bug that caused SIGCHLD to get lost has been fixed, and the
886 workaround for it can now cause Emacs to abort.
887
888 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
889
890 * sysdep.c (emacs_abort): Bump backtrace size to 40.
891 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
892 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
893
894 2012-12-16 Romain Francoise <romain@orebokech.com>
895
896 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
897 (Fcopy_file): Change last arg to `preserve_extended_attributes'
898 and copy ACL entries of file in addition to SELinux context if set.
899 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
900
901 * Makefile.in (LIBACL_LIBS): New macro.
902 (LIBES): Use it.
903
904 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
905
906 * fileio.c (internal_delete_file): Use bool for boolean.
907
908 2012-12-15 Eli Zaretskii <eliz@gnu.org>
909
910 Fix bug #13079 on MS-Windows with temp files not being deleted.
911 * w32.h (_child_process): New members input_file and
912 pending_deletion.
913 (register_child): First argument is now pid_t.
914 (record_infile, record_pending_deletion): New prototypes.
915
916 * w32proc.c (new_child): Initialize input_file and
917 pending_deletion members of the child.
918 (delete_child): Delete the child's temporary input file, if any,
919 that is pending deletion.
920 (register_child): First argument is now pid_t.
921 (record_infile, record_pending_deletion): New functions.
922 (reap_subprocess): Fix a typo in DebPrint string.
923 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
924
925 * fileio.c (internal_delete_file): Return an int again: non-zero
926 if delete-file succeeds, zero otherwise.
927
928 * lisp.h (internal_delete_file): Adjust prototype.
929
930 * callproc.c (Fcall_process): Don't overwrite infile with result
931 of DECODE_FILE.
932 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
933 asynchronous subprocess, record the name of the input file name,
934 if any.
935 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
936 delete the file, record it as pending deletion when the subprocess
937 exits.
938
939 2012-12-14 Eli Zaretskii <eliz@gnu.org>
940
941 * editfns.c [HAVE_PWD_H]: Include grp.h.
942
943 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
944
945 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
946
947 Fix permissions bugs with setgid directories etc. (Bug#13125)
948 * dired.c (Ffile_attributes): Return t as the 9th attribute,
949 to mark it as a placeholder. The old value was often wrong.
950 The only user of this attribute has been changed to use
951 file-ownership-preserved-p instead, with its new group arg.
952 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
953
954 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
955
956 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
957 Keep selected_window and selected_frame in sync.
958
959 2012-12-14 Eli Zaretskii <eliz@gnu.org>
960
961 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
962 try to get accurate owner and group information from NT file
963 security APIs. This is to make most callers of 'stat' and
964 'lstat', which don't need that information, much faster.
965
966 * dired.c (Ffile_attributes) [WINDOWSNT]:
967 Set w32_stat_get_owner_group to a non-zero value, to request accurate
968 owner and group information from 'lstat'.
969
970 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
971
972 * fileio.c (Finsert_file_contents): Don't put tail into head area,
973 as that confuses set-auto-coding, so insist on the head-read
974 returning the full 1024 bytes. Let lseek compute the tail offset;
975 less work for us. Do not ignore I/O errors when reading the tail.
976
977 * xdisp.c: Minor style fixes.
978 (init_iterator): Hoist assignment out of if-expression.
979 (markpos_of_region): Callers now test for sign, not for -1.
980
981 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
982
983 Minor redisplay optimization when the region length is zero.
984 * xdisp.c (markpos_of_region): New function.
985 (init_iterator): Do not highlight the region of zero length.
986 (redisplay_window): Check whether the region is of non-zero length.
987 (try_cursor_movement): Allow if the region length is zero.
988 (try_window_reusing_current_matrix, try_window_id): Likewise.
989
990 2012-12-13 Eli Zaretskii <eliz@gnu.org>
991
992 * search.c (search_buffer): Check the inverse translations of each
993 character in pattern when the buffer being searched is unibyte.
994 (Bug#13084)
995
996 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
997
998 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
999 files, fixing a regression from 24.2.
1000 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
1001
1002 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1003
1004 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1005 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1006 Remove unnecessary S_ISLNK test, as (contra the comments) this
1007 function can't copy symlinks. Improve quality of error message
1008 when attempting to copy files that are neither regular files nor
1009 directories.
1010
1011 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1012
1013 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1014 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1015 * window.c (Frecenter):
1016 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1017 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1018
1019 2012-12-12 Daniel Colascione <dancol@dancol.org>
1020
1021 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
1022 the dumped Emacs is not a sparse file, greatly improving Cygwin
1023 "make bootstrap" performance.
1024
1025 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
1026
1027 * inotify.c (inotify_callback): Generate an Emacs event for every
1028 incoming inotify event.
1029
1030 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1031
1032 * xdisp.c (handle_face_prop): Fix logic of computing
1033 it->start_of_box_run_p.
1034 (append_space_for_newline): If the glyph row is R2L, reset the
1035 iterator's end_of_box_run_p flag before prepending the space glyph.
1036 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1037 iterator's start_of_box_run_p flag before prepending the stretch.
1038 (append_glyph, produce_image_glyph, append_composite_glyph)
1039 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1040 left_box_line_p and right_box_line_p flags of the glyph for R2L
1041 glyph rows. (Bug#13011)
1042
1043 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1044
1045 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1046 if changed buffer is not shown in a window.
1047 * insdel.c (prepare_to_modify_buffer): Likewise.
1048 * window.c (replace_buffer_in_windows_safely): Do nothing
1049 if buffer is not shown in a window.
1050 (Fforce_window_update): Likewise if string or buffer argument
1051 is passed.
1052
1053 2012-12-11 Eli Zaretskii <eliz@gnu.org>
1054
1055 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1056 encoded_file_name, which is what it is.
1057
1058 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1059
1060 Consistently use marker_position and marker_byte_position.
1061 * fringe.c (Ffringe_bitmaps_at_pos):
1062 * indent.c (Fvertical_motion):
1063 * insdel.c (prepare_to_modify_buffer):
1064 * keyboard.c (make_lispy_position):
1065 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1066 (window_scroll_pixel_based, displayed_window_lines)
1067 (Fset_window_configuration):
1068 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1069 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1070 Replace direct access to marker fields with calls
1071 to marker_position and/or marker_byte_position.
1072
1073 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
1074
1075 * makefile.w32-in (SIG2STR_H): New macro.
1076 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1077 ($(BLD)/w32notify.$(O)): Update dependencies.
1078
1079 2012-12-10 Daniel Colascione <dancol@dancol.org>
1080
1081 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1082 Windows file notification functionality unless WINDOWSNT.
1083
1084 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1085 declarations.
1086
1087 * w32fns.c (cache_system_info): Initialize the global hinst
1088 variable here so various initialization calls DTRT.
1089
1090 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1091 (hinst): Remove unneeded extern declaration.
1092 (_start): Remove initialization of above variables; remove
1093 initialization of hinst, as cache_system_info now does that.
1094
1095 * emacs.c (main): Call cache_system_info early in startup; we
1096 previously weren't calling it in Cygwin builds.
1097
1098 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1099 Teach the autoconf build system how to compile a Windows resource file
1100 and link it to Emacs.
1101
1102 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Per-buffer window counters.
1105 * buffer.h (struct buffer): New member window_count.
1106 (buffer_window_count): New function.
1107 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1108 Initialize window_count.
1109 (Fkill_buffer): Verify window_count for the buffer being killed.
1110 (modify_overlay): Do not force redisplay if buffer is not shown
1111 in any window.
1112 (init_buffer_once): Initialize window_count for buffer_defaults
1113 and buffer_local_symbols.
1114 * window.h (buffer_shared): Remove declaration.
1115 (wset_buffer): Convert from inline ...
1116 * window.c (wset_buffer): ... to an ordinary function.
1117 (adjust_window_count): New function.
1118 (make_parent_window): Use it.
1119 * xdisp.c (buffer_shared): Remove.
1120 (redisplay_internal, redisplay_window): Adjust users.
1121 (buffer_shared_and_changed): Use per-buffer window counter.
1122
1123 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1124
1125 Support for filesystem notifications on MS-Windows.
1126 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1127 and this is a TTY frame, signal the caller that keyboard input is
1128 available.
1129
1130 * w32xfns.c (drain_message_queue): Now returns an int: an
1131 indication whether any WM_EMACS_FILENOTIFY messages were found in
1132 the queue.
1133
1134 * w32inevt.c (handle_file_notifications): New function.
1135 (w32_console_read_socket): Call it to process file notifications.
1136
1137 * w32console.c (initialize_w32_display): Record the main thread ID
1138 in dwMainThreadId.
1139
1140 * deps.mk (inotify.o): New dependency list.
1141
1142 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1143
1144 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1145 (WM_EMACS_END): Bump value by 1.
1146 (notification_buffer_in_use, file_notifications)
1147 (notifications_size, notifications_desc): Declare.
1148 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1149 Add prototypes.
1150
1151 * w32term.c (lispy_file_action, queue_notifications): New functions.
1152 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1153 <Qrenamed_to>: New symbols.
1154 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1155
1156 * w32notify.c: New file, implements file event notifications for
1157 MS-Windows.
1158
1159 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1160 by posting it to the w32_read_socket queue.
1161
1162 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
1163
1164 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1165 (GLOBAL_SOURCES): Add w32notify.c
1166 ($(BLD)/w32notify.$(O)): New set of dependencies.
1167
1168 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1169
1170 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1171 Handle FILE_NOTIFY_EVENT.
1172 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1173 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1174 w32notify-handle-event by default.
1175
1176 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1177 syms_of_w32notify.
1178
1179 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1180
1181 Support for filesystem notifications on GNU/Linux via inotify.
1182 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
1183
1184 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1185
1186 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1187 (syms_of_keyboard): DEFSYM it.
1188 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1189 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1190 Qfile_inotify events.
1191 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1192 special-event-map to inotify-handle-event.
1193
1194 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1195
1196 * Makefile.in (base_obj): Add inotify.o.
1197
1198 * inotify.c: New file.
1199
1200 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
1201
1202 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1203
1204 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
1205
1206 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1207 DWORD_PTR, for compatibility with 64-bit builds.
1208
1209 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
1210 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1211 (system_process_attributes): Use SIZE_T rather than DWORD, for
1212 compatibility with 64-bit builds.
1213
1214 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
1215
1216 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1217
1218 2012-12-10 Eli Zaretskii <eliz@gnu.org>
1219
1220 * indent.c (Fvertical_motion): If a display string will be
1221 displayed on the left or the right margin, don't consider it as a
1222 factor in cursor positioning. (Bug#13108)
1223
1224 2012-12-10 Martin Rudalics <rudalics@gmx.at>
1225
1226 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1227
1228 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1229
1230 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1231 for string length.
1232
1233 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1234
1235 * w32.c (unsetenv): Return 0 if the input string is too long.
1236
1237 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1238
1239 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1240 * alloc.c (xputenv): New function.
1241 * dbusbind.c (Fdbus_init_bus):
1242 * emacs.c (main):
1243 * xterm.c (x_term_init):
1244 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
1245 * editfns.c (initial_tz): Move static var decl up.
1246 (tzvalbuf_in_environ): New static var.
1247 (init_editfns): Initialize these two static vars.
1248 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
1249 Save old TZ value on stack, if it's small.
1250 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
1251 instead, use xputenv+unsetenv to set and restore TZ.
1252 (environbuf): Remove static var. All uses removed.
1253 (Fset_time_zone_rule): Do not save TZ and environ;
1254 no longer needed here.
1255 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
1256 Move to inside set_time_zone_rule; they don't need file scope any more.
1257 (set_time_zone_rule): Maintain the TZ=value string separately.
1258 (syms_of_editfns): Don't initialize initial_tz;
1259 init_editfns now does it.
1260 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
1261 * lisp.h (xputenv): New decl.
1262
1263 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
1264
1265 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
1266
1267 2012-12-08 Eli Zaretskii <eliz@gnu.org>
1268
1269 * w32.c (unsetenv, sys_putenv): New functions.
1270
1271 2012-12-08 Chong Yidong <cyd@gnu.org>
1272
1273 * editfns.c (Finsert_char): Make the error message more
1274 informative (Bug#12992).
1275
1276 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1277
1278 Simplify get_lim_data.
1279 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1280 Remove USG and vlimit methods; no longer used these days.
1281 Add #error catchall just in case.
1282
1283 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1284 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1285 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1286 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1287 (deleted_pid_list, Fdelete_process, create_process)
1288 (record_child_status_change, handle_child_signal, deliver_child_signal)
1289 (init_process_emacs, syms_of_process):
1290 Assume SIGCHLD is defined.
1291 (parse_signal): Remove. All uses removed.
1292 (abbr_to_signal): New static function.
1293 (Fsignal_process): Use it to convert signal names to ints.
1294 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1295 kill (getpgrp (), ...).
1296 (emacs_sigaction_init): Assume SIGCHLD is defined.
1297 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1298 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
1299 * syssignal.h (EMACS_KILLPG): Remove.
1300 All uses replaced by 'kill' with a negative pid.
1301 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
1302 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
1303
1304 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
1305
1306 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
1307 This will cause a production Emacs to dump core instead of
1308 infinite-looping.
1309
1310 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1311
1312 * frame.c (make_frame): Do not set window's buffer to t.
1313 * window.c (Fsplit_window_internal): Likewise. Previously it was
1314 used to indicate that the window is being set up. Now we use
1315 set_window_buffer for all new windows, so the condition in ...
1316 (Fset_window_buffer): ... is always true and can be removed.
1317
1318 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
1319
1320 Convenient macro to check whether the buffer is hidden.
1321 * buffer.h (BUFFER_HIDDEN_P): New macro.
1322 * frame.c (make_frame): Use it. Adjust comment.
1323 * buffer.c (candidate_buffer): New function.
1324 (Fother_buffer, other_buffer_safely): Use it.
1325
1326 2012-12-06 Eli Zaretskii <eliz@gnu.org>
1327
1328 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
1329 if the child process is still running. Instead, exit the wait
1330 loop and return zero. (Bug#13086)
1331
1332 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1333
1334 * frame.h (x_char_width, x_char_height): Remove prototypes.
1335 * w32term.h (x_char_width, x_char_height): Likewise.
1336 * xfns.c (x_char_width, x_char_height): Remove.
1337 * w32fns.c (x_char_width, x_char_height): Likewise.
1338 * nsfns.c (x_char_width, x_char_height): Likewise.
1339 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
1340 all window frames.
1341 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
1342 * keyboard.c (command_loop_1): Remove prototype.
1343 (command_loop_2, top_level_1): Add static to match prototype.
1344
1345 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
1346
1347 Fix a recently-introduced delete-process race condition.
1348 * callproc.c, process.h (record_kill_process):
1349 New function, containing part of the old call_process_kill.
1350 (call_process_kill): Use it.
1351 This does not change call_process_kill's behavior.
1352 * process.c (Fdelete_process): Use record_kill_process to fix a
1353 race condition that could cause Emacs to lose track of a child.
1354
1355 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
1356
1357 Avoid code duplication between prev_frame and next_frame.
1358 * frame.c (candidate_frame): New function. Add comment.
1359 (prev_frame, next_frame): Use it. Adjust comment.
1360
1361 2012-12-06 Eli Zaretskii <eliz@gnu.org>
1362
1363 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
1364 fails, signal an error instead of continuing with an empty
1365 string. (Bug#13079)
1366 Encode expanded temp file pattern before passing it to mkstemp or
1367 mktemp.
1368
1369 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
1370 Encode the file name before passing it to dostounix_filename, in
1371 case it will downcase it (under w32-downcase-file-names).
1372 (Bug#12933)
1373
1374 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
1375
1376 Minor call-process cleanups.
1377 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
1378 at the same time as other platforms, to simplify analysis.
1379 No need for fd0_volatile since we have synch_process_fd.
1380 Avoid needless emacs_close; arg is always negative.
1381
1382 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
1383
1384 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
1385 processes.
1386
1387 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
1388
1389 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
1390 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
1391 and mouse_face_hidden members to a bitfields.
1392 * frame.h (struct frame): Remove set-but-not-used space_width member.
1393 (FRAME_SPACE_WIDTH): Remove.
1394 * nsterm.m, w32term.c, xterm.c: Adjust users.
1395 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
1396 member. Adjust users. Convert term_initted, delete_in_insert_mode,
1397 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
1398 members to a bitfields.
1399
1400 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
1401
1402 Don't let call-process be a zombie factory (Bug#12980).
1403 Fixing this bug required some cleanup of the signal-handling code.
1404 As a side effect, this change also fixes a longstanding rare race
1405 condition whereby Emacs could mistakenly kill unrelated processes,
1406 and it fixes a bug where a second C-g does not kill a recalcitrant
1407 synchronous process in GNU/Linux and similar platforms.
1408 The patch should also fix the last vestiges of Bug#9488,
1409 a bug which has mostly been fixed on the trunk by other changes.
1410 * callproc.c, process.h (synch_process_alive, synch_process_death)
1411 (synch_process_termsig, sync_process_retcode):
1412 Remove. All uses removed, to simplify analysis and so that
1413 less consing is done inside critical sections.
1414 * callproc.c (call_process_exited): Remove. All uses replaced
1415 with !synch_process_pid.
1416 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
1417 These take the role of what used to be in unwind-protect arg.
1418 All uses changed.
1419 (block_child_signal, unblock_child_signal):
1420 New functions, to avoid races that could kill innocent-victim processes.
1421 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
1422 (call_process_kill): Record killed processes as deleted, so that
1423 zombies do not clutter up the system. Do this inside a critical
1424 section, to avoid a race that would allow the clutter.
1425 (call_process_cleanup): Fix code so that the second C-g works again
1426 on common platforms such as GNU/Linux.
1427 (Fcall_process): Create the child process in a critical section,
1428 to fix a race condition. If creating an asynchronous process,
1429 record it as deleted so that zombies do not clutter up the system.
1430 Do unwind-protect for WINDOWSNT too, as that's simpler in the
1431 light of these changes. Omit unnecessary call to emacs_close
1432 before failure, as the unwind-protect code does that.
1433 * callproc.c (call_process_cleanup):
1434 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
1435 * process.c (record_deleted_pid): New function, containing
1436 code refactored out of Fdelete_process.
1437 (Fdelete_process): Use it.
1438 (process_status_retrieved): Remove. All callers changed to use
1439 child_status_change.
1440 (record_child_status_change): Remove, folding its contents into ...
1441 (handle_child_signal): ... this signal handler. Now, this
1442 function is purely a handler for SIGCHLD, and is not called after
1443 a synchronous waitpid returns; the synchronous code is moved to
1444 wait_for_termination. There is no need to worry about reaping
1445 more than one child now.
1446 * sysdep.c (get_child_status, child_status_changed): New functions.
1447 (wait_for_termination): Now takes int * status and bool
1448 interruptible arguments, too. Do not record child status change;
1449 that's now the caller's responsibility. All callers changed.
1450 Reimplement in terms of get_child_status.
1451 (wait_for_termination_1, interruptible_wait_for_termination):
1452 Remove. All callers changed to use wait_for_termination.
1453 * syswait.h: Include <stdbool.h>, for bool.
1454 (record_child_status_change, interruptible_wait_for_termination):
1455 Remove decls.
1456 (record_deleted_pid, child_status_changed): New decls.
1457 (wait_for_termination): Adjust to API changes noted above.
1458
1459 * bytecode.c, lisp.h (Qbytecode): Remove.
1460 No longer needed after 2012-11-20 interactive-p changes.
1461
1462 2012-12-03 Eli Zaretskii <eliz@gnu.org>
1463
1464 * xdisp.c (redisplay_window): If the cursor is visible, but inside
1465 the scroll margin, move point outside the margin. (Bug#13055)
1466
1467 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
1468
1469 * gtkutil.c (my_log_handler): New function.
1470 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
1471
1472 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1473
1474 * lisp.h (modify_region): Rename to...
1475 (modify_region_1): ...new prototype.
1476 * textprop.c (modify_region): Now static. Adjust users.
1477 * insdel.c (modify_region): Rename to...
1478 (modify_region_1): ...new function to work with current buffer.
1479 Adjust comment and users. Use true and false for booleans.
1480
1481 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
1482
1483 * alloc.c (free_save_value): New function.
1484 (safe_alloca_unwind): Use it.
1485 * lisp.h (free_save_value): New prototype.
1486 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
1487 Add comment.
1488 (save_excursion_restore): Adjust to match saved data structure.
1489 Use free_save_value to offload some work from GC. Drop obsolete
1490 #if 0 code.
1491
1492 2012-12-03 Chong Yidong <cyd@gnu.org>
1493
1494 * fileio.c (Vauto_save_list_file_name): Doc fix.
1495
1496 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
1497
1498 * w32fns.c: Remove prototype of atof.
1499 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
1500 builds.
1501 (file_dialog_callback): Make it UINT_PTR.
1502
1503 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
1504 with 64-bit builds.
1505
1506 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1507 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
1508 defined.
1509
1510 2012-12-03 Glenn Morris <rgm@gnu.org>
1511
1512 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
1513
1514 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
1515
1516 Fix xpalloc confusion after memory is exhausted.
1517 * alloc.c (xpalloc): Comment fix.
1518 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
1519 and signals an error, do not clear charset_table_size, as
1520 charset_table is still valid.
1521 * doprnt.c (evxprintf): Clear *BUF after freeing it.
1522
1523 Use execve to avoid need to munge environ (Bug#13054).
1524 * callproc.c (Fcall_process):
1525 * process.c (create_process):
1526 Don't save and restore environ; no longer needed.
1527 * callproc.c (child_setup):
1528 Use execve, not execvp, to preserve environ.
1529
1530 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
1531
1532 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
1533
1534 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1535
1536 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
1537 display for sliced images (Bug#10500).
1538
1539 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
1540
1541 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
1542
1543 * doc.c (Fdocumentation): Re-add handling of function-documentation,
1544 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
1545
1546 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
1547
1548 * xdisp.c (window_outdated): Remove eassert since it hits
1549 some suspicious corner cases (see Bug#13007 and Bug#13012).
1550 (mode_line_update_needed): New function.
1551 (redisplay_internal, redisplay_window): Use it.
1552 (ensure_selected_frame): New function.
1553 (redisplay_internal, unwind_redisplay): Use it.
1554 (redisplay_internal): Move comment about buffer_shared...
1555 (buffer_shared_and_changed): ...near to its real use.
1556
1557 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 * callproc.c (Fcall_process): Don't misreport vfork failure.
1560
1561 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
1562
1563 * callproc.c (Fcall_process): Fix vfork portability problems.
1564 Do not assume that fd[0], count, filefd, and save_environ survive
1565 vfork. Fix bug whereby wrong errno value could be reported for
1566 pipe failure. Some minor cleanups, too, as follows. Move buf and
1567 bufsize to the context where they're needed. Change new_argv to
1568 be of type char **, as this is more convenient and avoids casts.
1569 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
1570 Now local constants, not macros.
1571
1572 2012-11-18 Kenichi Handa <handa@gnu.org>
1573
1574 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
1575 for the variable "f".
1576
1577 2012-11-13 Kenichi Handa <handa@gnu.org>
1578
1579 * font.c (font_unparse_xlfd): Exclude special characters from the
1580 generating XLFD name.
1581
1582 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
1585 * dired.c (stat_uname, stat_gname):
1586 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
1587
1588 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
1589 * dired.c (directory_files_internal, file_name_completion):
1590 Assume EAGAIN and EINTR are defined.
1591
1592 * fileio.c (Fcopy_file): Assume EISDIR is defined.
1593 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
1594 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
1595 * lread.c (readbyte_from_file): Assume EINTR is defined.
1596 * process.c (wait_reading_process_output, send_process) [subprocesses]:
1597 Assume EIO and EAGAIN are defined.
1598 * unexcoff.c (write_segment): Assume EFAULT is defined.
1599
1600 2012-11-27 Eli Zaretskii <eliz@gnu.org>
1601
1602 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
1603 (Bug#11964)
1604
1605 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
1606 highlighting on the frame was cleared. Prevents assertion
1607 violations when repeatedly clicking on the "Top" link of the
1608 "bread-crumbs" in Info buffers.
1609
1610 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
1611
1612 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
1613
1614 2012-11-24 Ken Brown <kbrown@cornell.edu>
1615
1616 * keyboard.c (HAVE_MOUSE):
1617 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
1618 were always defined.
1619
1620 2012-11-24 Eli Zaretskii <eliz@gnu.org>
1621
1622 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
1623 between bpos_covered and bpos_max. This fixes cursor display when
1624 several display strings follow each other.
1625
1626 * .gdbinit (pgx): If the glyph's object is a string, display the
1627 pointer to string data, rather than the value of the string object
1628 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1629
1630 * indent.c (Fvertical_motion): If the starting position is covered
1631 by a display string, return to one position before that, to avoid
1632 overshooting it inside move_it_to. (Bug#12930)
1633
1634 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1635
1636 * frame.h (struct frame): Remove display_preempted member
1637 since all users are dead long ago.
1638 * nsterm.h (struct x_output): Use the only dummy member.
1639 * w32menu.c (pending_menu_activation): Remove since not
1640 really used.
1641 (set_frame_menubar): Adjust user.
1642 * w32term.h (struct x_output): Drop outdated #if 0 code.
1643 (struct w32_output): Use bitfields for explicit_parent,
1644 asked_for_visible and menubar_active members.
1645 Drop unused pending_menu_activation member.
1646 * xterm.h (struct x_output): Drop outdated #if 0 code.
1647 Use bitfields for explicit_parent, asked_for_visible,
1648 has_been_visible and net_wm_state_hidden_seen members.
1649
1650 2012-11-23 Eli Zaretskii <eliz@gnu.org>
1651
1652 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
1653 of a literal "/". (Bug#12955)
1654 (gl-stamp): Invoke fc.exe directly, not through cmd.
1655
1656 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
1659 * dired.c: Assume HAVE_DIRENT_H.
1660 (NAMLEN): Remove, replacing with ...
1661 (dirent_namelen): New function. All uses changed. Use the GNU macro
1662 _D_EXACT_NAMELEN if available, as it's faster than strlen.
1663 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
1664 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
1665 * makefile.w32-in (DIR_H): Remove. All uses replaced with
1666 $(NT_INC)/dirent.h.
1667 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
1668 * ndir.h: Rename to ../nt/inc/dirent.h.
1669 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
1670 Do not include <dirent.h>; no longer needed.
1671 * w32.c: Include <dirent.h> rather than "ndir.h".
1672
1673 2012-11-23 Chong Yidong <cyd@gnu.org>
1674
1675 * xftfont.c (xftfont_open): Remove duplicate assignment.
1676
1677 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 * alloc.c (Fgarbage_collect): Unblock input after clearing
1680 gc_in_progress to avoid note_mouse_highlight glitch with GC.
1681 * frame.h (FRAME_MOUSE_UPDATE): New macro.
1682 * msdos.c (IT_frame_up_to_date): Use it here...
1683 * w32term.c (w32_frame_up_to_date): ...here...
1684 * xterm.c (XTframe_up_to_date): ...and here...
1685 * nsterm.m (ns_frame_up_to_date): ...but not here.
1686 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
1687 Adjust users.
1688 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
1689 Do not check whether GC is in progress.
1690
1691 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1692
1693 * xdisp.c (window_buffer_changed): New function.
1694 (update_menu_bar, update_tool_bar): Use it to
1695 simplify large 'if' statements.
1696 (redisplay_internal): Generalize commonly used
1697 'tail' and 'frame' local variables.
1698
1699 2012-11-22 Eli Zaretskii <eliz@gnu.org>
1700
1701 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
1702 with Windows system header.
1703
1704 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
1705
1706 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
1707 * alloc.c: Assume unistd.h exists.
1708 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
1709 * sysdep.c (get_current_dir_name): Assume getcwd exists.
1710 (getwd) [USG]: Remove; no longer needed.
1711 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
1712 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
1713 * w32.h (getcwd): Remove decl.
1714
1715 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
1716
1717 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
1718 Make it set selected_window as well.
1719 (update_tool_bar): Use it.
1720
1721 2012-11-21 Ken Brown <kbrown@cornell.edu>
1722
1723 * emacs.c (main): Set the G_SLICE environment variable for all
1724 Cygwin builds, not just GTK builds. See
1725 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
1726
1727 2012-11-21 Eli Zaretskii <eliz@gnu.org>
1728
1729 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1730 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
1731 Define for the MSVC compiler.
1732
1733 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
1734
1735 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
1736 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
1737 dostounix_filename. Prevents crashes down the road, because
1738 dostounix_filename assumes it gets a unibyte string.
1739 Reported by Michel de Ruiter <michel@sentient.nl>, see
1740 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
1741
1742 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1743
1744 Conflate Qnil and Qunbound for `symbol-function'.
1745 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
1746 * lread.c (init_obarray): Set `function' fields to Qnil.
1747 * eval.c (Fcommandp): Ignore Qunbound.
1748 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
1749 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
1750 Test NILP rather than Qunbound.
1751 (Ffmakunbound): Set to Qnil.
1752 (Fsymbol_function): Never signal an error.
1753 (Finteractive_form): Ignore Qunbound.
1754
1755 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
1756
1757 * eval.c (interactive_p): Remove no-longer-used decl.
1758
1759 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
1760
1761 * xdisp.c (buffer_shared): Adjust comment.
1762 (buffer_shared_and_changed): New function.
1763 (prepare_menu_bars, redisplay_internal): Use it to
1764 decide whether all windows or frames should be updated.
1765 (window_outdated): New function.
1766 (text_outside_line_unchanged_p, redisplay_window): Use it.
1767 (redisplay_internal): Likewise. Fix indentation.
1768
1769 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1770
1771 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
1772 (syms_of_eval): Remove corresponding defsubr.
1773 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
1774
1775 2012-11-19 Daniel Colascione <dancol@dancol.org>
1776
1777 * w32fns.c (Fx_file_dialog):
1778 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
1779 cygwin_convert_file_name*.
1780
1781 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
1782 Rename cygwin_convert_path* to cygwin_convert_file_name*.
1783
1784 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
1785
1786 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
1787
1788 2012-11-18 Eli Zaretskii <eliz@gnu.org>
1789
1790 * w32select.c: Include w32common.h before w32term.h, so that
1791 windows.h gets included before w32term.h uses some of its
1792 features, see below.
1793
1794 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1795 New typedefs.
1796 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1797 New prototypes.
1798 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1799
1800 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
1801
1802 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1803 (ns_select): Return at once if events are held (Bug#12834).
1804
1805 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
1806
1807 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1808 Needed following 2012-10-20 change. (Bug#12902)
1809
1810 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
1811
1812 * w32proc.c (waitpid): Remove unused label get_result.
1813
1814 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
1815
1816 * makefile.w32-in (SYSWAIT_H): New macro.
1817 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1818 ($(BLD)/sysdep.$(O)): Update dependencies.
1819
1820 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1821
1822 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1823 * callproc.c (relocate_fd): Assume F_DUPFD.
1824 * emacs.c, term.c (O_RDWR): Remove.
1825 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1826 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1827 * nsterm.m: Assume <fcntl.h> exists.
1828 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1829 (create_pty, Fmake_network_process, server_accept_connection)
1830 (wait_reading_process_output, init_process_emacs):
1831 Assume O_NONBLOCK.
1832 (wait_reading_process_output): Put in a special case for WINDOWSNT
1833 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1834 It's not clear this is needed, but it's a more-conservative change.
1835 (create_process): Assume FD_CLOEXEC.
1836 (create_process, create_pty): Assume O_NOCTTY.
1837 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1838 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1839 Omit if not DOS_NT, since F_GETFL is not defined there.
1840 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1841 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1842 (O_NOCTTY): Remove.
1843 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1844 lack it, since gnulib guarantees this.
1845 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1846
1847 2012-11-17 Eli Zaretskii <eliz@gnu.org>
1848
1849 * w32.c (faccessat): Pretend that directories have the execute bit
1850 set. Emacs expects that, e.g., in files.el:cd-absolute.
1851
1852 * w32proc.c (create_child): Don't clip the PID of the child
1853 process to fit into an Emacs integer, as this is no longer a
1854 restriction.
1855 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1856 reaping only the process specified by PID argument, if that is
1857 positive. Use PID instead of dead_child to know which process to
1858 reap. Wait for the child to die only if WNOHANG is not in
1859 OPTIONS.
1860 (sys_select): Don't set dead_child.
1861
1862 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1863 as it is no longer needed.
1864
1865 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1866 no longer needed.
1867 (record_child_status_change): Remove the setting of
1868 record_at_most_one_child for the !WNOHANG case.
1869
1870 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1871
1872 Fix problems in ns port found by static checking.
1873 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1874 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1875 not to process group.
1876 (ns_select): Use emacs_write, not write, as that's more robust
1877 in the presence of signals.
1878 (fd_handler:): Check for read errors.
1879
1880 2012-11-16 Glenn Morris <rgm@gnu.org>
1881
1882 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1883
1884 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
1885
1886 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1887
1888 2012-11-16 Eli Zaretskii <eliz@gnu.org>
1889
1890 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1891 use the same value of thread handle.
1892 (start_timer_thread): If the timer thread exited (due to error),
1893 clean up by closing the two handles it used. Duplicate the caller
1894 thread's handle here, so it gets duplicated only once, when
1895 launching the timer thread. Set priority of the timer thread, not
1896 the caller thread.
1897 (getitimer): Don't duplicate the caller thread's handle here.
1898 (Bug#12832)
1899
1900 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
1901
1902 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1903 called (Bug#12834).
1904
1905 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 Remove no-longer-used pty_max_bytes variable.
1908 * process.c (pty_max_bytes): Remove; unused.
1909 (send_process): Do not set it.
1910
1911 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
1912
1913 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1914 Update dependencies.
1915
1916 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1917
1918 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1919 This follows up on the 2012-09-29 patch that removed indirection
1920 for the 'function' field. Reported by Sergey Vinokurov in
1921 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1922
1923 2012-11-14 Eli Zaretskii <eliz@gnu.org>
1924
1925 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1926 different name, as the MS runtime does not have such a function,
1927 and probably never will.) All callers changed. Ignore DIRFD
1928 value if PATH is an absolute file name, to match Posix spec
1929 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1930 symlinks.
1931
1932 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1933
1934 * xdisp.c (echo_area_display, redisplay_internal):
1935 Omit redundant check whether frame_garbaged is set.
1936
1937 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 Use faccessat, not access, when checking file permissions (Bug#12632).
1940 This fixes a bug that has been present in Emacs since its creation.
1941 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1942 which must set some sort of record. (Torek's bug report was against
1943 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1944 same common flaw.) See Torek's Usenet posting
1945 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1946 Posted: Fri Apr 8 14:18:56 1983.
1947 * Makefile.in (LIB_EACCESS): New macro.
1948 (LIBES): Use it.
1949 * callproc.c (init_callproc):
1950 * charset.c (init_charset):
1951 * fileio.c (check_existing, check_executable, check_writable)
1952 (Ffile_readable_p):
1953 * lread.c (openp, load_path_check):
1954 * process.c (allocate_pty):
1955 * xrdb.c (file_p):
1956 Use effective UID when checking permissions, not real UID.
1957 * callproc.c (init_callproc):
1958 * charset.c (init_charset):
1959 * lread.c (load_path_check, init_lread):
1960 Test whether directories are accessible, not merely whether they exist.
1961 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1962 * fileio.c (check_existing, check_executable, check_writable)
1963 (Ffile_readable_p):
1964 Use symbolic names instead of integers for the flags, as they're
1965 portable now.
1966 (check_writable): New arg AMODE. All uses changed.
1967 Set errno on failure.
1968 (Ffile_readable_p): Use faccessat, not stat + open + close.
1969 (Ffile_writable_p): No need to call check_existing + check_writable.
1970 Just call check_writable and then look at errno. This saves a syscall.
1971 dir should never be nil; replace an unnecessary runtime check
1972 with an eassert. When checking the parent directory of a nonexistent
1973 file, check that the directory is searchable as well as writable, as
1974 we can't create files in unsearchable directories.
1975 (file_directory_p): New function, which uses 'stat' on most platforms
1976 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1977 (Ffile_directory_p, Fset_file_times): Use it.
1978 (file_accessible_directory_p): New function, which uses a single
1979 syscall for efficiency.
1980 (Ffile_accessible_directory_p): Use it.
1981 * xrdb.c (file_p): Use file_directory_p.
1982 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1983 * lread.c (openp): When opening a file, use fstat rather than
1984 stat, as that avoids a permissions race. When not opening a file,
1985 use file_directory_p rather than stat.
1986 (dir_warning): First arg is now a usage string, not a format.
1987 Use errno. All uses changed.
1988 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1989 that merely introduced a race.
1990 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1991 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1992 and similarly for the other O_* flags.
1993 * w32.c (sys_faccessat): Rename from sys_access and switch to
1994 faccessat's API. All uses changed.
1995 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1996 (magic_db): Rename from magic_file_p.
1997 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1998 char *, so that we don't have to test for file existence
1999 separately from opening the file for reading. This removes a race
2000 fixes a permission-checking problem, and simplifies the code.
2001 All uses changed.
2002 (file_p): Remove; no longer needed.
2003
2004 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2005
2006 Omit glyphs initialization at startup.
2007 * dispnew.c (glyphs_initialized_initially_p): Remove.
2008 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2009 (Fredraw_frame): Move actual code from here...
2010 (redraw_frame): ...to here. Add eassert. Adjust comment.
2011 (Fredraw_display): Use redraw_frame.
2012 * xdisp.c (clear_garbaged_frames): Likewise.
2013
2014 2012-11-13 Eli Zaretskii <eliz@gnu.org>
2015
2016 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2017 passed to pint2str and pint2hrstr to be at most the size of the
2018 frame's decode_mode_spec_buffer. This avoids crashes with very
2019 large values of FIELD_WIDTH argument to decode_mode_spec.
2020 (Bug#12867)
2021
2022 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2023
2024 Fix a race with verify-visited-file-modtime (Bug#12863).
2025 Since at least 1991 Emacs has ignored an mtime difference of no
2026 more than one second, but my guess is that this was to work around
2027 file system bugs that were fixed long ago. Since the race is
2028 causing problems now, let's remove that code.
2029 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2030 whose time stamp is off by no more than a second. Insist that the
2031 file time stamps match exactly.
2032
2033 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2034
2035 * frame.h (struct frame): Convert external_tool_bar member to
2036 1-bit unsigned bitfield.
2037 * termhooks.h (struct terminal): Remove mouse_moved member since
2038 all users are long dead. Adjust comment on mouse_position_hook.
2039
2040 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2041
2042 Simplify by using FOR_EACH_FRAME here and there.
2043 * frame.c (next_frame, prev_frame, other_visible_frames)
2044 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2045 * w32term.c (x_window_to_scroll_bar): Likewise.
2046 * window.c (window_list): Likewise.
2047 * xdisp.c (x_consider_frame_title): Likewise.
2048 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2049 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2050 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2051 * xmenu.c (menubar_id_to_frame): Likewise.
2052 * xselect.c (frame_for_x_selection): Likewise.
2053 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2054 (x_window_to_menu_bar): Likewise.
2055 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2056
2057 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2058
2059 * data.c (Qdefalias_fset_function): Now static.
2060
2061 Another tweak to vectorlike_header change.
2062 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2063 Remove, and replace all uses with ...
2064 (next_in_free_list, set_next_in_free_list):
2065 New functions, which respect C's aliasing rules better.
2066
2067 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2068
2069 * window.c (list4i): Rename from 'quad'. All uses changed.
2070 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2071
2072 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
2073
2074 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2075 warning about mixing declarations and code in ISO C90.
2076
2077 2012-11-10 Martin Rudalics <rudalics@gmx.at>
2078
2079 * window.c (Fsplit_window_internal): Set combination limit of
2080 new parent window to t iff Vwindow_combination_limit is t;
2081 fixing a regression introduced with the change from 2012-09-22.
2082 (Fset_window_combination_limit): Fix doc-string.
2083
2084 2012-11-10 Eli Zaretskii <eliz@gnu.org>
2085
2086 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2087 amount when the scroll margins are too large. When scrolling
2088 backwards in the buffer, give up if cannot reach point or the
2089 scroll margin within a reasonable number of screen lines.
2090 Fixes point position in window under scroll-up/down-aggressively when
2091 point is positioned many lines beyond the window top/bottom.
2092 (Bug#12811)
2093
2094 * ralloc.c (relinquish): If real_morecore fails to return memory
2095 to the system, don't crash; instead, leave the last heap
2096 unchanged and return. (Bug#12774)
2097
2098 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2099
2100 * lisp.h (AUTOLOADP): New macro.
2101 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2102 * data.c (Ffset): Remove special ad-advice-info handling.
2103 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2104 (Fsubr_arity): CSE.
2105 (Finteractive_form): Simplify.
2106 (Fquo): Don't insist on having at least 2 arguments.
2107 (Qdefalias_fset_function): New var.
2108
2109 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2110
2111 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2112
2113 * nsfont.m (Qcondensed, Qexpanded): New variables.
2114 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2115 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2116
2117 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2118
2119 Fix recently introduced crash on MS-Windows (Bug#12839).
2120 * w32term.h (struct scroll_bar): Use convenient header.
2121 (SCROLL_BAR_VEC_SIZE): Remove.
2122 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2123
2124 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2125
2126 Tweak last vectorlike_header change.
2127 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2128 vectorlike object on the free list. This is introduced to avoid
2129 some (but not all) pointer casting and aliasing problems, see
2130 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2131 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2132 objects.
2133 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2134
2135 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2136
2137 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
2138 been removed, so remove them here also.
2139
2140 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2141
2142 * doc.c (Fdocumentation): Handle new property
2143 dynamic-docstring-function to replace the old ad-advice-info.
2144
2145 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2146
2147 * fns.c (Qeql, hashtest_eq): Now static.
2148
2149 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2150
2151 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2152 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2153 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2154 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2155
2156 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2157
2158 Use same hash function for hashfn_profiler as for hash_string etc.
2159 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2160 * lisp.h (sxhash_combine): New inline function, with the contents
2161 of the old SXHASH_COMBINE.
2162 * profiler.c (hashfn_profiler): Use it, instead of having a
2163 special hash function containing a comparison that always yields 1.
2164
2165 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2166
2167 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2168 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2169 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2170 Remove unused vars.
2171
2172 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2173
2174 * image.c (xpm_make_color_table_h): Fix compiler error because
2175 make_hash_table changed.
2176
2177 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
2178
2179 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2180
2181 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2182
2183 Use ad-hoc comparison function for the profiler's hash-tables.
2184 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2185 (make_log): Use them.
2186 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2187 call Fequal any more.
2188 (Ffunction_equal): New function.
2189 (cmpfn_profiler, hashfn_profiler): New functions.
2190 (syms_of_profiler): Initialize them.
2191 * lisp.h (struct hash_table_test): New struct.
2192 (struct Lisp_Hash_Table): Use it.
2193 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2194 * fns.c (make_hash_table): Take a struct to describe the test.
2195 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2196 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2197 (hash_lookup, hash_remove_from_table): Move assertion checking of
2198 hashfn result here. Check hash-equality before calling cmpfn.
2199 (Fmake_hash_table): Adjust call to make_hash_table.
2200 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2201 (syms_of_fns): Initialize them.
2202 * emacs.c (main): Move syms_of_fns earlier.
2203 * xterm.c (syms_of_xterm):
2204 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2205 * print.c (print_object): Adjust to new hash-table struct.
2206 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2207
2208 2012-11-08 Eli Zaretskii <eliz@gnu.org>
2209
2210 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2211 value of w32-scroll-lock-modifier is neither nil nor one of the
2212 known key modifiers. (Bug#12806)
2213
2214 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2215
2216 Shrink struct vectorlike_header to the only size field.
2217 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2218 Adjust comment.
2219 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2220 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2221 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2222 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2223 information from the vector header. Adjust comment.
2224 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2225 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2226 layout.
2227 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2228 (struct vectorlike_header): Remove next member. Adjust comment.
2229 (struct Lisp_Subr): Add convenient header. Adjust comment.
2230 (allocate_pseudovector): Adjust prototype.
2231 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2232 (sweep_string, lisp_malloc): Remove useless prototypes.
2233 (enum mem_type): Adjust comment.
2234 (NEXT_IN_FREE_LIST): New macro.
2235 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2236 (Fmake_bool_vector): Likewise.
2237 (struct large_vector): New type to represent allocation unit for
2238 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2239 (large_vectors): Change type to struct large_vector.
2240 (allocate_vector_from_block): Simplify.
2241 (PSEUDOVECTOR_NBYTES): Replace with...
2242 (vector_nbytes): ...new function. Adjust users.
2243 (sweep_vectors): Adjust processing of large vectors.
2244 (allocate_vectorlike): Likewise.
2245 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
2246 Add easserts. Adjust XSETPVECTYPESIZE usage.
2247 (allocate_buffer): Use BUFFER_PVEC_INIT.
2248 (live_vector_p): Adjust to match large vector.
2249 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
2250 * buffer.h (struct buffer): Add next member.
2251 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
2252 New macros.
2253 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
2254 * fns.c (internal_equal): Adjust to match enum pvec_type change.
2255 (copy_hash_table): Adjust to match vector header change.
2256 * lread.c (defsubr): Use XSETPVECTYPE.
2257 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
2258 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
2259 (xvecsize): New command.
2260
2261 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2262
2263 * keyboard.c (event_to_kboard): Do not dereference
2264 frame_or_window field of SELECTION_REQUEST_EVENT
2265 and SELECTION_CLEAR_EVENT events (Bug#12814).
2266 * xterm.h (struct selection_input_event): Adjust comment.
2267
2268 2012-11-07 Eli Zaretskii <eliz@gnu.org>
2269
2270 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2271 such as Scroll Lock, if the respective keys are treated as
2272 function keys, not as modifiers. This avoids destroying non-ASCII
2273 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
2274
2275 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2276
2277 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2278
2279 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2280
2281 Restore some duplicate definitions (Bug#12814).
2282 This undoes part of the 2012-11-03 changes. Some people build
2283 with plain -g rather than with -g3, and they need the duplicate
2284 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2285 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2286 Define as macros, as well as as enums or as constants.
2287
2288 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2289
2290 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2291 to keypad keys (Bug#12816).
2292
2293 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2294
2295 Minor adjustments of recently-changed frame functions.
2296 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2297 known to be a frame (we're in the FRAMEP branch).
2298 * lisp.h (Qframep): Remove decl. frame.h declares this.
2299 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
2300 since they're meant for Lisp fixnum values.
2301
2302 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2303
2304 * window.c (Fwindow_combination_limit): Revert to the only
2305 required argument and adjust docstring as suggested in
2306 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
2307 by Martin Rudalics <rudalics@gmx.at>.
2308
2309 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2310
2311 Widely used frame validity and checking functions.
2312 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
2313 * frame.c (decode_live_frame, decode_any_frame): New functions.
2314 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
2315 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
2316 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
2317 (Fframe_pointer_visible_p): Use decode_any_frame.
2318 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
2319 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
2320 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
2321 (Fframe_focus): Likewise. Allow zero number of arguments.
2322 Adjust docstring.
2323 (frame_buffer_list, frame_buffer_predicate): Remove.
2324 * lisp.h (frame_buffer_predicate): Remove prototype.
2325 * buffer.c (Fother_buffer): Use decode_any_frame.
2326 * xdisp.c (Ftool_bar_lines_needed): Likewise.
2327 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
2328 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
2329 (Fclose_font, Ffont_info): Use decode_live_frame.
2330 * fontset.c (check_fontset_name): Likewise.
2331 * terminal.c (Fframe_terminal): Likewise.
2332 * w32fns.c (check_x_frame): Likewise.
2333 * window.c (Fminibuffer_window, Fwindow_at)
2334 (Fcurrent_window_configuration): Likewise.
2335 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
2336 Likewise. Allow zero number of arguments. Adjust docstring.
2337 * dispnew.c (Fredraw_frame): Likewise.
2338 * xfaces.c (frame_or_selected_frame): Remove.
2339 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
2340 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
2341 (Fframe_face_alist): Use decode_live_frame.
2342 * xfns.c (check_x_frame): Likewise.
2343
2344 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
2345
2346 * window.c (quad): New function.
2347 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
2348 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
2349 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
2350 (Fwindow_line_height): Use it.
2351 (Fwindow_fringes): Use list3.
2352 (Fwindow_scroll_bars): Use list4.
2353 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
2354 (Fwindow_combination_limit): Allow zero number of arguments.
2355
2356 2012-11-05 Eli Zaretskii <eliz@gnu.org>
2357
2358 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
2359
2360 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
2361 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
2362 file descriptor 2 for standard error. (Bug#12805)
2363
2364 2012-11-05 Chong Yidong <cyd@gnu.org>
2365
2366 * process.c (wait_reading_process_output): Revert previous change.
2367
2368 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
2369
2370 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
2371 This removes code that has been obsolete since around 1990.
2372 * callproc.c (Fcall_process):
2373 * emacs.c (main):
2374 * process.c (create_process):
2375 * term.c (dissociate_if_controlling_tty):
2376 Assume setsid exists.
2377 * callproc.c (child_setup): Assume setpgid exists and behaves as
2378 per POSIX.1-1988 or later.
2379 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
2380 * emacs.c (shut_down_emacs):
2381 * sysdep.c (sys_suspend, init_foreground_group):
2382 Assume getpgrp behaves as per POSIX.1-1998 or later.
2383 * msdos.c (setpgrp): Remove.
2384 (tcgetpgrp, setpgid, setsid): New functions.
2385 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
2386 * term.c (no_controlling_tty): Remove; unused.
2387 * w32proc.c (setpgrp): Remove.
2388 (setsid, tcgetpgrp): New functions.
2389
2390 Simplify by assuming __fpending.
2391 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
2392 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
2393 Do not assume that __fpending's result fits in int.
2394
2395 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
2396
2397 Remove EMACS_OUTQSIZE+sleep hack.
2398 * dispnew.c (update_frame_1): Remove hack for terminals slower
2399 than 2400 bps, which throttled Emacs by having it sleep.
2400 This code hasn't worked since at least 2007, when the multi-tty stuff
2401 was added, and anyway those old terminals are long dead.
2402 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
2403 without the dispnew.c change, as dispnew.c doesn't include systty.h.
2404
2405 Fix data-loss with --version (Bug#9574).
2406 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
2407 as we can't assume that emacs_strerror is initialized, and strerror
2408 is good enough here.
2409 (main): Invoke atexit earlier, to catch earlier instances of
2410 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
2411
2412 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2413
2414 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
2415 (keyDown): Remap keypad keys to X11 virtual key codes.
2416
2417 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
2418
2419 Fix data-loss with --batch (Bug#9574).
2420 * emacs.c: Include <close-stream.h>.
2421 (close_output_streams): New function.
2422 (main): Pass it to atexit, so that Emacs closes stdout and stderr
2423 and handles errors appropriately.
2424 (Fkill_emacs): Don't worry about flushing, as close_output_stream
2425 does that now.
2426
2427 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
2428 The symptom is a diagnostic "GLib-WARNING **: In call to
2429 g_spawn_sync(), exit status of a child process was requested but
2430 SIGCHLD action was set to SIG_IGN and ECHILD was received by
2431 waitpid(), so exit status can't be returned." The diagnostic
2432 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
2433 The real bug is a race condition between Emacs and glib: Emacs
2434 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
2435 so that glib can't find it. Work around the bug by invoking
2436 waitpid only on subprocesses that Emacs itself creates.
2437 * process.c (create_process, record_child_status_change):
2438 Don't use special value -1 in pid field, as the caller now must
2439 know the pid rather than having the callee infer it.
2440 The inference was sometimes incorrect anyway, due to another race.
2441 (create_process): Set new 'alive' member if child is created.
2442 (process_status_retrieved): New function.
2443 (record_child_status_change): Use it.
2444 Accept negative 1st argument, which means to wait for the
2445 processes that Emacs already knows about. Move special-case code
2446 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
2447 processes that have already been waited for, by testing and
2448 clearing new 'alive' member.
2449 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
2450 now does this internally.
2451 (handle_child_signal): Let record_child_status_change do all
2452 the work, since we do not want to reap all exited child processes,
2453 only the child processes that Emacs itself created.
2454 * process.h (Lisp_Process): New boolean member 'alive'.
2455
2456 Omit duplicate definitions no longer needed with gcc -g3.
2457 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
2458 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
2459 Define only as macros. There's no longer any need to also define
2460 these symbols as enums or as constants, since we now assume
2461 gcc -g3 when debugging.
2462
2463 2012-11-03 Eli Zaretskii <eliz@gnu.org>
2464
2465 * lisp.mk: Adjust comments to the fact that term/internal is now
2466 loaded from loadup.el.
2467
2468 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
2469 (msdos_fatal_signal): New function.
2470 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
2471 its argument list.
2472
2473 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
2474 for GCC versions before 4.
2475 (emacs_raise): Define to call msdos_fatal_signal.
2476
2477 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
2478 iterator when starting in the middle of a display or overlay
2479 string. (Bug#12745)
2480
2481 2012-11-03 Chong Yidong <cyd@gnu.org>
2482
2483 * process.c (wait_reading_process_output): Clean up the last
2484 change.
2485
2486 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
2487
2488 * process.c (wait_reading_process_output): Avoid a race condition
2489 with SIGIO delivery (Bug#11536).
2490
2491 2012-11-03 Chong Yidong <cyd@gnu.org>
2492
2493 * buffer.c (cursor_type): Untabify docstring.
2494
2495 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2496
2497 * frame.h (struct frame): Drop can_have_scroll_bars member
2498 which is meaningless for a long time. Adjust comments.
2499 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
2500 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
2501
2502 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
2503
2504 * window.c (decode_next_window_args): Update window arg after
2505 calling decode_live_window and so fix crash reported at
2506 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
2507 by Juanma Barranquero <lekktu@gmail.com>.
2508 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
2509 * font.c (Ffont_at): Likewise.
2510
2511 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
2512
2513 * widget.c (resize_cb): New function.
2514 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
2515 (EmacsFrameResize): Check if all is up to date before changing frame
2516 size.
2517
2518 2012-11-02 Eli Zaretskii <eliz@gnu.org>
2519
2520 Implement backtrace output for fatal errors on MS-Windows.
2521 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
2522 (BACKTRACE_LIMIT_MAX): New macro.
2523 (w32_backtrace): New function.
2524 (emacs_abort): Use w32_backtrace when the user chooses not to
2525 attach a debugger. Update the text of the abort dialog.
2526
2527 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2528
2529 Window-related stuff cleanup here and there.
2530 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
2531 Use decode_any_window.
2532 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
2533 * xdisp.c (Fformat_mode_line): Likewise.
2534 * font.c (Ffont_at): Use decode_live_window.
2535 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
2536 * window.c (decode_next_window_args): Likewise.
2537 (decode_any_window): Remove static.
2538 * window.h (decode_any_window): Add prototype.
2539 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
2540 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
2541 respectively.
2542
2543 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2544
2545 Remove pad from struct input_event.
2546 * termhooks.h (struct input_event): Remove padding field.
2547 Adjust comment.
2548 * keyboard.c (event_to_kboard): Simplify because frame_or_window
2549 member is never cons for a long time. Adjust comment.
2550 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
2551 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
2552 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
2553 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
2554
2555 2012-11-01 Eli Zaretskii <eliz@gnu.org>
2556
2557 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
2558
2559 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2560
2561 Fix crash when using Emacs as commit editor for git (Bug#12697).
2562 * callproc.c (setpgrp): Remove macro, as we now use setpgid
2563 and it is configured in conf_post.h.
2564 (Fcall_process): Don't invoke both setsid and setpgid; the former
2565 is enough, if it exists.
2566 * callproc.c (Fcall_process, child_setup):
2567 * process.c (create_process): Use setpgid.
2568 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
2569 for the real thing.
2570 * dispnew.c (init_display): Initialize the foreground group
2571 if we are running a tty display.
2572 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
2573 * lisp.h (init_foreground_group): New decl.
2574 * sysdep.c (inherited_pgroup): New static var.
2575 (init_foreground_group, tcsetpgrp_without_stopping)
2576 (narrow_foreground_group, widen_foreground_group): New functions.
2577 (init_sys_modes): Narrow foreground group.
2578 (reset_sys_modes): Widen foreground group.
2579
2580 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
2581
2582 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
2583
2584 2012-10-31 Martin Rudalics <rudalics@gmx.at>
2585
2586 * minibuf.c (read_minibuf): Restore current buffer since
2587 choose_minibuf_frame calling Fset_frame_selected_window may
2588 change it (Bug#12766).
2589
2590 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
2591
2592 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
2593
2594 2012-10-30 Kenichi Handa <handa@gnu.org>
2595
2596 * font.c (Ffont_at): If WINDOW is specified and it is not
2597 displaying the current buffer, signal an error.
2598
2599 2012-10-29 Daniel Colascione <dancol@dancol.org>
2600
2601 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
2602 In preparation for fixing bug#12739, move these functions from
2603 here...
2604
2605 * coding.h, coding.c: ... to here, and compile them only when
2606 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
2607 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
2608
2609 2012-10-28 Eli Zaretskii <eliz@gnu.org>
2610
2611 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
2612 (timer_loop, getitimer, setitimer): Use it instead of
2613 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
2614 'clock'.
2615 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
2616 literal 10000.
2617
2618 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
2619
2620 * nsterm.m (NO_APPDEFINED_DATA): New define.
2621 (last_appdefined_event_data): New variable
2622 (last_appdefined_event): Remove.
2623 (ns_select): Initialize t from last_appdefined_event_data instead
2624 of [last_appdefined_event data1].
2625 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
2626 remove last_appdefined_event (Bug#12698).
2627
2628 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2629
2630 * frame.c (x_set_font): Catch internal error.
2631
2632 2012-10-27 Eli Zaretskii <eliz@gnu.org>
2633
2634 Avoid overflow in w32 implementation of interval timers.
2635 When possible, for ITIMER_PROF count only times the main thread
2636 actually executes.
2637 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2638 'volatile ULONGLONG' types. All the other data which was
2639 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
2640 (GetThreadTimes_Proc): New typedef.
2641 (w32_get_timer_time): New function, returns a suitable time value
2642 for the timer.
2643 (timer_loop): Enter critical section when accessing ULONGLONG
2644 values of the itimer_data struct, as these accesses are no longer
2645 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2646 Remove unused variable.
2647 (init_timers): Initialize s_pfn_Get_Thread_Times.
2648 (start_timer_thread): Don't assign itimer->caller_thread here.
2649 (getitimer): Assign itimer->caller_thread here.
2650 (setitimer): Always call getitimer to get the value of ticks_now.
2651 (sys_spawnve): Avoid compiler warning about format mismatch.
2652
2653 2012-10-26 Eli Zaretskii <eliz@gnu.org>
2654
2655 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
2656 mouse movement events if the menu bar is active. This avoids
2657 producing a busy "hour-glass" cursor by Windows if the mouse
2658 pointer is positioned over a tooltip shown for some menu item.
2659
2660 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2661
2662 Don't assume process IDs fit in int.
2663 * emacs.c (shut_down_emacs) [!DOS_NT]:
2664 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
2665 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
2666 Use pid_t, not int, to store process IDs, as 'int'
2667 is not wide enough on a few platforms (e.g., AIX and IRIX).
2668
2669 2012-10-23 Kenichi Handa <handa@gnu.org>
2670
2671 The following change is to make face-font-rescale-alist work
2672 correctly for non-ASCII fonts.
2673
2674 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
2675 (font_open_for_lface): Handle Vface_font_rescale_alist.
2676
2677 2012-10-23 Chong Yidong <cyd@gnu.org>
2678
2679 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
2680
2681 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
2682
2683 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
2684 for screen font.
2685 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
2686
2687 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
2688 event (Bug#12681).
2689
2690 2012-10-21 Glenn Morris <rgm@gnu.org>
2691
2692 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
2693
2694 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
2695
2696 Port to OpenBSD 5.1.
2697 * frame.c (Fmouse_position, Fmouse_pixel_position):
2698 * xdisp.c (produce_stretch_glyph):
2699 Declare local vars only when they're needed.
2700 This is clearer and avoids a warning on OpenBSD about unused vars.
2701 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
2702 This is safer, and avoids OpenBSD warnings about unused vars.
2703 * keyboard.c (record_menu_key): Remove unnecessary decl.
2704 (poll_timer): Define only if POLL_FOR_INPUT is defined.
2705 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
2706 as our definition clashes with OpenBSD's.
2707 * xfaces.c (load_face_colors, check_lface_attrs)
2708 (get_lface_attributes_no_remap, get_lface_attributes)
2709 (lface_fully_specified_p, x_supports_face_attributes_p)
2710 (tty_supports_face_attributes_p, face_fontset, realize_face)
2711 (realize_x_face, realize_tty_face):
2712 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
2713 merely Lisp_Object *. This is more informative and avoids
2714 a warning on OpenBSD about accessing beyond an object's size.
2715
2716 2012-10-20 Chong Yidong <cyd@gnu.org>
2717
2718 * lread.c (Fload): Doc fix (Bug#12592).
2719
2720 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2721
2722 * font.c (Ffont_at): Fix previous change.
2723
2724 2012-10-19 Eli Zaretskii <eliz@gnu.org>
2725
2726 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
2727 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
2728 for the reasons.
2729
2730 * alloc.c (NSTATICS): Decrease to 0x800.
2731
2732 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2733
2734 * fns.c (Fnreverse): Include the problem element when signaling an
2735 error (bug#12677).
2736
2737 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
2738
2739 * nsterm.m (ns_select): Check writefds before call to
2740 FD_ISSET (Bug#12668).
2741
2742 2012-10-18 Daniel Colascione <dancol@dancol.org>
2743
2744 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
2745 (staticpro): If we run out of staticpro slots, die with an
2746 informative error instead of just calling emacs_abort.
2747
2748 2012-10-18 Martin Rudalics <rudalics@gmx.at>
2749
2750 Fix two flaws reported by Dmitry Antipov.
2751 * window.c (Ftemp_output_buffer_show): Remove.
2752 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
2753 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2754
2755 2012-10-17 Eli Zaretskii <eliz@gnu.org>
2756
2757 * makefile.w32-in ($(BLD)/w32.$(O)):
2758 ($(BLD)/vm-limit.$(O)):
2759 ($(BLD)/term.$(O)):
2760 ($(BLD)/unexw32.$(O)):
2761 ($(BLD)/fileio.$(O)):
2762 ($(BLD)/dispnew.$(O)): Update dependencies.
2763
2764 * w32term.h (w32_initialize_display_info, initialize_w32_display):
2765 Add prototypes.
2766
2767 * w32proc.c: Include ctype.h.
2768
2769 * w32.h (init_environment, check_windows_init_file)
2770 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
2771 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
2772 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
2773 (sys_link): Add prototypes.
2774
2775 * w32.c: Include w32select.h.
2776 (sys_access, e_malloc, sys_select): Add prototypes.
2777 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
2778
2779 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
2780
2781 * unexw32.c: Include lisp.h and w32.h.
2782
2783 * term.c [WINDOWSNT]: Include w32term.h.
2784
2785 * process.c [WINDOWSNT]: Add prototype of sys_select.
2786
2787 * fileio.c [WINDOWSNT]: Include w32.h.
2788
2789 * dispnew.c [WINDOWSNT]: Include w32.h.
2790
2791 * cygw32.c (Fcygwin_convert_path_to_windows)
2792 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2793 Lisp_Object values. (Bug#12661)
2794
2795 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2796 to Lisp_Object. (Bug#12661)
2797
2798 2012-10-17 Kenichi Handa <handa@gnu.org>
2799
2800 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2801 invalidate.
2802
2803 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2804
2805 * buffer.c (Fkill_buffer): When unchaining the marker,
2806 reset its buffer pointer to NULL (Bug#12652).
2807
2808 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2809
2810 Do not verify indirection counters of killed buffers (Bug#12579).
2811 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2812 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2813
2814 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2815
2816 * alloc.c (Fmake_byte_code): Fix typo in comment.
2817 * print.c (print_interval): Define as static to match prototype.
2818 * indent.c (disptab_matches_widthtab, recompute_width_table):
2819 Convert to eassert.
2820
2821 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2822
2823 * editfns.c (get_system_name): Remove.
2824 * lisp.h (get_system_name): Remove prototype.
2825 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2826 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2827
2828 2012-10-15 Daniel Colascione <dancol@dancol.org>
2829
2830 * dbusbind.c: Add comment explaining reason for previous change.
2831
2832 2012-10-15 Martin Rudalics <rudalics@gmx.at>
2833
2834 * window.c (Fwindow_end): Rewrite check whether cached position
2835 can be used (Bug#12600).
2836 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2837 Set windows_or_buffers_changed.
2838
2839 2012-10-15 Daniel Colascione <dancol@dancol.org>
2840
2841 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2842 enabled by undefining the symbol "interface", which the platform
2843 headers define to something incompatible.
2844
2845 2012-10-14 Daniel Colascione <dancol@dancol.org>
2846
2847 * image.c (init_tiff_functions, init_imagemagick_functions)
2848 (init_svg_functions): Fix cygw32 build break by using these
2849 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2850
2851 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2852
2853 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2854
2855 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2856
2857 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2858
2859 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2860
2861 * coding.c (detect_coding): Set coding->id before calling
2862 this->detector.
2863
2864 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2865
2866 * fileio.c: Formatting fixes.
2867
2868 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2869
2870 Fix some stat-related races.
2871 * fileio.c (Fwrite_region): Avoid race condition if a file is
2872 removed or renamed by some other process immediately after Emacs
2873 writes it but before Emacs stats it. Do not assume that stat (or
2874 fstat) succeeds.
2875 * image.c (slurp_file): Resolve the file name with fopen + fstat
2876 rather than stat + fopen.
2877 (pbm_read_file) [0]: Remove unused code with stat race.
2878 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2879 Remove ineffective code with stat race.
2880
2881 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2882
2883 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2884
2885 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2886
2887 * nsterm.m (hold_event_q): New static variable.
2888 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2889 ! q_event_ptr.
2890 (hold_event): New function.
2891 (ns_read_socket): If hold_event_q have events, store them and
2892 return (Bug#12384).
2893 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2894 is zero (Bug#12384).
2895
2896 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
2897
2898 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2899
2900 2012-10-12 Eli Zaretskii <eliz@gnu.org>
2901
2902 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2903
2904 * fileio.c (check_existing): New function.
2905 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2906 instead of calling 'stat', when what's needed is to check whether
2907 a file exists. This avoids expensive system calls on MS-Windows.
2908 (Bug#12587)
2909
2910 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
2911
2912 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2913 determine whether a file exists and is not a directory.
2914
2915 * lisp.h (check_existing): Add prototype.
2916
2917 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2918
2919 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2920
2921 2012-10-12 Glenn Morris <rgm@gnu.org>
2922
2923 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2924
2925 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2926
2927 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2928
2929 * eval.c (Fautoload): Remember previous autoload status in load-history.
2930
2931 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2932
2933 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2934 * lread.c (load_each_byte, new_backquote_flag, readchar)
2935 (read_filtered_event, lisp_file_lexically_bound_p)
2936 (safe_to_load_version, Fload, complete_filename_p, openp)
2937 (build_load_history, readevalloop, read_escape, read1)
2938 (string_to_number, read_vector, read_list):
2939 * macros.c (Fstart_kbd_macro):
2940 * marker.c (CONSIDER):
2941 * menu.c (parse_single_submenu, digest_single_submenu)
2942 (find_and_return_menu_selection, Fx_popup_menu):
2943 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2944 (Ftry_completion):
2945 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2946 (ns_menu_show):
2947 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2948 (xmenu_show, xdialog_show):
2949 Use bool for booleans.
2950 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2951 as it's not a predicate. All uses changed. Omit unnecessary
2952 buffer termination.
2953
2954 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2955
2956 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2957 (save_excursion_restore): Do not restore mark if it was not saved.
2958
2959 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2960
2961 * marker.c (cached_modiff): EMACS_INT, not int.
2962
2963 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2964 instead of having a wrong decl.
2965 * nsmenu.m (waiting_for_input): Remove wrong decl.
2966
2967 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2968
2969 keyboard.c, keymap.c: Use bool for booleans.
2970 * dispnew.c (sit_for): Distinguish between 3-way display_option
2971 and boolean do_display.
2972 * keyboard.c (single_kboard, this_command_key_count_reset)
2973 (waiting_for_input, echoing, immediate_quit, input_pending)
2974 (interrupt_input, interrupts_deferred, pop_kboard)
2975 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2976 (command_loop_1, adjust_point_for_property)
2977 (safe_run_hooks_error, input_polling_used, read_char):
2978 (help_char_p, readable_events, kbd_buffer_events_waiting)
2979 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2980 (lucid_event_type_list_p, get_input_pending):
2981 (gobble_input, menu_separator_name_p, menu_bar_item)
2982 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2983 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2984 (keyremap_step, test_undefined, read_key_sequence)
2985 (detect_input_pending, detect_input_pending_ignore_squeezables)
2986 (detect_input_pending_run_timers, requeued_events_pending_p)
2987 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2988 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2989 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2990 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2991 (accessible_keymaps_1, Fkey_description, push_key_description):
2992 (shadow_lookup, struct where_is_internal_data)
2993 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2994 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2995 (describe_map, describe_vector):
2996 * menu.c (single_menu_item):
2997 * nsmenu.m (ns_update_menubar):
2998 * process.c (wait_reading_process_output):
2999 * search.c (scan_buffer, scan_newline):
3000 Use bool for boolean.
3001 * keyboard.c (timers_run, swallow_events)
3002 (detect_input_pending_run_timers):
3003 * process.c (wait_reading_process_output):
3004 Use unsigned for counter where wraparound-on-overflow is desired,
3005 since unsigned is guaranteed to have that behavior and signed is not.
3006 (read_char): Use ptrdiff_t for string length.
3007 (get_input_pending): Remove first argument, since it was always
3008 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3009 and behave as if it had that value. Return new value of
3010 input_pending. All callers changed.
3011 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3012 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3013 a string length.
3014 * keymap.c (push_key_description): Omit last arg, which was always 1.
3015 All callers changed.
3016
3017 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3018
3019 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
3020
3021 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3022 ($(BLD)/term.$(O)): Update dependencies.
3023
3024 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3025
3026 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3027 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3028 initializer for PVEC_NORMAL_VECTOR.
3029
3030 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3031
3032 Clean out old termopts cruft.
3033 * termopts.h (flow_control, meta_key): Remove unused decls.
3034 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3035 Don't include termopts.h.
3036
3037 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3038
3039 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3040
3041 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 * commands.h (immediate_quit): Remove duplicate decl.
3044
3045 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3046
3047 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3048 caching.
3049 (nsfont_open): Remove setting of Vfonts_in_cache.
3050 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
3051
3052 2012-10-09 Eli Zaretskii <eliz@gnu.org>
3053
3054 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3055 match what GetLastError returns. Explain why the function is
3056 needed.
3057
3058 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3059 'is_tooltip_frame', to avoid confusion with its global namesake.
3060
3061 2012-10-08 Daniel Colascione <dancol@dancol.org>
3062
3063 * xdisp.c (start_hourglass): Call w32_note_current_window when
3064 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3065 build that caused Emacs to display the hourglass cursor forever.
3066
3067 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3068 which is broken under remote desktop, calculate the number of
3069 colors available for a display based on the display's number of
3070 planes and number of bits per pixel per plane. (bug#10397).
3071
3072 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
3073
3074 * nsfont.m (Vfonts_in_cache): New variable.
3075 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3076 are used. Add cached fonts to Vfonts_in_cache.
3077 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3078
3079 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
3080
3081 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3082 in nt/config.nt.
3083 (FONT_H): Define after FRAME_H.
3084 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3085 Update dependencies.
3086
3087 * w32term.c: Remove leftover declaration of keyboard_codepage.
3088
3089 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3090
3091 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3092 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3093 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3094 (GLOBAL_SOURCES): Add cygw32.c.
3095 ($(BLD)/unexw32.$(O)):
3096 ($(BLD)/w32.$(O)):
3097 ($(BLD)/w32console.$(O)):
3098 ($(BLD)/w32fns.$(O)):
3099 ($(BLD)/w32heap.$(O)):
3100 ($(BLD)/w32menu.$(O)):
3101 ($(BLD)/w32proc.$(O)): Add w32common.h.
3102
3103 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3104 'const char *'.
3105 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3106
3107 2012-10-08 Daniel Colascione <dancol@dancol.org>
3108
3109 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3110 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3111 accidental message numbering hole. Change other messages to
3112 match.
3113
3114 * w32select.h (HAVE_W32SELECT): Remove.
3115
3116 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
3117 w32common.h instead of w32heap.h.
3118
3119 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3120 (get_allocation_unit, get_processor_type, get_w32_major_version)
3121 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3122 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3123 (OS_NT, os_subtype, cache_system_info): Move declarations to
3124 w32common.
3125
3126 * w32heap.c: Include w32common.h.
3127 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
3128 (w32_minor_version, w32_build_number, w32_subtype):
3129 Remove duplicate definitions.
3130
3131 * w32fns.c: Include w32common.h; include w32heap.h only in
3132 WINDOWSNT.
3133
3134 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3135 Use `report_file_error' instead of `error' in order to better
3136 inform users of what went wrong. Increase NTGUI_UNICODE file
3137 dialog box file name length to 32k, the maximum allowed by the NT
3138 kernel.
3139
3140 * w32common.h: New file.
3141 (ROUND_UP, ROUND_DOWN, get_page_size)
3142 (get_allocation_unit, get_processor_type, get_w32_major_version)
3143 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3144 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3145 (OS_NT, os_subtype, cache_system_info): Move here.
3146
3147 * unexw32.c, unexcw.c: Include w32common.h.
3148
3149 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3150 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3151 to call syms_of_w32select.
3152
3153 * cygw32.h: Remove obsolete EXFUN declarations.
3154
3155 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3156
3157 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3158 of w32inevt.o from SOME_MACHINE_OBJECTS.
3159
3160 2012-10-08 Daniel Colascione <dancol@dancol.org>
3161
3162 * image.c: Permanent fix for JPEG compilation issue --- limit
3163 jpeglib `boolean' redefinition to Cygwin builds.
3164
3165 2012-10-08 Eli Zaretskii <eliz@gnu.org>
3166
3167 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3168
3169 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3170 Cygwin.
3171
3172 2012-10-08 Daniel Colascione <dancol@dancol.org>
3173
3174 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3175 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3176 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3177 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3178 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3179 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3180 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3181 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3182 now a supported configuration.
3183
3184 * Makefile.in: consolidate image variables into LIBIMAGE; add
3185 W32_OBJ and W32_LIBS. Compile new files.
3186
3187 * conf_post.h:
3188 (_DebPrint) declare tracing facility for W32 debugging. We need
3189 to unify tracing later.
3190
3191 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3192 unconditional use of W32 Unicode functions. Cygwin runs only on
3193 100% Unicode operating systems.
3194
3195 * cygw32.c: New file. Define Cygwin-specific facilities.
3196 (Fcygwin_convert_path_to_windows)
3197 (Fcygwin_convert_path_from_windows): New user functions for
3198 accessing Cygwin path-munging routines.
3199
3200 * cygw32.h: New file.
3201 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3202 UTF-16LE strings temporarily inside non-Lisp-visible string
3203 objects.
3204
3205 (w32_strerror): Just what it says on the tin.
3206
3207 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3208 also run for Cygwin; both systems have the same problem with using
3209 GUI facilities in a forked child. Also call syms_of_cygw32,
3210 syms_of_w32select in correct places.
3211
3212 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3213 needs fork-then-exec for daemon launching.
3214
3215 * font.h: Include frame.h.
3216
3217 * image.c: Use the image library cache machinery only when we're
3218 compiling for native WINDOWSNT; Cygwin can use shared libraries
3219 like any other Unixlike system.
3220
3221 * keyboard.c: Clarify a comment regarding the input loop.
3222
3223 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3224 functions directly instead of trying to detect at runtime that our
3225 host operating system supports them. We make this change for two
3226 reasons: Cygwin lacks support for the multibyte character
3227 conversion functions used by the legacy menu code, and Cygwin
3228 never needs to rely on non-Unicode APIs.
3229
3230 * unexw32.c (hinst): Declare extern.
3231
3232 * w32.c: Change header order;
3233 (w32_strerror): Move to w32fns.c because we need it for
3234 non-WINDOWSNT builds.
3235
3236 * w32.h: Add #error macro to make sure we don't include w32.h for
3237 Cygwin builds. Remove w32select declarations.
3238
3239 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
3240 w32fns.c. w32console.c is WINDOWSNT-only.
3241
3242 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3243 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3244 POSIXy alternative.
3245 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
3246 (w32_major_version, w32_minor_version, w32_build_number)
3247 (os_subtype, sound_type): Define here
3248 (w32_defined_color): Make color parameter const for consistency
3249 with other _defined_color functions.
3250 (w32_createwindow): Unconditionally call w32_init_class instead of
3251 doing so only when hprevinst is non-NULL. Plumbing hprevinst
3252 through the code is complex and unnecessary because class
3253 registration is practically free.
3254 (w32_name_of_message): New EMACSDEBUG-only function.
3255 (Fset_message_beep): Move here
3256 (Fx_open_connection): Require that the display name for Windows be
3257 "w32" for consistency, emacsclient disambiguation, and maybe, one
3258 day, multi-window-system support.
3259 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
3260 Cygwin files for W32 GUI facilities, since these clearly don't
3261 expect Cygwin names.
3262 (_DebPrint): Define.
3263 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
3264 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
3265 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
3266 (w32_last_error): Remove.
3267
3268 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3269
3270 * w32heap.c (syspage_mask): Declare here.
3271 (cache_system_info): Remove.
3272
3273 * w32inevt.c (faked_key): Define globally, not statically.
3274 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3275 (w32_console_toggle_lock_key): Move to w32fns.c.
3276
3277 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3278
3279 * w32proc.c (_DebPrint): Move to w32fns.c.
3280 * w32select.c: Include string.h, stdio.h for Cygwin.
3281 * w32select.h: New File.
3282
3283 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3284 get_osfhandle.
3285 (w32_message_fd): New variable. Under Cygwin, holds the file
3286 descriptor the system used to tell us about pending thread
3287 messages.
3288
3289 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3290 that prevented compilation under non-WINDOWSNT systems.
3291
3292 (w32_initialize): Open /dev/windows and assign it to
3293 w32_message_fd. Provide w32 feature.
3294
3295 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3296 (WM_EMACS_INPUT_READY): add.
3297 (prepend_msg, w32_message_fd): Declare globally.
3298
3299 * w32xfns.c:
3300 (keyboard_handle): Use only when WINDOWSNT.
3301 (notify_msg_ready): New function. Posts a message to the main
3302 thread's message queue under CYGWIN, which wakes up the main
3303 thread from select(2) by making the /dev/windows file descriptor
3304 ready. Under WINDOWSNT, it sets an event the same way the old
3305 code did.
3306
3307 (post, prepend_msg): Actually call notify_msg_ready instead of
3308 setting the input event directly.
3309
3310 2012-10-07 Eli Zaretskii <eliz@gnu.org>
3311
3312 * ralloc.c (relinquish): If a heap is ready to be relinquished,
3313 but it still has blocs in it, don't return it to the system,
3314 instead of aborting. (Bug#12402)
3315
3316 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
3317
3318 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
3319
3320 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
3321 MAC_OS_X_VERSION_10_6.
3322 (syms_of_nsterm): Remove comment about Panther and above for
3323 ns-antialias-text.
3324 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
3325 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
3326 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
3327
3328 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
3329 MAC_OS_X_VERSION_10_4.
3330
3331 * nsmenu.m (fillWithWidgetValue:): Remove code for <
3332 MAC_OS_X_VERSION_10_2.
3333
3334 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
3335
3336 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
3337 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
3338
3339 * nsterm.m (ns_in_resize): Remove (Bug#12479).
3340 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
3341 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
3342 Remove ns_in_resize check.
3343 (ns_clear_frame_area): Remove resize handle code.
3344
3345 * nsfns.m (ns_in_resize): Remove.
3346 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
3347 Remove ns_in_resize check.
3348
3349 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
3350
3351 Improve sys_siglist detection.
3352 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
3353 defined as a macro, as is done in Solaris.
3354 (sys_siglist_entries): New macro.
3355 (save_strsignal): Use it.
3356 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
3357 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
3358
3359 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
3360
3361 * nsfns.m (Fx_create_frame): Call x_default_parameter with
3362 fullscreen/Fullscreen.
3363
3364 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
3365 tobar_height is new.
3366
3367 * nsterm.m (x_make_frame_visible): Check for fullscreen.
3368 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
3369 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
3370 (windowDidResize:): Check for correct window if old style fullscreen.
3371 Capitalize word in comment. Remove incorrect comment.
3372 (initFrameFromEmacs:): tbar_height renamed tibar_height.
3373 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
3374 error in drawing background.
3375 (toggleFullScreen:): Remove comment. Rearrange calls.
3376 Set toolbar values to zero, save old height in tobar_height.
3377 Restore tool bar height when leaving fullscreen.
3378 (canBecomeMainWindow): New function.
3379
3380 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
3381
3382 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
3383
3384 2012-10-05 Eli Zaretskii <eliz@gnu.org>
3385
3386 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
3387
3388 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
3389 that time stamps of directories could also be changed.
3390 Don't request the too broad GENERIC_WRITE, only the more restrictive
3391 FILE_WRITE_ATTRIBUTES access rights.
3392
3393 * fileio.c (Fset_file_times): Special-case ignoring errors for
3394 directories only on MSDOS, not on MS-Windows.
3395
3396 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
3397
3398 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
3399
3400 2012-10-04 Eli Zaretskii <eliz@gnu.org>
3401
3402 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
3403 see whether CreateFile failed.
3404
3405 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
3406
3407 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
3408 to avoid similar races.
3409 * keyboard.c (pending_signals): Now bool, not int.
3410
3411 Port timers to OpenBSD, plus check for timer failures.
3412 OpenBSD problem reported by Han Boetes.
3413 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
3414 and/or setitimer.
3415 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
3416 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
3417 like OpenBSD, which has timer_settime but does not declare it.
3418 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
3419 whether to use itimerspec-related primitives. All uses of
3420 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
3421
3422 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3423
3424 * profiler.c (handle_profiler_signal): Fix a malloc race
3425 that caused Emacs to hang on Fedora 17 when profiling Lisp.
3426
3427 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
3428
3429 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
3430
3431 2012-10-02 Eli Zaretskii <eliz@gnu.org>
3432
3433 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
3434 consistent with the change in return value of 'safe_strsignal'.
3435
3436 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
3437
3438 Prefer plain 'static' to 'static inline' (Bug#12541).
3439 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
3440 (bidi_set_sor_type, bidi_push_embedding_level)
3441 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
3442 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
3443 (bidi_cache_search, bidi_cache_ensure_space)
3444 (bidi_cache_iterator_state, bidi_cache_find)
3445 (bidi_peek_at_next_level, bidi_set_paragraph_end)
3446 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
3447 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
3448 Now 'static', not 'static inline'.
3449
3450 Count overruns when profiling; change units to ns.
3451 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
3452 Give extra weight to samples after overruns, to attempt to count
3453 the time more accurately.
3454 (setup_cpu_timer): Change sampling interval units from ms to ns, since
3455 the underlying primitives nominally do ns.
3456 (Fprofiler_cpu_start): Document the change. Mention that
3457 the sampling intervals are only approximate.
3458
3459 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3460
3461 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
3462
3463 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
3464 case for the special 0 coding-system.
3465
3466 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
3467 (Fmake_overlay): Remove redundant tests.
3468 (fix_start_end_in_overlays): Remove redundant recentering.
3469
3470 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
3471
3472 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
3473 Update dependencies.
3474
3475 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3476
3477 Fix a malloc race condition involving strsignal.
3478 A signal can arrive in the middle of a malloc, and Emacs's signal
3479 handler can invoke strsignal, which can invoke malloc, which is
3480 not portable. This race condition bug makes Emacs hang on GNU/Linux.
3481 Fix it by altering the signal handler so that it does not invoke
3482 strsignal.
3483 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
3484 * process.c (status_message): Use const pointer, in case strsignal
3485 is #defined to safe_strsignal.
3486 * sysdep.c (sys_siglist, init_signals): Always define and
3487 initialize a substitute sys_siglist if the system does not define
3488 one, even if HAVE_STRSIGNAL.
3489 (safe_strsignal): Rename from strsignal. Always define,
3490 using sys_siglist. Return a const pointer.
3491 * syssignal.h (safe_strsignal): New decl.
3492 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
3493
3494 2012-10-01 Eli Zaretskii <eliz@gnu.org>
3495
3496 * w32proc.c (timer_loop): Fix code that waits for timer
3497 expiration, to avoid high CPU usage.
3498
3499 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
3500
3501 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
3502 (sweep_weak_table): Remove redundant prototypes.
3503
3504 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
3505
3506 * emacs.c: Move the inclusion of TERM_HEADER after including
3507 windows.h on WINDOWSNT. This avoids compilation problems with
3508 MSVC.
3509
3510 2012-10-01 Eli Zaretskii <eliz@gnu.org>
3511
3512 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
3513 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
3514 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
3515 as the previous version used 'void *'.
3516
3517 * ralloc.c (ROUNDUP): Fix last change.
3518 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
3519 'size_t'.
3520
3521 * w32proc.c <disable_itimers>: New static flag.
3522 (init_timers): Initialize it to zero, after creating the critical
3523 sections used by the timer threads.
3524 (term_timers): Set to 1 before deleting the critical sections.
3525 (getitimer, setitimer): If disable_itimers is non-zero, return an
3526 error indication without doing anything. Reported by Fabrice
3527 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
3528 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
3529 return results.
3530 [!HAVE_SETITIMER]: Behave as the previous version that didn't
3531 support timers.
3532
3533 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
3534 term_ntproc after all the other bookkeeping, to get timers working
3535 as long as possible.
3536
3537 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
3538
3539 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
3540 Suggested by Juri Linkov in
3541 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
3542
3543 Prefer plain 'static' to 'static inline' (Bug#12541).
3544 With static functions, modern compilers inline pretty well by
3545 themselves; advice from programmers often hurts as much as it helps.
3546 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
3547 this change shrinks the text size of the Emacs executable by 1.1%
3548 without affecting CPU significantly in my benchmark.
3549 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
3550 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
3551 (mark_maybe_object, mark_maybe_pointer, bounded_number):
3552 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3553 (bset_auto_fill_function, bset_auto_save_file_format)
3554 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3555 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3556 (bset_cache_long_line_scans, bset_case_fold_search)
3557 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3558 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3559 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3560 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3561 (bset_header_line_format, bset_indicate_buffer_boundaries)
3562 (bset_indicate_empty_lines, bset_invisibility_spec)
3563 (bset_left_fringe_width, bset_major_mode, bset_mark)
3564 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3565 (bset_name, bset_overwrite_mode, bset_pt_marker)
3566 (bset_right_fringe_width, bset_save_length)
3567 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3568 (bset_scroll_up_aggressively, bset_selective_display)
3569 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3570 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
3571 (set_buffer_overlays_after):
3572 * category.c (bset_category_table):
3573 * charset.c (read_hex):
3574 * coding.c (produce_composition, produce_charset)
3575 (handle_composition_annotation, handle_charset_annotation)
3576 (char_encodable_p):
3577 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
3578 (assign_row, set_frame_matrix_frame, make_current)
3579 (add_row_entry):
3580 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
3581 * fns.c (maybe_resize_hash_table):
3582 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
3583 * gmalloc.c (register_heapinfo):
3584 * image.c (lookup_image_type):
3585 * intervals.c (set_interval_object, set_interval_left)
3586 (set_interval_right, copy_interval_parent, rotate_right)
3587 (rotate_left, balance_possible_root_interval):
3588 * keyboard.c (kset_echo_string, kset_kbd_queue)
3589 (kset_keyboard_translate_table, kset_last_prefix_arg)
3590 (kset_last_repeatable_command, kset_local_function_key_map)
3591 (kset_overriding_terminal_local_map, kset_real_last_command)
3592 (kset_system_key_syms, clear_event, set_prop):
3593 * lread.c (digit_to_number):
3594 * marker.c (attach_marker, live_buffer, set_marker_internal):
3595 * nsterm.m (ns_compute_glyph_string_overhangs):
3596 * process.c (pset_buffer, pset_command)
3597 (pset_decode_coding_system, pset_decoding_buf)
3598 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
3599 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
3600 (pset_status, pset_tty_name, pset_type, pset_write_queue):
3601 * syntax.c (bset_syntax_table, dec_bytepos):
3602 * terminal.c (tset_param_alist):
3603 * textprop.c (interval_has_some_properties)
3604 (interval_has_some_properties_list):
3605 * window.c (wset_combination_limit, wset_dedicated)
3606 (wset_display_table, wset_hchild, wset_left_fringe_width)
3607 (wset_left_margin_cols, wset_new_normal, wset_new_total)
3608 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3609 (wset_right_fringe_width, wset_right_margin_cols)
3610 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
3611 (wset_vertical_scroll_bar_type, wset_window_parameters):
3612 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3613 (wset_column_number_displayed, wset_region_showing)
3614 (window_box_edges, run_window_scroll_functions)
3615 (append_glyph_string_lists, prepend_glyph_string_lists)
3616 (append_glyph_string, set_glyph_string_background_width)
3617 (append_glyph, append_composite_glyph)
3618 (take_vertical_position_into_account):
3619 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
3620 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
3621 (lface_hash, lface_same_font_attributes_p, lookup_face):
3622 * xml.c (libxml2_loaded_p):
3623 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
3624 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
3625 Now 'static', not 'static inline'.
3626
3627 * bidi.c: Tune.
3628 (bidi_copy_it): Do the whole copy with a single memcpy.
3629 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3630
3631 Revert the FOLLOW-SYMLINKS change for file-attributes.
3632 Doing it right would require several changes to Tramp, and there's
3633 not enough time to get that tested before the freeze today.
3634 * dired.c (directory_files_internal, Ffile_attributes):
3635 Undo last change.
3636
3637 * frame.c (x_report_frame_params): Port better to wider ints.
3638 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3639 or that pointers can be printed in 15 decimal digits.
3640 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3641
3642 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3643
3644 Support x64 build on MS-Windows.
3645 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3646 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3647 compatibility with x64.
3648 (x_get_focus_frame): Add prototype.
3649
3650 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
3651 defining an XRectangle structure.
3652
3653 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
3654 arithmetics for compatibility with x64.
3655
3656 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
3657 compatibility with x64.
3658
3659 * w32heap.h: Adjust prototypes and declarations.
3660
3661 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
3662 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
3663 DWORD, long, and unsigned long, for compatibility with x64.
3664 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
3665 (sbrk): Argument is now of type ptrdiff_t.
3666
3667 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
3668 less than 0x0500.
3669 (w32_msg_pump): Use WPARAM type for 'result'.
3670
3671 * w32.c (init_environment, get_emacs_configuration): Support AMD64
3672 architecture.
3673 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
3674 compatibility with x64.
3675
3676 * vm-limit.c (lim_data): Now size_t.
3677 (check_memory_limits): Adjust prototypes of real_morecore and
3678 __morecore to receive argument of type ptrdiff_t. Use size_t for
3679 five_percent and data_size.
3680
3681 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
3682 variables, for compatibility with x64.
3683 (rva_to_section, offset_to_section, relocate_offset)
3684 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
3685 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
3686 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
3687 for compatibility with x64.
3688
3689 * sysdep.c (STDERR_FILENO): Define if not already defined.
3690
3691 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
3692 (__morecore): Argument type is now ptrdiff_t.
3693 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
3694 (relinquish): Use ptrdiff_t type for 'excess'.
3695 (r_alloc_sbrk): Argument type is now ptrdiff_t.
3696
3697 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
3698 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
3699 instead of a literal number.
3700
3701 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
3702 (min): Define only if not already defined.
3703
3704 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
3705 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
3706 hosts.
3707
3708 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
3709 'bitmaps' is a pointer.
3710
3711 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
3712
3713 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
3714
3715 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3716
3717 file-attributes has a new optional arg FOLLOW-SYMLINKS.
3718 * dired.c (directory_files_internal, Ffile_attributes):
3719 New arg follow_symlinks. All uses changed.
3720
3721 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
3722
3723 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
3724
3725 2012-09-30 Eli Zaretskii <eliz@gnu.org>
3726
3727 Support atimers and CPU profiler via profile.c on MS-Windows.
3728 * w32proc.c (sig_mask, crit_sig): New static variables.
3729 (sys_signal): Support SIGALRM and SIGPROF.
3730 (sigemptyset, sigaddset, sigfillset, sigprocmask)
3731 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
3732 sigfillset, and sigprocmask are no longer no-ops.
3733 (sigismember): New function.
3734 (struct itimer_data): New definition.
3735 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
3736 (crit_prof): New static variables.
3737 (MAX_SINGLE_SLEEP): New definition.
3738 (timer_loop, stop_timer_thread, term_timers, init_timers)
3739 (start_timer_thread, getitimer, setitimer): New functions.
3740 (alarm): No longer a no-op, calls setitimer.
3741
3742 * w32.c (term_ntproc): Call term_timers.
3743 (init_ntproc): Make sure all signals are unblocked at startup, to
3744 erase any traces of dumping. Call init_timers.
3745
3746 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
3747 Windows-specific code to display the hourglass mouse pointer is no
3748 longer used.
3749 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
3750 to hourglass timer expiration.
3751 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
3752 Remove, no longer used.
3753 (w32_note_current_window, show_hourglass, hide_hourglass):
3754 New functions, in support of hourglass cursor display similar to other
3755 window systems.
3756 (syms_of_w32fns): Don't initialize hourglass_timer.
3757
3758 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
3759 WINDOWSNT as well.
3760 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
3761
3762 * w32.h (init_timers, term_timers): Add prototypes.
3763
3764 2012-09-30 Kenichi Handa <handa@gnu.org>
3765
3766 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
3767 to the buffer relocation which may be caused by ccl_driver.
3768
3769 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
3770
3771 * xfns.c (Fx_file_dialog): Update comment.
3772
3773 * w32fns.c (Fx_file_dialog): Update comment.
3774
3775 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
3776 Initialize panel name field if OSX >= 10.6.
3777
3778 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
3779
3780 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
3781
3782 * nsterm.m (NEW_STYLE_FS): New define.
3783 (ns_fullscreen_hook, windowWillEnterFullScreen)
3784 (windowDidEnterFullScreen, windowWillExitFullScreen)
3785 (windowDidExitFullScreen, toggleFullScreen, handleFS)
3786 (setFSValue): New functions.
3787 (EmacsFSWindow): New implementation.
3788 (canBecomeKeyWindow): New function for EmacsFSWindow.
3789 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
3790 (dealloc): Release nonfs_window if in fullscreen.
3791 (updateFrameSize:): Call windowDidMove to update top/left.
3792 (windowWillResize:toSize:): Check if frame is still maximized.
3793 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3794 next_maximized, maximized_width, maximized_height and nonfs_window.
3795 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3796 tbar_height.
3797 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
3798 fullscreen. Set maximized_width/height. Act on next_maximized.
3799
3800 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3801 (EmacsView): Add variables for fullscreen.
3802 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3803 (EmacsFSWindow): New interface for fullscreen.
3804
3805 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
3806
3807 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3808
3809 2012-09-30 Chong Yidong <cyd@gnu.org>
3810
3811 * fns.c (Frandom): Doc fix.
3812
3813 2012-09-30 Martin Rudalics <rudalics@gmx.at>
3814
3815 * window.c (Vwindow_combination_limit): New default value.
3816 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3817
3818 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3819
3820 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3821 Suggested by Eli Zaretskii in
3822 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3823
3824 2012-09-30 Eli Zaretskii <eliz@gnu.org>
3825
3826 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3827 HAVE_TIMER_SETTIME is defined.
3828
3829 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3830
3831 Profiler improvements: more-accurate timers, overflow checks.
3832 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3833 signal.h, setjmp.h. Include systime.h instead.
3834 (saturated_add): New function.
3835 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3836 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3837 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3838 New static vars.
3839 (enum profiler_cpu_running): New enum.
3840 (profiler_cpu_running): Now of that enum type, not bool.
3841 All uses changed to store the new value.
3842 (handle_profiler_signal): Rename from sigprof_handler_1,
3843 for consistency with other handlers. Do not check whether
3844 cpu_log is a hash-table if garbage collecting, since it
3845 doesn't matter in that case.
3846 (deliver_profiler_signal): Rename from sigprof_handler,
3847 for consistency with other handlers.
3848 (setup_cpu_timer): New function, with much of what used to be in
3849 Fprofiler_cpu_start. Check for out-of-range argument.
3850 Prefer timer_settime if available, and prefer
3851 thread cputime clocks, then process cputime clocks, then
3852 monotonic clocks, to the old realtime clock. Use make_timeval
3853 to round more-correctly when falling back to setitimer.
3854 (Fprofiler_cpu_start): Use it.
3855 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3856 Don't assume that passing NULL as the 2nd argument of setitimer
3857 is the same as passing a pointer to all-zero storage.
3858 Ignore SIGPROF afterwards.
3859 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3860 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3861 non-fatal signal handlers. Ignore SIGPROF on startup.
3862 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3863 in profiler.c, since sysdep.c now uses it.
3864
3865 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3866 Suggested by Eli Zaretskii in
3867 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3868
3869 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
3870
3871 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3872
3873 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3874
3875 * lisp.h (struct backtrace): Remove indirection for `function' field.
3876 * xdisp.c (redisplay_internal):
3877 * profiler.c (record_backtrace, sigprof_handler_1):
3878 * alloc.c (Fgarbage_collect):
3879 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3880 (Fbacktrace_frame): Adjust accordingly.
3881
3882 2012-09-28 Glenn Morris <rgm@gnu.org>
3883
3884 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3885 (Frun_hook_with_args_until_failure): Doc fixes.
3886
3887 2012-09-28 Eli Zaretskii <eliz@gnu.org>
3888
3889 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3890 Qautomatic_redisplay and change the symbol name. All users changed.
3891
3892 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3893
3894 * profiler.c (sigprof_handler): Fix race condition.
3895
3896 2012-09-28 Glenn Morris <rgm@gnu.org>
3897
3898 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3899
3900 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 Check more robustly for timer_settime.
3903 * Makefile.in (LIB_TIMER_TIME): New macro.
3904 (LIBES): Add it.
3905 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3906 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3907 call timer_settime.
3908
3909 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3910
3911 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3912
3913 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
3914
3915 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3916
3917 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3918
3919 * character.h (MAYBE_UNIFY_CHAR): Remove.
3920 * charset.c, charset.h (maybe_unify_char): Now static.
3921 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3922 Since this stuff is now private to charset.c, there's no need for
3923 a public macro and no need to inline by hand.
3924
3925 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3926 Stefan Monnier <monnier@iro.umontreal.ca>
3927 Juanma Barranquero <lekktu@gmail.com>
3928
3929 * profiler.c: New file.
3930 * Makefile.in (base_obj): Add profiler.o.
3931 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3932 ($(BLD)/profiler.$(O)): New target.
3933 * emacs.c (main): Call syms_of_profiler.
3934 * alloc.c (Qautomatic_gc): New constant.
3935 (MALLOC_PROBE): New macro.
3936 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3937 (total_bytes_of_live_objects): New function.
3938 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3939 Call malloc_probe for the memory profiler.
3940 (syms_of_alloc): Define Qautomatic_gc.
3941 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3942 race condition.
3943 (struct backtrace): Move definition...
3944 * lisp.h (struct backtrace): ..here.
3945 (Qautomatic_gc, profiler_memory_running): Declare vars.
3946 (malloc_probe, syms_of_profiler): Declare functions.
3947 * xdisp.c (Qautomatic_redisplay): New constant.
3948 (redisplay_internal): Record itself in backtrace_list.
3949 (syms_of_xdisp): Define Qautomatic_redisplay.
3950
3951 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3952 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3953
3954 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3955
3956 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3957
3958 Prefer POSIX timers if available.
3959 They avoid a race if the timer is too close to the current time.
3960 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3961 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
3962 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
3963
3964 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3965
3966 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3967 CHAR_STRING_ADVANCE.
3968 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3969 STRING_CHAR_ADVANCE.
3970
3971 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
3972
3973 Move Vlibrary_cache to emacs.c and reset before dumping.
3974
3975 * lisp.h (reset_image_types): Declare.
3976 [WINDOWSNT] (Vlibrary_cache): Declare.
3977
3978 * image.c (reset_image_types): New function.
3979
3980 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3981 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3982 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3983
3984 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3985 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3986
3987 * w32.h (Vlibrary_cache): Do not declare.
3988
3989 2012-09-25 Eli Zaretskii <eliz@gnu.org>
3990
3991 * w32proc.c (sys_signal): Handle all signals defined by the
3992 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3993 handlers for signals supported by Windows. Don't override
3994 term_ntproc as the handler for SIGABRT.
3995 (sigaction): Rewrite to call sys_signal instead of duplicating its
3996 code.
3997 (sys_kill): Improve commentary.
3998
3999 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4000 consistency with a signature of a signal handler. All callers
4001 changed.
4002 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4003 install term_ntproc as a signal handler for SIGABRT, as that
4004 should be done by the dumped Emacs.
4005
4006 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4007
4008 * w32select.c (term_w32select): Protect against repeated
4009 invocation by setting clipboard_owner to NULL after calling
4010 DestroyWindow.
4011
4012 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4013 and term_ntproc to their modified signatures.
4014
4015 * character.c (char_string, string_char): Remove calls to
4016 MAYBE_UNIFY_CHAR. See the discussion starting at
4017 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4018 for the details.
4019
4020 2012-09-25 Chong Yidong <cyd@gnu.org>
4021
4022 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4023
4024 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4025
4026 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4027 when encountering an unknown bytecode.
4028
4029 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4030
4031 image.c, indent.c: Use bool for booleans.
4032 * dispextern.h (struct image_type): Members valid_p, load, init
4033 now return bool, not int. All uses changed.
4034 * image.c: Omit unnecessary static decls.
4035 (x_create_bitmap_mask, x_build_heuristic_mask):
4036 Return void, not int, since callers don't care about the return value.
4037 (x_create_bitmap_mask, define_image_type, valid_image_p)
4038 (struct image_keyword, parse_image_spec, image_spec_value)
4039 (check_image_size, image_background)
4040 (image_background_transparent, x_clear_image_1)
4041 (postprocess_image, lookup_image, x_check_image_size)
4042 (x_create_x_image_and_pixmap, xbm_image_p)
4043 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4044 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4045 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4046 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4047 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4048 (png_image_p, init_png_functions, png_load_body, png_load)
4049 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4050 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4051 (init_gif_functions, gif_load, imagemagick_image_p)
4052 (imagemagick_load_image, imagemagick_load, svg_image_p)
4053 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4054 (gs_load):
4055 * nsimage.m (ns_load_image):
4056 * nsterm.m (ns_defined_color):
4057 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4058 * xfns.c (x_defined_color):
4059 * xterm.c (x_alloc_lighter_color_for_widget)
4060 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4061 (x_alloc_lighter_color):
4062 * indent.c (disptab_matches_widthtab, current_column)
4063 (scan_for_column, string_display_width, indented_beyond_p)
4064 (compute_motion, vmotion, Fvertical_motion):
4065 Use bool for booleans.
4066
4067 2012-09-24 Chong Yidong <cyd@gnu.org>
4068
4069 * chartab.c (Fset_char_table_default): Obsolete function removed.
4070
4071 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 Move pid_t related decls out of lisp.h.
4074 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4075 (interruptible_wait_for_termination):
4076 Move these decls from lisp.h to syswait.h, since they use pid_t.
4077 Needed on FreeBSD; see Herbert J. Skuhra in
4078 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4079 * callproc.c: Include syswait.h.
4080
4081 gnutls.c, gtkutil.c: Use bool for boolean.
4082 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4083 (emacs_gnutls_handle_error):
4084 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4085 (xg_hide_tooltip, xg_create_frame_widgets)
4086 (create_dialog, xg_uses_old_file_dialog)
4087 (xg_get_file_with_chooser, xg_get_file_with_selection)
4088 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4089 (xg_item_label_same_p, xg_update_menubar)
4090 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4091 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4092 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4093 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4094 (update_frame_tool_bar, free_frame_tool_bar):
4095 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4096 * nsmenu.m (ns_update_menubar):
4097 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4098 * xfns.c (Fx_show_tip) [USE_GTK]:
4099 Use bool for boolean.
4100 * gtkutil.c (xg_update_frame_menubar):
4101 * xmenu.c (update_frame_menubar):
4102 Return void, not int, since caller ignores return value.
4103 * gtkutil.c (xg_change_toolbar_position):
4104 Return void, not 1.
4105
4106 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4107
4108 * makefile.w32-in (BLOCKINPUT_H): Remove.
4109 (SYSSIGNAL_H): New macro.
4110 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4111 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4112 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4113 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4114 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4115 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4116 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4117 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4118 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4119 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4120 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4121 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4122 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4123 ($(BLD)/w32xfns.$(O)): Update dependencies.
4124
4125 2012-09-23 Eli Zaretskii <eliz@gnu.org>
4126
4127 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4128 fatal_error_backtrace.
4129
4130 * w32proc.c (sys_kill): Undo last change: don't do anything when
4131 invoked to deliver SIGABRT to our own process. This is now
4132 handled by emacs_raise.
4133
4134 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
4135
4136 * w32term.c (w32_read_socket): Remove leftover reference to
4137 interrupt_input_pending.
4138
4139 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4140
4141 Do not use SA_NODEFER.
4142 Problem reported by Dani Moncayo in
4143 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4144 * alloc.c (die):
4145 * sysdep.c (emacs_abort): Do not reset signal handler.
4146 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4147 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4148 wanted even on POSIXish hosts, and it doesn't work on Windows.
4149
4150 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4151
4152 * xterm.c (x_term_init): Call fixup_locale before and after calling
4153 gtk_init (Bug#12392).
4154
4155 2012-09-23 Chong Yidong <cyd@gnu.org>
4156
4157 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4158 Vdynamic_library_alist.
4159
4160 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4161 (Fgnutls_available_p): Caller changed.
4162
4163 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4164 (Flibxml_parse_xml_region): Likewise.
4165
4166 * dispextern.h (struct image_type): Remove arg from init function.
4167
4168 * image.c (Finit_image_library, lookup_image_type)
4169 (define_image_type): Remove now-unneeded second arg.
4170 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4171 (init_tiff_functions, init_gif_functions, init_svg_functions):
4172 Arglist and w32_delayed_load calling convention changed.
4173 (gs_type): Remove init_gs_functions; there is no such function.
4174 (valid_image_p, make_image): Fix caller to lookup_image_type.
4175
4176 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4177
4178 Simplify and avoid signal-handling races (Bug#12471).
4179 * alloc.c (die):
4180 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4181 Avoid recursive loop if there's a fatal error in the function itself.
4182 * atimer.c (pending_atimers):
4183 * blockinput.h: Don't include "atimer.h"; no longer needed.
4184 (interrupt_input_pending): Remove. All uses removed.
4185 pending_signals now counts both atimers and ordinary interrupts.
4186 This is less racy than having three separate pending-signal flags.
4187 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4188 (input_blocked_p):
4189 Rename from their upper-case counterparts BLOCK_INPUT,
4190 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4191 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4192 This makes it easier to access volatile variables more accurately.
4193 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4194 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4195 that's more reliable if the code is buggy and sets
4196 interrupt_input_blocked to a negative value. All uses changed.
4197 * atimer.c (deliver_alarm_signal):
4198 Remove. No need to deliver this to the parent; any thread can
4199 handle this signal now. All uses replaced by underlying handler.
4200 * atimer.c (turn_on_atimers):
4201 * dispnew.c (handle_window_change_signal):
4202 * emacs.c (handle_danger_signal):
4203 * keyboard.c (kbd_buffer_get_event):
4204 Don't reestablish signal handler; not needed with sigaction.
4205 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4206 (UNBLOCK_INPUT_TO):
4207 Rework to avoid unnecessary accesses to volatile variables.
4208 (UNBLOCK_INPUT_TO): Now a function.
4209 (totally_unblock_input, unblock_input): New decls.
4210 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4211 (init_data): Remove. Necessary stuff now done in init_signal.
4212 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4213 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4214 (fatal_error_code): Remove; no longer needed.
4215 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4216 it doesn't always backtrace. All uses changed. No need to reset
4217 signal to default, since sigaction and/or die does that for us now.
4218 Use emacs_raise (FOO), not kill (getpid (), FOO).
4219 (main): Check more-accurately whether we're dumping.
4220 Move fatal-error setup to sysdep.c
4221 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4222 * gtkutil.c (xg_get_file_name, xg_get_font):
4223 Remove no-longer-needed signal-mask manipulation.
4224 * keyboard.c, process.c (POLL_FOR_INPUT):
4225 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4226 * keyboard.c (read_avail_input): Remove.
4227 All uses replaced by gobble_input.
4228 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4229 (kbd_buffer_store_event_hold, gobble_input):
4230 (record_asynch_buffer_change) [USABLE_SIGIO]:
4231 (store_user_signal_events):
4232 No need to mess with signal mask.
4233 (gobble_input): If blocking input and there are terminals, simply
4234 set pending_signals to 1 and return. All hooks changed to not
4235 worry about whether input is blocked.
4236 (process_pending_signals): Clear pending_signals before processing
4237 them, in case a signal comes in while we're processing.
4238 By convention callers now test pending_signals before calling us.
4239 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4240 New functions, to support changes to blockinput.h.
4241 (handle_input_available_signal): Now extern.
4242 (reinvoke_input_signal): Remove. All uses replaced by
4243 handle_async_input.
4244 (quit_count): Now volatile, since a signal handler uses it.
4245 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
4246 All callers changed. Block SIGINT only if not already blocked.
4247 Clear sigmask reliably, even if Fsignal returns, which it can.
4248 Omit unnecessary accesses to volatile var.
4249 (quit_throw_to_read_char): No need to restore sigmask.
4250 * keyboard.c (gobble_input, handle_user_signal):
4251 * process.c (wait_reading_process_output):
4252 Call signal-handling code rather than killing ourselves.
4253 * lisp.h: Include <float.h>, for...
4254 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
4255 (pending_signals): Now volatile.
4256 (syms_of_data): Now const if IEEE floating point.
4257 (handle_input_available_signal) [USABLE_SIGIO]:
4258 (terminate_due_to_signal, record_child_status_change): New decls.
4259 * process.c (create_process): Avoid disaster if memory is exhausted
4260 while we're processing a vfork, by tightening the critical section
4261 around the vfork.
4262 (send_process_frame, process_sent_to, handle_pipe_signal)
4263 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
4264 ignores SIGPIPE.
4265 (send_process): No need for setjmp/longjmp any more, since the
4266 SIGPIPE stuff is now gone. Instead, report an error if errno
4267 is EPIPE.
4268 (record_child_status_change): Now extern. PID and W are now args.
4269 Return void, not bool. All callers changed.
4270 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4271 Remove. All uses removed. This bug should be fixed now in a
4272 different way.
4273 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4274 and record the child status change directly. This avoids the
4275 need to futz with the signal mask.
4276 (process_fatal_action): Move here from emacs.c.
4277 (emacs_sigaction_flags): New function, containing
4278 much of what used to be in emacs_sigaction_init.
4279 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4280 caught by emacs, to make races less likely.
4281 (deliver_process_signal): Rename from handle_on_main_thread.
4282 All uses changed.
4283 (BACKTRACE_LIMIT_MAX): Now at top level.
4284 (thread_backtrace_buffer, threadback_backtrace_pointers):
4285 New static vars.
4286 (deliver_thread_signal, deliver_fatal_thread_signal):
4287 New functions, for more-accurate delivery of thread-specific signals.
4288 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4289 (deliver_arith_signal): Handle in this thread, not
4290 in the main thread, since it's triggered by this thread.
4291 (maybe_fatal_sig): New function.
4292 (init_signals): New arg DUMPING so that we can be more accurate
4293 about whether we're dumping. Caller changed.
4294 Treat thread-specific signals differently from process-general signals.
4295 Block all signals while handling fatal error; that's safer.
4296 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4297 on IEEE hosts.
4298 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
4299 Ignore SIGPIPE unless batch.
4300 (emacs_backtrace): Output backtrace for the appropriate thread,
4301 which is not necessarily the main thread.
4302 * syssignal.h: Include <stdbool.h>.
4303 (emacs_raise): New macro.
4304 * xterm.c (x_connection_signal): Remove; no longer needed
4305 now that we use sigaction.
4306 (x_connection_closed): No need to mess with sigmask now.
4307 (x_initialize): No need to reset SIGPIPE handler here, since
4308 init_signals does this for us now.
4309
4310 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4311
4312 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
4313 background rect may be larger (Bug#12245).
4314
4315 2012-09-23 Chong Yidong <cyd@gnu.org>
4316
4317 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
4318
4319 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 * .gdbinit: Just stop at fatal_error_backtrace.
4322 See Stefan Monnier's request in
4323 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
4324 Remove no-longer-used query of system type.
4325
4326 2012-09-22 Chong Yidong <cyd@gnu.org>
4327
4328 * search.c (Freplace_match): Doc fix (Bug#12325).
4329
4330 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
4331
4332 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
4333 (Fline_end_position): Doc fix.
4334
4335 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
4336
4337 2012-09-22 Chong Yidong <cyd@gnu.org>
4338
4339 * dispextern.h (struct image_type): Add new slot, storing a type
4340 initialization function.
4341
4342 * image.c (define_image_type): Call the image initializer function
4343 if it is defined. Arguments and return value changed.
4344 (valid_image_p, make_image): Callers changed.
4345 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
4346 (gif_type, imagemagick_type, svg_type, gs_type):
4347 Add initialization functions.
4348 (Finit_image_library): Call lookup_image_type.
4349 (CHECK_LIB_AVAILABLE): Macro deleted.
4350 (lookup_image_type): Call define_image_type here, rather than via
4351 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
4352 (syms_of_image): Move define_image_type calls for xbm_type and
4353 pbm_type to lookup_image_type.
4354
4355 2012-09-22 Eli Zaretskii <eliz@gnu.org>
4356
4357 * keyboard.c (timer_check_2): Move calculation of 'timers' and
4358 'idle_timers' from here ...
4359 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
4360 lists, to avoid infloops when the timer does something stupid,
4361 like reinvoke itself with the same or smaller time-out.
4362 (Bug#12447)
4363
4364 2012-09-22 Martin Rudalics <rudalics@gmx.at>
4365
4366 * window.c (Fsplit_window_internal): Handle only Qt value of
4367 Vwindow_combination_limit separately.
4368 (Qtemp_buffer_resize): New symbol.
4369 (Vwindow_combination_limit): New default value.
4370 Rewrite doc-string.
4371
4372 2012-09-22 Eli Zaretskii <eliz@gnu.org>
4373
4374 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4375 the new overlay string. (Bug#10159)
4376
4377 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
4378
4379 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
4380 or that fprintf is async-signal-safe. POSIX doesn't require
4381 either assumption.
4382
4383 2012-09-22 Chong Yidong <cyd@gnu.org>
4384
4385 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
4386 (Bug#8207).
4387
4388 2012-09-22 Kenichi Handa <handa@gnu.org>
4389
4390 * composite.c (composition_reseat_it): Handle the case that a
4391 grapheme cluster is not covered by a single font (Bug#12352).
4392
4393 2012-09-21 Chong Yidong <cyd@gnu.org>
4394
4395 * image.c (define_image_type): Avoid adding duplicate types to
4396 image_types (Bug#12463). Suggested by Jörg Walter.
4397
4398 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4399
4400 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4401 (print_load_command_name): Add case LC_DATA_IN_CODE.
4402 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
4403
4404 2012-09-21 Glenn Morris <rgm@gnu.org>
4405
4406 * eval.c (Frun_hook_with_args_until_success)
4407 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
4408
4409 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
4410
4411 * fileio.c (Ffile_selinux_context): Only call freecon when
4412 lgetfilecon succeeded.
4413 (Fset_file_selinux_context): Likewise. (Bug#12444)
4414
4415 2012-09-21 Eli Zaretskii <eliz@gnu.org>
4416
4417 * xdisp.c (try_window_reusing_current_matrix): Under bidi
4418 reordering, locate the cursor by calling set_cursor_from_row; if
4419 that fails, clear the desired glyph matrix before returning a
4420 failure indication to the caller. Fixes leaving garbled display
4421 when fast scrolling with a down-key. (Bug#12403)
4422 (compute_stop_pos_backwards): Fix a typo that caused crashes while
4423 scrolling through multibyte text.
4424
4425 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
4426
4427 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
4428 calling mark_vectorlike since that's the one that marks the window.
4429 (mark_discard_killed_buffers): Mark the final cdr.
4430 * window.h (struct window): Move prev/next_buffers to the
4431 non-standard fields.
4432 * window.c (make_window): Initialize prev/next_buffers manually.
4433
4434 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 Omit unused arg EXPECTED from socket hooks.
4437 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
4438 * nsterm.m (ns_term_init):
4439 * termhooks.h (struct terminal.read_socket_hook):
4440 * w32inevt.c (w32_console_read_socket):
4441 * w32term.c (w32_read_socket):
4442 * xterm.c (XTread_socket):
4443 Omit unused arg EXPECTED. All callers changed.
4444 (store_user_signal_events): Return void, not int, since callers no
4445 longer care about the return value. All uses changed.
4446
4447 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
4448
4449 * w32gui.h (XParseGeometry): Do not declare.
4450
4451 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
4452
4453 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
4454 Ignore 'expected'. See Eli Zaretskii in
4455 <http://bugs.gnu.org/12471#8> (last line).
4456
4457 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
4458 (XParseGeometry): Now static. Substitute extremal values for
4459 values that are out of range.
4460
4461 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
4462
4463 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
4464
4465 * nsfns.m (XParseGeometry): Remove.
4466 (Fx_create_frame): Call x_set_offset to correctly interpret
4467 top_pos in geometry.
4468
4469 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
4470 (Fx_parse_geometry): If there is a space in string, call
4471 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
4472
4473 2012-09-17 Eli Zaretskii <eliz@gnu.org>
4474
4475 * search.c (scan_buffer): Use character positions in calls to
4476 region_cache_forward and region_cache_backward, not byte
4477 positions. (Bug#12196)
4478
4479 * w32term.c (w32_read_socket): Set pending_signals to 1, like
4480 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
4481
4482 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
4483 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
4484 emacs_blocked_malloc, now deleted.
4485
4486 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
4487
4488 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
4489 The workaround was for improving performance on Solaris 2.4, but
4490 is getting in the way now. Emacs will still work if someone is
4491 still running Solaris 2.4 in a museum somewhere; Sun dropped
4492 support for Solaris 2.4 in 2003.
4493 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
4494 * process.c (create_process) [HAVE_WORKING_VFORK]:
4495 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
4496 since Emacs no longer uses vfork on that platform.
4497
4498 2012-09-17 Glenn Morris <rgm@gnu.org>
4499
4500 * emacs.c: Use COPYRIGHT.
4501
4502 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
4503
4504 Remove configure's --without-sync-input option (Bug#12450).
4505 When auditing signal-handling in preparation for cleaning it up,
4506 I found that SYNC_INPUT has race conditions and would be a real
4507 pain to fix. Since it's an undocumented and deprecated
4508 configure-time option, now seems like a good time to remove it.
4509 Also see <http://bugs.gnu.org/11080#16>.
4510 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
4511 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
4512 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4513 (malloc_hysteresis):
4514 (check_depth) [XMALLOC_OVERRUN_CHECK]:
4515 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
4516 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
4517 (dont_register_blocks, bytes_used_when_reconsidered)
4518 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
4519 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
4520 [!SYSTEM_MALLOC && !SYNC_INPUT]:
4521 Remove. All uses removed.
4522 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
4523 implementation, one that depends on whether the new macro
4524 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
4525 is defined.
4526 * atimer.c (run_timers, handle_alarm_signal):
4527 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
4528 (handle_async_input, process_pending_signals)
4529 (handle_input_available_signal, init_keyboard):
4530 * nsterm.m (ns_read_socket):
4531 * process.c (wait_reading_process_output):
4532 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
4533 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
4534 (emacs_write):
4535 * xterm.c (XTread_socket):
4536 Assume SYNC_INPUT.
4537 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
4538 * eval.c (handling_signal): Remove. All uses removed.
4539 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
4540 All uses replaced with the SYNC_INPUT version.
4541 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
4542 Remove decls.
4543 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4544 Now static.
4545
4546 * font.c (Ffont_shape_gstring): Remove unused local.
4547
4548 2012-09-16 Glenn Morris <rgm@gnu.org>
4549
4550 * Makefile.in (clean): No longer run nextstep's clean.
4551
4552 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
4553 (ns_frag): Remove.
4554 (ns-app): Move here from ns.mk, and simplify.
4555 (clean): Simplify nextstep entry.
4556 * ns.mk: Remove file.
4557
4558 2012-09-17 Kenichi Handa <handa@gnu.org>
4559
4560 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4561 not covert the last few charactes.
4562
4563 2012-09-16 Kenichi Handa <handa@gnu.org>
4564
4565 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
4566 here, but just check the validity of glyphs in the glyph-string.
4567
4568 2012-09-16 Martin Rudalics <rudalics@gmx.at>
4569
4570 * window.c (Fwindow_parameter, Fset_window_parameter):
4571 Accept any window as argument (Bug#12452).
4572
4573 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
4574
4575 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
4576 to ns_term_init to avoid memory leak.
4577
4578 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
4579 explicit retain/release.
4580 (ns_term_init): Only allow one display. Initialize outerpool and
4581 ns_*_types.
4582
4583 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4584
4585 Port _setjmp fix to POSIXish hosts as well as Microsoft.
4586 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
4587 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
4588 the Microsoft problem in a different way, by altering ../nt/config.nt.
4589
4590 2012-09-15 Eli Zaretskii <eliz@gnu.org>
4591
4592 * w32xfns.c:
4593 * w32uniscribe.c:
4594 * w32term.c:
4595 * w32select.c:
4596 * w32reg.c:
4597 * w32proc.c:
4598 * w32menu.c:
4599 * w32inevt.c:
4600 * w32heap.c:
4601 * w32font.c:
4602 * w32fns.c:
4603 * w32console.c:
4604 * w32.c:
4605 * w16select.c: Remove inclusion of setjmp.h, as it is now included
4606 by lisp.h. This completes removal of setjmp.h inclusion
4607 erroneously announced in the previous commit. (Bug#12446)
4608
4609 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
4610 more accurate.
4611
4612 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
4613 not defined as a macro. The latter happens on MS-Windows.
4614 (Bug#12446)
4615
4616 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4617
4618 Port better to POSIX hosts lacking _setjmp (Bug#12446).
4619 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
4620 Some instances of '#include <setjmp.h>' removed, if the
4621 only reason for the instance was because "lisp.h" was included.
4622 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
4623 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
4624 and _longjmp with the new symbols. Emacs already uses _setjmp if
4625 available, so this change affects only POSIXish hosts that have
4626 sigsetjmp but not _setjmp, such as some versions of Solaris and
4627 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
4628 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4629 (png_load_body) [HAVE_PNG]:
4630 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4631 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4632 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4633 since PNG requires jmp_buf. This is the only exception to the
4634 general rule that we now use sys_setjmp and sys_longjmp.
4635 This exception is OK since this code does not change the signal
4636 mask or longjmp out of a signal handler.
4637
4638 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4641 Include "syssignal.h", for 'main_thread'.
4642
4643 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4644
4645 Avoid out-of-range marker position (Bug#12426).
4646 * insdel.c (replace_range, replace_range_2):
4647 Adjust markers before overlays, as suggested by comments.
4648 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4649 Remove redundant check before calling offset_intervals.
4650
4651 2012-09-14 Martin Rudalics <rudalics@gmx.at>
4652
4653 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
4654 current buffer (Bug#12387).
4655
4656 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
4657
4658 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
4659
4660 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4661
4662 Use a more backwards-compatible timer format (Bug#12430).
4663 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
4664 vector element, not from the 4th, since PSECS is now at the end.
4665 (Fcurrent_idle_time): Doc fix.
4666
4667 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
4668
4669 Function to mark objects and remove killed buffers at once.
4670 * alloc.c (discard_killed_buffers): Rename to ...
4671 (mark_discard_killed buffers) ... new name. Add marking
4672 of remaining objects. Fix comment. Adjust users.
4673 (mark_object): Do not touch frame buffer lists here.
4674 * frame.c (delete_frame): Reset frame buffer lists here.
4675
4676 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4677
4678 Better workaround for GNOME bug when --enable-gcc-warnings.
4679 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
4680 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
4681 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
4682
4683 Simplify SIGIO usage (Bug#12408).
4684 The code that dealt with SIGIO was crufty and confusing, e.g., it
4685 played tricks like "#undef SIGIO" but these tricks were not used
4686 consistently. Simplify mostly by not #undeffing standard symbols,
4687 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
4688 or not as we please) rather than "defined SIGIO" (standard symbol
4689 that we probably shouldn't #undef).
4690 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
4691 Modules that need it can include it.
4692 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
4693 * dispextern.h (ignore_sigio): New decl.
4694 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
4695 unconditionally, since it's now a no-op if !USABLE_SIGIO.
4696 * emacs.c (shut_down_emacs):
4697 * keyboard.c (kbd_buffer_store_event_hold):
4698 Use ignore_sigio rather than invoking 'signal' directly.
4699 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
4700 for FIONREAD.
4701 (FIONREAD, SIGIO): Do not #undef.
4702 (tty_read_avail_input): Use #error rather than a syntax error.
4703 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
4704 for I_PIPE, used by SETUP_SLAVE_PTY.
4705 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
4706 * sysdep.c (croak): Remove; no longer needed. This bit of
4707 temporary code, with Fred N. Fish's comment that it's temporary,
4708 has been in Emacs since at least 1992!
4709 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
4710 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
4711 * syssignal.h (croak): Remove decl.
4712 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
4713 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
4714 now that we're termios-only.
4715 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
4716 * term.c (dissociate_if_controlling_tty): Use #error rather than
4717 a run-time error.
4718
4719 Work around GCC and GNOME bugs when --enable-gcc-warnings.
4720 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
4721 to work around GNOME bug 683906.
4722 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
4723 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
4724 This works around GCC bug 54561.
4725
4726 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4727
4728 More fixes for 'volatile' and setjmp/longjmp.
4729 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
4730 * image.c (struct png_load_context) [HAVE_PNG]: New type.
4731 (png_load_body) [HAVE_PNG]:
4732 (jpeg_load_body) [HAVE_JPEG]:
4733 New function, with most of the old parent function's body.
4734 (png_load) [HAVE_PNG]:
4735 (jpeg_load) [HAVE_JPEG]:
4736 Invoke the new function, to avoid longjmp munging our locals.
4737 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
4738 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
4739 longjmp is passed 2, as the C standard doesn't guarantee this.
4740 Instead, store the failure code into mgr->failure_code.
4741
4742 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4743
4744 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4745 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
4746 (syms_of_keyboard): Remove support for unread-command-char.
4747
4748 2012-09-12 Eli Zaretskii <eliz@gnu.org>
4749
4750 * w32proc.c (sys_kill): If PID is our process ID and the signal is
4751 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
4752 violation. (Bug#12426)
4753
4754 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4755
4756 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
4757
4758 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4759
4760 * eval.c: Add `inhibit-debugger'.
4761 (Qinhibit_debugger): New symbol.
4762 (call_debugger): Bind it instead of Qdebug_on_error.
4763 (maybe_call_debugger): Test Vinhibit_debugger.
4764 (syms_of_eval): Define inhibit-debugger.
4765 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
4766 (syms_of_xdisp): Remove inhibit-debug-on-message.
4767
4768 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4769
4770 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
4771 If a nonvolatile local variable is written before a _longjmp to
4772 the frame containing the variable, and is read after the _longjmp,
4773 the value read is indeterminate. Some local variables of type
4774 'struct handler' and 'struct catchtag' are used in this way, so
4775 mark each of their slots as volatile if the slot can be set before
4776 _longjmp and read afterwards.
4777 * lisp.h (struct handler): var and chosen_clause are now volatile.
4778 (struct catchtag): val, next, and pdlcount are now volatile.
4779
4780 * bidi.c (bidi_push_it, bidi_pop_it):
4781 * fns.c (copy_hash_table):
4782 * image.c (define_image_type):
4783 * keyboard.c (kbd_buffer_store_event_hold):
4784 * process.c (Fprocess_send_eof):
4785 * xfaces.c (x_create_gc) [HAVE_NS]:
4786 * xgselect.c (xg_select):
4787 Prefer assignment to memcpy when either will do.
4788
4789 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4790 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4791 time an item is removed. No need to mark this function 'inline';
4792 the compiler knows better than we do.
4793
4794 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4795
4796 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4797 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4798 to change_frame_size (Bug#12388).
4799 (windowDidResize:): Pass YES to updateFrameSize.
4800
4801 * nsterm.h: Add delay parameter to updateFrameSize.
4802
4803 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Discard killed buffers from deleted window and frame objects.
4806 This reduces an amount of references to killed buffers and
4807 helps GC to reclaim them faster.
4808 * alloc.c (discard_killed_buffers): New function.
4809 (mark_object): Use it for deleted windows and frames.
4810 (mark_object): If symbol's value is set up for a killed buffer
4811 or deleted frame, restore its global binding.
4812 * data.c (swap_in_global_binding): Add GC notice.
4813 (swap_in_symval_forwarding): Use convenient set_blv_where.
4814 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4815 * window.h: ... to here.
4816
4817 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4818
4819 Convenient macro to check whether the buffer is live.
4820 * buffer.h (BUFFER_LIVE_P): New macro.
4821 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4822 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4823
4824 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4825
4826 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4827 composition cases (Bug#12364).
4828
4829 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4830 overhang of succeeding glyphs overlapping box cursor.
4831
4832 * w32term.c (x_draw_glyph_string): Likewise.
4833
4834 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4835
4836 Simplify, document, and port floating-point (Bug#12381).
4837 The porting part of this patch fixes bugs on non-IEEE platforms
4838 with frexp, ldexp, logb.
4839 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4840 Now static.
4841 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4842 support, by removing commented-out code and briefly listing the
4843 C89 functions excluded. The commented-out stuff was confusing
4844 maintenance, e.g., we thought we needed cbrt but it was commented out.
4845 (logb): Remove decl; no longer needed.
4846 (isfinite): New macro, if not already supplied.
4847 (isnan): Don't replace any existing macro.
4848 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4849 are present on all C89 platforms.
4850 (Ffrexp): Do not special-case zero, as frexp does the right thing
4851 for that case.
4852 (Flogb): Do not use logb, as it doesn't have the desired meaning
4853 on hosts that use non-base-2 floating point. Instead, stick with
4854 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4855 frexp, to avoid getting an unspecified result.
4856
4857 * xdisp.c (Qinhibit_debug_on_message): Now static.
4858
4859 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4860
4861 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4862 NSBezierPath (Bug#12131).
4863
4864 2012-09-10 Chong Yidong <cyd@gnu.org>
4865
4866 * fns.c (Fdelq, Fdelete): Doc fix.
4867
4868 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4871 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4872
4873 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4874
4875 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4876 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4877 Use it.
4878
4879 2012-09-09 Eli Zaretskii <eliz@gnu.org>
4880
4881 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4882 left fringe if the window has a left margin. This avoids leaving
4883 traces of the cursor because its leftmost pixel is not drawn over.
4884
4885 * dispnew.c (update_window_line): When the left margin area of a
4886 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4887 that screen line. (Bug#12277)
4888
4889 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 Assume C89 or later for math functions (Bug#12381).
4892 This simplifies the code, and makes it a bit smaller and faster,
4893 and (most important) makes it easier to clean up signal handling
4894 since we can stop worring about floating-point exceptions in
4895 library code. That was a problem before C89, but the problem
4896 went away many years ago on all practical Emacs targets.
4897 * data.c, image.c, lread.c, print.c:
4898 Don't include <math.h>; no longer needed.
4899 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4900 might be autoconfigured, as that never happens.
4901 * data.c (fmod):
4902 * doprnt.c (DBL_MAX_10_EXP):
4903 * print.c (DBL_DIG):
4904 Remove. C89 or later always defines these.
4905 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4906 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4907 (arith_error, domain_error, domain_error2):
4908 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4909 no longer needed -- we simply return what C returns. All uses removed.
4910 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4911 the wrapped code.
4912 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4913 Remove. All uses expanded, as these macros are no longer used
4914 more than once and are now more trouble than they're worth.
4915 (Ftan): Use tan, not sin / cos.
4916 (Flogb): Assume C89 frexp.
4917 (fmod_float): Assume C89 fmod.
4918 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4919 (init_floatfns): Remove. All uses removed.
4920
4921 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4922
4923 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4924 compositeToPoint for OSX < 10.6 (Bug#12390).
4925
4926 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4927
4928 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4929 This produces more-accurate results.
4930
4931 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4932
4933 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4934 changes (Bug#12088).
4935
4936 2012-09-08 Chong Yidong <cyd@gnu.org>
4937
4938 * syntax.c (Fstring_to_syntax): Doc fix.
4939
4940 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4941
4942 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4943 in the internal border.
4944 (x_set_window_size): Remove static variables and their usage.
4945 (ns_redraw_scroll_bars): Fix NSTRACE arg.
4946 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4947 Remove fringe/internal border adjustment (Bug#11052).
4948 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4949 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4950 (ns_fix_rect_ibw): Remove.
4951 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4952 (ns_dumpglyphs_box_or_relief): Ditto.
4953 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4954 adjustment.
4955 (ns_dumpglyphs_image): Ditto.
4956 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
4957 border adjustment.
4958 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4959 their usage. Add fringe_extended_p and its use as in other terms.
4960 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4961 scroll bar was removed.
4962 (updateFrameSize): New function.
4963 (windowDidResize): Move code to updateFrameSize and call it.
4964
4965 * nsterm.h (EmacsView): Add updateFrameSize.
4966
4967 2012-09-07 Chong Yidong <cyd@gnu.org>
4968
4969 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4970
4971 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4972
4973 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4974
4975 More signal-handler cleanup (Bug#12327).
4976 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4977 Problem introduced when merging patches. Noted by Eli Zaretskii in
4978 <http://bugs.gnu.org/12327#67>.
4979 * floatfns.c: Comment fix.
4980 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4981 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4982 and anyway the declaration is harmless even if SIGDANGER is not defined.
4983 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4984 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4985 source files not surprisingly expected syssignal.h to define, or
4986 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4987 Include <sys/ioctl.h>, for FIONREAD.
4988 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4989 This eliminates a problem whereby other files mysteriously had
4990 to include "syssignal.h" before including "systty.h" if they
4991 wanted to use "#ifdef SIGIO".
4992
4993 2012-09-07 Eli Zaretskii <eliz@gnu.org>
4994
4995 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4996
4997 * w32.c (sigemptyset): Empty the set.
4998 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4999
5000 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5001
5002 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5003
5004 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5005 (mark_object): Likewise for frame objects.
5006
5007 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5008
5009 * syssignal.h (handle_on_main_thread): Always declare,
5010 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5011 This ports to platforms without HAVE_PTHREAD.
5012
5013 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 Signal-handler cleanup (Bug#12327).
5016 Emacs's signal handlers were written in the old 4.2BSD style with
5017 sigblock and sigmask and so forth, and this led to some
5018 inefficiencies and confusion. Rewrite these to use
5019 pthread_sigmask etc. without copying signal sets around. Also,
5020 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5021 'signal', and instead use functions that do not attempt to take
5022 over the system name space. This patch causes Emacs's text
5023 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5024 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5025 Do not include <signal.h> or "syssignal.h", as these
5026 modules do not use signals.
5027 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5028 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5029 Do not include <signal.h>, as "syssignal.h" does that for us now.
5030 * atimer.c (sigmask_atimers): New function.
5031 (block_atimers, unblock_atimers): New functions,
5032 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5033 All uses replaced.
5034 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5035 no longer needed here.
5036 * emacs.c (main): Inspect existing signal handler with sigaction,
5037 so that there's no need to block and unblock SIGHUP.
5038 * sysdep.c (struct save_signal): New member 'action', replacing
5039 old member 'handler'.
5040 (save_signal_handlers, restore_signal_handlers):
5041 Use sigaction instead of 'signal' to save and restore.
5042 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5043 New function. All users of 'signal' modified to use set_sighandler
5044 if they're writeonly, and to use sys_signal if they're read+write.
5045 (emacs_sigaction_init, forwarded_signal): New functions.
5046 (sys_signal): Remove. All uses replaced by calls to sigaction
5047 and emacs_sigaction_init, or by direct calls to 'signal'.
5048 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5049 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5050 all uses replaced by pthread_sigmask etc. calls.
5051 * syssignal.h: Include <signal.h>.
5052 (emacs_sigaction_init, forwarded_signal): New decls.
5053 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5054 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5055 (sigmask, sys_sigmask): Remove; no longer needed.
5056 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5057 (sigblock, sigunblock, sigfree):
5058 (sigsetmask) [!defined sigsetmask]:
5059 Remove. All uses replaced by pthread_sigmask.
5060 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5061 no longer need to be replaced, and its typical old uses
5062 are now done via emacs_sigaction_init and sigaction.
5063 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5064 (sys_sigdel): Remove; unused.
5065 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5066
5067 2012-09-06 Eli Zaretskii <eliz@gnu.org>
5068
5069 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5070 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5071
5072 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 Explicitly mark buffer_defaults and buffer_local_symbols.
5075 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5076 mark_local_symbols here.
5077 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5078 since special buffers aren't marked here any more.
5079 (allocate_buffer): Chain new buffer with all_buffers here...
5080 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5081 not here.
5082 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5083 (syms_of_buffer): Remove staticpro of the above.
5084 (init_buffer_once): Set names for buffer_defaults and
5085 buffer_local_symbols.
5086
5087 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5088
5089 Use bool for booleans in font-related modules.
5090 * font.c (font_intern_prop, font_style_to_value)
5091 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5092 (generate_otf_features, font_check_otf_features, font_check_otf)
5093 (font_match_p, font_list_entities, font_at):
5094 * fontset.c (fontset_id_valid_p, reorder_font_vector
5095 (fontset_find_font, Fset_fontset_font)
5096 (face_suitable_for_char_p) [0]:
5097 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5098 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5099 (m17n_flt_initialized, ftfont_shape_by_flt):
5100 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5101 * nsfont.m (nsfont_draw):
5102 * w32font.c (w32font_draw):
5103 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5104 Use bool for booleans.
5105 * font.h: Adjust to above API changes.
5106 (struct font, struct font_driver, struct font_driver_list):
5107 Use bool for booleans.
5108 (struct font): Remove useless member encoding_type.
5109 All users removed.
5110 * fontset.c, xftfont.c: Omit unnecessary static decls.
5111
5112 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5113
5114 * alloc.c (mark_object): Revert window marking code
5115 since it's unsafe for the Fset_window_configuration.
5116
5117 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5118
5119 Fix race conditions with signal handlers and errno (Bug#12327).
5120 Be more systematic about preserving errno whenever a signal
5121 handler returns, even if it's not in the main thread. Do this by
5122 renaming signal handlers to distinguish between signal delivery
5123 and signal handling. All uses changed.
5124 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5125 * data.c (deliver_arith_signal): Rename from arith_error.
5126 * dispnew.c (deliver_window_change_signal): Rename from
5127 window_change_signal.
5128 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5129 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5130 * keyboard.c (deliver_input_available_signal): Rename from
5131 input_available_signal.
5132 (deliver_user_signal): Rename from handle_user_signal.
5133 (deliver_interrupt_signal): Rename from interrupt_signal.
5134 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5135 (deliver_child_signal): Rename from sigchld_handler.
5136 * atimer.c (handle_alarm_signal):
5137 * data.c (handle_arith_signal):
5138 * dispnew.c (handle_window_change_signal):
5139 * emacs.c (handle_fatal_signal, handle_danger_signal):
5140 * keyboard.c (handle_input_available_signal):
5141 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5142 * process.c (handle_pipe_signal, handle_child_signal):
5143 New functions, with the actual signal-handling code taken from the
5144 original respective signal handlers, sans the sporadic attempts to
5145 preserve errno, since that's now done by handle_on_main_thread.
5146 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5147 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5148 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5149 Move to sysdep.c.
5150 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5151 Move initialization of main_thread to sysdep.c's init_signals.
5152 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5153 our usage, and simplifies the mainline code.
5154 (record_child_status_change): New static function, as a helper
5155 for handle_child_signal, and with most of the old child handler's
5156 contents.
5157 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5158 (handle_child_signal): Use the above.
5159 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5160 Moved here from emacs.c.
5161 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5162 code moved here from emacs.c's main function.
5163 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
5164 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5165 This lets callers save and restore errno properly.
5166
5167 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5168
5169 Remove redundant or unused things here and there.
5170 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5171 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5172 * editfns.c (Fcompare_buffer_substrings): Likewise.
5173 * frame.h (struct terminal, struct font_driver_list):
5174 Remove redundant declarations.
5175 * window.h (Qleft, Qright): Likewise.
5176
5177 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5178
5179 Do not mark objects from deleted buffers, windows and frames.
5180 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5181 (mark_object): Likewise for windows and frames.
5182
5183 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5184
5185 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5186 buffer_defaults and buffer_local_symbols as valid objects.
5187 Return special value to denote them.
5188
5189 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5190
5191 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5192 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5193 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5194 (file_name_absolute_p, Fsubstitute_in_file_name):
5195 (check_executable, check_writable, Ffile_accessible_directory_p)
5196 (Fset_file_selinux_context, Fdefault_file_modes)
5197 (Finsert_file_contents, choose_write_coding_system)
5198 (Fwrite_region, build_annotations, a_write, e_write)
5199 (Fdo_auto_save):
5200 * filelock.c (boot_time_initialized, get_boot_time)
5201 (get_boot_time_1, lock_file_1, within_one_second):
5202 * floatfns.c (in_float):
5203 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5204 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5205 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5206 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5207 * window.c (compare_window_configurations):
5208 Use bool for booleans.
5209 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5210 (Fdefault_file_modes): Now mode_t, not int, for modes.
5211 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5212 (internal_delete_file): Now returns void, not a (boolean) int,
5213 since nobody was looking at the return value.
5214 * lisp.h, window.h: Adjust to above API changes.
5215
5216 * xdisp.c (set_message): Simplify and reindent last change.
5217
5218 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
5219
5220 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5221
5222 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5223
5224 * eval.c (call_debugger): Make the function non-static so that we
5225 can call it from set_message.
5226
5227 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5228 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5229
5230 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5231
5232 Give more-useful info on a fatal error (Bug#12328).
5233 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5234 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5235 of doing the work ourselves.
5236 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5237 do most of the work.
5238 (fatal_error_backtrace): New function, taken from the guts
5239 of the old fatal_error_signal, but with a new option to output
5240 a backtrace.
5241 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5242 info about the signal than just its number.
5243 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5244 * sysdep.c: Include <execinfo.h>
5245 (emacs_backtrace): New function, taken partly from the previous
5246 code of the 'die' function.
5247 (emacs_abort): Call fatal_error_backtrace rather than abort.
5248
5249 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
5250
5251 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
5252 eager (load-time) macro-expansion.
5253 * lisp.mk (lisp): Add macroexp.
5254
5255 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5256
5257 Simplify redefinition of 'abort' (Bug#12316).
5258 Do not try to redefine the 'abort' function. Instead, redo
5259 the code so that it calls 'emacs_abort' rather than 'abort'.
5260 This removes the need for the NO_ABORT configure-time macro
5261 and makes it easier to change the abort code to do a backtrace.
5262 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
5263 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
5264 Remove; sysdep.c's emacs_abort now takes its place.
5265 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
5266 'abort' changed to use 'emacs_abort'.
5267 * msdos.c (dos_abort) [defined abort]: Remove; not used.
5268 (abort) [!defined abort]: Rename to ...
5269 (emacs_abort): ... new name.
5270 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5271 the place of the old 'abort' in emacs.c.
5272 * w32.c, w32fns.c (abort): Do not #undef.
5273 * w32.c (emacs_abort): Rename from w32_abort.
5274
5275 2012-09-04 Eli Zaretskii <eliz@gnu.org>
5276
5277 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5278 offsets[j].dv, since the y axis of the screen coordinates points
5279 down, while the y axis of the font definition coordinates points
5280 up. This fixes display of Arabic diacritics such as KASRA and
5281 KASRATAN. (Bug#11860)
5282
5283 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 Be more systematic about _setjmp vs setjmp.
5286 * alloc.c (test_setjmp, mark_stack):
5287 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5288 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5289 (png_load, my_error_exit, jpeg_load):
5290 * process.c (send_process_trap, send_process):
5291 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5292 The underscored versions are up to 30x faster on some hosts.
5293 Formerly, the code used setjmp+longjmp sometimes and
5294 _setjmp+_longjmp at other times, with no particular reason to
5295 prefer setjmp+longjmp.
5296
5297 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 Fix minor problem found by static checking.
5300 * buffer.c (Fdelete_all_overlays): Return nil.
5301
5302 2012-09-03 Martin Rudalics <rudalics@gmx.at>
5303
5304 * buffer.c (Fdelete_all_overlays): New function.
5305
5306 2012-09-03 Chong Yidong <cyd@gnu.org>
5307
5308 * gtkutil.c: Add extern decl for Qxft.
5309
5310 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5311
5312 * emacs.c, eval.c: Use bool for boolean.
5313 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
5314 (malloc_using_checking) [DOUG_LEA_MALLOC]:
5315 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
5316 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
5317 (main, decode_env_path, Fdaemon_initialized):
5318 * eval.c (call_debugger, Finteractive_p, interactive_p):
5319 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
5320 (maybe_call_debugger, Fbacktrace):
5321 * process.c (read_process_output, exec_sentinel):
5322 Use bool for booleans.
5323 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
5324 All callers changed.
5325 * eval.c (interactive_p): Omit always-true boolean argument
5326 EXCLUDE_SUBRS_P. All callers changed.
5327 * dispextern.h, lisp.h: Reflect above API changes.
5328 * firstfile.c (dummy): Use the address of 'main', whose signature
5329 won't change, instead of the address of 'initialize', whose
5330 signature just changed from int to bool.
5331 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
5332 * msdos.c (fatal_error_in_progress): ... from here.
5333 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
5334 of incrementing it.
5335 (redisplay_internal, unwind_redisplay): Simply clear
5336 REDISPLAYING_P when unwinding, instead of saving its previous,
5337 always-false value and then restoring it.
5338
5339 Clean up some extern decls.
5340 Mostly, this hoists extern decls out of .c files and into .h files.
5341 That way, we're more likely to catch errors if the interfaces change.
5342 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
5343 declare xg_mark_data.
5344 * dispextern.h (x_frame_parm_handlers):
5345 * font.h (Qxft):
5346 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
5347 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
5348 (Qultra_bold, Qoblique, Qitalic):
5349 Move extern decl here from .c file.
5350 * alloc.c (xg_mark_data) [USE_GTK]:
5351 * doc.c (Qclosure):
5352 * eval.c (Qlexical_binding):
5353 * fns.c (time) [!HAVE_UNISTD_H]:
5354 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
5355 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
5356 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
5357 * lread.c (Qinternal_interpreter_environment):
5358 * minibuf.c (Qbuffer):
5359 * process.c (QCfamily, QCfilter):
5360 * widget.c (free_frame_faces):
5361 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
5362 * xfont.c (x_clear_errors):
5363 * xterm.c (x_frame_parm_handlers):
5364 Remove now-redundant extern decls.
5365 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
5366 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
5367 Now static.
5368 * xfaces.c: Remove unnecessary static decls.
5369 * xterm.c (updating_frame): Remove decl of nonexistent object.
5370
5371 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
5372 when building globals.h, as the objects that are not built on
5373 this host are not needed to compile C files on this host.
5374
5375 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
5376
5377 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
5378
5379 * frame.h: Add missing prototype for x_wm_set_size_hint.
5380
5381 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
5382
5383 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
5384 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
5385 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
5386 (Fsubstitute_command_keys):
5387 * editfns.c (region_limit, find_field, Fconstrain_to_field)
5388 (save_excursion_save, save_excursion_restore)
5389 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
5390 (format_time_string, general_insert_function)
5391 (make_buffer_string, make_buffer_string_both)
5392 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
5393 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
5394 (copy_text, insert_1, insert_1_both, insert_from_string)
5395 (insert_from_string_before_markers, insert_from_string_1)
5396 (insert_from_buffer, insert_from_buffer_1, replace_range)
5397 (replace_range_2, del_range_1, del_range_byte, del_range_both)
5398 (del_range_2, modify_region):
5399 * intervals.c (intervals_equal, balance_possible_root_interval)
5400 (adjust_intervals_for_insertion, merge_properties_sticky)
5401 (graft_intervals_into_buffer, lookup_char_property)
5402 (adjust_for_invis_intang, set_point_both)
5403 (get_property_and_range, compare_string_intervals)
5404 (set_intervals_multibyte_1, set_intervals_multibyte):
5405 * keyboard.c (decode_timer):
5406 Use bool for boolean.
5407 * intervals.h, lisp.h, systime.h: Reflect above API changes.
5408 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
5409
5410 2012-09-02 Chong Yidong <cyd@gnu.org>
5411
5412 * keymap.c (push_key_description): Print M-TAB as C-M-i
5413 (Bug#11758).
5414
5415 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
5416
5417 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
5418 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
5419 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
5420 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
5421 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
5422 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
5423 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5424
5425 2012-09-01 Eli Zaretskii <eliz@gnu.org>
5426
5427 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
5428 more than one grapheme cluster passed to the shaper: compute the
5429 offset adjustment values separately for each cluster. (Bug#11860)
5430
5431 * image.c: Restore mistakenly removed inclusion of w32.h. Without
5432 it, GCC doesn't see prototypes of w32_delayed_load, and complains
5433 about implicit conversions from integer to pointer.
5434
5435 2012-09-01 Daniel Colascione <dancol@dancol.org>
5436
5437 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
5438 system used too early.
5439
5440 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
5441
5442 Better seed support for (random).
5443 * emacs.c (main): Call init_random.
5444 * fns.c (Frandom): Set the seed from a string argument, if given.
5445 Remove long-obsolete Gentzel cruft.
5446 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
5447 (init_random): New function.
5448
5449 2012-09-01 Daniel Colascione <dancol@dancol.org>
5450
5451 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
5452 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
5453 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
5454 x_wm_set_size_hint, x_query_colors, x_real_positions,
5455 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
5456 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
5457 all of which have been moved to common code.
5458
5459 * xfaces.c: Include TERM_HEADER instead of listing all possible
5460 window-system headers.
5461
5462 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
5463 to match header.
5464
5465 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
5466 directly accessing frame internals.
5467
5468 * w32font.h: Include font.h. Define syms_of_w32font and
5469 globals_of_w32font.
5470
5471 * process.c: Include TERM_HEADER instead of listing all possible
5472 window-system headers.
5473
5474 * nsterm.h: Remove declarations now in frame.h.
5475 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
5476
5477 * menu.c: Include TERM_HEADER instead of listing all possible
5478 window-system headers.
5479
5480 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
5481 window system.
5482
5483 * keyboard.c: Include TERM_HEADER instead of listing all possible
5484 window-system headers.
5485
5486 * image.c: Include TERM_HEADER instead of listing all possible
5487 window-system headers. Declare Vlibrary_cache when compiling for
5488 Windows.
5489
5490 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
5491 window system declarations.
5492
5493 * frame.h: Move common functions here: set_frame_menubar,
5494 x_set_window_size, x_sync, x_get_focus_frame,
5495 x_set_mouse_position, x_set_mouse_pixel_position,
5496 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
5497 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
5498 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
5499 x_activate_menubar, x_real_positions, x_bitmap_icon,
5500 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
5501 and x_query_colors.
5502
5503 * frame.c: Include TERM_HEADER instead of listing all possible
5504 window-system headers.
5505
5506 * font.c: Include TERM_HEADER instead of listing all possible
5507 window-system headers.
5508
5509 * emacs.c: Include TERM_HEADER.
5510
5511 * dispnew.c: Include TERM_HEADER instead of listing all possible
5512 window-system headers.
5513
5514 * ccl.h: Include character.h.
5515
5516 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
5517 the current window system; include in list of objects to link into
5518 Emacs.
5519
5520 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5521
5522 Remove mark_ttys function and fix tty_display_info initialization.
5523 * lisp.h (mark_ttys): Remove prototype.
5524 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
5525 to mark_ttys because all possible values of 'top_frame' slot are
5526 the frames which are reachable from Vframe_list.
5527 * term.c (mark_ttys): Remove.
5528 (init_tty): Safely initialize 'top_frame' slot with Qnil.
5529
5530 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5531
5532 Change struct frame bitfields from unsigned char to unsigned.
5533 * frame.h (struct frame): Change type of 'display_preempted',
5534 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
5535 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
5536 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
5537 bitfields from unsigned char to unsigned.
5538
5539 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
5540
5541 Remove unused member of struct x_output and struct w32_output.
5542 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
5543 * w32term.h (struct w32_output): Likewise.
5544
5545 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
5546
5547 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
5548 does not become zero (Bug#12234).
5549
5550 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
5551
5552 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
5553 for GCC 4.7.1 x86-64.
5554
5555 2012-08-30 Glenn Morris <rgm@gnu.org>
5556
5557 * lread.c (init_lread): For out-of-tree builds, only add the
5558 source directory's site-lisp dir to the load-path if it exists,
5559 consistent with in-tree builds. (Bug#12302)
5560
5561 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
5562
5563 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
5564 button_values to NULL. Call setStykeMask so dialogs get a close button.
5565 (windowShouldClose:): Set window_closed.
5566 (dealloc): New member, free button_values.
5567 (process_dialog:): Make member function. Remove window argument,
5568 replace window with self. Count buttons and allocate and store values
5569 in button_values.
5570 (addButton:value:row:): value is int with the name tag. Call setTag
5571 with tag. Remove return self, declare return value as void.
5572 (addString:row:): Remove return self, declare return value as void.
5573 (addSplit): Remove return self, declare return value as void.
5574 (clicked:): Remove return self, declare return value as void.
5575 Set dialog_return to button_values[seltag]. Code formatting change.
5576 (initFromContents:isQuestion:): Adjust call to process_dialog.
5577 Code formatting change.
5578 (timeout_handler:): Set timer_fired to YES.
5579 (runDialogAt:): Set timer_fired to NO.
5580 Handle click on close button as quit.
5581
5582 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
5583 Add window_closed and button_values. Add void as return value for
5584 add(Button|String|Split). addButton takes int instead of Lisp_Object.
5585 Add process_dialog as new member.
5586
5587 2012-08-28 Eli Zaretskii <eliz@gnu.org>
5588
5589 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
5590 is not one of the heaps we manage. (Bug#12242)
5591
5592 2012-08-28 Glenn Morris <rgm@gnu.org>
5593
5594 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
5595
5596 2012-08-28 Martin Rudalics <rudalics@gmx.at>
5597
5598 * window.c (Fset_window_configuration): Remove handling of
5599 auto-buffer-name window parameter. Install revision of reverted
5600 fix.
5601
5602 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5603
5604 Do not allow to set major mode for a dead buffer.
5605 * buffer.c (Fset_buffer_major_mode): Signal an error
5606 if the buffer is dead.
5607 (Fother_buffer, other_buffer_safely): Remove redundant
5608 nested declaration.
5609
5610 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5611
5612 Always use set_buffer_if_live to restore original buffer at unwind.
5613 * buffer.h (record_unwind_current_buffer): New function.
5614 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
5615 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
5616 * undo.c, window.c: Adjust users.
5617 * buffer.c (set_buffer_if_live): Fix comment.
5618
5619 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5620
5621 Fix usage of set_buffer_internal.
5622 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
5623 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
5624 * coding.c (decode_coding): Omit redundant test.
5625 * fileio.c (decide_coding_unwind): Likewise.
5626 * fns.c (secure_hash): Likewise.
5627 * insdel.c (modify_region): Likewise.
5628 * keyboard.c (command_loop_1): Likewise.
5629 * print.c (PRINTFINISH): Likewise.
5630 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5631
5632 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5633
5634 * dispnew.c: Use bool for boolean.
5635 (frame_garbaged, display_completed, delayed_size_change)
5636 (fonts_changed_p, add_window_display_history)
5637 (add_frame_display_history, verify_row_hash)
5638 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5639 (row_equal_p, realloc_glyph_pool)
5640 (allocate_matrices_for_frame_redisplay)
5641 (showing_window_margins_p)
5642 (adjust_frame_glyphs_for_frame_redisplay)
5643 (build_frame_matrix_from_leaf_window, make_current)
5644 (mirrored_line_dance, mirror_line_dance, update_frame)
5645 (update_window_tree, update_single_window)
5646 (check_current_matrix_flags, update_window, update_text_area)
5647 (update_window_line, set_window_update_flags, scrolling_window)
5648 (update_frame_1, scrolling, buffer_posn_from_coords)
5649 (do_pending_window_change, change_frame_size)
5650 (change_frame_size_1, sit_for):
5651 Use bool for boolean.
5652 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
5653 and remove last int (actually boolean) argument, which was always 0.
5654 All callers changed.
5655 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
5656 * dispextern.h (struct composition_it): Use bool for boolean.
5657 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
5658 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
5659 * dired.c (file_name_completion):
5660 Use bool for boolean. (This was missed in an earlier change.)
5661
5662 2012-08-27 Martin Rudalics <rudalics@gmx.at>
5663
5664 * window.c (Fset_window_configuration): Revert first part of
5665 last change.
5666
5667 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
5668
5669 * nsterm.h (NSPanel): New class variable dialog_return.
5670
5671 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
5672 Initialize dialog_return.
5673 (windowShouldClose:): Use stop instead of stopModalWithCode.
5674 (clicked:): Ditto, and also set dialog_return (Bug#12258).
5675 (timeout_handler:): Use stop instead of abortModal. Send a dummy
5676 event.
5677 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
5678 modal loop returns.
5679
5680 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5681
5682 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
5683 * composite.c (find_composition, composition_gstring_p)
5684 (composition_reseat_it, find_automatic_composition):
5685 * data.c (let_shadows_buffer_binding_p)
5686 (let_shadows_global_binding_p, set_internal, make_blv)
5687 (Fmake_variable_buffer_local, Fmake_local_variable)
5688 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
5689 (cons_to_signed, arith_driver):
5690 * dbusbind.c (xd_in_read_queued_messages):
5691 * dired.c (directory_files_internal, file_name_completion):
5692 Use bool for booleans.
5693 * dired.c (file_name_completion):
5694 * process.h (fd_callback):
5695 Omit int (actually boolean) argument. It wasn't being used.
5696 All uses changed.
5697 * composite.h, lisp.h: Reflect above API changes.
5698
5699 * cmds.c, coding.c: Use bool for booleans.
5700 * cmds.c (move_point, Fself_insert_command):
5701 * coding.h (struct composition status, struct coding_system):
5702 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
5703 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
5704 (emacs_mule_char, decode_coding_emacs_mule)
5705 (encode_coding_emacs_mule, detect_coding_iso_2022)
5706 (decode_coding_iso_2022, encode_invocation_designation)
5707 (encode_designation_at_bol, encode_coding_iso_2022)
5708 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
5709 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
5710 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
5711 (encode_coding_raw_text, detect_coding_charset)
5712 (decode_coding_charset, encode_coding_charset, detect_eol)
5713 (detect_coding, get_translation_table, produce_chars)
5714 (consume_chars, reused_workbuf_in_use)
5715 (make_conversion_work_buffer, code_conversion_save)
5716 (decode_coding_object, encode_coding_object)
5717 (detect_coding_system, char_encodable_p)
5718 (Funencodable_char_position, code_convert_region)
5719 (code_convert_string, code_convert_string_norecord)
5720 (Fset_coding_system_priority):
5721 * fileio.c (Finsert_file_contents):
5722 Use bool for booleans.
5723 * coding.h, lisp.h: Reflect above API changes.
5724 * coding.c: Remove unnecessary static function decls.
5725 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
5726 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
5727 not a boolean 'int', since callers never look at the return value.
5728 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
5729 * coding.h (decoding_buffer_size, encoding_buffer_size)
5730 (emacs_mule_string_char): Remove unused extern decls.
5731 (struct iso_2022_spec, struct coding_system):
5732 Use 'unsigned int : 1' for boolean fields, since there's more than one.
5733 (struct emacs_mule_spec): Remove unused field 'full_support'.
5734 All initializations removed.
5735 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
5736
5737 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5738
5739 Fix spare memory change (Bug#12286).
5740 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
5741 (valid_lisp_object_p): Likewise.
5742
5743 2012-08-27 Martin Rudalics <rudalics@gmx.at>
5744
5745 * window.c (Fset_window_configuration): Record any window's old
5746 buffer if it's replaced (see Bug#8789). If the new current
5747 buffer doesn't appear in the selected window, go to its old
5748 point (Bug#12208).
5749
5750 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5751
5752 Special MEM_TYPE_SPARE to denote reserved memory.
5753 * alloc.c (enum mem_type): New memory type.
5754 (refill_memory_reserve): Use new type for spare memory.
5755 This prevents live_cons_p and live_string_p from incorrect
5756 detection of uninitialized objects from spare memory as live.
5757
5758 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 Spelling fixes.
5761 * Makefile.in (.PHONY): versioclean -> versionclean.
5762
5763 Remove unused external symbols.
5764 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
5765 * window.c (Qwindow_valid_p, decode_valid_window):
5766 Now static, not extern.
5767 * data.c (Qinterval): Remove; unused.
5768 (syms_of_data): Do not define 'interval'.
5769 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
5770 * window.h (decode_valid_window):
5771 Remove decls.
5772
5773 * character.c, charset.c, chartab.c: Use bool for booleans.
5774 * character.c (lisp_string_width, string_count_byte8)
5775 (string_escape_byte8):
5776 * charset.c (charset_map_loaded, load_charset_map, read_hex):
5777 (load_charset_map_from_file, map_charset_chars)
5778 (Fdefine_charset_internal, define_charset_internal)
5779 (Fdeclare_equiv_charset, find_charsets_in_text)
5780 (Ffind_charset_region, char_charset, Fiso_charset):
5781 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
5782 (sub_char_table_set, sub_char_table_set_range)
5783 (char_table_set_range, optimize_sub_char_table)
5784 (map_sub_char_table):
5785 Use bool for boolean.
5786 * character.c (str_to_unibyte): Omit last boolean argument; it was
5787 always 0. All callers changed.
5788 * character.h, charset.h: Adjust to match previous changes.
5789 * character.h (char_printable_p): Remove decl of nonexistent function.
5790 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5791 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5792 are all boolean, so make them single-bit bitfields.
5793
5794 * lisp.h (ASET): Remove attempt to detect side effects.
5795 It was meant to be temporary and it often doesn't work,
5796 because when IDX has side effects the behavior of IDX==IDX
5797 is undefined. See Stefan Monnier in
5798 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5799
5800 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5801
5802 * lisp.h (functionp): New function (extracted from Ffunctionp).
5803 (FUNCTIONP): Use it.
5804 * eval.c (Ffunctionp): Use it.
5805
5806 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5807
5808 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5809 as that's faster and simpler than static storage. Don't bother
5810 with the g_main_context_query overhead if g_main_context_pending
5811 says no events are pending.
5812 (gfds, gfds_size): Remove these static vars.
5813 (xgselect_initialize): Remove; no longer needed.
5814 All uses and decls removed.
5815
5816 * emacs.c (fatal_error_signal_hook): Remove.
5817 All uses removed. This leftover from old code was always 0.
5818
5819 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5820 * casefiddle.c (casify_object, casify_region):
5821 * casetab.c (set_case_table):
5822 * category.c, category.h (word_boundary_p):
5823 * category.h (CHAR_HAS_CATEGORY):
5824 Use bool for booleans, instead of int.
5825
5826 2012-08-25 Eli Zaretskii <eliz@gnu.org>
5827
5828 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5829
5830 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5831
5832 On assertion failure, print backtrace if available.
5833 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5834 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5835 * Makefile.in (LIB_EXECINFO): New macro.
5836 (LIBES): Use it.
5837
5838 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5839 * bytecode.c (exec_byte_code):
5840 * callint.c (check_mark, Fcall_interactively):
5841 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5842 (getenv_internal, sync_process_alive, call_process_exited):
5843 * lisp.h (USE_SAFE_ALLOCA):
5844 Use bool for booleans, instead of int.
5845 * lisp.h, process.h: Adjust prototypes to match above changes.
5846 * callint.c (Fcall_interactively): Don't assume the mark's
5847 offset fits in 'int'.
5848
5849 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5850
5851 * buffer.c, buffer.h: Use bool for boolean.
5852 * buffer.c (reset_buffer_local_variables)
5853 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5854 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5855 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5856 (overlay_touches_p, overlay_strings, Foverlay_put)
5857 (report_overlay_modification, call_overlay_mod_hooks):
5858 (mmap_enlarge, mmap_set_vars):
5859 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5860 Use bool for booleans, instead of int.
5861 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5862 since the 1-or-0 return value is always ignored anyway.
5863 (mmap_initialized_p):
5864 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5865 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5866
5867 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5868
5869 * bidi.c: Use bool for boolean.
5870 This is a bit more readable, and makes the text segment of bidi.o
5871 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5872 Presumably it's faster too.
5873 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5874 Now bool.
5875 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5876 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5877 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5878 (bidi_explicit_dir_char, bidi_level_of_next_char)
5879 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5880 Use bool for booleans, instead of int.
5881 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5882 (bidi_unshelve_cache): Adjust decls to match code.
5883
5884 2012-08-23 Martin Rudalics <rudalics@gmx.at>
5885
5886 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5887 argument.
5888
5889 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5890
5891 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5892 * atimer.h: Include <stdbool.h>.
5893
5894 2012-08-22 Dan Nicolaescu <dann@gnu.org>
5895
5896 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5897 compile time tests instead of run time tests on systems that do
5898 not use them.
5899 (FRAME_MAC_P): Remove leftover from deleted code.
5900 * frame.c (syms_of_frame): Remove leftover from deleted code.
5901
5902 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5903
5904 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5905
5906 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5907
5908 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5909 Otherwise, the compiler complains about (A?B:C) where B is void
5910 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
5911 (fontset_add): Return void, for FONTSET_ADD.
5912
5913 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * alloc.c: Use bool for booleans.
5916 (gc_in_progress, abort_on_gc)
5917 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5918 (dont_register_blocks) [GC_MALLOC_CHECK]:
5919 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5920 (check_string_bytes, make_specified_string, memory_full)
5921 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5922 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5923 (mark_stack, valid_pointer_p, make_pure_string)
5924 (Fgarbage_collect, survives_gc_p, gc_sweep):
5925 Use bool for booleans, instead of int.
5926 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5927 Remove unused local.
5928 * alloc.c (PURE_POINTER_P):
5929 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5930 * editfns.c (Fformat):
5931 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5932 (Fdo_auto_save):
5933 * fns.c (sweep_weak_table):
5934 * lisp.h (suppress_checking, push_message, survives_gc_p)
5935 (make_pure_string, gc_in_progress, abort_on_gc):
5936 * lread.c (readchar, read1):
5937 * print.c (Fprin1_to_string):
5938 * xdisp.c (push_message):
5939 Use bool for booleans affected directly or indirectly by
5940 alloc.c's changes.
5941
5942 Make recently-introduced setters macros.
5943 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5944 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5945 (set_fontset_default, set_fontset_fallback): Rename from their
5946 upper-case counterparts, and make them functions rather than macros.
5947 This is more consistent with the other recently-introduced setters.
5948 These don't need to be inline, since they're local.
5949
5950 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5951
5952 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5953 the loop (Bug#12247).
5954
5955 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5956
5957 * lisp.h (vcopy): Use memcpy rather than our own loop.
5958 This fixes a performance regression introduced by the recent
5959 addition of vcopy. This means 'vcopy' will need to be modified
5960 for a copying collector, but that's OK. Also, tighten the
5961 checking in the assertion.
5962
5963 2012-08-21 Eli Zaretskii <eliz@gnu.org>
5964
5965 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5966 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5967 non-base glyph for the width of the base character, according to
5968 what x_draw_composite_glyph_string_foreground expects.
5969 Generate WADJUST value according to composition_gstring_width's
5970 expectations, to produce correct width of the composed character.
5971 Reverse the sign of the DU offset produced by ScriptPlace.
5972
5973 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5974
5975 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5976
5977 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5978
5979 Avoid direct writes to contents member of struct Lisp_Vector.
5980 * lisp.h (vcopy): New function to copy data into vector.
5981 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5982 * fns.c (Ffillarray): Use ASET.
5983 * keyboard.c (timer_check_2): Use AREF and ASET.
5984 (append_tool_bar_item, Frecent_keys): Use vcopy.
5985 * lread.c (read_vector): Use ASET.
5986 * msdos.c (Frecent_doskeys): Use vcopy.
5987 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5988 (Finternal_merge_in_global_face): Use ASET and vcopy.
5989 * xfont.c (xfont_list_pattern): Likewise.
5990
5991 2012-08-21 Martin Rudalics <rudalics@gmx.at>
5992
5993 * window.c (Fwindow_point): For the selected window always return
5994 the position of its buffer's point.
5995 (Fset_window_point): For the selected window always go in its
5996 buffer to the specified position.
5997
5998 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5999
6000 Setter macros for fontsets.
6001 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6002 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6003 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6004 Adjust users.
6005
6006 2012-08-20 Glenn Morris <rgm@gnu.org>
6007
6008 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6009 Don't assume that `ln -f' works.
6010
6011 2012-08-20 Eli Zaretskii <eliz@gnu.org>
6012
6013 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6014 and later about non-assignments with no effect. See discussion at
6015 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6016 details.
6017
6018 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6019
6020 Inline setter functions for Lisp_Objects slots of struct specbinding.
6021 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6022 Adjust users.
6023
6024 2012-08-20 Martin Rudalics <rudalics@gmx.at>
6025
6026 * window.c (select_window): Always make selected window's buffer
6027 current.
6028
6029 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6030
6031 Use AREF and ASET for docstrings of category tables.
6032 * category.h (CATEGORY_DOCSTRING): Use AREF.
6033 (SET_CATEGORY_DOCSTRING): Use ASET.
6034 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6035
6036 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6037
6038 Inline setter functions for hash table members.
6039 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6040 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6041 (set_hash_key_and_value, set_hash_index, set_hash_next)
6042 (set_hash_hash): New functions.
6043 * charset.c, fns.c: Adjust users.
6044
6045 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6046
6047 Inline getter and setter functions for per-buffer values.
6048 * buffer.h (per_buffer_default, set_per_buffer_default)
6049 (per_buffer_value, set_per_buffer_value): New functions.
6050 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6051 * buffer.c, data.c: Adjust users.
6052
6053 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
6054
6055 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6056
6057 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6058
6059 Rely on <config.h> + <unistd.h> to declare 'environ',
6060 as gnulib does this if the system doesn't.
6061 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
6062 Remove declaration. MS-Windows declares it on stdlib.h which is
6063 included by conf_post.h.
6064 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6065 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6066 * vm-limit.c: Include <unistd.h>, for 'environ'.
6067
6068 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6069 (start_of_data): Remove decl; mem-limits.h provides it.
6070
6071 * xdisp.c (handle_invisible_prop): Make it a bit faster
6072 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6073
6074 2012-08-19 Chong Yidong <cyd@gnu.org>
6075
6076 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6077 ends (Bug#3874).
6078
6079 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6080
6081 * .gdbinit: Use call instead of set when calling a function in the
6082 inferior.
6083
6084 * data.c (set_internal): Don't use set_blv_found.
6085 (Fkill_local_variable): Likewise.
6086
6087 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6088
6089 * nsfont.m (ns_ascii_average_width): Ensure the string
6090 ascii_printable is initialized with a null-terminated character
6091 array. Otherwise, it can contain undesired extra characters.
6092
6093 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 port new setting code to Sun C 5.8 2005/10/13
6096 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6097 Return void, not Lisp_Object. Otherwise, the compiler
6098 complains about (A?B:C) where B is void and C is Lisp_Object
6099 when compiling CHAR_TABLE_SET, due to the recent change to
6100 the API of sub_char_table_set_contents.
6101
6102 2012-08-18 Chong Yidong <cyd@gnu.org>
6103
6104 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6105 for the string case (Bug#3874).
6106
6107 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6108
6109 * buffer.h (BSET): Remove (Bug#12215).
6110 Replace all uses with calls to new setter functions.
6111 (bset_bidi_paragraph_direction, bset_case_canon_table)
6112 (bset_case_eqv_table, bset_directory, bset_display_count)
6113 (bset_display_time, bset_downcase_table)
6114 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6115 (bset_last_selected_window, bset_local_var_alist)
6116 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6117 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6118 (bset_width_table):
6119 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6120 (bset_auto_fill_function, bset_auto_save_file_format)
6121 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6122 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6123 (bset_cache_long_line_scans, bset_case_fold_search)
6124 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6125 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6126 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6127 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6128 (bset_header_line_format, bset_indicate_buffer_boundaries)
6129 (bset_indicate_empty_lines, bset_invisibility_spec)
6130 (bset_left_fringe_width, bset_major_mode, bset_mark)
6131 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6132 (bset_name, bset_overwrite_mode, bset_pt_marker)
6133 (bset_right_fringe_width, bset_save_length)
6134 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6135 (bset_scroll_up_aggressively, bset_selective_display)
6136 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6137 (bset_word_wrap, bset_zv_marker):
6138 * category.c (bset_category_table):
6139 * syntax.c (bset_syntax_table):
6140 New setter functions.
6141
6142 * process.h (PSET): Remove (Bug#12215).
6143 Replace all uses with calls to new setter functions.
6144 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6145 (PROCESS_INLINE): New macro.
6146 (pset_childp): New setter function.
6147 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6148 * process.c (PROCESS_INLINE):
6149 Define to EXTERN_INLINE, so that the corresponding functions
6150 are compiled into code.
6151 (pset_buffer, pset_command, pset_decode_coding_system)
6152 (pset_decoding_buf, pset_encode_coding_system)
6153 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6154 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6155 (pset_type, pset_write_queue): New setter functions.
6156
6157 * window.h (WSET): Remove (Bug#12215).
6158 Replace all uses with calls to new setter functions.
6159 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6160 (WINDOW_INLINE): New macro.
6161 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6162 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6163 (wset_total_lines, wset_vertical_scroll_bar)
6164 (wset_window_end_pos, wset_window_end_valid)
6165 (wset_window_end_vpos): New setter functions.
6166 * window.c (WINDOW_INLINE):
6167 Define to EXTERN_INLINE, so that the corresponding functions
6168 are compiled into code.
6169 (wset_combination_limit, wset_dedicated, wset_display_table)
6170 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6171 (wset_new_normal, wset_new_total, wset_next_buffers)
6172 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6173 (wset_prev_buffers, wset_right_fringe_width)
6174 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6175 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6176 (wset_window_parameters):
6177 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6178 (wset_column_number_displayed, wset_region_showing):
6179 New setter functions.
6180
6181 * termhooks.h (TSET): Remove (Bug#12215).
6182 Replace all uses with calls to new setter functions.
6183 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6184 (TERMHOOKS_INLINE): New macro.
6185 (tset_charset_list, tset_selection_alist): New setter functions.
6186 * terminal.c (TERMHOOKS_INLINE):
6187 Define to EXTERN_INLINE, so that the corresponding functions
6188 are compiled into code.
6189 (tset_param_alist): New setter function.
6190
6191 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 * keyboard.h (KSET): Remove (Bug#12215).
6194 Replace all uses with calls to new setter functions.
6195 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6196 (KEYBOARD_INLINE): New macro.
6197 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6198 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6199 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6200 New setter functions.
6201 * keyboard.c (KEYBOARD_INLINE):
6202 Define to EXTERN_INLINE, so that the corresponding functions
6203 are compiled into code.
6204 (kset_echo_string, kset_kbd_queue)
6205 (kset_keyboard_translate_table, kset_last_prefix_arg)
6206 (kset_last_repeatable_command, kset_local_function_key_map)
6207 (kset_overriding_terminal_local_map, kset_real_last_command)
6208 (kset_system_key_syms): New setter functions.
6209
6210 * frame.h (FSET): Remove (Bug#12215).
6211 Replace all uses with calls to new setter functions.
6212 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6213 (FRAME_INLINE): New macro.
6214 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6215 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6216 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6217 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6218 (fset_param_alist, fset_root_window, fset_scroll_bars)
6219 (fset_selected_window, fset_title, fset_tool_bar_items)
6220 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6221 * frame.c (FRAME_INLINE):
6222 Define to EXTERN_INLINE, so that the corresponding functions
6223 are compiled into code.
6224 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6225
6226 A few more naming-convention fixes for getters and setters.
6227 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6228 and rename from buffer_overlays_set_before.
6229 (set_buffer_overlays_after): Move here from buffer.h, and rename
6230 from buffer_overlays_set_after.
6231 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6232 All uses changed.
6233 (set_buffer_intervals): Rename from buffer_set_intervals.
6234 * intervals.c (set_interval_object): Move here from intervals.h,
6235 and rename from interval_set_object.
6236 (set_interval_left): Move here from intervals.h, and rename from
6237 interval_set_left.
6238 (set_interval_right): Move here from intervals.h, and rename from
6239 interval_set_right.
6240 (copy_interval_parent): Move here from intervals.h, and rename from
6241 interval_copy_parent.
6242 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6243 (set_interval_plist): Rename from interval_set_plist.
6244 Return void, not Lisp_Object, since no caller uses the result.
6245 * lisp.h (string_intervals): Rename from string_get_intervals.
6246 (set_string_intervals): Rename from string_set_intervals.
6247
6248 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
6249 (set_char_table_contents): Rename from char_table_set_contents.
6250 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
6251 All uses changed. See the end of
6252 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
6253
6254 * lisp.h (CSET): Remove (Bug#12215).
6255 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
6256 (set_char_table_purpose): New functions,
6257 replacing CSET. All uses changed. For example, replace
6258 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
6259 "set_char_table_parent (char_table, parent);".
6260 The old version was confusing because it used the same name
6261 'parent' for two different things.
6262
6263 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6264
6265 Functions to get and set Lisp_Object fields of buffer-local variables.
6266 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
6267 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
6268 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6269 * data.c, eval.c, frame.c: Adjust users.
6270
6271 2012-08-17 Chong Yidong <cyd@gnu.org>
6272
6273 * xfaces.c (merge_face_vectors): If the target font specfies a
6274 font spec, make the font's attributes take precedence over
6275 directly-specified attributes.
6276 (merge_face_ref): Recognize :font.
6277
6278 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6279
6280 Do not use memcpy for copying intervals.
6281 * intervals.c (reproduce_interval): New function.
6282 (reproduce_tree, reproduce_tree_obj): Use it.
6283 (reproduce_tree_obj): Remove prototype.
6284
6285 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6286
6287 * lisp.h (duration_to_sec_usec): Remove unused decl.
6288
6289 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6290
6291 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6292 to an allocated instance of NSString, not to the class itself.
6293
6294 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
6295
6296 * makefile.w32-in (C_CTYPE_H): New macro.
6297 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6298 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
6299 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6300
6301 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
6302
6303 Use ASCII tests for character types.
6304 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
6305 * xfns.c, xterm.c:
6306 Don't include <ctype.h>; was not needed.
6307 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
6308 * sysdep.c, xfaces.c:
6309 Include <c-ctype.h> instead of <ctype.h>.
6310 * nsterm.m: Include <c-ctype.h>.
6311 * charset.c (read_hex):
6312 * doc.c (Fsnarf_documentation):
6313 * fileio.c (IS_DRIVE) [WINDOWSNT]:
6314 (DRIVE_LETTER) [DOS_NT]:
6315 (Ffile_name_directory, Fexpand_file_name)
6316 (Fsubstitute_in_file_name):
6317 * font.c (font_parse_xlfd, font_parse_fcname):
6318 * frame.c (x_set_font_backend):
6319 * gtkutil.c (xg_get_font):
6320 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
6321 * nsimage.m (hexchar):
6322 * nsterm.m (ns_xlfd_to_fontname):
6323 * sysdep.c (system_process_attributes):
6324 * xfaces.c (hash_string_case_insensitive):
6325 Use C-locale tests instead of locale-specific tests for character
6326 types, since we want the ASCII interpretation here, not the
6327 interpretation suitable for whatever happens to be the current locale.
6328
6329 2012-08-16 Martin Rudalics <rudalics@gmx.at>
6330
6331 Consistently check windows for validity/liveness
6332 (Bug#11984, Bug#12025, Bug#12026).
6333 * lisp.h (CHECK_VALID_WINDOW): New macro.
6334 * window.c (decode_window): Rename to decode_live_window.
6335 (decode_valid_window, Fwindow_valid_p): New functions.
6336 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
6337 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
6338 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
6339 (Fwindow_prev_sibling, Fwindow_combination_limit)
6340 (Fset_window_combination_limit, Fwindow_use_time)
6341 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
6342 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
6343 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
6344 (Fwindow_hscroll, Fset_window_hscroll)
6345 (Fwindow_redisplay_end_trigger)
6346 (Fset_window_redisplay_end_trigger, Fwindow_edges)
6347 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
6348 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
6349 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
6350 (Fwindow_end, Fset_window_point, Fset_window_start)
6351 (Fpos_visible_in_window_p, Fwindow_line_height)
6352 (Fwindow_dedicated_p, Fset_window_dedicated_p)
6353 (Fwindow_prev_buffers, Fset_window_prev_buffers)
6354 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
6355 (Fset_window_parameter, Fwindow_display_table)
6356 (Fset_window_display_table, Fdelete_other_windows_internal)
6357 (Fset_window_buffer, Fset_window_new_total)
6358 (Fset_window_new_normal, Fdelete_window_internal)
6359 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
6360 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
6361 (Fwindow_scroll_bars): Check whether argument window is a valid or
6362 live window. Update doc-strings.
6363 (syms_of_window): New symbol Qwindow_valid_p.
6364 * keyboard.c (Fposn_at_x_y): Check whether argument
6365 frame_or_window denotes a valid window.
6366
6367 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6368
6369 Fix previous char table change.
6370 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
6371 * chartab.c (optimize_sub_char_table): Likewise.
6372
6373 2012-08-16 Chong Yidong <cyd@gnu.org>
6374
6375 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
6376
6377 * xfont.c (xfont_open):
6378 * xftfont.c (xftfont_open): Set the font's max_width field.
6379
6380 * nsfont.m (nsfont_open): Similar to the Xft backend, set
6381 min_width to space_width and average_width to the average over
6382 printable ASCII characters.
6383 (ns_char_width): Code cleanup.
6384 (ns_ascii_average_width): New utility function.
6385
6386 * font.h (struct font): Update comments.
6387
6388 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
6389
6390 Simple interface to set Lisp_Object fields of character tables.
6391 * lisp.h (CSET): New macro.
6392 (char_table_set_extras, char_table_set_contents)
6393 (sub_char_table_set_contents): New function.
6394 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
6395 * syntax.c: Adjust users.
6396
6397 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
6398
6399 * eval.c (eval_sub): Bind lexical-binding.
6400 * lread.c (Qlexical_binding): Make non-static.
6401
6402 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
6403
6404 * nsmenu.m (popupSession): Remove.
6405 (pop_down_menu): Remove endModalSession.
6406 (timeout_handler:): New method.
6407 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
6408 Call runModalForWindow. Check timer_fired when it returns.
6409 If not set, cancel timer and break out of loop.
6410 Otherwise loop again, with a new timeout.
6411
6412 * nsterm.m: Include fcntl.h if present.
6413 (fd_entry, t_readfds, inNsSelect): Remove.
6414 (select_writefds, select_valid, select_timeout, selfds)
6415 (select_mutex, apploopnr): Add.
6416 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
6417 Otherwise call kbd_buffer_store_event.
6418 (ns_send_appdefined): Remove release of fd_entry.
6419 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
6420 Increment and decrement apploopnr.
6421 (ns_select): If no file descriptors, just do a NSTimer.
6422 Otherwise copy read/write masks and start select thread (fd_handler).
6423 Start main loop and wait for application defined event.
6424 Inform select thread to stop selecting after main loop is exited.
6425 (ns_term_init): Create selfds pipe and set non-blocking.
6426 Initialize select_mutex. Start the select thread (fd_handler).
6427 (fd_handler:): Loop forever, wait for info from the main thread
6428 to either start or stop selecting. When select returns, send
6429 and appdefined event.
6430 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
6431 If not call kbd_buffer_store_event.
6432
6433 * nsterm.h (EmacsApp): fd_handler takes id argument.
6434 (EmacsDialogPanel): Add timer_fired and timeout_handler.
6435
6436 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
6437
6438 2012-08-15 Eli Zaretskii <eliz@gnu.org>
6439
6440 * region-cache.c (move_cache_gap): Update gap_len using the actual
6441 growth of the boundaries array. Do not change cache_len.
6442 (Bug#12196)
6443
6444 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6445
6446 Generalize and cleanup font subsystem checks.
6447 * font.h (FONT_DEBUG, font_assert): Remove.
6448 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
6449 Change font_assert to eassert. Use eassert where appropriate.
6450
6451 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
6452
6453 * gtkutil.c (xg_get_font): Use pango_units_to_double.
6454
6455 2012-08-15 Chong Yidong <cyd@gnu.org>
6456
6457 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
6458 When using the new font chooser, use gtk_font_chooser_get_font_desc to
6459 extract the font descriptor instead of just the font name.
6460 In that case, return a font spec instead of a string.
6461 (x_last_font_name): Move to this file from xfns.c.
6462
6463 * xfns.c (Fx_select_font): The return value can also be a font
6464 spec. Move x_last_font_name management to gtkutil.c.
6465
6466 * xfaces.c: Make font weight and style symbols non-static.
6467
6468 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
6469
6470 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
6471 (bug#12117).
6472
6473 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
6474
6475 * alloc.c (Fgarbage_collect): Use plural form consistently.
6476
6477 2012-08-14 Eli Zaretskii <eliz@gnu.org>
6478
6479 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
6480 iteration through the command loop. Fixes a problem whereby mouse
6481 movements are ignored until the first mouse click.
6482
6483 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6484
6485 Use bool, not int, for Lisp booleans.
6486 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
6487 makes Emacs a bit smaller and presumably a bit faster.
6488 * lisp.h: Include <stdbool.h>.
6489 (struct Lisp_Boolfwd, defvar_bool):
6490 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
6491 * regex.c [!emacs]: Include <stdbool.h>.
6492 (false, true): Remove; <stdbool.h> does this for us now.
6493
6494 2012-08-14 Chong Yidong <cyd@gnu.org>
6495
6496 * character.c (Fcharacterp): Doc fix (Bug#12076).
6497
6498 * data.c (Findirect_variable): Doc fix (Bug#11040).
6499
6500 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
6501
6502 * editfns.c (Fformat): Doc fix (Bug#12059).
6503 (Fsave_current_buffer): Doc fix (Bug#11542).
6504
6505 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6506
6507 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
6508 (bug#12022).
6509
6510 2012-08-14 Martin Rudalics <rudalics@gmx.at>
6511
6512 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
6513 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
6514 * minibuf.c (choose_minibuf_frame, read_minibuf):
6515 * w32fns.c (x_create_tip_frame):
6516 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
6517 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
6518
6519 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6520
6521 * intervals.c (offset_intervals): Remove obsolete comment.
6522
6523 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
6524
6525 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
6526
6527 2012-08-14 Gergely Risko <gergely@risko.hu>
6528
6529 * coding.c (decode_coding): Record buffer modification before
6530 disabling undo_list (Bug#11773).
6531
6532 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6533
6534 Revert and cleanup some recent overlay changes.
6535 * buffer.h (enum overlay_type): Remove.
6536 (buffer_get_overlays, buffer_set_overlays): Likewise.
6537 (buffer_set_overlays_before, buffer_set_overlays_after):
6538 New function. Adjust users.
6539 (unchain_both): Add eassert.
6540
6541 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
6542
6543 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
6544
6545 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
6546
6547 * gtkutil.c (xg_mark_data): Don't assume C99.
6548
6549 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
6550
6551 * gtkutil.c (xg_frame_tb_info): New struct.
6552 (TB_INFO_KEY): New define.
6553 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
6554 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
6555 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
6556 if not present.
6557 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
6558 is up to date. Otherwise store new data.
6559 (free_frame_tool_bar): Free xg_frame_tb_info if present.
6560
6561 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6562
6563 Use KSET for write access to Lisp_Object members of struct kboard.
6564 * keyboard.h (KSET): New macro.
6565 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
6566 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
6567 * xterm.c: Adjust users.
6568
6569 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
6570
6571 Use BSET for write access to Lisp_Object members of struct buffer.
6572 * buffer.h (BSET): New macro.
6573 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
6574 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
6575 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
6576 * window.c, xdisp.c, xfns.c: Adjust users.
6577
6578 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
6579
6580 * lread.c (syms_of_lread): Initialize Vlexical_binding.
6581
6582 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
6583
6584 * nsterm.m (not_in_argv): New function.
6585 (application:openFile, application:openTempFile:):
6586 (application:openFileWithoutUI:, application:openFiles:): Open file
6587 if not_in_argv returns non-zero (bug#12171).
6588
6589 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
6590 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
6591 Define for Gtk+ versions less than 3.2.
6592 (xg_get_font_name): Use those functions/macros here.
6593 Reported by Frans Oilinki <moilinki@gmail.com>.
6594
6595 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6596
6597 * unexmacosx.c (copy_data_segment): Copy initialized data in
6598 statically linked libraries from input file rather than memory.
6599
6600 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
6601 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
6602 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
6603
6604 2012-08-10 Glenn Morris <rgm@gnu.org>
6605
6606 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
6607 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
6608
6609 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6610
6611 Fix last change to allow compilation with low optimization levels.
6612 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
6613 Reported by Jan Djärv <jan.h.d@swipnet.se>.
6614
6615 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6616
6617 Use common inline syntax in intervals.h.
6618 * intervals.h (INTERVALS_INLINE): New macro.
6619 Change all users from LISP_INLINE.
6620
6621 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6622
6623 Define Qnone once for all platforms.
6624 * frame.c (Qnone): Define here.
6625 (syms_of_frame): DEFSYM it.
6626 * lisp.h (Qnone): New declaration.
6627 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
6628 * xfns.c: Remove duplication. Adjust users.
6629
6630 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6631
6632 Remove unused macros from intervals.h.
6633 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6634 * intervals.c: Adjust comment.
6635
6636 2012-08-10 Eli Zaretskii <eliz@gnu.org>
6637
6638 * w32fns.c <w32_unicode_gui>: New static variable.
6639 (globals_of_w32fns): Initialize it according to os_subtype.
6640 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6641 testing os_subtype.
6642
6643 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
6644 Eli Zaretskii <eliz@gnu.org>
6645
6646 Fix bug #10299 with Unicode characters sent by customized
6647 keyboards created by MSKLC.
6648 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6649 (w32_init_class): Use it to initialize the Emacs class with either
6650 ANSI or Unicode API calls.
6651 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
6652 later.
6653 (w32_wnd_proc): If the character code sent by WM_CHAR or
6654 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
6655 original message. Call DefWindowProcW on NT and later.
6656
6657 2012-08-10 Glenn Morris <rgm@gnu.org>
6658
6659 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
6660
6661 * lisp.h (DIRECTORY_SEP): Let configure set it.
6662
6663 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
6664
6665 Use TSET for write access to Lisp_Object slots of struct terminal.
6666 * termhooks.h (TSET): New macro.
6667 * coding.c, terminal.c, xselect.c: Adjust users.
6668
6669 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
6670
6671 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
6672 the failing expression, include them in the error message.
6673 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
6674 * lisp.h (internal_condition_case_n): Update declaration.
6675
6676 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6677
6678 Inline functions to examine and change buffer overlays.
6679 * buffer.c (unchain_both): New function.
6680 * buffer.h (buffer_get_overlays, buffer_set_overlays):
6681 (buffer_has_overlays): New function.
6682 (enum overlay_type): New enum.
6683 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
6684 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
6685
6686 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6687
6688 Inline functions to examine and change buffer intervals.
6689 * alloc.c (mark_interval_tree): Remove.
6690 (MARK_INTERVAL_TREE): Simplify.
6691 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
6692 * intervals.c (buffer_balance_intervals): New function.
6693 (graft_intervals_into_buffer): Adjust indentation.
6694 (set_intervals_multibyte): Simplify.
6695 * buffer.h (BUF_INTERVALS): Remove.
6696 (buffer_get_intervals, buffer_set_intervals): New function.
6697 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
6698 * intervals.c, textprop.c: Adjust users.
6699
6700 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6701
6702 Inline functions to examine and change string intervals.
6703 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
6704 (string_get_intervals, string_set_intervals): New function.
6705 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6706 * lread.c, print.c, textprop.c: Adjust users.
6707
6708 2012-08-08 Glenn Morris <rgm@gnu.org>
6709
6710 * lisp.mk (lisp): Remove language/persian.elc.
6711
6712 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6713
6714 Cleanup intervals.
6715 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
6716 (NULL_INTERVAL_P): Likewise. Adjust users.
6717 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
6718 Adjust comment. Move under #if 0.
6719 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6720 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
6721
6722 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6723
6724 Check total length of intervals with eassert.
6725 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
6726 * intervals.c: Change all users to eassert.
6727
6728 2012-08-07 Eli Zaretskii <eliz@gnu.org>
6729
6730 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
6731 Rename fields to match removal of FGET and WGET and disuse of
6732 INTERNAL_FIELD in Lisp_Cons.
6733
6734 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6735
6736 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
6737 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
6738 name since all xname users are fixed long time ago. Do not
6739 use INTERNAL_FIELD.
6740 (set_symbol_name, set_symbol_function, set_symbol_plist):
6741 (set_symbol_next, set_overlay_plist): New function.
6742 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
6743 (struct Lisp_Overlay): Likewise.
6744 (CVAR, MVAR, SVAR): Remove.
6745 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
6746 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
6747 * xterm.c: Adjust users.
6748 * .gdbinit: Change to use name field of struct Lisp_Symbol
6749 where appropriate.
6750
6751 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6752
6753 Basic functions to set Lisp_Object and pointer slots of intervals.
6754 * intervals.h (interval_set_parent, interval_set_object):
6755 (interval_set_left, interval_set_right, interval_set_plist):
6756 (interval_copy_parent): New function.
6757 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
6758 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
6759 Adjust indentation.
6760 (INTERVAL_SIZE): Remove. Adjust users.
6761 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
6762
6763 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6764
6765 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
6766 * process.h (PGET): Remove.
6767 (struct Lisp_Process): Do not use INTERNAL_FIELD.
6768 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6769
6770 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6771
6772 Drop WGET and revert read access to Lisp_Objects slots of struct window.
6773 * window.h (WGET): Remove.
6774 (struct window): Do not use INTERNAL_FIELD.
6775 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6776 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6777 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6778 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6779 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6780 Adjust users.
6781
6782 2012-08-07 Chong Yidong <cyd@gnu.org>
6783
6784 * window.c (Fwindow_edges, Fwindow_pixel_edges)
6785 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
6786 (Fdelete_window_internal): Signal an error if the window is not on
6787 a live frame (Bug#12025).
6788
6789 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6790
6791 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6792 * frame.h (FGET): Remove.
6793 (struct frame): Do not use INTERNAL_FIELD.
6794 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6795 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6796 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6797 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6798
6799 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
6800
6801 * w32.c: Silence compiler warnings.
6802 (map_w32_filename): Remove unused variable `is_fat'.
6803 (chase_symlinks): Add parentheses around expression.
6804
6805 2012-08-06 Glenn Morris <rgm@gnu.org>
6806
6807 * sysdep.c: Respect BROKEN_GETWD.
6808
6809 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6810 Let configure handle it.
6811 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6812
6813 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 Use GCALIGNMENT where appropriate.
6816 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6817 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6818 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6819
6820 2012-08-06 Eli Zaretskii <eliz@gnu.org>
6821
6822 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6823 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
6824
6825 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6826
6827 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6828 that should be sufficient for everyone.
6829
6830 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6831
6832 * keyboard.c (timer_check_2): Add break so timer_check returns next
6833 timeout.
6834
6835 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6836
6837 Fix Windows build errors introduced after converting to WGET and WSET.
6838 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6839 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6840
6841 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6842
6843 * nsterm.m (ns_frame_rehighlight): Use FSET.
6844
6845 * nsmenu.m (ns_update_menubar): Use FSET.
6846
6847 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6848
6849 Separate read and write access to Lisp_Object slots of Lisp_Process.
6850 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6851 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6852
6853 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6854
6855 Separate read and write access to Lisp_Object slots of struct window.
6856 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6857 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6858 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6859 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6860 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6861 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6862 Adjust users.
6863
6864 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6865
6866 Fix Windows build errors introduced after converting to FGET and FSET.
6867 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6868 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6869 (w32_judge_scroll_bars): Change to use FSET.
6870 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6871
6872 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6873
6874 Fix replacement typo.
6875 * window.c (replace_window): Set root_window instead of
6876 selected_window. This fixes a total window subsystem
6877 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6878
6879 2012-08-06 Glenn Morris <rgm@gnu.org>
6880
6881 * lisp.mk (lisp): Add language/persian.elc.
6882
6883 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6884
6885 Separate read and write access to Lisp_Object slots of struct frame.
6886 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6887 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6888 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6889 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6890 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6891
6892 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6893
6894 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6895
6896 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6897
6898 Generalize common compile-time constants.
6899 * lisp.h (header_size, bool_header_size, word_size): Now here.
6900 (struct Lisp_Vector): Add comment.
6901 (struct Lisp_Bool_Vector): Move up to define handy constants.
6902 (VECSIZE, PSEUDOVECSIZE): Simplify.
6903 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6904 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6905 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6906 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6907 * xfont.c, xmenu.c: Use word_size where appropriate.
6908
6909 2012-08-05 Lawrence Mitchell <wence@gmx.li>
6910
6911 * search.c (Freplace_match): Treat \? in the replacement text
6912 literally (Bug#8161).
6913
6914 2012-08-05 Chong Yidong <cyd@gnu.org>
6915
6916 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6917 * frame.c (Vdelete_frame_functions):
6918 * emacs.c (Vkill_emacs_hook): Doc fix.
6919
6920 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6921
6922 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6923 --with-x-toolkit=no builds.
6924 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6925
6926 2012-08-04 Chong Yidong <cyd@gnu.org>
6927
6928 * syntax.c (Fmodify_syntax_entry): Doc fix.
6929
6930 2012-08-04 Eli Zaretskii <eliz@gnu.org>
6931
6932 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6933 * w32.c (init_environment): Change the default values of many
6934 environment variables in dflt_envvars[] to NULL, to avoid pushing
6935 them into environment when they were not already defined.
6936 Remove the code that deletes site-lisp subdirectories from the default
6937 value of EMACSLOADPATH, as it is no longer needed.
6938 (check_windows_init_file): Now external, not static.
6939 Use Vload_path as is, without adding anything, as this function is now
6940 called when Vload_path is already set up.
6941
6942 * w32.h (check_windows_init_file): Add prototype.
6943
6944 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6945 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6946 compatibility with Posix platforms.
6947 (main): Move the call to check_windows_init_file to here from
6948 w32.c.
6949 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6950 any, in the DEFALT argument into the root of the Emacs build or
6951 installation tree, as appropriate.
6952
6953 * callproc.c (init_callproc_1): Call decode_env_path instead of
6954 doing its equivalent by hand.
6955 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6956 the code that sets Vexec_path run on MS-Windows.
6957
6958 * lread.c (init_lread): Add comments to #ifdef's.
6959
6960 * msdos.c (dos_set_window_size, IT_update_begin)
6961 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6962 instead of direct references.
6963
6964 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6965
6966 Export DEFAULT_REHASH_* to GDB.
6967 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6968 Now constants, not macros.
6969
6970 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6971
6972 Remove unnecessary casts involving pointers.
6973 These casts are no longer needed now that we assume C89 or later,
6974 since they involve casting to or from void *.
6975 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6976 (make_pure_float, make_pure_vector):
6977 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6978 * macros.c (Fstart_kbd_macro):
6979 * menu.c (find_and_return_menu_selection):
6980 * minibuf.c (read_minibuf_noninteractive):
6981 * sysdep.c (closedir):
6982 * xdisp.c (x_produce_glyphs):
6983 * xfaces.c (compare_fonts_by_sort_order):
6984 * xfns.c (x_real_positions, select_visual):
6985 * xselect.c (x_stop_queuing_selection_requests)
6986 (x_get_window_property, x_get_window_property_as_lisp_data):
6987 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6988 Remove unnecessary pointer casts.
6989 * alloc.c (record_xmalloc): New function.
6990 * lisp.h (record_xmalloc): New decl.
6991 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6992 more like a function. This is because the pointer cast is not
6993 needed. All uses changed.
6994 * print.c (print_string, print_error_message): Avoid length recalc.
6995
6996 Improve fix for macroexp crash with debugging (Bug#12118).
6997 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6998 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6999 not supposed to be invoked from the garbage collector.
7000 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7001 (gc_aset): New function, which is like ASET but can be
7002 used in the garbage collector.
7003 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7004 (set_hash_index): Use it instead of ASET.
7005
7006 2012-08-03 Eli Zaretskii <eliz@gnu.org>
7007
7008 Support symlinks on latest versions of MS-Windows.
7009 * w32.c: Include winioctl.h and aclapi.h.
7010 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7011 (revert_to_self): Forward declarations of static functions.
7012 <static BOOL g_b_init_get_security_info>:
7013 <g_b_init_create_symbolic_link>: New static flags.
7014 (globals_of_w32): Initialize them to zero.
7015 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7016 (map_w32_filename): Improve commentary. Simplify switch.
7017 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7018 headers (most versions of MinGW w32api don't).
7019 (get_security_info, create_symbolic_link)
7020 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7021 New functions.
7022 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7023 in the argument file name.
7024 (sys_access): Call unc_volume_file_attributes only if
7025 GetFileAttributes fails with network-related error codes.
7026 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7027 have the required privileges.
7028 (get_file_security_desc_by_name): Rename from
7029 get_file_security_desc.
7030 (stat_worker): New function, with most of the guts of 'stat', and
7031 with addition of handling of symlinks and support for 'lstat'.
7032 If possible, get file's attributes and security information by
7033 handle, not by name. Produce S_IFLNK bit for symlinks, when
7034 called from 'lstat'.
7035 (stat, lstat): New functions, call 'stat_worker'.
7036 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7037 symlinks when the underlying filesystem supports them.
7038
7039 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 Fix macroexp crash on Windows with debugging (Bug#12118).
7042 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7043 checking subscripts; problem introduced with the recent
7044 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7045 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7046 since it's used in non-static inline functions now.
7047
7048 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7049 Don't assume buffer size fits in 'int'. Remove unused local.
7050
7051 Use C99-style 'extern inline' if available.
7052 * buffer.h (BUFFER_INLINE):
7053 * category.h (CATEGORY_INLINE):
7054 * character.h (CHARACTER_INLINE):
7055 * charset.h (CHARSET_INLINE):
7056 * composite.h (COMPOSITE_INLINE):
7057 * dispextern.h (DISPEXTERN_INLINE):
7058 * lisp.h (LISP_INLINE):
7059 * systime.h (SYSTIME_INLINE):
7060 New macro, replacing 'static inline' in this header.
7061 * buffer.h, category.h, character.h, charset.h, composite.h:
7062 * dispextern.h, lisp.h, systime.h:
7063 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7064 * alloc.c (LISP_INLINE):
7065 * buffer.c (BUFFER_INLINE):
7066 * category.c (CATEGORY_INLINE):
7067 * character.c (CHARACTER_INLINE):
7068 * charset.c (CHARSET_INLINE):
7069 * composite.c (COMPOSITE_INLINE):
7070 * dispnew.c (DISPEXTERN_INLINE):
7071 * sysdep.c (SYSTIME_INLINE):
7072 Define to EXTERN_INLINE, so that the corresponding functions
7073 are compiled into code.
7074 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7075 (INLINE_HEADER_END): New macros.
7076 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7077 since it's used in non-static inline functions now.
7078 (VALMASK) [!USE_LSB_TAG]: Likewise.
7079
7080 2012-08-02 Glenn Morris <rgm@gnu.org>
7081
7082 * s/: Remove empty directory.
7083
7084 * s/ms-w32.h: Move to ../nt/inc.
7085 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7086 Update for new ms-w32.h location.
7087
7088 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7089
7090 Port to Solaris 8.
7091 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7092
7093 2012-08-02 Glenn Morris <rgm@gnu.org>
7094
7095 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7096 hard-coding the path separator.
7097
7098 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7101 This how ASET and AREF are supposed to work, and makes
7102 it easier to think about future improvements. See
7103 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7104 * charset.h (set_charset_attr): New function.
7105 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7106 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7107 (aref_addr): New function. All uses of &AREF(...) changed.
7108 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7109 (set_hash_index): New functions. All lvalue-style uses of
7110 HASH_KEY etc. changed.
7111 * keyboard.c (set_prop): New function. All lvalue-style uses
7112 of PROP changed.
7113
7114 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7115
7116 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7117 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
7118 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
7119 * nsfns.m (ns_set_name_as_filename): Likewise.
7120 * nsmenu.m (ns_update_menubar): Likewise.
7121 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7122
7123 2012-08-01 Eli Zaretskii <eliz@gnu.org>
7124
7125 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7126 Adapt to latest changes in field names of the corresponding Lisp
7127 objects.
7128
7129 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7130
7131 2012-08-01 Glenn Morris <rgm@gnu.org>
7132
7133 * s/msdos.h: Remove file.
7134 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7135 * Makefile.in (S_FILE): Remove.
7136 (config_h): Remove S_FILE.
7137
7138 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7139
7140 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7141 Remove; moved to nt/config.nt.
7142
7143 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7144
7145 Use INTERNAL_FIELD for conses and overlays.
7146 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7147 Remove obsolete comment.
7148 (MVAR): New macro.
7149 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7150 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7151
7152 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7153
7154 Use INTERNAL_FIELD for symbols.
7155 * lisp.h (SVAR): New macro. Adjust users.
7156 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7157 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7158
7159 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7160
7161 Use INTERNAL_FIELD for processes.
7162 * process.h (PVAR): New macro. Adjust style.
7163 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7164 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7165
7166 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7167
7168 Use INTERNAL_FIELD for windows.
7169 * window.h (WVAR): New macro.
7170 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7171 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7172 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7173 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7174 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7175 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7176
7177 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7178
7179 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7180
7181 2012-08-01 Glenn Morris <rgm@gnu.org>
7182
7183 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7184 Move to configure.ac.
7185
7186 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
7187
7188 * makefile.w32-in (CONFIG_H): Update dependencies.
7189 (CONF_POST_H): New macro.
7190
7191 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7192
7193 2012-07-31 Glenn Morris <rgm@gnu.org>
7194
7195 * Makefile.in (S_FILE): No longer set by configure.
7196
7197 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7198 is available.
7199 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7200
7201 * process.h (NULL_DEVICE):
7202 * emacs.c (SEPCHAR):
7203 * editfns.c (USER_FULL_NAME): Let configure set them.
7204
7205 * s/README, s/template.h: Remove files.
7206
7207 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7208
7209 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7210 Move to configure.ac.
7211
7212 2012-07-31 Eli Zaretskii <eliz@gnu.org>
7213
7214 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7215 resulting renaming of 'struct frame' members.
7216
7217 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7218
7219 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7220 after introduction of FVAR.
7221
7222 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7223
7224 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7225
7226 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7227 instead of compositeToPoint.
7228 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7229
7230 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
7231
7232 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7233
7234 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7235 * lisp.h (INTERNAL_FIELD): New macro.
7236 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
7237 (BVAR): Change to use INTERNAL_FIELD.
7238 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7239 (KVAR): Change to use INTERNAL_FIELD.
7240 * frame.h (FVAR): New macro.
7241 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
7242 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7243 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7244 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7245 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7246
7247 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7248
7249 Miscellaneous fixes for non-default X toolkits.
7250 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
7251 * xterm.c (x_frame_of_widget): Remove redundant prototype.
7252 Move under #ifdef USE_LUCID.
7253 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
7254 definition and usage to avoid warnings.
7255
7256 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7257
7258 * nsterm.m (openFiles): Fix previous checkin.
7259
7260 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
7261
7262 * indent.c (compute_motion): Remove unused local.
7263
7264 2012-07-31 Glenn Morris <rgm@gnu.org>
7265
7266 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
7267
7268 * conf_post.h [USG5_4]:
7269 Move remaining contents of s/usg5-4-common.h here.
7270 * s/usg5-4-common.h: Remove file.
7271
7272 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7273 * s/irix6-5.h: Remove file.
7274
7275 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7276 * s/darwin.h: Remove file.
7277
7278 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7279 * s/hpux10-20.h: Remove file, which is now empty.
7280
7281 2012-07-30 Glenn Morris <rgm@gnu.org>
7282
7283 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7284 * Makefile.in (config_h): Add conf_post.h.
7285 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7286
7287 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7288
7289 * nsterm.m (ns_do_open_file): New variable.
7290 (ns_term_init): Set ns_do_open_file to YES after run returns.
7291 (openFile, openTempFile, openFileWithoutUI, openFiles):
7292 Open files only if ns_do_open_file.
7293
7294 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7295
7296 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7297 This no-op macro hasn't been needed for many years.
7298 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
7299
7300 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
7301 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
7302 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
7303 gdb_make_enums_visible.
7304 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
7305 (DIRECTORY_SEP): Now a constant, not a macro.
7306
7307 2012-07-30 Eli Zaretskii <eliz@gnu.org>
7308
7309 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
7310 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
7311
7312 * w32term.c <w32_keyboard_codepage>: Renamed from
7313 keyboard_codepage and now external. All users changed.
7314
7315 * w32term.h: Add declaration of w32_keyboard_codepage.
7316
7317 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
7318 the codepage to translate keys to Unicode. If this argument is
7319 -1, use the value returned by GetConsoleCP. All callers changed.
7320
7321 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7322
7323 Update .PHONY listings in makefiles.
7324 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
7325 bootstrap-clean, distclean, maintainer-clean, versioclean,
7326 extraclean, frc.
7327
7328 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
7329 This is a bit clearer. Fix some commentary typos.
7330
7331 2012-07-30 Glenn Morris <rgm@gnu.org>
7332
7333 * s/netbsd.h: Let configure include signal.h if needed.
7334 Remove file, which is now empty.
7335
7336 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
7337 Let configure set them.
7338 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
7339 No more need to undefine.
7340
7341 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
7342
7343 * keymap.c (Fkey_description): Don't remove 0x80 bit from
7344 non-single-byte char when adding meta modifier. (Bug#12090)
7345
7346 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7347
7348 Convert safe_call to use variable number of arguments.
7349 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
7350 (safe_call2): Fix comment.
7351 * lisp.h (safe_call): Adjust prototype.
7352 * coding.c (encode_coding_object): Change to use safe_call2.
7353 * xfaces.c (merge_face_heights): Change to use safe_call1.
7354
7355 2012-07-30 Glenn Morris <rgm@gnu.org>
7356
7357 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
7358 does that unconditionally. Remove file, which is now empty.
7359
7360 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
7361 Remove empty files.
7362
7363 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7364
7365 Export to GDB most of lisp.h's remaining object-like macros.
7366 * lisp.h (min, max): Move earlier, because they're used earlier now.
7367 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
7368 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
7369 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
7370 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
7371 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
7372 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
7373 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
7374 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
7375 Now constants, for GDB. They need not be macros.
7376 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
7377 Now constants, for GDB, as well as macros, for static initializers.
7378 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
7379 Move to after the definition of struct Lisp_Char_Table,
7380 since the former now needs that type defined.
7381 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
7382 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
7383 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
7384 New enums, for gdb_make_enums_visible.
7385 (GLYPH_MODE_LINE_FACE): Remove; unused.
7386 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
7387 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
7388 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
7389 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
7390 enum maxargs, enum MAX_ALLOCA.
7391 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
7392 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
7393 no longer needed, now that they are done in lisp.h.
7394
7395 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
7396
7397 Cleanup string bytes checking.
7398 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
7399 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
7400 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
7401 (check_sblock, compact_small_strings): Simplify.
7402
7403 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7404
7405 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
7406 These macros are confusing and no longer need to be defined, as
7407 the enum values now suffice. All uses replaced with definiens.
7408 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
7409
7410 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
7411
7412 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
7413 ($(BLD)/w32console.$(O)): Update dependencies.
7414
7415 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7416
7417 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
7418 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
7419 time. Adjust users.
7420 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
7421
7422 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
7423
7424 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
7425 setting sitelisp (Bug#12010).
7426
7427 2012-07-29 Eli Zaretskii <eliz@gnu.org>
7428
7429 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
7430
7431 * w32heap.c (cache_system_info):
7432 * w32.c (sys_rename):
7433 * w32proc.c (find_child_console, sys_kill): All users changed.
7434
7435 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7436
7437 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
7438
7439 2012-07-29 Eli Zaretskii <eliz@gnu.org>
7440
7441 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
7442
7443 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7444
7445 Cleanup statistics calculation in Fgarbage_collect.
7446 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
7447 Fix zombies percentage calculation. Simplify elapsed time calculation.
7448
7449 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
7450
7451 Generalize marker debugging code under MARKER_DEBUG and use eassert.
7452 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
7453 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
7454 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
7455 (replace_range, replace_range_2, del_range_2): Change to eassert.
7456 * marker.c (byte_char_debug_check): Adjust style.
7457
7458 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
7459
7460 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
7461 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
7462 long-ago-commented-out code that talks about "WIN32".
7463 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
7464 All uses changed.
7465
7466 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 Use Gnulib stdalign module (Bug#9772, Bug#9960).
7469 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
7470 Simplify by using alignof.
7471 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
7472 * lisp.h: Include <stdalign.h>.
7473 (GCALIGNMENT): New macro and constant.
7474 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
7475 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
7476 (stdalign): New macro, if not already defined.
7477
7478 2012-07-28 Eli Zaretskii <eliz@gnu.org>
7479
7480 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
7481 * w32inevt.c: Include w32inevt.h.
7482 (w32_read_console_input): New inline function, calls either
7483 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
7484 w32_console_unicode_input.
7485 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
7486 (w32_kbd_patch_key, key_event): Use the codepage returned by
7487 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
7488 (key_event): use uChar.UnicodeChar only if
7489 w32_console_unicode_input is non-zero.
7490
7491 * w32console.c: Include w32heap.h.
7492 <w32_console_unicode_input>: New global variable.
7493 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
7494 family of Windows, zero otherwise.
7495
7496 * w32inevt.h: Declare w32_console_unicode_input.
7497
7498 * xdisp.c (init_iterator): Don't reference tip_frame in a build
7499 --without-x. (Bug#11742)
7500
7501 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7502
7503 Adjust GDB to reflect pvec_type changes (Bug#12036).
7504 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
7505 2012-07-04 changes to pseudovector representation.
7506 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
7507
7508 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
7509
7510 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
7511 bus address.
7512 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
7513
7514 2012-07-27 Eli Zaretskii <eliz@gnu.org>
7515
7516 * alloc.c (listn): Fix the order the arguments are consed onto the
7517 list.
7518
7519 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
7520 enumeration constants, as PURE and HEAP are too general, and clash
7521 with other headers and sources, such as gmalloc.c and the
7522 MS-Windows system headers. All users changed.
7523
7524 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7525
7526 Revert last save_excursion_save and save_excursion_restore changes.
7527 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
7528 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
7529
7530 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7531
7532 Fix recently-introduced typos in Windows port.
7533 Reported by Martin Rudalics <rudalics@gmx.at>.
7534 * w32.c (init_environment): Replace comma with semicolon.
7535 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
7536
7537 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
7538
7539 Improve GDB symbol export (Bug#12036).
7540 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
7541 arms of an 'if', not using conditional expressions; otherwise GDB
7542 complains about the types in the unevaluated arm when the argument
7543 is an integer literal.
7544 (xgetint): Simplify expression.
7545 * alloc.c (gdb_make_enums_visible): New constant. This ports to
7546 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
7547 Zaretskii in <http://bugs.gnu.org/12036#13>.
7548 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
7549 needed now that we have gdb_make_enums_visible.
7550 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
7551 (enum enum_USE_LSB_TAG):
7552 New enum types, packaging up enums that need to be exported to GDB.
7553
7554 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7555
7556 Utility function to make a list from specified amount of objects.
7557 * lisp.h (enum constype): New datatype.
7558 (listn): New prototype.
7559 * alloc.c (listn): New function.
7560 (Fmemory_use_count, syms_of_alloc): Use it.
7561 * buffer.c (syms_of_buffer): Likewise.
7562 * callint.c (syms_of_callint): Likewise.
7563 * charset.c (define_charset_internal): Likewise.
7564 * coding.c (syms_of_coding): Likewise.
7565 * keymap.c (syms_of_keymap): Likewise.
7566 * search.c (syms_of_search): Likewise.
7567 * syntax.c (syms_of_syntax): Likewise.
7568 * w32.c (init_environment): Likewise.
7569 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
7570 * xdisp.c (syms_of_xdisp): Likewise.
7571 * xfns.c (syms_of_xfns): Likewise.
7572
7573 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
7574
7575 Fast save_excursion_save and save_excursion_restore.
7576 * lisp.h (struct Lisp_Excursion): New data type.
7577 (PVEC_EXCURSION): New pseudovector type.
7578 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
7579 to deal with it. Adjust comments.
7580 (init_marker, attach_marker): New prototype.
7581 (unchain_marker): Adjust prototype.
7582 * marker.c (attach_marker): Change to global.
7583 (init_marker): New function.
7584 * alloc.c (Fmake_marker, build_marker): Use it.
7585 (build_marker): More easserts.
7586 (mark_object): Handle struct Lisp_Excursion.
7587 * editfns.c (save_excursion_save, save_excursion_restore):
7588 Reimplement to use struct Lisp_Excursion. Add comments.
7589
7590 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7591
7592 Fix export of symbols to GDB (Bug#12036).
7593 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
7594 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
7595 emacs.c, as this is a more-suitable home. Had this been done earlier
7596 the fix for 12036 would have avoided some of the problems noted in
7597 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
7598 would have been more obvious.
7599 * emacs.c: Do not include <verify.h>; no longer needed.
7600 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
7601 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
7602 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7603 Remove; now done in lisp.h.
7604 * lisp.h (PUBLISH_TO_GDB): New macro.
7605 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
7606 (DATA_SEG_BITS): Use it.
7607 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
7608 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
7609 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
7610 not be usable in #if. This simplifies things.
7611
7612 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
7613
7614 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
7615
7616 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7617
7618 Simplify export of symbols to GDB (Bug#12036).
7619 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
7620 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
7621 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
7622 Adjust to changes in lisp.h and emacs.c, by using
7623 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
7624 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
7625 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
7626 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
7627 instead of gdb_valbits.
7628 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7629 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7630 instead of gdb_array_mark_flag.
7631 (xboolvector): Get size from $->size, not $->header.size.
7632 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7633 (xreload, hook-run, hookpost-run): Remove.
7634 * emacs.c: Include <verify.h>.
7635 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7636 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7637 Remove.
7638 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7639 (gdb_USE_LSB_TAG): New enum constants.
7640 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7641 Also define these as enum constants, so they're visible to GDB.
7642 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7643 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7644 as constants, so they're visible to GDB.
7645 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7646 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7647 Now enum constants, not macros, so they're visible to GDB.
7648 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7649 more convenient now. All uses changed.
7650 (VALMASK) [USE_LSB_TAG]: Also define in this case.
7651 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
7652
7653 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
7654
7655 Explicitly free restriction data that are not needed anymore.
7656 * editfns.c (save_restriction_restore): Free restriction data.
7657
7658 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
7659
7660 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
7661 add argument, tune behavior, and adjust all callers.
7662
7663 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
7664
7665 Use typedef for EMACS_INT, EMACS_UINT.
7666 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
7667 than macros. This simplifies debugging in the usual case, since
7668 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7669 and it allows expressions involving EMACS_INT casts.
7670 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
7671
7672 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
7673
7674 * nsterm.m (ns_read_socket): Return early if there is a modal
7675 window (Bug#12043).
7676
7677 2012-07-25 Martin Rudalics <rudalics@gmx.at>
7678
7679 * frame.c (Fredirect_frame_focus): In doc-string don't mention
7680 that FOCUS-FRAME can be omitted.
7681
7682 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
7683
7684 Adjust buffer text indirection counters at the end of Fkill_buffer.
7685 * buffer.c (Fkill_buffer): Adjust indirection counters when the
7686 buffer is definitely dead. This should really fix an issue reported
7687 by Christoph Scholtes again. (Bug#12007).
7688 (init_buffer_once): Initialize indirection counters of
7689 buffer_defaults and buffer_local_symbols (for sanity and safety).
7690
7691 2012-07-24 Eli Zaretskii <eliz@gnu.org>
7692
7693 * xdisp.c (init_iterator): Don't compute dimensions of truncation
7694 and continuation glyphs on tooltip frames, leave them at zero.
7695 Avoids continued lines in tooltips. (Bug#11832)
7696
7697 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
7698
7699 Simplify copy_overlay.
7700 * buffer.c (copy_overlay): Simplify. Use build_marker.
7701 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
7702
7703 2012-07-23 Eli Zaretskii <eliz@gnu.org>
7704
7705 * print.c (print_object): Don't crash when a frame's name is nil
7706 or invalid. (Bug#12025)
7707
7708 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7709 it signals an error when a tooltip frame is being created.
7710
7711 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7712
7713 Cleanup miscellaneous objects allocation and initialization.
7714 * alloc.c (allocate_misc): Change to static. Add argument to
7715 specify the subtype. Adjust comment and users.
7716 (build_overlay): New function.
7717 * buffer.c (copy_overlays, Fmake_overlay): Use it.
7718 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
7719 (allocate_misc): Remove prototype.
7720 (build_overlay): Add prototype.
7721
7722 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7723
7724 Swap buffer text indirection counters in Fbuffer_swap_text.
7725 * buffer.c (Fbuffer_swap_text): Swap indirections too.
7726 This avoids crash reported by Christoph Scholtes at
7727 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7728
7729 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
7730
7731 * nsmenu.m (Popdown_data): New struct.
7732 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
7733 free Popdown_data.
7734 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
7735 (initWithContentRect): Make imgView and contentView non-static
7736 and autorelease them. Also autorelease img and matrix (Bug#12005).
7737 (dealloc): Remove (Bug#12005).
7738
7739 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7740
7741 Adjust consing_since_gc when objects are explicitly freed.
7742 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
7743 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
7744 (free_cons, free_misc): Subtract object size from consing_since_gc.
7745
7746 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7747
7748 Simplify and cleanup markers positioning code.
7749 * marker.c (attach_marker): More useful eassert.
7750 (live_buffer, set_marker_internal): New function.
7751 (Fset_marker, set_marker_restricted): Use set_marker_internal.
7752 (set_marker_both, set_marker_restricted_both): Use live_buffer.
7753
7754 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
7755
7756 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
7757 as it's limited by the amount of memory, not by INT_MAX.
7758
7759 2012-07-21 Eli Zaretskii <eliz@gnu.org>
7760
7761 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
7762 in special-event-map. See the discussion at
7763 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
7764 for the reasons.
7765
7766 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
7767 info.dwItemData. Fixes crashes on 64-bit Windows.
7768 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
7769
7770 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
7771
7772 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
7773 (conversationIdentifier): Return value is NSInteger.
7774 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
7775
7776 2012-07-21 Chong Yidong <cyd@gnu.org>
7777
7778 * window.c (decode_any_window): Signal an error if the window is
7779 on a dead frame (Bug#11984).
7780
7781 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7782
7783 Add indirection counting to speed up Fkill_buffer.
7784 * buffer.h (struct buffer): New member.
7785 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
7786 (Fmake_indirect_buffer): Set indirection counter to -1, increment
7787 base buffer indirection counter.
7788 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
7789 (Fkill_buffer): Adjust indirection counters as needed, don't walk
7790 through buffer list if indirection counter is 0.
7791
7792 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7793
7794 Extend the value returned by Fgarbage_collect with heap statistics.
7795 * alloc.c (Qheap): New symbol.
7796 (syms_of_alloc): DEFSYM it.
7797 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7798 (Fmemory_free): Remove.
7799 (syms_of_alloc): Don't defsubr it.
7800 * buffer.c (Fcompact_buffer): Remove.
7801 (syms_of_buffer): Don't defsubr it.
7802
7803 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7804
7805 Make maybe_gc inline.
7806 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7807 * lisp.h (consing_since_gc, gc_relative_threshold)
7808 (memory_full_cons_threshold): Revert declaration.
7809 (maybe_gc): Remove prototype, define as inline.
7810 * alloc.c: Remove old commented-out code.
7811 (consing_since_gc, gc_relative_threshold)
7812 (memory_full_cons_threshold): Revert to global.
7813 (maybe_gc): Remove.
7814
7815 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7816
7817 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7818 * lisp.h (build_unibyte_string): New function.
7819 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7820 * sysdep.c, w32fns.c, xfns.c: Use it.
7821 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7822 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7823 Adjust users accordingly.
7824 * font.h (font_open_by_name): Adjust prototype.
7825
7826 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7827
7828 Cleanup calls to Fgarbage_collect.
7829 * lisp.h (maybe_gc): New prototype.
7830 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7831 Remove declarations.
7832 * alloc.c (maybe_gc): New function.
7833 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7834 Make them static.
7835 * bytecode.c (MAYBE_GC): Use maybe_gc.
7836 * eval.c (eval_sub, Ffuncall): Likewise.
7837 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7838 to avoid dependency from auto-save feature.
7839
7840 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7841
7842 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7843 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7844 'for_each_per_buffer_object_at'.
7845 All uses changed. It's better to use upper-case for macros that
7846 cannot be implemented as functions, to give the reader a clue
7847 that they're special.
7848
7849 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7850
7851 * alloc.c (Fgarbage_collect): Tweak docstring.
7852
7853 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7854
7855 Tweak the value returned from Fgarbage_collect again.
7856 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7857 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7858 Adjust documentation.
7859 (total_vector_bytes): Rename to total_vector_slots, adjust
7860 accounting.
7861 (total_free_vector_bytes): Rename to total_free_vector_slots,
7862 adjust accounting.
7863 (Qstring_bytes, Qvector_slots): New symbols.
7864 (syms_of_alloc): DEFSYM them.
7865
7866 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7867
7868 Buffer compaction primitive which may be used from Lisp.
7869 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7870 (syms_of_buffer): Register Fcompact_buffer.
7871 * alloc.c (Fgarbage_collect): Use compact_buffer.
7872 * buffer.h (compact_buffer): New prototype.
7873 (struct buffer_text): New member.
7874
7875 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7876
7877 New macro to iterate over all buffers, miscellaneous cleanups.
7878 * lisp.h (all_buffers): Remove declaration.
7879 * buffer.h (all_buffers): Add declaration, with comment.
7880 (for_each_buffer): New macro.
7881 * alloc.c (Fgarbage_collect, mark_object): Use it.
7882 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7883 (init_buffer): Likewise.
7884 * data.c (Fset_default): Likewise.
7885 * coding.c (code_conversion_restore): Remove redundant check
7886 for dead buffer.
7887 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7888
7889 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7890
7891 Fix bug that created negative-length intervals.
7892 * intervals.c (merge_interval_right, merge_interval_left):
7893 Do not zero out this interval if it is absorbed by its children,
7894 as this interval's total length doesn't change in that case. See
7895 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7896
7897 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7898
7899 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7900 when invoking (make-bool-vector N t) and N is a positive
7901 multiple of 8 -- the last 8 bits were mistakenly cleared.
7902
7903 Remove some struct layout assumptions in bool vectors.
7904 * alloc.c (bool_header_size): New constant.
7905 (header_size, word_size): Move earlier, as they're now used earlier.
7906 Use 'word_size' in a few more places, where it's appropriate.
7907 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7908 padding before the data member of a bool vector.
7909 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7910 than doing the check by hand with an abort ().
7911
7912 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7913
7914 * eval.c (Fdefvar): Don't check constants since we only set the var if
7915 it's not yet defined anyway (bug#11904).
7916
7917 * lisp.h (last_undo_boundary): Declare new var.
7918 * keyboard.c (command_loop_1): Set it.
7919 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7920 were auto-added by the command loop (bug#11774).
7921
7922 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7923
7924 * w32font.c (Qsymbol): Remove local definition.
7925 (syms_of_w32font): Don't DEFSYM it.
7926
7927 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7928
7929 Fix sweep_vectors to handle large bool vectors correctly.
7930 * alloc.c (sweep_vectors): Account total_vector_bytes for
7931 bool vectors larger than VBLOCK_BYTES_MAX.
7932
7933 2012-07-18 Chong Yidong <cyd@gnu.org>
7934
7935 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7936 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7937
7938 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7939
7940 Return more descriptive data from Fgarbage_collect.
7941 Suggested by Stefan Monnier in
7942 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7943 * alloc.c (bounded_number): New function.
7944 (total_buffers, total_vectors): New variable.
7945 (total_string_size): Rename to total_string_bytes, adjust users.
7946 (total_vector_size): Rename to total_vector_bytes, adjust users.
7947 (sweep_vectors): Account total_vectors and total_vector_bytes.
7948 (Fgarbage_collect): New return value. Adjust documentation.
7949 (gc_sweep): Account total_buffers.
7950 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7951 (VECTOR_SIZE): Remove.
7952 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7953 (Qinterval, Qmisc): New symbols.
7954 (syms_of_data): Initialize them.
7955 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7956 (Qcons, Qbuffer): New declarations.
7957
7958 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7959
7960 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7961 Round up, not down. Improve doc.
7962
7963 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7964
7965 Restore old code in allocate_string_data to avoid Faset breakage.
7966 Reported by Julien Danjou <julien@danjou.info> in
7967 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7968 * alloc.c (allocate_string_data): Restore old code with minor
7969 adjustments, fix comment to explain this subtle issue.
7970
7971 2012-07-17 Eli Zaretskii <eliz@gnu.org>
7972
7973 Remove FILE_SYSTEM_CASE.
7974 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7975
7976 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7977 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7978 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7979 call-process-region passes it through expand-file-name.
7980
7981 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7982
7983 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7984
7985 Fix crash when creating indirect buffer (Bug#11917)
7986 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7987 Don't handle unbound variables specially if non-zero.
7988 (Fbuffer_local_variables): Pass zero.
7989 (clone_per_buffer_values): Pass non-zero.
7990
7991 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7992
7993 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7994 to make the loop interruptible.
7995
7996 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7997
7998 * gnutls.c (emacs_gnutls_handshake): Only retry if
7999 GNUTLS_E_INTERRUPTED.
8000
8001 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8002
8003 Cleanup and convert miscellaneous checks to eassert.
8004 * alloc.c (mark_interval): Fix comment, partially rephrase
8005 old comment from intervals.h (see below).
8006 * intervals.c (find_interval, adjust_intervals_for_insertion)
8007 (delete_interval, adjust_intervals_for_deletion)
8008 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8009 Convert to eassert.
8010 (adjust_intervals_for_insertion, make_new_interval):
8011 Remove obsolete and unused code.
8012 * intervals.h (struct interval): Remove obsolete comment.
8013 * textprotp.c (erase_properties): Remove unused code.
8014 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8015 (Fremove_list_of_text_properties): Convert to eassert.
8016
8017 2012-07-17 Chong Yidong <cyd@gnu.org>
8018
8019 * editfns.c (Finsert_char): Doc fix.
8020
8021 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8022
8023 Fix previous change to make Fmemory_free always accurate.
8024 * alloc.c (make_interval): Update total_free_intervals.
8025 (make_float): Likewise for total_free_floats.
8026 (free_cons, Fcons): Likewise for total_free_conses.
8027 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8028 Likewise for total_free_vector_bytes.
8029 (Fmake_symbol): Likewise for total_free_symbols.
8030 (bytes_free): Remove.
8031
8032 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8033
8034 Simple free memory accounting feature.
8035 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8036 (sweep_vectors): Accumulate size of free vectors.
8037 (Fgarbage_collect): Setup bytes_free.
8038 (Fmemory_free): New function.
8039 (syms_of_alloc): Register it.
8040
8041 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8042
8043 Cleanup overlays checking.
8044 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8045 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8046 eassert and OVERLAYP.
8047 (sort_overlays): Change to use OVERLAYP.
8048
8049 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8050
8051 * editfns.c (Finsert_char): Make it interactive, and make the
8052 second arg optional. Copy interactive spec and docstring from
8053 ucs-insert.
8054
8055 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8056
8057 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8058 Unlike the other wrapped functions, fabs has an unspecified
8059 effect on errno.
8060
8061 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8062
8063 * nsterm.m (keyDown): Interpret flags without left/right bits
8064 as the left key (Bug#11670).
8065
8066 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8067
8068 Remove empty and useless init functions.
8069 * lisp.h (init_character_once, init_fns, init_image)
8070 (init_filelock, init_sound): Remove prototype.
8071 * character.c (init_character_once): Remove.
8072 * filelock.c (init_filelock): Likewise.
8073 * fns.c (init_fns): Likewise.
8074 * image.c (init_image): Likewise.
8075 * sound.c (init_sound): Likewise.
8076 * emacs.c (main): Adjust accordingly.
8077
8078 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8079
8080 * gtkutil.h: Tiny cleanups.
8081 (use_old_gtk_file_dialog): Remove useless declaration.
8082 (xg_uses_old_file_dialog): Add suggested const attribute.
8083
8084 2012-07-15 Eli Zaretskii <eliz@gnu.org>
8085
8086 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8087 (bidi_paragraph_init): Use it to limit search forward for a strong
8088 directional character in abnormally large paragraphs full of
8089 neutral or weak characters. (Bug#11943)
8090
8091 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8092
8093 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8094 the toolbar (Bug#9451).
8095 (xg_make_tool_item): Give the widget event box a transparent
8096 background.
8097
8098 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8099
8100 Cleanup basic allocation variables and functions.
8101 * alloc.c (ignore_warnings, init_intervals, init_float)
8102 (init_cons, init_symbol, init_marker): Remove.
8103 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8104 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8105 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8106 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8107 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8108 (staticidx, init_alloc_once, init_strings, free_ablock):
8109 Remove redundant initialization.
8110 * fns.c (init_weak_hash_tables): Remove.
8111 * lisp.h (init_weak_hash_tables): Remove prototype.
8112
8113 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8114
8115 Use zero_vector where appropriate.
8116 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8117 accordingly.
8118 * lisp.h (zero_vector): New declaration.
8119 * font.c (null_vector): Remove.
8120 (syms_of_font): Remove initialization and staticpro.
8121 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8122 * keymap.c (Faccessible_keymaps): Likewise.
8123
8124 2012-07-15 Leo Liu <sdl.web@gmail.com>
8125
8126 * fringe.c: Fix typo in comments.
8127
8128 2012-07-14 Leo Liu <sdl.web@gmail.com>
8129
8130 * fringe.c: Add a new bitmap exclamation-mark.
8131
8132 2012-07-14 Eli Zaretskii <eliz@gnu.org>
8133
8134 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8135
8136 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8137 (HAVE_MENUS): Don't define, defined by editing config.in with
8138 msdos/sed2v2.inp.
8139 (GMALLOC_INHIBIT_VALLOC): Don't define.
8140 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8141
8142 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
8143
8144 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8145
8146 2012-07-14 Glenn Morris <rgm@gnu.org>
8147
8148 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8149 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8150 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8151
8152 2012-07-13 Glenn Morris <rgm@gnu.org>
8153
8154 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8155
8156 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8157 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8158
8159 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8160
8161 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8162 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8163 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8164 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8165 where appropriate.
8166 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8167 as boolean expression.
8168 (x_set_window_size): Remove unused variable toolbar.
8169 (ns_get_color_default, ns_mod_to_lisp): Remove.
8170 (ns_mouse_position): Remove unused variables xchar and ychar.
8171 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8172 (ns_set_vertical_scroll_bar): Remove unused variable count.
8173 (ns_delete_terminal): Remove unused variable i.
8174 (ns_term_init): Remove unused variables r, g and b.
8175 (mouseDown): Remove unused variable window.
8176 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8177 (initFrameFromEmacs): Remove unused variable vbextra.
8178 (mouseEntered): Remove unused variables p and dpyinfo.
8179 (mouseExited): Remove unused variables p and r.
8180 (ns_define_frame_cursor, ns_clear_frame_area)
8181 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8182 (menuDown): Assign [sender tag] to variable and cast the variable.
8183
8184 * nsterm.h (menuDown): Add id as type to argument sender.
8185 (ns_display_info_for_name): Add Lisp_Object argument.
8186 (ns_term_init): Add Lisp_Object argument.
8187 (ns_map_event_to_object): Add void argument.
8188 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8189 prototype with arguments and only declare if __OBJC__.
8190 (nxatoms_of_nsselect): Add void argument.
8191 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8192 (ns_alloc_autorelease_pool): Add void argument.
8193 (ns_release_autorelease_pool): Add void* argument.
8194 (ns_get_defaults_value): Add const char* argument.
8195
8196 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8197 (initFromContents): Use SSDATA where appropriate.
8198 (ns_update_menubar): Add braces to ambigous if-else.
8199 (initWithTitle): Put () around assignment in if statement.
8200 (ns_menu_show): Remove unused variables window and keymap.
8201 (update_frame_tool_bar): Remove unused variable selected_p.
8202 (initWithContentRect): Remove unused variable this_cmd_name.
8203
8204 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8205 appropriate.
8206 (setXBMColor): Remove unused variable len.
8207 (setPixmapData): Put () around assignment in loop statement.
8208
8209 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8210 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8211 where appropriate.
8212 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8213 around assignment in loop statement.
8214 (nsfont_open): Remove unused variable i.
8215 (nsfont_open): Remove unused variable len.
8216 (nsfont_draw): Remove unused variable cs.
8217
8218 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8219 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8220 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8221 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8222 (Fns_font_name, Fns_perform_service)
8223 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8224 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8225 (ns_set_name): Remove unused variable view.
8226 (x_set_menu_bar_lines): Remove unused variable olines.
8227 (x_set_tool_bar_lines): Remove unused variable root_window.
8228 (Fns_list_colors): Put () around assignment in while statement.
8229 (Fns_perform_service): Remove unused variable len.
8230 (Fns_display_usable_bounds): Remove unused variable top.
8231 (syms_of_nsfns): Remove unused variable i.
8232
8233 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8234 memcpy (Bug#11907).
8235
8236 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
8237
8238 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8239 and free it with DestroyExceptionInfo (Bug#11558).
8240
8241 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
8242
8243 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8244 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
8245 Set here, not in nt/config.nt.
8246
8247 2012-07-13 Eli Zaretskii <eliz@gnu.org>
8248
8249 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
8250 cursor overflow into the last glyph on display line when the right
8251 fringe is off. (Bug#11832)
8252
8253 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
8254
8255 * xdisp.c (produce_special_glyphs): Now static.
8256 * dispextern.h (produce_special_glyphs): Remove decl.
8257
8258 2012-07-13 Glenn Morris <rgm@gnu.org>
8259
8260 * s/bsd-common.h, s/cygwin.h: Remove empty files.
8261 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
8262
8263 * s/usg5-4-common.h (USG, USG5):
8264 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8265 * s/sol2-6.h (SOLARIS2):
8266 * s/irix6-5.h (IRIX6_5):
8267 * s/hpux10-20.h (USG, USG5, HPUX):
8268 * s/gnu-linux.h (USG, GNU_LINUX):
8269 * s/freebsd.h (BSD_SYSTEM):
8270 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8271 * s/cygwin.h (CYGWIN):
8272 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8273 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8274
8275 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
8276
8277 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
8278
8279 2012-07-13 Glenn Morris <rgm@gnu.org>
8280
8281 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8282
8283 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8284
8285 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8286 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8287
8288 2012-07-12 Glenn Morris <rgm@gnu.org>
8289
8290 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
8291
8292 * process.c (init_process_emacs): Rename from init_process.
8293 The old name is also the name of a Mach system call.
8294 * lisp.h, emacs.c: Update for this name change.
8295 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8296 longer needed.
8297
8298 2012-07-12 Eli Zaretskii <eliz@gnu.org>
8299
8300 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
8301 memmove call that removes glyphs covered by the left truncation
8302 glyph. Improve commentary.
8303 (display_line): Fix display of continuation glyphs on GUI frames
8304 when the right fringe is turned off and variable-size fonts are
8305 used in the window. Move the code that appends a stretch glyph to
8306 produce_special_glyphs, so that it could be used for truncation
8307 and continuation glyphs alike.
8308 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
8309 glyph of a suitably computed width, to align the special glyphs at
8310 the window margin. Code moved from display_line. (Bug#11832)
8311
8312 2012-07-12 Glenn Morris <rgm@gnu.org>
8313
8314 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
8315
8316 * s/gnu-linux.h, s/hpux10-20.h:
8317 Do not unconditionally define HAVE_XRMSETDATABASE.
8318
8319 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
8320
8321 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 Fix typos that broke OS X build.
8324 Reported by Randal L. Schwartz in
8325 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
8326 * nsterm.m (ns_timeout): Add missing local decl.
8327 (ns_get_color): snprintf -> sprintf, to fix typo.
8328
8329 2012-07-12 Glenn Morris <rgm@gnu.org>
8330
8331 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
8332 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
8333 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
8334 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
8335
8336 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
8337 Move PTY_OPEN to configure.
8338
8339 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8340 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
8341 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
8342
8343 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
8344
8345 Use empty_unibyte_string where applicable.
8346 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
8347 * lread.c (read1): Likewise.
8348 * xsettings.c (syms_of_xsettings): Likewise.
8349
8350 2012-07-12 Glenn Morris <rgm@gnu.org>
8351
8352 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
8353 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
8354 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
8355 * s/hpux10-20.h (RUN_TIME_REMAP):
8356 * s/bsd-common.h (TABDLY): Move to configure.
8357
8358 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
8359
8360 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
8361
8362 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8363 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
8364
8365 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
8366
8367 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
8368 * s/template.h: Move NARROWPROTO to configure.
8369
8370 2012-07-11 Glenn Morris <rgm@gnu.org>
8371
8372 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
8373 unused since 2011-01-17 change to systty.h.
8374
8375 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
8376 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8377 Move HAVE_PTYS and HAVE_SOCKETS to configure.
8378
8379 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8380
8381 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
8382
8383 2012-07-11 Glenn Morris <rgm@gnu.org>
8384
8385 * s/darwin.h, s/gnu-linux.h, s/template.h:
8386 Move INTERRUPT_INPUT to configure.
8387
8388 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8389
8390 Minor adjustments to interning code.
8391 * lisp.h (intern, intern_c_string): Redefine as static inline
8392 wrappers for intern_1 and intern_c_string_1, respectively.
8393 (intern_1, intern_c_string_1): Rename prototypes.
8394 * lread.c (intern_1, intern_c_string_1, oblookup):
8395 Simplify Vobarray checking.
8396 * font.c (font_intern_prop): Likewise. Adjust comment.
8397 * w32font.c (intern_font_name): Likewise.
8398
8399 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
8400
8401 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
8402
8403 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
8404 of Fcar/Fcdr if possible.
8405 * font.c (check_otf_features): Likewise.
8406 * fontset.c (Fnew_fontset): Likewise.
8407 * gnutls.c (Fgnutls_boot): Likewise.
8408 * minibuf.c (read_minibuf): Likewise.
8409 * msdos.c (IT_set_frame_parameters): Likewise.
8410 * xmenu.c (Fx_popup_dialog): Likewise.
8411 * w32menu.c (Fx_popup_dialog): Likewise.
8412
8413 2012-07-11 Glenn Morris <rgm@gnu.org>
8414
8415 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
8416 since nothing has defined it on these platforms.
8417
8418 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
8419 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
8420
8421 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8422 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
8423 Move CLASH_DETECTION to configure.
8424
8425 * s/gnu.h: Remove file, which is now empty.
8426
8427 * s/gnu.h, s/gnu-linux.h:
8428 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
8429
8430 2012-07-11 John Wiegley <johnw@newartisans.com>
8431
8432 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
8433 function attribute, so we only use it if it exists in the
8434 compiler.
8435
8436 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8437
8438 Avoid call to strlen in fast_c_string_match_ignore_case.
8439 * search.c (fast_c_string_match_ignore_case): Change to use
8440 length argument. Adjust users accordingly.
8441 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
8442
8443 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
8444
8445 Assume mkdir, rmdir.
8446 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
8447 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
8448
8449 Assume rename.
8450 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
8451
8452 Assume perror.
8453 * s/hpux10-20.h (HAVE_PERROR): Remove.
8454 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
8455 Remove dummy definition, as this problem was obsolete long ago.
8456
8457 Assume strerror.
8458 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
8459
8460 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
8461
8462 Avoid calls to strlen in font processing functions.
8463 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
8464 (font_open_by_name): Change to use length argument.
8465 Adjust users accordingly.
8466 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
8467 Adjust prototypes.
8468 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
8469 Change to return ptrdiff_t.
8470 (xfont_list_pattern, xfont_match): Use length returned by
8471 xfont_decode_coding_xlfd.
8472 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
8473
8474 2012-07-11 Glenn Morris <rgm@gnu.org>
8475
8476 * s/darwin.h, s/freebsd.h, s/netbsd.h:
8477 Move DONT_REOPEN_PTY to configure.
8478
8479 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
8480 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
8481
8482 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
8483
8484 Remove "#define unix" that is no longer needed (Bug#11905).
8485 * s/aix4-2.h (unix): Remove; no longer needed.
8486
8487 EMACS_TIME simplification (Bug#11875).
8488 This replaces macros (which typically do not work in GDB)
8489 with functions, typedefs and enums, making the code easier to debug.
8490 The functional style also makes code easier to read and maintain.
8491 * systime.h: Include <sys/time.h> on all hosts, not just if
8492 WINDOWSNT, since 'struct timeval' is needed in general.
8493 (EMACS_TIME): Now a typedef, not a macro.
8494 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
8495 not macros.
8496 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
8497 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
8498 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
8499 (EMACS_TIME_LE): Now functions, not macros.
8500 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
8501 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
8502 which are not functions. All uses rewritten to use:
8503 (make_emacs_time): New function.
8504 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
8505 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
8506 not functions. All uses rewritten to use the following, respectively:
8507 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
8508 (add_emacs_time, sub_emacs_time): New functions.
8509 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
8510 * fileio.c (Fcopy_file):
8511 * xterm.c (XTflash): Get the current time closer to when it's used.
8512 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
8513
8514 * bytecode.c (targets): Suppress -Woverride-init warnings.
8515
8516 Simplify by avoiding confusing use of strncpy etc.
8517 * doc.c (Fsnarf_documentation):
8518 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
8519 * frame.c (Fmake_terminal_frame):
8520 * gtkutil.c (get_utf8_string):
8521 * lread.c (openp):
8522 * nsmenu.m (ns_update_menubar):
8523 * regex.c (regerror):
8524 Prefer memcpy to strncpy and strncat when either will do.
8525 * fileio.c (Fsubstitute_in_file_name):
8526 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
8527 (menu_separator_name_p):
8528 * nsmenu.m (ns_update_menubar):
8529 Prefer memcmp to strncmp when either will do.
8530 * nsterm.m: Include <ftoastr.h>.
8531 (ns_get_color):
8532 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
8533 Prefer snprintf to strncpy.
8534 * nsterm.m (ns_term_init):
8535 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
8536 * nsterm.m (ns_term_init):
8537 Avoid the need for strncpy, by using build_string or
8538 make_unibyte_string directly. Use dtoastr, not snprintf.
8539 * process.c (Fmake_network_process): Diagnose service names that
8540 are too long, rather than silently truncating them or creating
8541 non-null-terminated names.
8542 (Fnetwork_interface_info): Likewise, for interface names.
8543 * sysdep.c (system_process_attributes) [GNU_LINUX]:
8544 Prefer sprintf to strncat.
8545 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
8546 Prefer vsnprintf to vsprintf + strncpy.
8547
8548 2012-07-10 Glenn Morris <rgm@gnu.org>
8549
8550 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
8551 Clarify fallback case.
8552
8553 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8554
8555 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
8556 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
8557 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
8558 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
8559 where argument type is known to be a Lisp_Cons.
8560
8561 2012-07-10 Tom Tromey <tromey@redhat.com>
8562
8563 * bytecode.c (BYTE_CODE_THREADED): New macro.
8564 (BYTE_CODES): New macro. Replaces all old byte-code defines.
8565 (enum byte_code_op): New type.
8566 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
8567 (exec_byte_code): Use them. Use token threading when applicable.
8568
8569 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8570
8571 Optimize pure C strings initialization.
8572 * lisp.h (make_pure_string): Fix prototype.
8573 (build_pure_c_string): New function, defined as static inline. This
8574 provides a better opportunity to optimize away calls to strlen when
8575 the function is called with compile-time constant argument.
8576 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
8577 argument, adjust users accordingly. Use build_pure_c_string where
8578 appropriate.
8579 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
8580 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
8581 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8582
8583 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8584
8585 Avoid calls to strlen in miscellaneous functions.
8586 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
8587 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
8588 * lread.c (openp): Likewise.
8589
8590 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8591
8592 Avoid calls to strlen in path processing functions.
8593 * fileio.c (file_name_as_directory): Add comment. Change to add
8594 srclen argument and return the length of result. Adjust users
8595 accordingly.
8596 (directory_file_name): Fix comment. Change to add srclen argument,
8597 swap 1st and 2nd arguments to obey the common convention.
8598 Adjust users accordingly.
8599 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
8600
8601 2012-07-10 Glenn Morris <rgm@gnu.org>
8602
8603 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
8604 Move PENDING_OUTPUT_COUNT definition to configure.
8605
8606 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
8607 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
8608 * s/gnu.h (DATA_START): Move definitions to configure.
8609
8610 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
8611 We include usg5-4-common.h, which defines them both.
8612
8613 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
8614 O_RDONLY already includes it).
8615
8616 Stop ns builds setting the EMACSLOADPATH environment variable.
8617 * nsterm.m (ns_load_path): Rename from ns_init_paths.
8618 Now it does not set EMACSLOADPATH, just returns the load-path string.
8619 * nsterm.h: Update accordingly.
8620 * lread.c [HAVE_NS]: Include nsterm.h.
8621 (init_lread) [HAVE_NS]: Use ns_load_path.
8622 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
8623
8624 2012-07-09 Glenn Morris <rgm@gnu.org>
8625
8626 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
8627 since the included bsd-common.h does so.
8628
8629 Stop ns builds setting the EMACSPATH environment variable.
8630 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8631 (ns_init_paths): Do not set EMACSPATH.
8632 * nsterm.h (ns_exec_path): Add it.
8633 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8634 Use ns_exec_path.
8635
8636 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8637
8638 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8639
8640 * process.c (wait_reading_process_output): 'waitchannels' was unset
8641 when read_kbd || !NILP (wait_for_cell); fix this.
8642
8643 Add GCC-style 'const' attribute to functions that can use it.
8644 * character.h (char_resolve_modifier_mask):
8645 * keyboard.h (make_ctrl_char):
8646 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8647 (init_character_once, next_almost_prime, init_fns, init_image)
8648 (flush_pending_output, init_sound):
8649 * mem-limits.h (start_of_data):
8650 * menu.h (finish_menu_items):
8651 Add ATTRIBUTE_CONST.
8652 * emacs.c (DEFINE_DUMMY_FUNCTION):
8653 Declare the dummy function with ATTRIBUTE_CONST.
8654 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
8655 Add decls with ATTRIBUTE_CONST.
8656
8657 Minor improvements to make_formatted_string.
8658 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
8659 where int is good enough, as vsprintf returns an int.
8660 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
8661
8662 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8663
8664 Use make_formatted_string to avoid double length calculation.
8665 * lisp.h (make_formatted_string): New prototype.
8666 * alloc.c (make_formatted_string): New function.
8667 * buffer.c (Fgenerate_new_buffer_name): Use it.
8668 * dbusbind.c (syms_of_dbusbind): Likewise.
8669 * editfns.c (Fcurrent_time_zone): Likewise.
8670 * filelock.c (get_boot_time): Likewise.
8671 * frame.c (make_terminal_frame, set_term_frame_name)
8672 (x_report_frame_params): Likewise.
8673 * image.c (gs_load): Likewise.
8674 * minibuf.c (get_minibuffer): Likewise.
8675 * msdos.c (dos_set_window_size): Likewise.
8676 * process.c (make_process): Likewise.
8677 * xdisp.c (ensure_echo_area_buffers): Likewise.
8678 * xsettings.c (apply_xft_settings): Likewise.
8679
8680 2012-07-09 Glenn Morris <rgm@gnu.org>
8681
8682 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
8683 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
8684 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
8685 * nsterm.h (ns_etc_directory): Add it.
8686 * callproc.c [HAVE_NS]: Include nsterm.h.
8687 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
8688
8689 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8690
8691 Move marker debugging code under MARKER_DEBUG.
8692 * marker.c (MARKER_DEBUG): Move marker debugging code under
8693 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
8694 for bootstrap with --enable-checking (~3x slowdown reported
8695 by Juanma Barranquero <lekktu@gmail.com>).
8696 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
8697
8698 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
8699
8700 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
8701 See <http://bugs.gnu.org/11825#29>.
8702
8703 2012-07-08 Eli Zaretskii <eliz@gnu.org>
8704
8705 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
8706 has no font, use the frame's font. (Bug#11813)
8707 (display_line): Add commentary about displaying truncation glyphs
8708 on GUI frames.
8709 (produce_special_glyphs): Move here from term.c.
8710
8711 * term.c (produce_special_glyphs): Move to xdisp.c.
8712
8713 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
8714 section.
8715
8716 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
8717
8718 * xdisp.c (display_line): Avoid warning about implicit declaration
8719 of FRAME_FONT.
8720
8721 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
8722
8723 * lisp.h: Remove empty conditional.
8724
8725 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8726
8727 * lread.c (load_path_check): Now static.
8728
8729 Fix some minor --with-ns problems found by static checking.
8730 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
8731 (x_set_font) [!HAVE_X_WINDOWS]:
8732 * image.c (xpm_load_image) [HAVE_NS]:
8733 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
8734 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
8735 Remove unused local.
8736 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
8737 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
8738 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
8739 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
8740 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
8741 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
8742 Fix pointer signedness problem.
8743 * xfaces.c (FRAME_X_FONT_TABLE):
8744 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
8745
8746 2012-07-07 Glenn Morris <rgm@gnu.org>
8747
8748 * lread.c (load_path_check): New function, split from init_lread.
8749 (init_lread): Reorganize. Motivation:
8750 If EMACSLOADPATH is set, check/warn about that rather than the
8751 defaults, which we are not going to use. Hence we can remove
8752 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
8753 Don't warn if site-lisp directories are missing.
8754 If not installed, start from a blank load-path, since
8755 PATH_LOADSEARCH refers to the eventual installation directories.
8756
8757 2012-07-07 Eli Zaretskii <eliz@gnu.org>
8758
8759 Support truncation and continuation glyphs on GUI frames, when
8760 fringes are disabled. (Bug#11832)
8761 * xdisp.c (init_iterator): Get dimensions of truncation and
8762 continuation glyphs even if on GUI frames.
8763 Adjust it->last_visible_x on GUI frames when the left or right fringes,
8764 or both, are absent.
8765 (start_display, move_it_in_display_line_to): Handle the case of a
8766 GUI frame without a fringe to display continuation or truncation
8767 glyphs.
8768 (insert_left_trunc_glyphs): Support GUI frames: make sure
8769 truncation glyphs overwrite enough glyphs from the current line to
8770 have sufficient space in pixels.
8771 (display_line): Support truncation and continuation glyphs on GUI
8772 frames. If some spare pixels are left on the line after inserting
8773 the truncation glyphs, fill that space with a stretch glyph of a
8774 suitably computed width.
8775
8776 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
8777 produce_glyphs, to support GUI sessions.
8778
8779 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8780
8781 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
8782
8783 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
8784
8785 Do not require float-time's arg to fit in time_t (Bug#11825).
8786 This works better on hosts where time_t is unsigned, and where
8787 float-time is applied to the (negative) difference between two times.
8788 * editfns.c (decode_time_components): Last arg is now double *,
8789 not int *, and means to store all the result as a double, without
8790 worrying about whether the seconds part fits in time_t.
8791 All callers changed.
8792 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8793 All callers changed.
8794 (Ffloat_time): Do not fail merely because the specified time falls
8795 outside of time_t range.
8796
8797 2012-07-07 Glenn Morris <rgm@gnu.org>
8798
8799 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8800 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8801 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8802
8803 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
8804
8805 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8806 Update dependencies.
8807
8808 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8809
8810 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8811
8812 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8813 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8814 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8815 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8816 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8817 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8818
8819 * xfont.c (compare_font_names): Redo to omit the need for casts.
8820
8821 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8822
8823 * xfns.c (Fx_change_window_property): Doc fix.
8824 * w32fns.c (Fx_change_window_property): Doc fix.
8825
8826 * w32fns.c (Fx_window_property): Accept the same arguments as the
8827 X Windows version. Doc fix.
8828 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8829
8830 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
8831 Eli Zaretskii <eliz@gnu.org>
8832
8833 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8834 Windows-specific code from nt/config.nt moved here.
8835 Obsolete settings removed.
8836
8837 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 * process.c: Avoid unnecessary calls to gettime.
8840 (wait_reading_process_output): Don't get the time of day
8841 when gobbling data immediately and not waiting, as there's no need
8842 for it in that case. This removes a FIXME.
8843
8844 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8845
8846 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8847 is defined (Bug#11768).
8848
8849 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8850
8851 Fix marker debugging code.
8852 * marker.c (byte_char_debug_check): Do not perform the check
8853 if buffer is not multibyte.
8854 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8855 Call byte_char_debug_check with correct arguments.
8856
8857 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8858
8859 Compile marker debugging code only if ENABLE_CHECKING is defined.
8860 * marker.c (byte_char_debug_check, count_markers):
8861 Use only if ENABLE_CHECKING is defined.
8862 (byte_debug_flag): Remove.
8863 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8864 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8865
8866 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8867
8868 Avoid code repetition in marker-related functions.
8869 * marker.c (attach_marker): New function.
8870 (Fset_marker, set_marker_restricted, set_marker_both)
8871 (set_marker_restricted_both): Use it.
8872 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8873 Consistently rename charno to charpos.
8874 (marker_position): Add eassert.
8875 (marker_byte_position): Convert to eassert.
8876
8877 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8878
8879 Simplify list operations in unchain_overlay and unchain_marker.
8880 * buffer.c (unchain_overlay): Simplify. Add comment.
8881 * marker.c (unchain_marker): Simplify. Fix comments.
8882
8883 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8884
8885 Introduce fast path for the widely used marker operation.
8886 * alloc.c (build_marker): New function.
8887 * lisp.h (build_marker): New prototype.
8888 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8889 * composite.c (autocmp_chars): Likewise.
8890 * editfns.c (buildmark): Remove.
8891 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8892 (save_restriction_save): Use build_marker.
8893 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8894 * window.c (save_window_save): Likewise.
8895
8896 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8897
8898 Do not use Fdelete_overlay in delete_all_overlays
8899 to avoid redundant calls to unchain_overlay.
8900 * buffer.c (drop_overlay): New function.
8901 (delete_all_overlays, Fdelete_overlay): Use it.
8902 * minibuf.c (get_minibuffer): Fix comment.
8903
8904 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8905
8906 Port to OpenBSD 5.1 amd64.
8907 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8908 This is needed for OpenBSD, and should be harmless on all BSD systems.
8909 Also, include <sys/sysctl.h>, as it should be available on all
8910 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8911 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8912 use p_pid member, not kp_proc.pid.
8913
8914 2012-07-06 Glenn Morris <rgm@gnu.org>
8915
8916 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8917
8918 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8919
8920 More xmalloc and related cleanup.
8921 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8922 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8923 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8924 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8925 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8926 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8927 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8928 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8929 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8930 * xterm.c:
8931 Omit needless casts involving void * pointers and allocation.
8932 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8933 as the former is more robust if P's type is changed.
8934 Prefer xzalloc to xmalloc + memset 0.
8935 Simplify malloc-or-realloc to realloc.
8936 Don't worry about xmalloc returning a null pointer.
8937 Prefer xstrdup to xmalloc + strcpy.
8938 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8939 growing it.
8940 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8941 alloca of a constant.
8942
8943 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8944
8945 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8946 hscroll is larger than the line width. Fixes long and futile
8947 looping inside extend_face_to_end_of_line (on a TTY) producing
8948 glyphs that are not needed and thrown away.
8949
8950 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8951
8952 * marker.c (set_marker_restricted_both): Simplify by using
8953 clip_to_bounds.
8954
8955 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8958
8959 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8960
8961 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8962 not defined (Bug#11768).
8963 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8964 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8965 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8966 followed by gtk_box_set_homogeneous (Bug#11768).
8967 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
8968 (update_theme_scrollbar_width, xg_create_scroll_bar):
8969 Use gtk_scrollbar_new (Bug#11768).
8970 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8971 (is_box_type): New function (Bug#11768).
8972 (xg_tool_item_stale_p): Call is_box_type.
8973 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
8974 with default display (Bug#11768).
8975
8976 2012-07-05 Eli Zaretskii <eliz@gnu.org>
8977
8978 * xdisp.c (window_hscroll_limited): New function.
8979 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8980 coordinates when window's hscroll is set to insanely large
8981 values. (Bug#11857)
8982
8983 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
8984
8985 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8986 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8987
8988 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8989
8990 Cleanup xmalloc.
8991 * lisp.h (xzalloc): New prototype. Omit needless casts.
8992 * alloc.c (xzalloc): New function. Omit needless casts.
8993 * charset.c: Omit needless casts. Convert all calls to
8994 xmalloc with following memset to xzalloc.
8995 * dispnew.c: Likewise.
8996 * fringe.c: Likewise.
8997 * image.c: Likewise.
8998 * sound.c: Likewise.
8999 * term.c: Likewise.
9000 * w32fns.c: Likewise.
9001 * w32font.c: Likewise.
9002 * w32term.c: Likewise.
9003 * xfaces.c: Likewise.
9004 * xfns.c: Likewise.
9005 * xterm.c: Likewise.
9006 * atimer.c: Omit needless casts.
9007 * buffer.c: Likewise.
9008 * callproc.c: Likewise.
9009 * ccl.c: Likewise.
9010 * coding.c: Likewise.
9011 * composite.c: Likewise.
9012 * doc.c: Likewise.
9013 * doprnt.c: Likewise.
9014 * editfns.c: Likewise.
9015 * emacs.c: Likewise.
9016 * eval.c: Likewise.
9017 * filelock.c: Likewise.
9018 * fns.c: Likewise.
9019 * gtkutil.c: Likewise.
9020 * keyboard.c: Likewise.
9021 * lisp.h: Likewise.
9022 * lread.c: Likewise.
9023 * minibuf.c: Likewise.
9024 * msdos.c: Likewise.
9025 * print.c: Likewise.
9026 * process.c: Likewise.
9027 * region-cache.c: Likewise.
9028 * search.c: Likewise.
9029 * sysdep.c: Likewise.
9030 * termcap.c: Likewise.
9031 * terminal.c: Likewise.
9032 * tparam.c: Likewise.
9033 * w16select.c: Likewise.
9034 * w32.c: Likewise.
9035 * w32reg.c: Likewise.
9036 * w32select.c: Likewise.
9037 * w32uniscribe.c: Likewise.
9038 * widget.c: Likewise.
9039 * xdisp.c: Likewise.
9040 * xmenu.c: Likewise.
9041 * xrdb.c: Likewise.
9042 * xselect.c: Likewise.
9043
9044 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9045
9046 * fileio.c (time_error_value): Check the right error number.
9047 Problem reported by Troels Nielsen in
9048 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9049
9050 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9051
9052 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9053 This should be fixed in a better way; see Eli Zaretskii in
9054 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9055 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9056
9057 * fileio.c (time_error_value): Rename from special_mtime.
9058 The old name's problems were noted by Eli Zaretskii in
9059 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9060
9061 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9062 This variable's comment says Emacs needs at least one GDB-visible
9063 symbol of type enum pvec_type, to work around GDB problems.
9064 The symbol's value doesn't matter.
9065
9066 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9067 that causes compilation to fail on pre-C99 compilers.
9068
9069 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
9070
9071 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9072 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9073
9074 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9075
9076 * buffer.c (init_buffer_once): Fix initialization of
9077 headers for buffer_defaults and buffer_local_symbols.
9078 Reported by Juanma Barranquero <lekktu@gmail.com>.
9079
9080 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9081
9082 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9083 * lisp.h (enum pvec_type): Use fewer bits.
9084 (PSEUDOVECTOR_SIZE_BITS): New constant.
9085 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9086 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9087 change in pvec_type.
9088 (PSEUDOVECTOR_TYPEP): New macro.
9089 (TYPED_PSEUDOVECTORP): Use it.
9090 * fns.c (internal_equal): Adapt code to extract pvectype.
9091 * emacs.c (gdb_pvec_type): Update type.
9092 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9093 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9094 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9095 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9096 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9097 abusing vector->header.next.nbytes.
9098 (live_vector_p): Use PVEC_TYPE.
9099 (mark_object): Adapt code to extract pvectype. Use switch.
9100
9101 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9102
9103 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9104 Tighten new eassert a bit.
9105
9106 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9107
9108 Fix compilation with --enable-gcc-warnings and -O1
9109 optimization level.
9110 * doprnt.c (doprnt): Change type of tem to int, initialize
9111 to avoid compiler warning. Add eassert.
9112 * search.c (simple_search): Initialize match_byte to avoid
9113 compiler warning. Add eassert.
9114
9115 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 Avoid weird behavior with large horizontal scrolls.
9118 Without this change, for example, large hscroll values would
9119 mess up Emacs's display on Fedora 15 x86, presumably due to
9120 overflows in int calculations in the display code.
9121 Also, if buffers had long lines, Emacs would freeze.
9122 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9123 (set_window_hscroll): New function, containing the old guts of
9124 Fset_window_hscroll. Return the clipped value.
9125 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9126 This avoids the need to check against PTRDIFF_MAX.
9127
9128 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9129
9130 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9131
9132 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9133
9134 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9137 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9138 since GCC 4.4.6 issues a bogus warning for them.
9139
9140 Fix bugs in file timestamp newness comparisons.
9141 * fileio.c (Ffile_newer_than_file_p):
9142 * lread.c (Fload): Use full timestamp resolution of files,
9143 not just the 1-second resolution, so that files that are only
9144 slightly newer still count as newer.
9145 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9146 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9147
9148 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9149
9150 * fileio.c: Improve handling of file time marker. (Bug#11852)
9151 (special_mtime): New function.
9152 (Finsert_file_contents, Fverify_visited_file_modtime):
9153 Use it to set special mtime values consistently.
9154
9155 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9156
9157 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9158 marker for non-existing file. (Bug#11852)
9159
9160 2012-07-03 Glenn Morris <rgm@gnu.org>
9161
9162 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9163 and did not make it into globals.h).
9164
9165 2012-07-03 Tom Tromey <tromey@redhat.com>
9166
9167 * window.c (Fset_window_margins, Fset_window_fringes)
9168 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9169 * textprop.c (Fprevious_property_change): No longer static.
9170 * syntax.c (Fsyntax_table_p): No longer static.
9171 * process.c (Fget_process, Fprocess_datagram_address): No longer
9172 static.
9173 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9174 * keyboard.c (Fcommand_execute): No longer static.
9175 Remove EXFUN.
9176 * insdel.c (Fcombine_after_change_execute): No longer static.
9177 * image.c (Finit_image_library): No longer static.
9178 * fileio.c (Fmake_symbolic_link): No longer static.
9179 * eval.c (Ffetch_bytecode): No longer static.
9180 * editfns.c (Fuser_full_name): No longer static.
9181 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9182 No longer static.
9183 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9184 static.
9185 * dired.c (Ffile_attributes): No longer static.
9186 * composite.c (Fcomposition_get_gstring): No longer static.
9187 * callproc.c (Fgetenv_internal): No longer static.
9188
9189 * ccl.h: Remove EXFUNs.
9190 * buffer.h: Remove EXFUNs.
9191 * dispextern.h: Remove EXFUNs.
9192 * intervals.h: Remove EXFUNs.
9193 * fontset.h: Remove EXFUN.
9194 * font.h: Remove EXFUNs.
9195 * dosfns.c (system_process_attributes): Remove EXFUN.
9196 * keymap.h: Remove EXFUNs.
9197 * lisp.h: Remove EXFUNs.
9198 * w32term.h: Remove EXFUNs.
9199 * window.h: Remove EXFUNs.
9200 * xsettings.h: Remove EXFUN.
9201 * xterm.h: Remove EXFUN.
9202
9203 2012-07-03 Glenn Morris <rgm@gnu.org>
9204
9205 * lisp.h (Frandom): Make it visible to C.
9206 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9207 buffer for invisible buffers. (Bug#1229)
9208
9209 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9210
9211 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9212 values which aren't power of 2.
9213 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
9214 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
9215 accordingly.
9216
9217 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9218
9219 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9220
9221 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9222
9223 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9224
9225 * alloc.c (allocate_vector_block): Remove redundant
9226 calls to mallopt if DOUG_LEA_MALLOC is defined.
9227 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9228 avoid calls to mallopt if zero_vector is returned.
9229
9230 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9231
9232 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9233 is enabled, avoid dereferencing NULL current_sblock if
9234 running undumped.
9235
9236 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9237
9238 Cleanup basic buffer management.
9239 * buffer.h (struct buffer): Change layout to use generic vector
9240 marking code. Fix some comments. Change type of 'clip_changed'
9241 to bitfield. Remove unused #ifndef old.
9242 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9243 (GET_OVERLAYS_AT): Fix indentation.
9244 (for_each_per_buffer_object_at): New macro.
9245 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
9246 (Fbuffer_local_variables): Use it.
9247 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
9248 * alloc.c (allocate_buffer): Adjust to match new layout of
9249 struct buffer. Fix comment.
9250 (mark_overlay): New function.
9251 (mark_buffer): Use it. Use mark_vectorlike to mark normal
9252 Lisp area of struct buffer.
9253 (mark_object): Use it. Adjust marking of misc objects
9254 and related comments.
9255
9256 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
9257
9258 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
9259 wrapper that is not needed because the wrapped code is a no-op (zero
9260 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
9261 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
9262
9263 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
9264
9265 * alloc.c (mark_buffer): Simplify. Remove prototype.
9266 (mark_object): Add comment. Reorganize marking of vector-like
9267 objects. Use CHECK_LIVE for all vector-like objects except buffers
9268 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9269 Avoid redundant calls to mark_vectorlike for bool vectors.
9270
9271 2012-06-30 Glenn Morris <rgm@gnu.org>
9272
9273 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9274
9275 * epaths.in (PATH_SITELOADSEARCH): New.
9276 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9277 This is rather than relying on --enable-locallisppath elements
9278 having "site-lisp" in their names. (Bug#10208#25, 11658)
9279
9280 2012-06-30 Eli Zaretskii <eliz@gnu.org>
9281
9282 * w32proc.c (sys_select): Accept and ignore one more argument.
9283
9284 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9285
9286 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9287 (pselect) [!MS_DOS]: Redirect to sys_select.
9288
9289 * sysdep.c: Don't include dos.h and dosfns.h.
9290
9291 * process.c (sys_select):
9292 * msdos.c (sys_select): Accept one more argument and ignore it.
9293
9294 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9295 adapt data types and code to that.
9296
9297 * dosfns.c:
9298 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
9299 which clashes with the gnulib function of the same name.
9300
9301 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
9302
9303 * font.c (font_style_to_value, font_style_symbolic)
9304 (font_prop_validate_style): Add type checks for values in
9305 font_style_table.
9306
9307 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
9308 argument.
9309 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
9310 uses.
9311
9312 2012-06-29 Eli Zaretskii <eliz@gnu.org>
9313
9314 * xdisp.c (try_window_id): Undo last change.
9315
9316 * w32.c (getwd): Adjust commentary about startup_dir.
9317 (init_environment): Always call sys_access, even in non-MSVC
9318 builds. Don't chdir to the directory of the Emacs executable.
9319 This undoes code from 1997 which was justified by the need to
9320 "avoid conflicts when removing and renaming directories". But its
9321 downside was that every relative file name was being interpreted
9322 relative to the directory of the Emacs executable, which can never
9323 be TRT. In particular, it broke sys_access when called with
9324 relative file names.
9325 (sys_access): Map GetLastError to errno.
9326
9327 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9328
9329 * window.h (struct window): Change type of 'fringes_outside_margins'
9330 to bitfield. Fix comment. Adjust users accordingly.
9331 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
9332 Adjust comment.
9333 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
9334 to ptrdiff_t.
9335
9336 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
9337
9338 * gnutls.c (emacs_gnutls_handshake):
9339 Add QUIT to make the loop interruptible.
9340
9341 2012-06-29 Glenn Morris <rgm@gnu.org>
9342
9343 * charset.c (init_charset): Make lack of etc/charsets fatal.
9344
9345 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9346
9347 * editfns.c (region_limit): Fix type mismatch.
9348
9349 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
9350
9351 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
9352 undefined. Convert from xassert to eassert.
9353 * nsmenu.m: Convert from xassert to eassert.
9354 * nsterm.m: Likewise.
9355
9356 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
9357
9358 * editfns.c (region_limit): Clip to narrowing (bug#11770).
9359
9360 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 Avoid integer overflow on scroll-left and scroll-right.
9363 * window.c (HSCROLL_MAX): New macro.
9364 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
9365 overflow when requested scroll falls outside ptrdiff_t range.
9366
9367 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9368
9369 * window.h (struct window): Change type of 'hscroll',
9370 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
9371 'last_modified' and 'last_overlay_modified' to EMACS_INT.
9372 Adjust users accordingly.
9373 * xdisp.c (try_cursor_movement): Replace type check with eassert.
9374 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
9375 from EMACS_INT to ptrdiff_t.
9376 (make_window): Omit redundant initialization.
9377
9378 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
9379
9380 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
9381
9382 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9383
9384 * window.h (struct window): Change type of 'use_time' and
9385 'sequence_number' from Lisp_Object to int.
9386 * frame.c (make_frame): Adjust users accordingly.
9387 * print.c (print_object): Likewise.
9388 * window.c (select_window, Fwindow_use_time, make_parent_window)
9389 (make_window): Likewise.
9390
9391 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9392
9393 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
9394 enabled with --enable-checking=[all,glyphs] configure option.
9395 Fix GLYPH_DEBUG usage assuming that it may be undefined,
9396 adjust comments accordingly.
9397 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
9398 undefined, adjust comments accordingly.
9399 * image.c: Likewise.
9400 * scroll.c: Likewise.
9401 * w32fns.c: Likewise.
9402 * w32term.c: Likewise.
9403 * xdisp.c: Likewise.
9404 * xfaces.c: Likewise.
9405 * xfns.c: Likewise.
9406 * xterm.c: Likewise.
9407
9408 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9409
9410 Generalize run-time debugging checks.
9411 * dispextern.h (XASSERTS): Remove.
9412 * fontset.c (xassert): Remove.
9413 Convert from xassert to eassert.
9414 * alloc.c: Convert from xassert to eassert.
9415 * bidi.c: Likewise.
9416 * dispnew.c: Likewise.
9417 * fns.c: Likewise.
9418 * fringe.c: Likewise.
9419 * ftfont.c: Likewise.
9420 * gtkutil.c: Likewise.
9421 * image.c: Likewise.
9422 * keyboard.c: Likewise.
9423 * menu.c: Likewise.
9424 * process.c: Likewise.
9425 * scroll.c: Likewise.
9426 * sound.c: Likewise.
9427 * term.c: Likewise.
9428 * w32console.c: Likewise.
9429 * w32fns.c: Likewise.
9430 * w32term.c: Likewise.
9431 * window.c: Likewise.
9432 * xdisp.c: Likewise.
9433 * xfaces.c: Likewise.
9434 * xfns.c: Likewise.
9435 * xselect.c: Likewise.
9436 * xterm.c: Likewise.
9437
9438 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
9439
9440 * fns.c (maybe_resize_hash_table): Output message when growing the
9441 purify-hashtable.
9442
9443 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9444
9445 * alloc.c (allocate_string_data): Remove dead code.
9446 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
9447 avoid GCC warning about unused macro.
9448
9449 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9450
9451 * alloc.c (allocate_string): Omit intervals initialization.
9452 * alloc.c (make_uninit_multibyte_string): Initialize intervals
9453 as in make_pure_string and make_pure_c_string.
9454
9455 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9456
9457 * alloc.c (allocate_string): Fix last change.
9458
9459 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
9460
9461 * alloc.c (allocate_string): Remove two redundant calls
9462 to memset, add explicit initialization where appropriate.
9463
9464 2012-06-27 Glenn Morris <rgm@gnu.org>
9465
9466 * lisp.mk (lisp): Remove paths.elc.
9467
9468 2012-06-27 Chong Yidong <cyd@gnu.org>
9469
9470 * doc.c (Fsubstitute_command_keys): Fix punctuation.
9471
9472 2012-06-26 John Wiegley <johnw@newartisans.com>
9473
9474 * unexmacosx.c (copy_data_segment): Add two section names used
9475 on Mac OS X Lion: __mod_init_func and __mod_term_func.
9476
9477 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
9478 when building with Clang.
9479
9480 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
9481
9482 * eval.c (Fapply): Allow calling it with a single argument.
9483
9484 2012-06-26 Eli Zaretskii <eliz@gnu.org>
9485
9486 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
9487 _stricmp and _strnicmp.
9488 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
9489
9490 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9491
9492 * alloc.c (allocate_window): Zero out non-Lisp part of newly
9493 allocated window.
9494 (allocate_process): Likewise for new process.
9495 (allocate_terminal): Change to use offsetof.
9496 (allocate_frame): Likewise.
9497 * frame.c (make_frame): Omit redundant initialization.
9498 * window.c (make_parent_window): Use memset.
9499 (make_window): Omit redundant initialization.
9500 * process.c (make_process): Omit redundant initialization.
9501 * terminal.c (create_terminal): Likewise.
9502
9503 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9504
9505 * term.c (delete_tty): Remove redundant call to memset.
9506
9507 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
9508
9509 * alloc.c: Remove build_string.
9510 * lisp.h: Define build_string as static inline. This provides
9511 a better opportunity to optimize away calls to strlen when the
9512 function is called with compile-time constant argument.
9513 * image.c (imagemagick_error): Convert to build_string.
9514 * w32proc.c (sys_spawnve): Likewise.
9515 * xterm.c (x_term_init): Likewise.
9516
9517 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
9518
9519 Use sprintf return value instead of invoking strlen on result.
9520 In the old days this wasn't portable, since some sprintf
9521 implementations returned char *. But they died out years ago and
9522 Emacs already assumes sprintf returns int.
9523 Similarly for float_to_string.
9524 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
9525 * ccl.c (ccl_driver):
9526 * character.c (string_escape_byte8):
9527 * data.c (Fnumber_to_string):
9528 * doprnt.c (doprnt):
9529 * print.c (print_object):
9530 * xdisp.c (message_dolog):
9531 * xfns.c (syms_of_xfns):
9532 Use sprintf or float_to_string result to avoid need to call strlen.
9533 * data.c (Fnumber_to_string):
9534 Use make_unibyte_string, since the string must be ASCII.
9535 * lisp.h, print.c (float_to_string): Now returns int length.
9536 * term.c (produce_glyphless_glyph):
9537 Use sprintf result rather than recomputing it.
9538
9539 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
9540 * Makefile.in (ALL_CFLAGS):
9541 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
9542 * gmalloc.c, regex.c: Include <config.h> unconditionally.
9543
9544 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9545
9546 * dispextern.h (xstrcasecmp): Define to library function
9547 strcasecmp if available.
9548 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
9549
9550 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
9551
9552 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
9553 Avoid comma operator.
9554 * menu.c (push_submenu_start, push_submenu_end)
9555 (push_left_right_boundary, push_menu_pane): Likewise.
9556 * msdos.c (dos_rawgetc): Likewise.
9557
9558 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 * xfns.c (xic_create_fontsetname): Remove redundant calls
9561 to memset.
9562
9563 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 * gtkutil.c (get_utf8_string): Remove redundant assignment.
9566 sprintf already null-terminates its output.
9567
9568 * xfns.c (x_window): Remove redundant cast.
9569
9570 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
9571
9572 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
9573 `const char *' to `char *' to avoid compiler warning.
9574
9575 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
9578 instead of truncating it to 63 (admittedly a generous limit).
9579
9580 * process.c: Fix spelling and caps in comments.
9581
9582 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
9583
9584 * emacs.c (setpgrp): Remove definition, unused.
9585 * sysdep.c (setpgrp): Remove definition, not used in this file.
9586
9587 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
9588
9589 * makefile.w32-in: Update dependencies.
9590
9591 2012-06-24 Eli Zaretskii <eliz@gnu.org>
9592
9593 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
9594 (SYSTIME_H): Add nt/inc/sys/time.h.
9595
9596 * systime.h [WINDOWSNT]: Include sys/time.h.
9597
9598 * s/ms-w32.h (struct timespec): Definition moved from
9599 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
9600
9601 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9602
9603 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
9604 * buffer.h (buffer_slot_type_mismatch):
9605 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9606 * eval.c (unwind_to_catch):
9607 * image.c (my_png_error, my_error_exit):
9608 * keyboard.c (quit_throw_to_read_char, user_error)
9609 (Fexit_recursive_edit, Fabort_recursive_edit):
9610 * lisp.h (die, args_out_of_range, args_out_of_range_3)
9611 (wrong_type_argument, buffer_overflow, __executable_start)
9612 (memory_full, buffer_memory_full, string_overflow, Fthrow)
9613 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
9614 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
9615 (fatal):
9616 (child_setup) [!DOS_NT]:
9617 * lread.c (end_of_file_error, invalid_syntax):
9618 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9619 * puresize.h (pure_write_error):
9620 * search.c (matcher_overflow):
9621 * sound.c (sound_perror, alsa_sound_perror):
9622 * sysdep.c, syssignal.h (croak):
9623 * term.c (maybe_fatal, vfatal):
9624 * textprop.c (text_read_only):
9625 * undo.c (user_error):
9626 * unexmacosx.c (unexec_error):
9627 * xterm.c (x_ins_del_lines, x_delete_glyphs):
9628 Use _Noreturn rather than NO_RETURN.
9629 No need for separate decl merely because of _Noreturn.
9630 * sound.c (sound_warning, parse_sound):
9631 Remove unnecessary forward decls.
9632
9633 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9634
9635 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9636 * lisp.h (WAIT_READING_MAX): New macro.
9637 * dispnew.c (Fsleep_for, sit_for):
9638 * keyboard.c (kbd_buffer_get_event):
9639 * process.c (Faccept_process_output):
9640 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9641 This improves on the previous patch, which introduced a bug
9642 when time_t is unsigned and as wide as intmax_t.
9643 See <http://bugs.gnu.org/9000#51>.
9644
9645 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9646
9647 * dispnew.c (sit_for, Fsleep_for):
9648 * keyboard.c (kbd_buffer_get_event):
9649 * process.c (Faccept_process_output): Avoid compiler warnings when
9650 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
9651
9652 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
9653
9654 * makefile.w32-in: Update dependencies.
9655
9656 * w32.c (ltime): Add return type and declare static.
9657 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
9658
9659 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9660
9661 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9662 Privately reported by Herbert J. Skuhra.
9663 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
9664 All uses changed.
9665 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
9666 not make_lisp_timeval, when the argument is of type EMACS_TIME.
9667
9668 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9669
9670 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
9671 last argument of make_unibyte_string.
9672
9673 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
9674 language ID in the event parameters.
9675
9676 * w32term.c (w32_read_socket): Put the new keyboard codepage into
9677 event.code, not the obscure "character set ID".
9678
9679 2012-06-23 Chong Yidong <cyd@gnu.org>
9680
9681 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
9682
9683 2012-06-23 Eli Zaretskii <eliz@gnu.org>
9684
9685 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
9686 * w32.c (fdutimens): New function.
9687
9688 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
9689
9690 * s/ms-w32.h (pselect): Redirect to sys_select.
9691
9692 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
9693
9694 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
9695 in the logic of incrementing and decrementing the value of
9696 use_relocatable_buffers.
9697
9698 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
9701 Privately reported by Herbert J. Skuhra.
9702 [__FreeBSD__]: Remove "*/" typo after "#include".
9703 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
9704 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
9705 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
9706 Don't assume EMACS_TIME and struct timeval are the same type.
9707
9708 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
9709
9710 Support higher-resolution time stamps (Bug#9000).
9711 The time stamps are only nanosecond-resolution at the C level,
9712 since that's the best that any real-world system supports now.
9713 But they are picosecond-resolution at the Lisp level, as that's
9714 easy, and leaves room for future OS improvements.
9715
9716 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
9717 (LIBES): Use it.
9718
9719 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
9720 Don't get current time unless it's needed.
9721
9722 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
9723 now provides it if it's absent.
9724 (start_atimer): Port to higher-res time stamps.
9725 Check for time stamp overflow. Don't get current time more
9726 often than is needed.
9727
9728 * buffer.h (struct buffer): Buffer modtime now has high resolution.
9729 Include systime.h, not time.h.
9730 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
9731
9732 * dired.c: Include stat-time.h.
9733 (Ffile-attributes): File times now have higher resolution.
9734
9735 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
9736 (struct image): Timestamp now has higher resolution.
9737
9738 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
9739 has at least microseconds now. All uses removed.
9740 (update_frame, update_single_window, update_window, update_frame_1)
9741 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
9742 (duration_to_sec_usec): Remove; no longer needed.
9743
9744 * editfns.c (time_overflow): Now extern.
9745 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
9746 (float-time, Fformat_time_string, Fcurrent_time_string)
9747 (Fcurrent_time_zone): Accept and generate higher-resolution
9748 time stamps.
9749 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
9750 (decode_time_components, lisp_seconds_argument): New functions.
9751 (make_time): Now static.
9752 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
9753 Report an error if the time is invalid, rather than having the caller
9754 do that.
9755
9756 * fileio.c: Include <stat-time.h>
9757 (Fcopy_file): Copy higher-resolution time stamps.
9758 Prefer to set the time stamp via a file descriptor if that works.
9759 (Fset_file_times, Finsert_file_contents, Fwrite_region)
9760 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
9761 (Fvisited_file_modtime, Fset_visited_file_modtime):
9762 Support higher-resolution time stamps.
9763
9764 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
9765
9766 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
9767
9768 * image.c (prepare_image_for_display, clear_image_cache)
9769 (lookup_image): Port to higer-resolution time stamps.
9770
9771 * keyboard.c (start_polling, bind_polling_period):
9772 Check for time stamp overflow.
9773 (read_char, kbd_buffer_get_event, timer_start_idle)
9774 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
9775 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
9776 Port to higher-resolution time stamps. Do not assume time_t is signed.
9777 (decode_timer): New function. Timers are now vectors of length 9,
9778 not 8, to accommodate the picosecond component.
9779 (timer_check_2): Use it.
9780
9781 * nsterm.m (select_timeout, timeval_subtract): Remove.
9782 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
9783 as they're a bit more accurate and handle overflow better.
9784 (ns_select): Change prototype to be compatible with pselect.
9785 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
9786 * nsterm.h (ns_select): Adjust prototype.
9787
9788 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
9789 us-resolution time stamps.
9790 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9791
9792 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9793
9794 * lisp.h (time_overflow): New decl.
9795 (wait_reading_process_output): First arg is now intmax_t, not int,
9796 to accommodate larger waits.
9797
9798 * process.h (struct Lisp_Process.read_output_delay):
9799 Now counts nanoseconds, not microseconds.
9800 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9801 EMACS_HAS_USECS.
9802 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9803 (wait_reading_process_output):
9804 Port to ns-resolution time stamps.
9805 (Faccept_process_output, wait_reading_process_output):
9806 Check for time stamp overflow. Do not assume time_t is signed.
9807 (select_wrapper): Remove; we now use pselect.
9808 (Fprocess_attributes): Now generates ns-resolution time stamps.
9809
9810 * sysdep.c: Include utimens.h. Don't include utime.h
9811 or worry about struct utimbuf; gnulib does that for us now.
9812 (gettimeofday): Remove; gnulib provides a substitute.
9813 (make_timeval): New function.
9814 (set_file_times): Now sets ns-resolution time stamps.
9815 New arg FD; all uses changed.
9816 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9817 (system_process_attributes):
9818 Now returns ns-resolution time stamp. All uses changed.
9819 Check for time stamp overflow.
9820
9821 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9822 provides a substitute now.
9823
9824 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9825 since it guarantees struct timespec.
9826 (EMACS_TIME): Now struct timespec, so that we can support
9827 ns-resolution time stamps.
9828 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9829 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9830 (EMACS_USECS): Remove.
9831 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9832 so multiply the arg by 1000 before storing it.
9833 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9834 New macros.
9835 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9836 Port to ns-resolution time stamps.
9837 (EMACS_TIME_NEG_P): Remove; replaced by....
9838 (EMACS_TIME_SIGN): New macro.
9839 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9840 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9841 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9842 (make_timeval, make_lisp_time, decode_time_components): New decls.
9843 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9844 that it mishandled time_t overflow. You can't compare by subtracting!
9845 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9846 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9847
9848 * term.c: Include <sys/time.h>.
9849 (timeval_to_Time): New function, for proper overflow wraparound.
9850 (term_mouse_position, term_mouse_click): Use it.
9851
9852 * undo.c (record_first_change): Support higher-resolution time stamps
9853 in the undo buffer.
9854 (Fprimitive_undo): Use them when restoring time stamps.
9855
9856 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9857 (w32_get_internal_run_time):
9858 Port to higher-resolution Emacs time stamps.
9859 (ltime): Now accepts single 64-bit integer, as that's more convenient
9860 for callers.
9861
9862 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9863
9864 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9865 for compatibility with pselect. Support ns-resolution time stamps.
9866
9867 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9868
9869 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9870 Check for time stamp overflow, and support ns-resolution time stamps.
9871
9872 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9873 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9874 (timeval_subtract): Remove; no longer needed.
9875 (XTflash, XTring_bell, x_wait_for_event):
9876 Port to ns-resolution time stamps. Don't assume time_t is signed.
9877
9878 2012-06-22 Chong Yidong <cyd@gnu.org>
9879
9880 * xdisp.c (x_consider_frame_title): Revert last change.
9881
9882 2012-06-22 Eli Zaretskii <eliz@gnu.org>
9883
9884 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9885 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9886 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9887 staticidx goes up to 1597 out of 1600 = 0x640.)
9888
9889 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9892 Otherwise, the umask might be mistakenly 0 while handling input signals.
9893
9894 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9895
9896 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9897
9898 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9899
9900 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9901 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9902 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9903 access to `contents' member of Lisp_Vector objects with AREF and ASET
9904 where appropriate.
9905
9906 2012-06-19 Chong Yidong <cyd@gnu.org>
9907
9908 * frame.c (delete_frame): When selecting a frame on a different
9909 text terminal, do not alter the terminal's top-frame.
9910
9911 * xdisp.c (format_mode_line_unwind_data): Record the target
9912 frame's selected window and its terminal's top-frame.
9913 (unwind_format_mode_line): Restore them.
9914 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9915 Callers changed.
9916 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9917 since tty frames can be explicitly named.
9918 (prepare_menu_bars): Likewise.
9919
9920 * term.c (Ftty_top_frame): New function.
9921
9922 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 Port byte-code-meter to modern targets.
9925 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9926 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
9927 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
9928 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9929 (METER_1, METER_2): Simplify.
9930
9931 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9932
9933 * data.c (Fdefalias): Return `symbol' (bug#11686).
9934
9935 2012-06-18 Martin Rudalics <rudalics@gmx.at>
9936
9937 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
9938 gets killed during executing of this function (Bug#11665).
9939 Try to always return Qt when the buffer has been actually killed.
9940 (Vkill_buffer_query_functions): In doc-string say that functions
9941 run by this hook should not change the current buffer.
9942
9943 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9944
9945 Fix recently-introduced process.c problems found by static checking.
9946 * process.c (write_queue_push, write_queue_pop, send_process):
9947 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9948 (write_queue_pop): Fix pointer signedness problem.
9949 (send_process): Remove unused local.
9950
9951 2012-06-17 Chong Yidong <cyd@gnu.org>
9952
9953 * xdisp.c (redisplay_internal): No need to redisplay terminal
9954 frames that are not on top.
9955
9956 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
9957
9958 * process.c (make_process): Initialize write_queue.
9959 (write_queue_push, write_queue_pop): New functions.
9960 (send_process): Use them to maintain correct ordering of process
9961 writes (Bug#10815).
9962
9963 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9964
9965 * lisp.h (eassert): Assume C89 or later.
9966 This removes the need for CHECK.
9967 (CHECK): Remove. Its comments about always evaluating its
9968 argument were confusing, as 'eassert' typically does not evaluate
9969 its argument.
9970
9971 * coding.c (produce_chars): Use ptrdiff_t, not int.
9972
9973 * xterm.c (x_draw_underwave): Check for integer overflow.
9974 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9975
9976 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
9977
9978 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9979 referenced (Bug#11583).
9980
9981 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9982
9983 Implement wave-style variant of underlining.
9984 * dispextern.h (face_underline_type): New enum.
9985 (face): Add field for underline type.
9986 * nsterm.m (ns_draw_underwave): New function.
9987 (ns_draw_text_decoration): Use it.
9988 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9989 New functions.
9990 (x_draw_glyph_string): Use them.
9991 * xfaces.c (Qline, Qwave): New Lisp objects.
9992 (check_lface_attrs, merge_face_ref)
9993 (Finternal_set_lisp_face_attribute, realize_x_face):
9994 Handle wave-style underline face attributes.
9995 * xterm.c (x_draw_underwave): New function.
9996 (x_draw_glyph_string): Use it.
9997
9998 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
9999
10000 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10001 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10002 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10003 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10004 ($(BLD)/w32select.$(O)): Update dependencies.
10005
10006 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10007
10008 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10009 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10010 * character.c (_fetch_multibyte_char_p): Remove.
10011 * alloc.c: Include "character.h" before "buffer.h".
10012 * bidi.c: Likewise.
10013 * buffer.c: Likewise.
10014 * bytecode.c: Likewise.
10015 * callint.c: Likewise.
10016 * callproc.c: Likewise.
10017 * casefiddle.c: Likewise.
10018 * casetab.c: Likewise.
10019 * category.c: Likewise.
10020 * cmds.c: Likewise.
10021 * coding.c: Likewise.
10022 * composite.c: Likewise.
10023 * dired.c: Likewise.
10024 * dispnew.c: Likewise.
10025 * doc.c: Likewise.
10026 * dosfns.c: Likewise.
10027 * editfns.c: Likewise.
10028 * emacs.c: Likewise.
10029 * fileio.c: Likewise.
10030 * filelock.c: Likewise.
10031 * font.c: Likewise.
10032 * fontset.c: Likewise.
10033 * fringe.c: Likewise.
10034 * indent.c: Likewise.
10035 * insdel.c: Likewise.
10036 * intervals.c: Likewise.
10037 * keyboard.c: Likewise.
10038 * keymap.c: Likewise.
10039 * lread.c: Likewise.
10040 * macros.c: Likewise.
10041 * marker.c: Likewise.
10042 * minibuf.c: Likewise.
10043 * nsfns.m: Likewise.
10044 * nsmenu.m: Likewise.
10045 * print.c: Likewise.
10046 * process.c: Likewise.
10047 * regex.c: Likewise.
10048 * region-cache.c: Likewise.
10049 * search.c: Likewise.
10050 * syntax.c: Likewise.
10051 * term.c: Likewise.
10052 * textprop.c: Likewise.
10053 * undo.c: Likewise.
10054 * unexsol.c: Likewise.
10055 * w16select.c: Likewise.
10056 * w32fns.c: Likewise.
10057 * w32menu.c: Likewise.
10058 * window.c: Likewise.
10059 * xdisp.c: Likewise.
10060 * xfns.c: Likewise.
10061 * xmenu.c: Likewise.
10062 * xml.c: Likewise.
10063 * xselect.c: Likewise.
10064
10065 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10066
10067 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10068 If all the glyphs of the glyph row came from strings, and we have no
10069 cursor positioning clues, put the cursor on the first glyph of the
10070 row.
10071 (handle_face_prop): Use chunk-relative overlay string index when
10072 indexing into it->string_overlays array. (Bug#11653)
10073 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10074 the rightmost. (Bug#11720)
10075
10076 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10077
10078 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10079 (CATEGORY_MEMBER): Enforce 1/0 value.
10080 * category.c (_temp_category_set): Remove.
10081
10082 2012-06-16 Eli Zaretskii <eliz@gnu.org>
10083
10084 * window.c (Fdelete_other_windows_internal)
10085 (Fdelete_window_internal): Don't access frame's mouse highlight
10086 info of the initial frame. (Bug#11677)
10087
10088 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10089
10090 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10091 Assume USE_2_TAGS_FOR_INTS.
10092 (xreload): Adjust $tagmask width to match recent lisp.h change.
10093
10094 Simplify lisp.h in minor ways that should not affect code.
10095 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10096 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10097 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10098 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10099 (INTTYPEBITS): New macro, for clarity.
10100 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
10101 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10102 Simplify now that USE_LSB_TAG is always defined.
10103 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10104 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10105
10106 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
10107
10108 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10109
10110 2012-06-13 Glenn Morris <rgm@gnu.org>
10111
10112 * s/bsd-common.h (BSD4_3):
10113 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10114
10115 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10116
10117 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10118 instead of union.
10119 (XLI, XIL): Define.
10120 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10121 Use them.
10122 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
10123 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
10124 * alloc.c (widen_to_Lisp_Object): Remove.
10125 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10126 * frame.c (delete_frame): Remove outdated comment.
10127 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10128 USE_LISP_UNION_TYPE.
10129 (Fw32_unregister_hot_key): Likewise.
10130 (Fw32_toggle_lock_key): Likewise.
10131 * w32menu.c (add_menu_item): Likewise.
10132 (w32_menu_display_help): Use XIL instead of checking
10133 USE_LISP_UNION_TYPE.
10134 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10135 (init_heap): Likewise.
10136 * w32term.c (w32_read_socket): Update comment.
10137
10138 2012-06-13 Glenn Morris <rgm@gnu.org>
10139
10140 * s/usg5-4-common.h, src/s/unixware.h:
10141 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10142
10143 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10144
10145 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10146
10147 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10148 * alloc.c (make_number) [!defined make_number]:
10149 Remove, as lisp.h always defines this now.
10150 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10151 (roundup_size): Verify that it is a power of 2.
10152 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10153 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10154 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10155 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10156 USE_LSB_TAG now is always defined to be either 0 or 1.
10157 All uses changed.
10158 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10159 code works fine either way, and efficiency is not a concern here,
10160 as the union type is for debugging, not for production.
10161 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10162 Use an inline function on all platforms when using the union type,
10163 since this is simpler and 'static inline' can be used portably
10164 within Emacs now.
10165 (LISP_INITIALLY_ZERO): New macro.
10166 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10167 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10168
10169 2012-06-12 Glenn Morris <rgm@gnu.org>
10170
10171 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10172
10173 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
10174
10175 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10176 Move BROKEN_SIGIO to configure.
10177
10178 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10179 Move NO_TERMIO to configure.
10180
10181 2012-06-12 Chong Yidong <cyd@gnu.org>
10182
10183 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10184 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10185 MagickExportImagePixels is undefined.
10186
10187 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10188
10189 * image.c (imagemagick_load_image): Remove unused label.
10190
10191 2012-06-11 Glenn Morris <rgm@gnu.org>
10192
10193 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10194 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10195 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10196 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10197
10198 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10199
10200 * alloc.c (make_byte_code): New function.
10201 (Fmake_byte_code): Use it. Don't purify here.
10202 * lread.c (read1): Use it as well to avoid extra allocation.
10203
10204 2012-06-11 Chong Yidong <cyd@gnu.org>
10205
10206 * image.c (imagemagick_load_image): Implement transparency.
10207
10208 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10209
10210 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10211 account for preceding backslashes. (Bug#11663)
10212
10213 2012-06-09 Chong Yidong <cyd@gnu.org>
10214
10215 * term.c: Support italics in capable terminals (Bug#9652).
10216 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10217 (turn_on_face): Output using TS_enter_italic_mode if available.
10218 Don't handle unused blinking and alt-charset cases.
10219 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10220 and tty_alt_charset_p cases.
10221 (tty_capable_p, init_tty): Support italics.
10222
10223 * termchar.h (struct tty_display_info): Add field for italics.
10224 Remove unused blink field.
10225
10226 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10227 Handle slant.
10228
10229 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10230 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10231 tty_alt_charset_p. Add tty_italic_p.
10232
10233 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
10234
10235 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10236 dbus_type_is_basic if available.
10237 (xd_extract_signed, xd_extract_unsigned): Rename from
10238 extract_signed and extract_unsigned, respectively. Adapt callers.
10239
10240 2012-06-09 Chong Yidong <cyd@gnu.org>
10241
10242 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10243
10244 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
10245 case (Bug#9752).
10246
10247 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
10248
10249 * xdisp.c (vmessage): Treat frame message as multibyte.
10250 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
10251 would generate the diagnostic "Making \302\247 buffer-local while
10252 let-bound!".
10253
10254 2012-06-08 Eli Zaretskii <eliz@gnu.org>
10255
10256 * dispnew.c (showing_window_margins_p): Undo last change, which
10257 was done due to an inadvertent commit.
10258 (adjust_frame_glyphs_for_frame_redisplay): Do call
10259 showing_window_margins_p.
10260
10261 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10262
10263 * eval.c (Fmake_var_non_special): New primitive.
10264 (syms_of_eval): Defsubr it.
10265 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
10266
10267 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
10268
10269 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10270 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10271
10272 2012-06-08 Eli Zaretskii <eliz@gnu.org>
10273
10274 * alloc.c (allocate_vectorlike): Fix last change.
10275
10276 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10277
10278 Block-based vector allocation of small vectors.
10279 * lisp.h (struct vectorlike_header): New field `nbytes',
10280 adjust comment accordingly.
10281 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
10282 to denote vector blocks. Adjust users (live_vector_p,
10283 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10284 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10285 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10286 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10287 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10288 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10289 (roundup_size): New constant.
10290 (struct vector_block): New data type.
10291 (vector_blocks, vector_free_lists, zero_vector): New variables.
10292 (all_vectors): Rename to `large_vectors'.
10293 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10294 (sweep_vectors): New functions.
10295 (allocate_vectorlike): Return `zero_vector' as the only vector of
10296 0 items. Allocate new vector from block if vector size is less than
10297 or equal to VBLOCK_BYTES_MAX.
10298 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
10299 (init_alloc_once): Add call to init_vectors.
10300
10301 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10302
10303 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
10304
10305 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
10306
10307 * doprnt.c (doprnt): Truncate multibyte char correctly.
10308 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
10309 would mishandle a string argument "Xc" if X was a multibyte
10310 character of length 2: it would truncate after X's first byte
10311 rather than including all of X.
10312
10313 2012-06-06 Chong Yidong <cyd@gnu.org>
10314
10315 * buffer.c (word_wrap): Doc fix.
10316
10317 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
10318
10319 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
10320
10321 2012-06-03 Glenn Morris <rgm@gnu.org>
10322
10323 * xdisp.c (tool-bar-style): Doc fix.
10324
10325 2012-06-03 Ulrich Müller <ulm@gentoo.org>
10326
10327 * Makefile.in (PAXCTL): Define.
10328 (temacs$(EXEEXT)): Disable memory randomization for the temacs
10329 binary via PaX flags if the paxctl utility is available.
10330 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
10331 Restore PaX flags to their default. (Bug#11398)
10332
10333 2012-06-03 Chong Yidong <cyd@gnu.org>
10334
10335 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
10336 buffer (Bug#11226).
10337
10338 2012-06-03 Chong Yidong <cyd@gnu.org>
10339
10340 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
10341 (note_mode_line_or_margin_highlight): If there is no help echo,
10342 use mode-line-default-help-echo. Handle the case where the mouse
10343 position is past the end of the mode line string.
10344
10345 * buffer.c (buffer_local_value_1): New function, split from
10346 Fbuffer_local_value; can return Qunbound.
10347 (Fbuffer_local_value): Use it.
10348 (Vmode_line_format): Docstring tweaks.
10349
10350 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10351
10352 * sysdep.c (system_process_attributes): Improve comment.
10353
10354 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
10355
10356 * keyboard.c: Export real-this-command to Elisp.
10357 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
10358 and DEFVAR it. Update all users.
10359
10360 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
10361
10362 * minibuf.c (Fassoc_string): Remove duplicate declaration.
10363
10364 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
10365 Convert pctcpu and pctmem to Lisp float properly.
10366 Let the compiler fold better, as 100.0/0x8000 is exact.
10367
10368 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
10369
10370 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
10371 cons_block.
10372
10373 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
10374
10375 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
10376
10377 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
10378
10379 For a 'struct window', replace some Lisp_Object fields to
10380 bitfields where appropriate, remove unused fields.
10381 * window.h (struct window): Remove unused 'last_mark_x' and
10382 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
10383 change its type from Lisp_Object to bitfield.
10384 Change type of 'force_start', 'optional_new_start',
10385 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
10386 fields from Lisp_Object to bitfield. Adjust users accordingly.
10387
10388 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10389
10390 Pacify gcc -Wdouble-precision when using Xaw.
10391 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
10392 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
10393 Use 'float' consistently, rather than 'float' in most places
10394 and 'double' in a couple of places.
10395
10396 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10397
10398 * xdisp.c (handle_stop): Detect whether we have overlay strings
10399 loaded by testing it->current.overlay_string_index to be
10400 non-negative, instead of checking whether n_overlay_strings is
10401 positive. (Bug#11587)
10402
10403 2012-05-31 Chong Yidong <cyd@gnu.org>
10404
10405 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
10406
10407 * doc.c (Fsubstitute_command_keys): Doc fix.
10408
10409 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10410
10411 * search.c (search_buffer): Remove calls to
10412 r_alloc_inhibit_buffer_relocation, as it is now called by
10413 maybe_unify_char, which was the cause of relocation of buffer text
10414 in bug#11519.
10415
10416 2012-05-31 Eli Zaretskii <eliz@gnu.org>
10417
10418 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
10419 for the duration of call to load_charset, to avoid problems with
10420 callers of maybe_unify_char that access buffer text through C
10421 pointers.
10422
10423 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
10424 decrement the inhibition flag, instead of just setting or
10425 resetting it.
10426
10427 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
10428
10429 Remove obsolete '#define static' cruft.
10430 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
10431 This #undef was "temporary" in 2000; it is no longer needed
10432 now that '#define static' has gone away.
10433 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
10434 (gray_bitmap_bits): Remove; no longer needed.
10435 All uses replaced with definiens.
10436 * xterm.c: Include "bitmaps/gray.xbm".
10437
10438 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10439
10440 Clean up __executable_start, monstartup when --enable-profiling.
10441 The following changes affect the code only when profiling.
10442 * dispnew.c (__executable_start): Rename from safe_bcopy.
10443 Define only on platforms that need it.
10444 * emacs.c: Include <sys/gmon.h> when profiling.
10445 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
10446 (__executable_start): Remove decl, since lisp.h does it now.
10447 (safe_bcopy): Remove decl; no longer has that name.
10448 (main): Coalesce #if into single bit of code, for simplicity.
10449 Cast pointers to uintptr_t, since standard libraries want integers
10450 and not pointers.
10451 * lisp.h (__executable_start): New decl.
10452
10453 2012-05-31 Glenn Morris <rgm@gnu.org>
10454
10455 * image.c (Fimagemagick_types): Doc fix.
10456
10457 2012-05-30 Jim Meyering <meyering@redhat.com>
10458
10459 * callproc.c (Fcall_process_region): Include directory component
10460 in mkstemp error message (Bug#11586).
10461
10462 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
10463
10464 * alloc.c, lisp.h (make_pure_vector): Now static.
10465
10466 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
10467
10468 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
10469 Move to byte-run.el.
10470 (Fautoload): Do the hash-doc more carefully.
10471 * data.c (Fdefalias): Purify definition, except for keymaps.
10472 (Qdefun): Move from eval.c.
10473 * lisp.h (Qdefun): Remove.
10474 * lread.c (read1): Tiny simplification.
10475
10476 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
10477
10478 Do not create empty overlays with the evaporate property (Bug#9642).
10479 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
10480 Bug#9642, but explicitly check that the buffer the overlay would
10481 be moved to is live and rearrange lines to make sure that errors
10482 will not put the overlay in an inconsistent state.
10483 (Fdelete_overlay): Cosmetics.
10484
10485 2012-05-28 Eli Zaretskii <eliz@gnu.org>
10486
10487 * w32term.c (my_bring_window_to_top): New function.
10488 (x_raise_frame): Use handle returned by DeferWindowPos, which
10489 could be different from the original one.
10490 Call my_bring_window_to_top instead of my_set_foreground_window.
10491 (Bug#11513)
10492
10493 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
10494 by calling BringWindowToTop.
10495
10496 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
10497 (WM_EMACS_END): Increase by one.
10498
10499 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
10500
10501 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
10502 This avoids undefined behavior that might cause the eassert
10503 to not catch an out-of-range value.
10504
10505 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
10506
10507 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
10508 Update dependencies.
10509
10510 2012-05-27 Eli Zaretskii <eliz@gnu.org>
10511
10512 * bidi.c (bidi_mirror_char): Fix last change.
10513
10514 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
10515
10516 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
10517 when referring to sectname field in printf format.
10518
10519 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
10520
10521 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
10522 Only r_alloc_inhibit_buffer_relocation needed to be added;
10523 the others were already declared.
10524
10525 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
10526 before checking whether it's out of range. Put the check inside
10527 eassert. See
10528 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
10529
10530 2012-05-27 Ken Brown <kbrown@cornell.edu>
10531
10532 * callproc.c (Fcall_process): Restore a line that was accidentally
10533 commented out in the 2011-02-13 change (bug#11547).
10534
10535 2012-05-27 Eli Zaretskii <eliz@gnu.org>
10536
10537 * lisp.h [REL_ALLOC]: Add prototypes for external functions
10538 defined on ralloc.c.
10539
10540 * buffer.c [REL_ALLOC]: Remove prototypes of
10541 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
10542 they are now on lisp.h.
10543
10544 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
10545
10546 * search.c (search_buffer): Use it to inhibit relocation of buffer
10547 text while re_search_2 is doing its job, because re_search_2 is
10548 passed C pointers to buffer text. (Bug#11519)
10549
10550 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
10551 Update value to 24.
10552
10553 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
10554 state after an additional call to move_it_in_display_line_to, keep
10555 the values of it->max_ascent and it->max_descent found for the
10556 entire line.
10557 (pos_visible_p): Revert the comparison against bottom_y to what it
10558 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
10559 (Bug#11464)
10560
10561 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10562
10563 Fix coding-related core dumps with gcc -ftrapv.
10564 The code was computing A - B, where A and B are pointers, and B is
10565 random garbage. This can lead to core dumps on platforms that
10566 have special pointer registers, and it also leads to core dumps on
10567 x86-64 when compiled with gcc -ftrapv. The fix is to compute
10568 A - B only when B is initialized properly.
10569 * coding.c (coding_set_source, coding_set_destination): Return void.
10570 (coding_change_source, coding_change_destinations): New functions,
10571 with the old behaviors of coding_set_source and coding_set_destination.
10572 All callers that need an offset changed to use these new functions.
10573
10574 2012-05-26 Glenn Morris <rgm@gnu.org>
10575
10576 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
10577
10578 2012-05-26 Eli Zaretskii <eliz@gnu.org>
10579
10580 Extend mouse support on W32 text-mode console.
10581 * xdisp.c (draw_row_with_mouse_face):
10582 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
10583
10584 * w32console.c: Include window.h.
10585 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
10586 New functions.
10587 (initialize_w32_display): Initialize mouse-highlight data.
10588
10589 * w32inevt.c: Include termchar.h and window.h.
10590 (do_mouse_event): Support mouse-autoselect-window. When the mouse
10591 moves, call note_mouse_highlight. If help_echo changed, call
10592 gen_help_event to produce help-echo message in the echo area.
10593 Call clear_mouse_face if mouse_face_hidden is set in the mouse
10594 highlight info.
10595
10596 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10597
10598 * lread.c (read1): Simplify slightly to avoid an overflow warning
10599 with GCC 4.7.0 on x86-64.
10600
10601 2012-05-26 Eli Zaretskii <eliz@gnu.org>
10602
10603 * bidi.c (bidi_mirror_char): Revert last change: an int is
10604 definitely wide enough here.
10605
10606 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 Fix integer width and related bugs (Bug#9874).
10609 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
10610 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
10611 (string_bytes, check_sblock, allocate_string_data):
10612 (compact_small_strings, Fmake_bool_vector, make_string)
10613 (make_unibyte_string, make_multibyte_string)
10614 (make_string_from_bytes, make_specified_string)
10615 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10616 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
10617 (mark_vectorlike):
10618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10619 (allocate_pseudovector):
10620 Use int, not EMACS_INT, where int is wide enough.
10621 (inhibit_garbage_collection, Fgarbage_collect):
10622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10623 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
10624 int might not be wide enough.
10625 (bidi_cache_search, bidi_cache_find, bidi_init_it)
10626 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
10627 (bidi_at_paragraph_end, bidi_find_paragraph_start)
10628 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10629 (bidi_level_of_next_char, bidi_move_to_visually_next):
10630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10631 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10632 (Fkill_buffer, Fset_buffer_major_mode)
10633 (advance_to_char_boundary, Fbuffer_swap_text)
10634 (Fset_buffer_multibyte, overlays_at, overlays_in)
10635 (overlay_touches_p, struct sortvec, record_overlay_string)
10636 (overlay_strings, recenter_overlay_lists)
10637 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10638 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10639 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10640 (Foverlay_recenter, last_overlay_modification_hooks_used)
10641 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10643 (validate_region): Omit unnecessary test for b <= e,
10644 since that's guaranteed by the previous test.
10645 (adjust_overlays_for_delete): Avoid pos + length overflow.
10646 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10647 (report_overlay_modification):
10648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10649 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10650 Omit pointer cast, which isn't needed anyway, and doesn't work
10651 after the EMACS_INT -> ptrdiff_t change.
10652 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
10653 * buffer.h: Adjust decls to match defn changes elsewhere.
10654 (struct buffer_text, struct buffer):
10655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10656 Use EMACS_INT, not int, where int might not be wide enough.
10657 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
10658 not int, to avoid needless 32-bit limit on 64-bit hosts.
10659 (exec_byte_code): Use tighter memory-full test, one that checks
10660 for alloca overflow. Don't compute the address of the object just
10661 before an array, as that's not portable. Use EMACS_INT, not
10662 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
10663 * callint.c (Fcall_interactively):
10664 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10665 * callproc.c (call_process_kill, Fcall_process):
10666 Don't assume pid_t fits into an Emacs fixnum.
10667 (call_process_cleanup, Fcall_process, child_setup):
10668 Don't assume pid_t fits into int.
10669 (call_process_cleanup, Fcall_process, delete_temp_file)
10670 (Fcall_process_region):
10671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10672 (Fcall_process): Simplify handling of volatile integers.
10673 Use int, not EMACS_INT, where int will do.
10674 * casefiddle.c (casify_object, casify_region, operate_on_word)
10675 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
10676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10677 (casify_object): Avoid integer overflow when overallocating buffer.
10678 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
10679 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
10680 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
10681 * category.h (CATEGORYP): Don't assume arg is nonnegative.
10682 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
10683 integers are now checked earlier. All uses replaced with XINT.
10684 (ccl_driver):
10685 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10686 For CCL_MapSingle, check that content and value are in int range.
10687 (ccl_driver, Fregister_code_conversion_map):
10688 Check that Vcode_version_map_vector is a vector.
10689 (resolve_symbol_ccl_program): Check that vector header is in range.
10690 Always copy the vector, so that we can check its contents reliably
10691 now rather than having to recheck each instruction as it's being
10692 executed. Check that vector words fit in 'int'.
10693 (ccl_get_compiled_code, Fregister_ccl_program)
10694 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
10695 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
10696 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
10697 contents are in range.
10698 (Fccl_execute_on_string): Check that status is in range.
10699 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
10700 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
10701 Accept and return EMACS_INT, not int, because callers can pass values
10702 out of 'int' range.
10703 (c_string_width, strwidth, lisp_string_width, chars_in_text)
10704 (multibyte_chars_in_text, parse_str_as_multibyte)
10705 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
10706 (str_as_unibyte, str_to_unibyte, string_count_byte8)
10707 (string_escape_byte8, Fget_byte):
10708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10709 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
10710 avoid mishandling large integers.
10711 * character.h: Adjust decls to match defn changes elsewhere.
10712 * charset.c (load_charset_map_from_file, find_charsets_in_text)
10713 (Ffind_charset_region):
10714 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10715 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
10716 (load_charset_map_from_vector, Fdefine_charset_internal):
10717 Don't assume fixnum fits in int.
10718 (load_charset_map_from_vector, Fmap_charset_chars):
10719 Remove now-unnecessary CHECK_NATNUMs.
10720 (Fdefine_charset_internal): Check ranges here, more carefully.
10721 Don't rely on undefined behavior with signed left shift overflow.
10722 Don't assume unsigned int fits into fixnum, or that fixnum fits
10723 into unsigned int. Don't require max_code to be a valid fixnum;
10724 that's not true for gb10830 4-byte on a 32-bit host. Allow
10725 invalid_code to be a cons, for the same reason. Require code_offset
10726 to be a character. Avoid int overflow if max_char is close
10727 to INT_MAX.
10728 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
10729 this is intended anyway and avoids some undefined behavior.
10730 (load_charset_map): Pass unsigned, not int, as 2nd arg of
10731 INDEX_TO_CODE_POINT, as that's what it expects.
10732 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
10733 * charset.h (DECODE_CHAR): Return int, not unsigned;
10734 this is what was intended anyway, and it avoids undefined behavior.
10735 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
10736 integer-overflow issues.
10737 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
10738 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
10739 where the argument is EMACS_INT, and this behavior is not intended.
10740 * chartab.c (Fmake_char_table, Fset_char_table_range)
10741 (uniprop_get_decoder, uniprop_get_encoder):
10742 Don't assume fixnum fits in int.
10743 * cmds.c (move_point): New function, that does the gist of
10744 Fforward_char and Fbackward_char, but does so while checking
10745 for integer overflow more accurately.
10746 (Fforward_char, Fbackward_char): Use it.
10747 (Fforward_line, Fend_of_line, internal_self_insert)
10748 (internal_self_insert):
10749 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10750 Fix a FIXME, by checking for integer overflow when calculating
10751 target_clm and actual_clm.
10752 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
10753 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
10754 (ASSURE_DESTINATION, coding_alloc_by_realloc)
10755 (coding_alloc_by_making_gap, alloc_destination)
10756 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
10757 (encode_coding_utf_16, detect_coding_emacs_mule)
10758 (decode_coding_emacs_mule, encode_coding_emacs_mule)
10759 (detect_coding_iso_2022, decode_coding_iso_2022)
10760 (encode_invocation_designation, encode_designation_at_bol)
10761 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10762 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
10763 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
10764 (encode_coding_ccl, encode_coding_raw_text)
10765 (detect_coding_charset, decode_coding_charset)
10766 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
10767 (produce_composition, produce_charset, produce_annotation)
10768 (decode_coding, handle_composition_annotation)
10769 (handle_charset_annotation, consume_chars, decode_coding_gap)
10770 (decode_coding_object, encode_coding_object, detect_coding_system)
10771 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
10772 (code_convert_region, code_convert_string)
10773 (Fdefine_coding_system_internal)
10774 (coding_set_source, coding_set_destination):
10775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10776 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
10777 (Fdefine_coding_system_internal):
10778 Don't assume fixnums fit in int.
10779 (decode_coding_gap, decode_coding_object, encode_coding_object)
10780 (Fread_coding_system, Fdetect_coding_region)
10781 (Funencodable_char_position, Fcheck_coding_systems_region)
10782 (get_translation, handle_composition_annotation, consume_chars):
10783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10784 (consume_chars): Rewrite to not calculate an address outside buffer.
10785 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
10786 Don't access memory outside of the args array.
10787 (Fdefine_coding_system_internal): Check for charset-id overflow.
10788 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
10789 result of ENCODE_CHAR.
10790 * coding.h: Adjust decls to match defn changes elsewhere.
10791 (struct coding_system):
10792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10793 * composite.c (get_composition_id, find_composition)
10794 (run_composition_function, update_compositions)
10795 (compose_text, composition_gstring_put_cache)
10796 (composition_gstring_p, composition_gstring_width)
10797 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10798 (composition_compute_stop_pos, composition_reseat_it)
10799 (composition_update_it, struct position_record)
10800 (find_automatic_composition, composition_adjust_point)
10801 (Fcomposition_get_gstring, Ffind_composition_internal):
10802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10803 (update_compositions):
10804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10805 * composite.h: Adjust decls to match defn changes elsewhere.
10806 (struct composition):
10807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10808 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10809 Do not attempt to compute the address of the object just before a
10810 buffer; this is not portable.
10811 (Faref, Faset):
10812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10813 (Faset): Use int, not EMACS_INT, where int is wide enough.
10814 (Fstring_to_number): Don't assume fixnums fit in int.
10815 (Frem): Don't assume arg is nonnegative.
10816 * dbusbind.c (xd_append_arg): Check for integers out of range.
10817 (Fdbus_call_method): Don't overflow the timeout int.
10818 (extract_signed, extract_unsigned): New functions.
10819 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10820 (xd_get_connection_references): Return ptrdiff_t, not int.
10821 All uses changed.
10822 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10823 (xd_read_message_1):
10824 Use int, not unsigned, where the dbus API uses int.
10825 (Fdbus_message_internal): Don't overflow mtype.
10826 (syms_of_dbusbind): Allocate right-sized buffer for integers.
10827 * dired.c (directory_files_internal, file_name_completion, scmp)
10828 (file_name_completion_stat):
10829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10830 (file_name_completion): Don't overflow matchcount.
10831 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10832 * dispextern.h: Adjust decls to match defn changes elsewhere.
10833 (struct text_pos, struct glyph, struct bidi_saved_info)
10834 (struct bidi_string_data, struct bidi_it, struct composition_it)
10835 (struct it):
10836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10837 (struct display_pos, struct composition_it, struct it):
10838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10839 * dispnew.c (increment_matrix_positions)
10840 (increment_row_positions, mode_line_string)
10841 (marginal_area_string):
10842 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10843 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
10844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10845 (duration_to_sec_usec): New function, to check for overflow better.
10846 (Fsleep_for, sit_for): Use it.
10847 * doc.c (get_doc_string, store_function_docstring):
10848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10849 (get_doc_string, Fsnarf_documentation):
10850 Use int, not EMACS_INT, where int is wide enough.
10851 (get_doc_string):
10852 Use SAFE_ALLOCA, not alloca.
10853 Check for overflow when converting EMACS_INT to off_t.
10854 * doprnt.c (doprnt):
10855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10856 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10857 Don't assume uid_t fits into fixnum.
10858 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10859 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10860 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10861 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10862 (general_insert_function)
10863 (Finsert_char, make_buffer_string, make_buffer_string_both)
10864 (update_buffer_properties, Fbuffer_substring)
10865 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10866 (Fsubst_char_in_region, check_translation)
10867 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10868 (transpose_markers, Ftranspose_regions):
10869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10870 (clip_to_bounds): Move to lisp.h as an inline function).
10871 (Fconstrain_to_field): Don't assume integers are nonnegative.
10872 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10873 (Fsubst_char_in_region, Fsave_restriction):
10874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10875 (Femacs_pid): Don't assume pid_t fits into fixnum.
10876 (lo_time): Use int, not EMACS_INT, when int suffices.
10877 (lisp_time_argument): Check for usec out of range.
10878 (Fencode_time): Don't assume fixnum fits in int.
10879 (Fuser_login_name, Fuser_full_name): Signal an error
10880 if a uid argument is out of range, rather than relying on
10881 undefined behavior.
10882 (Fformat_time_string): Remove now-unnecessary check.
10883 lisp_time_argument checks for out-of-range usec now.
10884 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
10885 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10886 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10887 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10888 (init_cmdargs, Fdump_emacs):
10889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10890 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10891 the bottom (typically) 32 bits of the fixnum.
10892 * eval.c (specpdl_size, call_debugger):
10893 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10894 (when_entered_debugger, Fbacktrace_debug):
10895 Don't assume fixnum can fit in int.
10896 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10897 the object just before a buffer; this is not portable.
10898 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10899 (grow_specpdl, unbind_to):
10900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10901 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10902 (grow_specpdl): Simplify allocation by using xpalloc.
10903 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
10904 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10905 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10907 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10908 (a_write, e_write):
10909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10910 (Fcopy_file, non_regular_nbytes, read_non_regular)
10911 (Finsert_file_contents):
10912 Use int, not EMACS_INT, where int is wide enough.
10913 (READ_BUF_SIZE): Verify that it fits in int.
10914 (Finsert_file_contents): Check that counts are in proper range,
10915 rather than assuming fixnums fit into ptrdiff_t etc.
10916 Don't assume fixnums fit into int.
10917 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
10918 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10919 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
10920 (string_char_to_byte, string_byte_to_char)
10921 (string_make_multibyte, string_to_multibyte)
10922 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10923 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10924 (substring_both, Fdelete, internal_equal, Ffillarray)
10925 (Fclear_string, mapcar1)
10926 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10927 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10928 (larger_vector, make_hash_table, maybe_resize_hash_table)
10929 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10930 (Fmaphash, secure_hash):
10931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10932 (concat): Check for string index and length overflow.
10933 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10934 (Frequire):
10935 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10936 (larger_vector): New API (vec, incr_min, size_max) replaces old
10937 one (vec, new_size, init). This catches size overflow.
10938 INIT was removed because it was always Qnil.
10939 All callers changed.
10940 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10941 the upper bound on a hash table index size.
10942 (make_hash_table, maybe_resize_hash_table): Use it.
10943 (secure_hash): Computer start_byte and end_byte only after
10944 they're known to be in ptrdiff_t range.
10945 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10946 (Ffont_get_glyphs, Ffont_at):
10947 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10948 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10949 (Flist_fonts, Fopen_font):
10950 Don't assume fixnum can fit in int.
10951 (check_gstring): Don't assume index can fit in int.
10952 (font_match_p): Check that fixnum is a character, not a nonnegative
10953 fixnum, since the later code needs to stuff it into an int.
10954 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10955 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10956 conversion overflow issues.
10957 (Fopen_font): Check for integer out of range.
10958 (Ffont_get_glyphs): Don't assume index can fit in int.
10959 * font.h: Adjust decls to match defn changes elsewhere.
10960 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10961 integer overflow.
10962 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10963 printmax_t, where ptrdiff_t is wide enough.
10964 (Finternal_char_font):
10965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10966 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10967 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10968 (Fset_frame_position, x_set_frame_parameters)
10969 (x_set_line_spacing, x_set_border_width)
10970 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10971 Check that fixnums are in proper range for system types.
10972 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10974 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10975 Use SAFE_ALLOCA_LISP, not alloca.
10976 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10977 intptr_t is wide enough.
10978 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10979 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10980 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10981 Check for fixnum out of range.
10982 * ftfont.c (ftfont_list): Don't assume index fits in int.
10983 Check that fixnums are in proper range for system types.
10984 (ftfont_shape_by_flt):
10985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10986 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10988 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10989 Check that fixnums are in proper range for system types.
10990 * gnutls.h: Adjust decls to match defn changes elsewhere.
10991 * gtkutil.c (xg_dialog_run):
10992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10993 (update_frame_tool_bar):
10994 Check that fixnums are in proper range for system types.
10995 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
10996 (lookup_image): Check that fixnums are in range for system types.
10997 * indent.c (last_known_column, last_known_column_point):
10998 (current_column_bol_cache):
10999 (skip_invisible, current_column, check_display_width):
11000 (check_display_width, scan_for_column, current_column_1)
11001 (Findent_to, Fcurrent_indentation, position_indentation)
11002 (indented_beyond_p, Fmove_to_column, compute_motion):
11003 (Fcompute_motion, Fvertical_motion):
11004 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11005 (last_known_column_modified): Use EMACS_INT, not int.
11006 (check_display_width):
11007 (Fcompute_motion):
11008 Check that fixnums and floats are in proper range for system types.
11009 (compute_motion): Don't assume index or fixnum fits in int.
11010 (compute_motion, Fcompute_motion):
11011 Use int, not EMACS_INT, when it is wide enough.
11012 (vmotion): Omit local var start_hpos that is always 0; that way
11013 we don't need to worry about overflow in expressions involving it.
11014 * indent.h: Adjust decls to match defn changes elsewhere.
11015 (struct position):
11016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11017 Use int, not EMACS_INT, where int is wide enough.
11018 Remove unused members ovstring_chars_done and tab_offset;
11019 all uses removed.
11020 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11021 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11022 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11023 (make_gap, copy_text, insert, insert_and_inherit)
11024 (insert_before_markers, insert_before_markers_and_inherit)
11025 (insert_1, count_combining_before, count_combining_after)
11026 (insert_1_both, insert_from_string)
11027 (insert_from_string_before_markers, insert_from_string_1)
11028 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11029 (adjust_after_replace, adjust_after_insert, replace_range)
11030 (replace_range_2, del_range, del_range_1, del_range_byte)
11031 (del_range_both, del_range_2, modify_region)
11032 (prepare_to_modify_buffer, signal_before_change)
11033 (signal_after_change, Fcombine_after_change_execute):
11034 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11035 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11036 (balance_an_interval, split_interval_right, split_interval_left)
11037 (find_interval, next_interval, update_interval)
11038 (adjust_intervals_for_insertion, delete_node, delete_interval)
11039 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11040 (static_offset_intervals, offset_intervals)
11041 (merge_interval_right, merge_interval_left, make_new_interval)
11042 (graft_intervals_into_buffer, temp_set_point_both)
11043 (temp_set_point, set_point, adjust_for_invis_intang)
11044 (set_point_both, move_if_not_intangible, get_property_and_range)
11045 (get_local_map, copy_intervals, copy_intervals_to_string)
11046 (compare_string_intervals, set_intervals_multibyte_1):
11047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11048 * intervals.h: Adjust decls to match defn changes elsewhere.
11049 (struct interval):
11050 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11051 * keyboard.c (this_command_key_count, this_single_command_key_start)
11052 (before_command_key_count, before_command_echo_length, echo_now)
11053 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11054 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11055 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11056 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11058 (last_non_minibuf_size, last_point_position, echo_truncate)
11059 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11060 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11061 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11062 (stuff_buffered_input):
11063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11064 (last_auto_save, command_loop_1, read_char):
11065 Use EMACS_INT, not int, to avoid integer overflow.
11066 (record_char): Avoid overflow in total_keys computation.
11067 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11068 * keyboard.h: Adjust decls to match defn changes elsewhere.
11069 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11070 (Fkey_description, Fdescribe_vector, Flookup_key):
11071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11072 (click_position): New function, to check that positions are in range.
11073 (Fcurrent_active_maps):
11074 (describe_command):
11075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11076 (Faccessible_keymaps, Fkey_description):
11077 (preferred_sequence_p):
11078 Don't assume fixnum can fit into int.
11079 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11080 Check for integer overflow in size calculations.
11081 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11082 avoid mishandling large integers.
11083 * lisp.h: Adjust decls to match defn changes elsewhere.
11084 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11085 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11086 (struct Lisp_Marker):
11087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11088 (clip_to_bounds): Now an inline function, moved here from editfns.c.
11089 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11090 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11091 All callers changed.
11092 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11093 Assume the arg has valid form, since it always does.
11094 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11095 unsigned integer system type.
11096 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11097 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11099 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11100 (duration_to_sec_usec): New decl.
11101 * lread.c (read_from_string_index, read_from_string_index_byte)
11102 (read_from_string_limit, readchar, unreadchar, openp)
11103 (read_internal_start, read1, oblookup):
11104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11105 (Fload, readevalloop, Feval_buffer, Feval_region):
11106 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11107 (openp): Check for out-of-range argument to 'access'.
11108 (read1): Use int, not EMACS_INT, where int is wide enough.
11109 Don't assume fixnum fits into int.
11110 Fix off-by-one error that can read outside a buffer.
11111 (read_filtered_event): Use duration_to_sec_usec
11112 to do proper overflow checking on durations.
11113 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11114 in size calculation.
11115 (Fexecute_kbd_macro):
11116 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11117 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11118 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11119 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11120 (set_marker_both, set_marker_restricted_both, marker_position)
11121 (marker_byte_position, Fbuffer_has_markers_at):
11122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11123 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
11124 * menu.c (ensure_menu_items): Rename from grow_menu_items.
11125 It now merely ensures that the menu is large enough, without
11126 necessarily growing it, as this avoids some integer overflow issues.
11127 All callers changed.
11128 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11130 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11131 Use SAFE_ALLOCA_LISP, not alloca.
11132 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11133 to EMACS_INT. Check that fixnums are in proper range for system types.
11134 * minibuf.c (minibuf_prompt_width, string_to_object)
11135 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11136 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11137 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11138 (get_minibuffer, read_minibuf_unwind):
11139 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11140 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11141 this simplifies overflow checking. All callers changed.
11142 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11143 (Ftest_completion):
11144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11145 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11146 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11147 Check that fixnums are in proper range for system types.
11148 (Fx_create_frame, Fx_show_tip):
11149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11150 * nsfont.m (ns_findfonts, nsfont_list_family):
11151 Don't assume fixnum fits in long.
11152 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11154 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11155 wide enough.
11156 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
11157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11158 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11159 (PRINTDECLARE, PRINTPREPARE):
11160 (strout, print_string):
11161 (print, print_preprocess, print_check_string_charset_prop)
11162 (print_object):
11163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11164 (PRINTDECLARE):
11165 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11166 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11167 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
11168 (printchar, strout): Use xpalloc to catch size calculation overflow.
11169 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
11170 (print_error_message): Use SAFE_ALLOCA, not alloca.
11171 (print_object): Use int, not EMACS_INT, where int is wide enough.
11172 (print_depth, new_backquote_output, print_number_index):
11173 Use ptrdiff_t, not int, where int might not be wide enough.
11174 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11175 (Fset_process_window_size, Fformat_network_address)
11176 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
11177 (sigchld_handler):
11178 Check that fixnums are in proper range for system types.
11179 (Fsignal_process): Simplify by avoiding a goto.
11180 Check for process-ids out of pid_t range rather than relying on
11181 undefined behavior.
11182 (process_tick, update_tick): Use EMACS_INT, not int.
11183 (Fformat_network_address, read_process_output, send_process)
11184 (Fprocess_send_region, status_notify):
11185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11186 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11187 (wait_reading_process_output, read_process_output, exec_sentinel):
11188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11189 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11190 (Faccept_process_output): Use duration_to_sec_usec to do proper
11191 overflow checking on durations.
11192 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11193 Don't assume pid_t fits in int.
11194 * process.h (struct Lisp_Process): Members tick and update_tick
11195 are now of type EMACS_INT, not int.
11196 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11197 configured --with-wide-int.
11198 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11199 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11200 * search.c (looking_at_1, string_match_1):
11201 (fast_string_match, fast_c_string_match_ignore_case)
11202 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11203 (scan_newline, find_before_next_newline, search_command)
11204 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11205 (set_search_regs, wordify):
11206 (Freplace_match):
11207 (Fmatch_data):
11208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11209 (string_match_1, search_buffer, set_search_regs):
11210 (Fmatch_data):
11211 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11212 (wordify): Check for overflow in size calculation.
11213 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11214 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11215 Check that fixnums are in proper range for system types.
11216 * sound.c (struct sound_device)
11217 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11219 (Fplay_sound_internal):
11220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11221 * syntax.c (struct lisp_parse_state, find_start_modiff)
11222 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11223 (Fparse_partial_sexp):
11224 Don't assume fixnums can fit in int.
11225 (struct lisp_parse_state, find_start_pos, find_start_value)
11226 (find_start_value_byte, find_start_begv)
11227 (update_syntax_table, char_quoted, dec_bytepos)
11228 (find_defun_start, prev_char_comend_first, back_comment):
11229 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11230 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11231 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11232 (Finternal_describe_syntax_value): Check that match_lisp is a
11233 character, not an integer, since the code stuffs it into int.
11234 (scan_words, scan_sexps_forward):
11235 Check that fixnums are in proper range for system types.
11236 (Fforward_word):
11237 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11238 (scan_sexps_forward):
11239 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11240 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11241 * syntax.h: Adjust decls to match defn changes elsewhere.
11242 (struct gl_state_s):
11243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11244 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
11245 MOST_POSITIVE_FIXNUM.
11246 * sysdep.c (wait_for_termination_1, wait_for_termination)
11247 (interruptible_wait_for_termination, mkdir):
11248 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
11249 (emacs_read, emacs_write):
11250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11251 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
11252 and double all fit in int.
11253 * term.c (set_tty_color_mode):
11254 Check that fixnums are in proper range for system types.
11255 * termhooks.h (struct input_event):
11256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11257 * textprop.c (validate_interval_range, interval_of)
11258 (Fadd_text_properties, set_text_properties_1)
11259 (Fremove_text_properties, Fremove_list_of_text_properties)
11260 (Ftext_property_any, Ftext_property_not_all)
11261 (copy_text_properties, text_property_list, extend_property_ranges)
11262 (verify_interval_modification):
11263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11264 (Fnext_single_char_property_change)
11265 (Fprevious_single_char_property_change):
11266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11267 (copy_text_properties):
11268 Check for integer overflow in index calculation.
11269 * undo.c (last_boundary_position, record_point, record_insert)
11270 (record_delete, record_marker_adjustment, record_change)
11271 (record_property_change):
11272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11273 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11275 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11276 (Fx_hide_tip, Fx_file_dialog):
11277 * w32menu.c (set_frame_menubar):
11278 Use ptrdiff_t, not int, for consistency with rest of code.
11279 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11280 (select_window, Fdelete_other_windows_internal)
11281 (window_scroll_pixel_based, window_scroll_line_based)
11282 (Frecenter, Fset_window_configuration):
11283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11284 (Fset_window_hscroll, run_window_configuration_change_hook)
11285 (set_window_buffer, temp_output_buffer_show, scroll_command)
11286 (Fscroll_other_window, Frecenter):
11287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11288 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11289 Don't assume fixnum fits in int.
11290 (Fset_window_scroll_bars):
11291 Check that fixnums are in proper range for system types.
11292 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11293 (string_pos, c_string_pos, number_of_chars, init_iterator)
11294 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11295 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11296 (compute_display_string_end, handle_face_prop)
11297 (face_before_or_after_it_pos, handle_invisible_prop)
11298 (handle_display_prop, handle_display_spec, handle_single_display_spec)
11299 (display_prop_intangible_p, string_buffer_position_lim)
11300 (string_buffer_position, handle_composition_prop, load_overlay_strings)
11301 (get_overlay_strings_1, get_overlay_strings)
11302 (iterate_out_of_display_property, forward_to_next_line_start)
11303 (back_to_previous_visible_line_start, reseat, reseat_to_string)
11304 (get_next_display_element, set_iterator_to_next)
11305 (get_visually_first_element, compute_stop_pos_backwards)
11306 (handle_stop_backwards, next_element_from_buffer)
11307 (move_it_in_display_line_to, move_it_in_display_line)
11308 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11309 (add_to_log, message_dolog, message_log_check_duplicate)
11310 (message2, message2_nolog, message3, message3_nolog
11311 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
11312 (current_message_1, truncate_echo_area, truncate_message_1)
11313 (set_message, set_message_1, store_mode_line_noprop)
11314 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
11315 (text_outside_line_unchanged_p, check_point_in_composition)
11316 (reconsider_clip_changes)
11317 (redisplay_internal, set_cursor_from_row, try_scrolling)
11318 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
11319 (redisplay_window, find_last_unchanged_at_beg_row)
11320 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
11321 (trailing_whitespace_p, find_row_edges, display_line)
11322 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
11323 (display_mode_element, store_mode_line_string)
11324 (pint2str, pint2hrstr, decode_mode_spec)
11325 (display_count_lines, display_string, draw_glyphs)
11326 (x_produce_glyphs, x_insert_glyphs)
11327 (rows_from_pos_range, mouse_face_from_buffer_pos)
11328 (fast_find_string_pos, mouse_face_from_string_pos)
11329 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11331 (safe_call, init_from_display_pos, handle_fontified_prop)
11332 (handle_single_display_spec, load_overlay_strings)
11333 (with_echo_area_buffer, setup_echo_area_for_printing)
11334 (display_echo_area, echo_area_display)
11335 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
11336 (update_tool_bar, hscroll_window_tree, redisplay_internal)
11337 (redisplay_window, dump_glyph_row, display_mode_line)
11338 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
11339 (handle_display_spec, display_prop_string_p):
11340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11341 (handle_single_display_spec, build_desired_tool_bar_string)
11342 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
11343 (get_specified_cursor_type):
11344 Check that fixnums are in proper range for system types.
11345 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
11346 (Flookup_image_map):
11347 Don't assume fixnums fit in int.
11348 (compare_overlay_entries):
11349 Avoid mishandling comparisons due to subtraction overflow.
11350 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
11351 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
11352 (handle_tool_bar_click):
11353 Use int, not unsigned, since we prefer signed and the signedness
11354 doesn't matter here.
11355 (get_next_display_element, next_element_from_display_vector):
11356 Use int, not EMACS_INT, when int is wide enough.
11357 (start_hourglass): Use duration_to_sec_usec to do proper
11358 overflow checking on durations.
11359 * xfaces.c (Fbitmap_spec_p):
11360 Check that fixnums are in proper range for system types.
11361 (compare_fonts_by_sort_order):
11362 Avoid mishandling comparisons due to subtraction overflow.
11363 (Fx_family_fonts, realize_basic_faces):
11364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11365 (Fx_family_fonts):
11366 Don't assume fixnum fits in int.
11367 Use SAFE_ALLOCA_LISP, not alloca.
11368 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
11369 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
11370 (face_at_buffer_position, face_for_overlay_string)
11371 (face_at_string_position):
11372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11373 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
11374 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
11375 (Fx_show_tip):
11376 Check that fixnums are in proper range for system types.
11377 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11378 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
11379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11380 (Fx_change_window_property): Don't assume fixnums fit in int.
11381 * xfont.c (xfont_chars_supported):
11382 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11383 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
11384 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
11385 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11386 * xml.c (parse_region):
11387 * xrdb.c (magic_file_p):
11388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11389 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
11390 (x_get_local_selection, x_reply_selection_request)
11391 (x_handle_selection_request, wait_for_property_change):
11392 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11393 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
11394 short is wide enough.
11395 (x_send_client_event): Don't assume fixnum fits in int.
11396 * xterm.c (x_x_to_emacs_modifiers):
11397 Don't assume EMACS_INT overflows nicely into int.
11398 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
11399 may come from Lisp.
11400 (handle_one_xevent): NATNUMP can eval its arg twice.
11401 (x_connection_closed):
11402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11403 * xterm.h: Adjust decls to match defn changes elsewhere.
11404 (struct scroll_bar): Use struct vectorlike_header
11405 rather than rolling our own approximation.
11406 (SCROLL_BAR_VEC_SIZE): Remove; not used.
11407
11408 2012-05-25 Glenn Morris <rgm@gnu.org>
11409
11410 * lisp.mk (lisp): Update for more files being compiled now.
11411
11412 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
11413
11414 * lread.c: Remove `read_pure' which makes no difference.
11415 (read_pure): Remove var.
11416 (unreadpure): Remove function.
11417 (readevalloop): Don't call read_list with -1 flag.
11418 (read1, read_vector): Don't test read_pure any more.
11419 (read_list): Simplify.
11420
11421 * fileio.c, character.h: Minor style tweaks.
11422
11423 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
11424
11425 * window.h (clip_changed): Remove useless declaration.
11426
11427 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
11428
11429 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
11430 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
11431
11432 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
11433
11434 Remove src/m/*.
11435 This directory predates autoconf and is no longer needed nowadays.
11436 Move its few remaining bits of functionality to where they're needed.
11437 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
11438 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
11439 * m/template.h: Remove.
11440 * Makefile.in (M_FILE): Remove. All uses removed.
11441 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
11442 * lisp.h (USE_LSB_TAG):
11443 * mem-limits.h (EXCEEDS_LISP_PTR):
11444 Use VAL_MAX, not VALBITS, in #if.
11445 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
11446 (EMACS_UINT): Define unconditionally now.
11447 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
11448 (BITS_PER_EMACS_INT): New constants, replacing
11449 what used to be in config.h, but not useful in #if.
11450 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
11451 define them any more.
11452 (VAL_MAX): New macro.
11453 (VALMASK): Use it.
11454 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
11455 BITS_PER_EMACS_INT, in #if.
11456 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11457 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
11458 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
11459 * s/ms-w32.h (DATA_START):
11460 Move here from removed file m/intel386.h.
11461 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
11462 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
11463
11464 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
11465
11466 Assume C89 or later.
11467 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
11468 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
11469 (xrealloc):
11470 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
11471 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
11472 * textprop.c, tparam.c (NULL): Remove.
11473 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11474 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
11475 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
11476 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
11477 * xterm.c (input_signal_count): Assume volatile works.
11478
11479 2012-05-21 Ken Brown <kbrown@cornell.edu>
11480
11481 * xgselect.c (xg_select): Fix first argument in call to 'select'
11482 (bug#11508).
11483
11484 2012-05-20 Ken Brown <kbrown@cornell.edu>
11485
11486 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
11487 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
11488
11489 2012-05-19 Ken Brown <kbrown@cornell.edu>
11490
11491 * xfns.c (x_in_use): Remove `static' qualifier.
11492 * xterm.h (x_in_use): Declare.
11493 * xgselect.c: Include xterm.h.
11494 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
11495 and `display_arg' (bug#9754).
11496
11497 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
11498
11499 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
11500
11501 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
11502 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
11503
11504 2012-05-18 Eli Zaretskii <eliz@gnu.org>
11505
11506 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
11507
11508 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
11509 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
11510
11511 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
11512 reference to image_cache->refcount.
11513 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
11514
11515 2012-05-17 Juri Linkov <juri@jurta.org>
11516
11517 * search.c (Fword_search_regexp, Fword_search_backward)
11518 (Fword_search_forward, Fword_search_backward_lax)
11519 (Fword_search_forward_lax): Move functions to isearch.el
11520 (bug#10145, bug#11381).
11521
11522 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
11523
11524 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
11525
11526 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
11527
11528 * lread.c (init_obarray): Declare Qt and Qnil as special.
11529
11530 2012-05-14 Glenn Morris <rgm@gnu.org>
11531
11532 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
11533 Put "libexec" before "bin", for the sake of init_callproc_1.
11534
11535 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11536
11537 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
11538
11539 * unexaix.c: Port to more-recent AIX compilers.
11540 (report_error, report_error_1, make_hdr, copy_sym)
11541 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
11542 Make arguments const char *, not char *, to avoid violations of C
11543 standard and to fix some AIX warnings reported by Gilles Pion.
11544
11545 2012-05-14 Eli Zaretskii <eliz@gnu.org>
11546
11547 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
11548 already have overlays loaded.
11549 (handle_single_display_spec): Before returning without displaying
11550 fringe bitmap, synchronize the bidi iterator with the main display
11551 iterator, by calling iterate_out_of_display_property.
11552 (iterate_out_of_display_property): Detect buffer iteration by
11553 testing that it->string is a Lisp string.
11554 (get_next_display_element): When the current object is exhausted,
11555 and there's something on it->stack, call set_iterator_to_next to
11556 proceed with what's on the stack, instead of returning zero.
11557 (set_iterator_to_next): If called at the end of a Lisp string,
11558 proceed to consider_string_end without incrementing string
11559 position. Don't increment display vector index past the end of
11560 the display vector. (Bug#11417)
11561 (pos_visible_p): Don't report a position visible when move_it_to
11562 stopped at the last line of window, which happens to be scanned
11563 backwards by the bidi iteration. (Bug#11464)
11564
11565 2012-05-14 Eli Zaretskii <eliz@gnu.org>
11566
11567 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
11568 and right-margin display specs even if the spec is invalid or we
11569 are on a TTY, and thus unable to display on the fringes.
11570 That's because the text with the property will not be displayed anyway,
11571 so we need to signal to the caller that this is a "replacing"
11572 display spec. This fixes display when the spec is invalid or we
11573 are on a TTY.
11574
11575 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
11576
11577 * unexaix.c (make_hdr): Fix typo in prototype.
11578 This bug broke the build on AIX. Problem reported by Gilles Pion.
11579
11580 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
11581
11582 * keyboard.c (kbd_buffer_get_event): Read special events also in
11583 batch mode. (Bug#11415)
11584
11585 2012-05-12 Glenn Morris <rgm@gnu.org>
11586
11587 * ns.mk: Update for ns_appbindir no longer having trailing "/".
11588
11589 2012-05-12 Eli Zaretskii <eliz@gnu.org>
11590
11591 * lisp.mk (lisp): Add newcomment.elc.
11592
11593 2012-05-12 Glenn Morris <rgm@gnu.org>
11594
11595 * Makefile.in (MKDIR_P): New, set by configure.
11596 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
11597
11598 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
11599
11600 Remove unused function hourglass_started.
11601 * dispextern.h (hourglass_started):
11602 * w32fns.c (hourglass_started):
11603 * xdisp.c (hourglass_started): Remove.
11604
11605 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
11606
11607 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
11608 Update dependencies.
11609
11610 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
11611
11612 * xgselect.c (xg_select): Put maxfds+1 into a var.
11613 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
11614
11615 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
11616
11617 2012-05-10 Dave Abrahams <dave@boostpro.com>
11618
11619 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
11620 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
11621
11622 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
11623
11624 * dbusbind.c (xd_registered_buses): New internal Lisp object.
11625 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
11626 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
11627 Initialize xd_registered_buses.
11628
11629 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11630
11631 Untag more efficiently if USE_LSB_TAG.
11632 This is based on a proposal by YAMAMOTO Mitsuharu in
11633 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11634 For an admittedly artificial (nth 8000 longlist) benchmark on
11635 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11636 Emacs's overall text size by 1%.
11637 * lisp.h (XUNTAG): New macro.
11638 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11639 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11640 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11641 * eval.c (Fautoload):
11642 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11643 * frame.h (XFRAME): Use XUNTAG.
11644
11645 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11646 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11647 Remove unportable assumptions about print widths of types like
11648 dbus_uint32_t.
11649 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11650 intptr_t when converting between pointer and integer, to avoid GCC
11651 warnings about wrong width.
11652
11653 2012-05-09 Eli Zaretskii <eliz@gnu.org>
11654
11655 * w32proc.c (new_child): Force Windows to reserve only 64KB of
11656 stack for each reader_thread, instead of defaulting to 8MB
11657 determined by the linker. This avoids failures in creating
11658 subprocesses on Windows 7, see the discussion in this thread:
11659 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
11660
11661 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
11662
11663 Fix up display of the *Minibuf-0* buffer in the mini window.
11664 * keyboard.c (read_char): Don't clear the echo area if there's no
11665 message to clear.
11666 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
11667 contents of *Minibuf-0*) if there's no message displayed in its stead.
11668
11669 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
11670
11671 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
11672 batch mode.
11673
11674 2012-05-06 Chong Yidong <cyd@gnu.org>
11675
11676 * lisp.mk (lisp): Update.
11677
11678 2012-05-05 Jim Meyering <meyering@redhat.com>
11679
11680 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
11681
11682 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
11683
11684 * data.c (PUT_ERROR): New macro.
11685 (syms_of_data): Use it. Add new error type `user-error'.
11686 * undo.c (user_error): New function.
11687 (Fprimitive_undo): Use it.
11688 * print.c (print_error_message): Adjust print style for `user-error'.
11689 * keyboard.c (user_error): New function.
11690 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
11691
11692 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
11693
11694 Do not limit current-time-string to years 1000..9999.
11695 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
11696 (Fcurrent_time_string): Support any year that is supported by the
11697 underlying localtime representation. Don't use asctime, as it
11698 has undefined behavior for years outside the range -999..9999.
11699
11700 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
11701
11702 Fix race conditions involving setenv, gmtime, localtime, asctime.
11703 Without this fix, interrupts could mess up code that uses these
11704 nonreentrant functions, since setting TZ invalidates existing
11705 tm_zone or tzname values, and since most of these functions return
11706 pointers to static storage.
11707 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
11708 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
11709 Grow the critical sections to include not just invoking
11710 localtime/gmtime, but also accessing these functions' results
11711 including their tm_zone values if any, and any related TZ setting.
11712 (format_time_string): Last arg is now struct tm *, not struct tm **,
11713 so that the struct tm is saved in the critical section.
11714 All callers changed. Simplify allocation of initial buffer, partly
11715 motivated by the fact that memory allocation needs to be outside
11716 the critical section.
11717
11718 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
11719
11720 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
11721 with RESET_INTERVAL.
11722
11723 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11724 Remove duplicated buffer name initialization.
11725
11726 2012-05-02 Jim Meyering <jim@meyering.net>
11727
11728 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
11729
11730 * xfns.c (x_window): Use xstrdup (Bug#11375).
11731
11732 2012-05-02 Eli Zaretskii <eliz@gnu.org>
11733
11734 * xdisp.c (pos_visible_p): If already at a newline from the
11735 display string before the 'while' loop, don't walk back the glyphs
11736 from it3.glyph_row. Solves assertion violation when the display
11737 string begins with a newline (egg.el). (Bug#11367)
11738
11739 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
11740
11741 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
11742 Move to simple.el.
11743
11744 2012-05-01 Glenn Morris <rgm@gnu.org>
11745
11746 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
11747 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
11748 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
11749 All were removed before 23.1.
11750
11751 * dispnew.c: Remove HAVE_LIBNCURSES test;
11752 it is always true on relevant platforms.
11753
11754 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
11755 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
11756
11757 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
11758
11759 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
11760
11761 * .gdbinit (xpr): Remove checks for no longer existing misc types.
11762 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
11763 Remove.
11764
11765 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
11766
11767 Do not avoid creating empty evaporating overlays (Bug#9642).
11768 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
11769 That is, do not delete an evaporating overlay if it becomes
11770 empty after its bounds are adjusted to fit within its buffer.
11771 This fix caused other problems, and I'm reverting it until we get
11772 to the bottom of them.
11773
11774 2012-04-27 Chong Yidong <cyd@gnu.org>
11775
11776 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
11777
11778 2012-04-27 Eli Zaretskii <eliz@gnu.org>
11779
11780 * xdisp.c (pos_visible_p): If the window start position is beyond
11781 ZV, start the display from buffer beginning. Prevents assertion
11782 violation in init_iterator when the minibuffer window is scrolled
11783 via the scroll bar.
11784
11785 * window.c (window_scroll_pixel_based): Likewise.
11786
11787 2012-04-27 Chong Yidong <cyd@gnu.org>
11788
11789 * keymap.c (where_is_internal): Doc fix (Bug#10872).
11790
11791 2012-04-27 Glenn Morris <rgm@gnu.org>
11792
11793 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11794 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11795
11796 2012-04-27 Eli Zaretskii <eliz@gnu.org>
11797
11798 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11799 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
11800
11801 2012-04-26 Eli Zaretskii <eliz@gnu.org>
11802
11803 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11804 display element, check also the underlying string or buffer
11805 character. (Bug#11341)
11806
11807 * w32menu.c: Include w32heap.h.
11808 (add_menu_item): If the call to AppendMenuW (via
11809 unicode_append_menu) fails, disable Unicode menus only if we are
11810 running on Windows 9X/Me.
11811
11812 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11813
11814 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11815 (xgetint): Add missing shift for LSB tags.
11816
11817 2012-04-24 Martin Rudalics <rudalics@gmx.at>
11818
11819 * keyboard.c (read_char): Don't wipe echo area for select window
11820 events: These might get delayed via `mouse-autoselect-window'
11821 (Bug#11304).
11822
11823 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
11824
11825 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11826 manipulation of :loaded-from data.
11827
11828 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
11829
11830 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11831 now a cons (bug#11311).
11832
11833 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11834
11835 Do not create empty overlays with the evaporate property (Bug#9642).
11836 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11837 if it becomes empty after its bounds are adjusted to fit within
11838 its buffer. Without this fix, in a nonempty buffer (let ((o
11839 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11840 yields an empty overlay that has the evaporate property, which is
11841 not supposed to happen.
11842
11843 Fix minor GTK3 problems found by static checking.
11844 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11845 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11846 (struct _EmacsFixedClass, emacs_fixed_get_type):
11847 Move decls here from emacsgtkfixed.h, since they needn't be public.
11848 (emacs_fixed_get_type): Now static.
11849 (emacs_fixed_class_init): Omit unused local.
11850 (emacs_fixed_child_type): Remove; unused.
11851 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11852 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11853 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11854 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11855 (EMACS_FIXED_GET_CLASS): Remove; unused.
11856 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11857
11858 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11859 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11860
11861 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11862
11863 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
11864 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
11865 (__malloc_size_t, __malloc_ptrdiff_t):
11866 Remove. All uses removed, replaced by the definiens if needed,
11867 since we can assume C89 or better now.
11868 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11869 (protect_malloc_state, align, get_contiguous_space)
11870 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11871 (malloc_atfork_handler_child, malloc_enable_thread)
11872 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11873 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11874 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11875 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11876 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11877 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11878 Define using prototypes, not old style.
11879 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11880 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11881 (align): Don't assume that signed integer overflow wraps around.
11882 Omit unused local var.
11883 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11884 (_free_internal_nolock, memalign, mallochook, reallochook):
11885 Omit no-longer-needed casts.
11886 (valloc): Use getpagesize, not __getpagesize.
11887 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11888 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11889
11890 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11891
11892 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
11893
11894 Move functions from C to Lisp. Make non-blocking method calls
11895 the default. Implement further D-Bus standard interfaces.
11896
11897 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11898 (QCdbus_request_name_allow_replacement)
11899 (QCdbus_request_name_replace_existing)
11900 (QCdbus_request_name_do_not_queue)
11901 (QCdbus_request_name_reply_primary_owner)
11902 (QCdbus_request_name_reply_in_queue)
11903 (QCdbus_request_name_reply_exists)
11904 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11905 (QCdbus_registered_serial, QCdbus_registered_method)
11906 (QCdbus_registered_signal): New Lisp objects.
11907 (XD_DEBUG_MESSAGE): Use sizeof.
11908 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11909 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11910 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11911 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11912 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11913 (xd_signature, xd_append_arg): Allow float for integer types.
11914 (xd_get_connection_references): New function.
11915 (xd_get_connection_address): Rename from xd_initialize.
11916 Return cached address.
11917 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11918 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11919 level.
11920 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
11921 Return number of refcounts.
11922 (Fdbus_get_unique_name): Make stronger parameter check.
11923 (Fdbus_message_internal): New defun.
11924 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11925 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11926 (Fdbus_send_signal, Fdbus_register_service)
11927 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11928 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11929 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11930 (Vdbus_compiled_version, Vdbus_runtime_version)
11931 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11932 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11933 (Vdbus_message_type_signal): New defvars.
11934 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11935 Adapt docstring.
11936
11937 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11938
11939 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11940 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11941 Do not assume ptrdiff_t is the same width as 'int'.
11942
11943 * alloc.c: Handle unusual debugging option combinations.
11944 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11945 since the two debugging options are incompatible.
11946 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11947 is defined.
11948 (mem_init, mem_insert, mem_insert_fixup):
11949 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11950 (NEED_MEM_INSERT): Remove; no longer needed.
11951
11952 2012-04-22 Leo Liu <sdl.web@gmail.com>
11953
11954 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11955
11956 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11957
11958 * sysdep.c [__FreeBSD__]: Minor cleanups.
11959 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11960 Use Emacs indenting style more consistently. Avoid some casts.
11961 Use 'double' consistently rather than mixing 'float' and 'double'.
11962
11963 2012-04-21 Eduard Wiebe <usenet@pusto.de>
11964
11965 * sysdep.c (list_system_processes, system_process_attributes):
11966 Add implementation for FreeBSD (Bug#5243).
11967
11968 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11969
11970 * lisp.mk (lisp): Update.
11971
11972 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11973
11974 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11975 It is never used otherwise.
11976
11977 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11978
11979 * print.c (print_preprocess): Only check print_depth if print-circle
11980 is nil.
11981 (print_object): Check for cycles even when print-circle is nil and
11982 print-gensym is t, but only check print_depth if print-circle is nil.
11983
11984 2012-04-20 Chong Yidong <cyd@gnu.org>
11985
11986 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11987 set the status to "failed" and ensure that sentinel is run.
11988
11989 2012-04-20 Glenn Morris <rgm@gnu.org>
11990
11991 * process.c (Fset_process_inherit_coding_system_flag)
11992 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
11993 (Fmake_network_process, Fmake_serial_process): Doc fix.
11994
11995 2012-04-20 Eli Zaretskii <eliz@gnu.org>
11996
11997 * xdisp.c (string_buffer_position_lim): Limit starting position to
11998 BEGV.
11999 (set_cursor_from_row): If called for a mode-line or header-line
12000 row, return zero immediately.
12001 (try_cursor_movement): If inside continuation line, don't back up
12002 farther than the first row after the header line, if any.
12003 Don't consider the header-line row as "partially visible", even if
12004 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12005
12006 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12007
12008 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12009 (bug#11238).
12010
12011 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
12012 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
12013
12014 configure: new option --enable-gcc-warnings (Bug#11207)
12015 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12016 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12017 (ALL_CFLAGS): Use new macros rather than old.
12018 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12019 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12020 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12021 -Wunused-result, -Wunused-variable. This should go away once
12022 the Emacs and Gnulib regex code is merged.
12023 (xmalloc, xrealloc): Now static.
12024
12025 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12026
12027 * dired.c (Fsystem_groups): Remove unused local.
12028
12029 2012-04-17 Glenn Morris <rgm@gnu.org>
12030
12031 * dired.c (Fsystem_users): Doc fix.
12032
12033 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12034
12035 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12036 (syms_of_dired): Add them.
12037
12038 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12039
12040 Fix minor alloc.c problems found by static checking.
12041 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12042 New extern decls, to avoid calling undeclared functions.
12043 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12044 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12045 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12046 (NEED_MEM_INSERT): New macro.
12047 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
12048 Remove one incorrect comment and fix another.
12049
12050 Fix minor ralloc.c problems found by static checking.
12051 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12052 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12053 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12054 (r_alloc_sbrk): Now static.
12055
12056 Improve ralloc.c interface checking.
12057 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12058 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12059 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12060 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12061 [REL_ALLOC]: ... to here, to check interface.
12062 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12063 Remove decls. This fixes an "It stinks!".
12064
12065 * alloc.c (which_symbols): Fix alignment issue / type clash.
12066
12067 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12068
12069 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12070 (struct Lisp_Misc_Any): Likewise.
12071 (struct Lisp_Free): Likewise.
12072 * alloc.c (union aligned_Lisp_Symbol): Define.
12073 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12074 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12075 (union aligned_Lisp_Misc): Define.
12076 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12077 aligned_Lisp_Misc instead of union Lisp_Misc.
12078 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
12079
12080 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12081
12082 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12083 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12084 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12085 * s/netbsd.h, s/sol2-6.h:
12086 Remove definition of GC_MARK_STACK, since the default now works.
12087 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12088 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12089 no longer the default.
12090 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12091
12092 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
12093
12094 * lread.c (lisp_file_lexically_bound_p):
12095 Fix hang at ";-*-\n" (bug#11238).
12096
12097 2012-04-14 Eli Zaretskii <eliz@gnu.org>
12098
12099 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12100 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12101
12102 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12103
12104 * nsterm.m (constrainFrameRect): Always constrain when there is only
12105 one screen (Bug#10962).
12106
12107 2012-04-13 Ken Brown <kbrown@cornell.edu>
12108
12109 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12110
12111 2012-04-13 Reuben Thomas <rrt@sc3d.org>
12112
12113 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12114
12115 2012-04-11 Daniel Colascione <dancol@dancol.org>
12116
12117 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12118 against is gone. It's better to use vfork now so that when Cygwin
12119 gains a new, working vfork, we use it automatically (bug#10398).
12120
12121 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12122
12123 * window.c (save_window_save): Obey window-point-insertion-type.
12124
12125 2012-04-11 Glenn Morris <rgm@gnu.org>
12126
12127 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12128
12129 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12130
12131 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12132
12133 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
12134
12135 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12136 (force_quit_count): New var.
12137 (handle_interrupt): Use it.
12138
12139 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
12140
12141 * w32.c (w32_delayed_load): Record the full path of the library
12142 being loaded (bug#10424).
12143
12144 2012-04-09 Glenn Morris <rgm@gnu.org>
12145
12146 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12147 not just in the obarray, before snarfing them. (Bug#11036)
12148
12149 * Makefile.in ($(leimdir)/leim-list.el):
12150 Pass EMACS rather than BUILT_EMACS.
12151
12152 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12153
12154 * process.c (make_process):
12155 * process.h: Add integer `gnutls_handshakes_tried' member to
12156 process struct.
12157
12158 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12159 Add convenience `GNUTLS_LOG2i' macro.
12160
12161 * gnutls.c (gnutls_log_function2i): Convenience log function.
12162 (emacs_gnutls_read): Use new log functions,
12163 `gnutls_handshakes_tried' process member, and
12164 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12165 attempts per process (connection).
12166
12167 2012-04-09 Chong Yidong <cyd@gnu.org>
12168
12169 * eval.c (Fuser_variable_p, user_variable_p_eh)
12170 (lisp_indirect_variable): Functions deleted.
12171 (Fdefvar): Caller changed.
12172
12173 * callint.c (Finteractive, Fcall_interactively):
12174 * minibuf.c (Fread_variable): Callers changed.
12175
12176 2012-04-09 Eli Zaretskii <eliz@gnu.org>
12177
12178 * xdisp.c (set_cursor_from_row): If the display string appears in
12179 the buffer at position that is closer to point than the position
12180 after the display string, display the cursor on the first glyph of
12181 the display string. Fixes cursor display when a 'display' text
12182 property immediately follows invisible text. (Bug#11094)
12183
12184 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12185
12186 composite.c: use 'double' consistently
12187 * composite.c (get_composition_id): Use 'double' consistently
12188 instead of converting 'float' to 'double' and vice versa; this is
12189 easier to understand and avoids a GCC warning.
12190
12191 2012-04-09 Glenn Morris <rgm@gnu.org>
12192
12193 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12194 preparation for dumping it with emacs. (Bug#4789)
12195 (leimdir): New variable.
12196 ($(leimdir)/leim-list.el): New rule.
12197 (emacs$(EXEEXT)): Depend on leim-list.el.
12198
12199 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12200 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12201 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12202
12203 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12204
12205 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12206 proper alignment.
12207
12208 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
12209
12210 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12211 Remove unused local variable.
12212
12213 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12214
12215 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12216 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12217 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12218 objects, as mark_maybe_pointer will catch them otherwise.
12219 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12220 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12221
12222 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 Fix typo that broke non-Windows builds.
12225 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12226
12227 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12228
12229 Support building on MS-Windows with libxml2.
12230
12231 * makefile.w32-in (OBJ2): Add xml.$(O).
12232 (GLOBAL_SOURCES): Add xml.c.
12233 ($(BLD)/xml.$(O)): New dependency list.
12234
12235 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12236 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12237 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12238 [!WINDOWSNT]: New macros.
12239 (init_libxml2_functions, libxml2_loaded_p): New functions.
12240 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12241 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12242 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12243 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12244 linked in).
12245 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
12246 Call init_libxml2_functions before calling libxml2 functions.
12247 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
12248
12249 * emacs.c: Don't include libxml/parser.h.
12250 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
12251 xmlCleanupParser directly.
12252
12253 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
12254
12255 2012-04-07 Eli Zaretskii <eliz@gnu.org>
12256
12257 * indent.c (Fvertical_motion): If there is a display string at
12258 point, use it.vpos to compute how many lines to backtrack after
12259 move_it_to point. (Bug#11133)
12260
12261 2012-04-06 Eli Zaretskii <eliz@gnu.org>
12262
12263 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
12264 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
12265 about subtle differences between FETCH_CHAR* and STRING_CHAR*
12266 macros related to unification of CJK characters. For the details,
12267 see the discussion following the message here:
12268 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12269
12270 2012-04-04 Chong Yidong <cyd@gnu.org>
12271
12272 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12273
12274 2012-04-01 Eli Zaretskii <eliz@gnu.org>
12275
12276 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12277 instead of alloca. (Bug#11138)
12278
12279 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12280
12281 * w32menu.c (is_simple_dialog): Properly check lisp types.
12282 (Bug#11141)
12283
12284 2012-03-31 Eli Zaretskii <eliz@gnu.org>
12285
12286 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12287 position we get to after a call to move_it_to fails the
12288 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12289 only if we wind up in a string from display property. (Bug#11063)
12290
12291 * window.c (Fdelete_other_windows_internal): Invalidate the row
12292 and column information about mouse highlight, so that redisplay
12293 restores it after reallocating the glyph matrices. (Bug#7464)
12294
12295 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12296 string comes from a `display' text property, use the buffer
12297 position of that property as if we actually saw that position in
12298 the row's glyphs.
12299 (move_it_by_lines): Remove the assertion that
12300 "it->current_x == 0 && it->hpos == 0" which can be legitimately
12301 violated when there's a before-string at the beginning of a line.
12302 (Bug#11063)
12303
12304 2012-03-30 Eli Zaretskii <eliz@gnu.org>
12305
12306 * xdisp.c (append_space_for_newline): If the default face was
12307 remapped, use the remapped face for the appended newline.
12308 (extend_face_to_end_of_line): Use the remapped default face for
12309 extending the face to the end of the line.
12310 (display_line): Call extend_face_to_end_of_line when the default
12311 face was remapped. (Bug#11068)
12312
12313 2012-03-29 Eli Zaretskii <eliz@gnu.org>
12314
12315 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
12316
12317 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12318
12319 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
12320
12321 2012-03-27 Glenn Morris <rgm@gnu.org>
12322
12323 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
12324 Doc fixes.
12325
12326 2012-03-26 Kenichi Handa <handa@m17n.org>
12327
12328 * dispextern.h (struct glyph): Fix previous change. Change the
12329 bit length of glyphless.ch to 25 (Bug#11082).
12330
12331 2012-03-26 Chong Yidong <cyd@gnu.org>
12332
12333 * keyboard.c (Vselection_inhibit_update_commands): New variable.
12334 (command_loop_1): Use it; inhibit selection update for
12335 handle-select-window too (Bug#8996).
12336
12337 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
12338
12339 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
12340
12341 2012-03-25 Kenichi Handa <handa@m17n.org>
12342
12343 * dispextern.h (struct glyph): Change the bit length of
12344 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
12345
12346 2012-03-24 Eli Zaretskii <eliz@gnu.org>
12347
12348 * s/ms-w32.h (tzname): Include time.h before redirecting to
12349 _tzname. Fixes the MSVC build. (Bug#9960)
12350
12351 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
12352
12353 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
12354 characters.
12355
12356 * xterm.c (XTread_socket): Only modify handling_signal if
12357 !SYNC_INPUT. (Bug#11080)
12358
12359 2012-03-23 Eli Zaretskii <eliz@gnu.org>
12360
12361 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
12362 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
12363 when fetching a multibyte character consumes more bytes than
12364 CHAR_BYTES returns, due to unification of CJK characters in
12365 string_char. (Bug#11073)
12366
12367 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
12368
12369 * process.c (wait_reading_process_output): Handle pty disconnect
12370 by refraining from sending oneself a SIGCHLD (bug#10933).
12371
12372 2012-03-22 Chong Yidong <cyd@gnu.org>
12373
12374 * dispextern.h (struct it): New member string_from_prefix_prop_p.
12375
12376 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
12377 Mark string as coming from a prefix property.
12378 (handle_face_prop): Use default face for prefix strings (Bug#4281).
12379 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
12380
12381 2012-03-21 Chong Yidong <cyd@gnu.org>
12382
12383 * xfaces.c (Vface_remapping_alist): Doc fix.
12384
12385 2012-03-20 Eli Zaretskii <eliz@gnu.org>
12386
12387 * w32proc.c (Fw32_set_console_codepage)
12388 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
12389 Doc fixes.
12390
12391 2012-03-20 Chong Yidong <cyd@gnu.org>
12392
12393 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
12394 to reflect default non-nil value of redisplay-dont-pause.
12395
12396 2012-03-19 Kenichi Handa <handa@m17n.org>
12397
12398 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
12399 it fit in a valid range (Bug#11003).
12400
12401 2012-03-18 Eli Zaretskii <eliz@gnu.org>
12402
12403 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
12404 that is not from display property, accept the row as a "cursor
12405 row" if one of the string's character has a non-nil `cursor'
12406 property. Fixes cursor positioning when there are newlines in
12407 overlay strings, e.g. in icomplete.el. (Bug#11035)
12408
12409 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
12410
12411 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
12412
12413 2012-03-12 Chong Yidong <cyd@gnu.org>
12414
12415 * eval.c (inhibit_lisp_code): Rename from
12416 inhibit_window_configuration_change_hook; move from window.c.
12417
12418 * xfns.c (unwind_create_frame_1, Fx_create_frame):
12419 * window.c (run_window_configuration_change_hook)
12420 (syms_of_window): Callers changed.
12421
12422 2012-03-11 Chong Yidong <cyd@gnu.org>
12423
12424 * keymap.c (Fkey_description): Doc fix (Bug#9700).
12425
12426 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
12427
12428 2012-03-10 Chong Yidong <cyd@gnu.org>
12429
12430 * frame.c (other_visible_frames): Don't assume the selected frame
12431 is visible (Bug#10955).
12432
12433 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
12434
12435 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
12436
12437 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
12438
12439 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
12440 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
12441 zero (Bug#10954).
12442
12443 2012-03-03 Glenn Morris <rgm@gnu.org>
12444
12445 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
12446
12447 2012-03-02 Eli Zaretskii <eliz@gnu.org>
12448
12449 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
12450 position past the first glyph_row that ends at ZV. (Bug#10902)
12451 (redisplay_window, next_element_from_string): Fix typos in
12452 comments.
12453 (redisplay_window): Pass to move_it_vertically the margin in
12454 pixels, not in screen lines.
12455
12456 2012-03-02 Glenn Morris <rgm@gnu.org>
12457
12458 * buffer.c (buffer-list-update-hook): Doc fix.
12459
12460 2012-02-29 Eli Zaretskii <eliz@gnu.org>
12461
12462 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
12463 push_it before setting up the iterator for the first overlay
12464 string, even if we have an empty string loaded.
12465 (next_overlay_string): If there's an empty string on the iterator
12466 stack, pop the stack. (Bug#10903)
12467
12468 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
12469
12470 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
12471 Suggested by Stefan Monnier in
12472 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
12473 * alloc.c (widen_to_Lisp_Object): New static function.
12474 (mark_memory): Also mark Lisp_Objects by fetching pointer words
12475 and widening them to Lisp_Objects. This would work even if
12476 USE_LSB_TAG is defined and wide integers are used, which might
12477 happen in a future version of Emacs.
12478
12479 2012-02-25 Chong Yidong <cyd@gnu.org>
12480
12481 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
12482 Doc fix.
12483
12484 * xselect.c (Fx_selection_exists_p): Doc fix.
12485 (x_clipboard_manager_save_all): Print an informative message
12486 before saving to clipboard manager.
12487
12488 2012-02-24 Chong Yidong <cyd@gnu.org>
12489
12490 * keyboard.c (process_special_events): Handle all X selection
12491 requests in kbd_buffer, not just the next one (Bug#8869).
12492
12493 2012-02-23 Chong Yidong <cyd@gnu.org>
12494
12495 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
12496 call when setting menu-bar-lines and tool-bar-lines parameters.
12497 (unwind_create_frame_1): New helper function.
12498
12499 * window.c (inhibit_window_configuration_change_hook): New var.
12500 (run_window_configuration_change_hook): Obey it.
12501 (syms_of_window): Initialize it.
12502
12503 2012-02-22 Chong Yidong <cyd@gnu.org>
12504
12505 * xterm.c (x_draw_image_relief): Add missing type check for
12506 Vtool_bar_button_margin (Bug#10743).
12507
12508 2012-02-21 Chong Yidong <cyd@gnu.org>
12509
12510 * fileio.c (Vfile_name_handler_alist): Doc fix.
12511
12512 * buffer.c (Fget_file_buffer): Protect against invalid file
12513 handler return value.
12514
12515 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
12516
12517 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
12518 when computing $valmask.
12519
12520 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
12521 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
12522 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
12523 It's useless in that case, and it can cause problems on hosts
12524 that allocate halves of EMACS_INT values separately.
12525 Reported by Dan Horák. Diagnosed by Andreas Schwab in
12526 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
12527 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
12528 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
12529 it avoids undefined behavior on hosts where shifting right by more
12530 than the word width has undefined behavior.
12531
12532 2012-02-19 Chong Yidong <cyd@gnu.org>
12533
12534 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
12535 (Funhandled_file_name_directory, Ffile_name_as_directory)
12536 (Fdirectory_file_name, Fexpand_file_name)
12537 (Fsubstitute_in_file_name): Protect against invalid file handler
12538 return values (Bug#10845).
12539
12540 2012-02-18 Eli Zaretskii <eliz@gnu.org>
12541
12542 * .gdbinit (pitx): Fix incorrect references to fields of the
12543 iterator stack.
12544
12545 2012-02-17 Chong Yidong <cyd@gnu.org>
12546
12547 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
12548
12549 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
12550
12551 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
12552 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
12553
12554 2012-02-15 Chong Yidong <cyd@gnu.org>
12555
12556 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
12557 marked as special. Also, starting docstrings with * is obsolete.
12558
12559 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
12560
12561 * gnutls.c (emacs_gnutls_write): Fix last change.
12562
12563 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
12564
12565 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
12566 send_process.
12567
12568 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
12569
12570 * keymap.c (Fsingle_key_description): Handle char ranges.
12571
12572 2012-02-12 Chong Yidong <cyd@gnu.org>
12573
12574 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
12575 as that creates a dangerous corner case.
12576
12577 * window.c (Fdelete_window_internal): Invalidate the mouse
12578 highlight (Bug#9904).
12579
12580 2012-02-12 Glenn Morris <rgm@gnu.org>
12581
12582 * xselect.c (Fx_own_selection_internal)
12583 (Fx_get_selection_internal, Fx_disown_selection_internal)
12584 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
12585 * nsselect.m (Fx_own_selection_internal)
12586 (Fx_disown_selection_internal, Fx_selection_exists_p)
12587 (Fx_selection_owner_p, Fx_get_selection_internal):
12588 Sync docs and argument specs with the xselect.c versions.
12589
12590 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
12591
12592 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
12593
12594 2012-02-11 Eli Zaretskii <eliz@gnu.org>
12595
12596 * w32select.c (Fx_selection_exists_p): Sync doc string and
12597 argument list with xselect.c. (Bug#10783)
12598
12599 * w16select.c (Fx_selection_exists_p): Sync doc string and
12600 argument list with xselect.c. (Bug#10783)
12601
12602 2012-02-10 Glenn Morris <rgm@gnu.org>
12603
12604 * fns.c (Fsecure_hash): Doc fix.
12605
12606 2012-02-09 Kenichi Handa <handa@m17n.org>
12607
12608 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
12609
12610 2012-02-07 Chong Yidong <cyd@gnu.org>
12611
12612 * buffer.c (Fbuffer_local_variables)
12613 (buffer_lisp_local_variables): Handle unbound vars correctly;
12614 don't let Qunbound leak into Lisp.
12615
12616 2012-02-07 Glenn Morris <rgm@gnu.org>
12617
12618 * image.c (Fimagemagick_types): Doc fix.
12619
12620 * image.c (imagemagick-render-type): Change it from a lisp object
12621 to an integer. Move the doc here from the lisp manual.
12622 Treat all values not equal to 0 the same.
12623
12624 2012-02-06 Chong Yidong <cyd@gnu.org>
12625
12626 * doc.c (store_function_docstring): Avoid applying docstring of
12627 alias to base function (Bug#2603).
12628
12629 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12630
12631 * .gdbinit (pp1, pv1): Remove redundant defines.
12632 (pr): Use pp.
12633
12634 2012-02-04 Chong Yidong <cyd@gnu.org>
12635
12636 * nsterm.m: Declare a global (Bug#10694).
12637
12638 2012-02-04 Eli Zaretskii <eliz@gnu.org>
12639
12640 * w32.c (get_emacs_configuration_options):
12641 Include --enable-checking, if specified, in the return value.
12642
12643 2012-02-04 Martin Rudalics <rudalics@gmx.at>
12644
12645 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12646 after rounding frame sizes. (Bug#9723)
12647
12648 2012-02-04 Eli Zaretskii <eliz@gnu.org>
12649
12650 * keyboard.c (adjust_point_for_property): Don't position point
12651 before BEGV. (Bug#10696)
12652
12653 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
12654
12655 Handle overflow when computing char display width (Bug#9496).
12656 * character.c (char_width): Return EMACS_INT, not int.
12657 (char_width, c_string_width): Check for overflow when
12658 computing the width; this is possible now that individual
12659 characters can have unbounded width. Problem introduced
12660 by merge from Emacs 23 on 2012-01-19.
12661
12662 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
12663
12664 * dbusbind.c (Fdbus_register_method): Mention the return value
12665 :ignore in the docstring.
12666
12667 2012-02-02 Glenn Morris <rgm@gnu.org>
12668
12669 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
12670
12671 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12672 Unconditionally set to t. (Bug#10673)
12673 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12674 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12675 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
12676
12677 2012-02-02 Kenichi Handa <handa@m17n.org>
12678
12679 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
12680 0, do not call append_composite_glyph.
12681
12682 2012-02-02 Kenichi Handa <handa@m17n.org>
12683
12684 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
12685 NULL (Bug#6988).
12686 (x_produce_glyphs): If the component of a composition is a null
12687 string, set it->pixel_width to 1 to avoid zero-width glyph.
12688
12689 2012-02-01 Eli Zaretskii <eliz@gnu.org>
12690
12691 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
12692 first 2 arguments are identical. This makes inserting large
12693 output from a subprocess an order of magnitude faster on
12694 MS-Windows, where all sbrk'ed memory is always contiguous.
12695
12696 2012-01-31 Glenn Morris <rgm@gnu.org>
12697
12698 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12699 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12700 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
12701
12702 2012-01-29 Glenn Morris <rgm@gnu.org>
12703
12704 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
12705
12706 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
12707
12708 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
12709
12710 2012-01-28 Chong Yidong <cyd@gnu.org>
12711
12712 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
12713
12714 2012-01-26 Chong Yidong <cyd@gnu.org>
12715
12716 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
12717
12718 * search.c (Fsearch_forward, Fsearch_backward): Document negative
12719 repeat counts (Bug#10507).
12720
12721 2012-01-26 Glenn Morris <rgm@gnu.org>
12722
12723 * lread.c (syms_of_lread): Doc fix.
12724
12725 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
12726
12727 * coding.c (encode_designation_at_bol): Change return value to
12728 EMACS_INT.
12729
12730 2012-01-25 Chong Yidong <cyd@gnu.org>
12731
12732 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
12733
12734 2012-01-21 Chong Yidong <cyd@gnu.org>
12735
12736 * floatfns.c (Fcopysign): Make the second argument non-optional,
12737 since nil is not allowed anyway.
12738
12739 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
12740
12741 * process.c (read_process_output): Use p instead of XPROCESS (proc).
12742 (send_process): Likewise.
12743
12744 2012-01-19 Martin Rudalics <rudalics@gmx.at>
12745
12746 * window.c (save_window_save, Fcurrent_window_configuration)
12747 (Vwindow_persistent_parameters): Do not use Qstate.
12748 Rewrite doc-strings.
12749
12750 2012-01-19 Kenichi Handa <handa@m17n.org>
12751
12752 * character.c (char_width): New function.
12753 (Fchar_width, c_string_width, lisp_string_width):
12754 Use char_width (Bug#9496).
12755
12756 2012-01-16 Martin Rudalics <rudalics@gmx.at>
12757
12758 * window.c (Vwindow_persistent_parameters): New variable.
12759 (Fset_window_configuration, save_window_save): Handle persistent
12760 window parameters.
12761
12762 2012-01-14 Eli Zaretskii <eliz@gnu.org>
12763
12764 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
12765 thrashing the stack of the thread. (Bug#9087)
12766
12767 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
12770
12771 2012-01-11 Eli Zaretskii <eliz@gnu.org>
12772
12773 * xdisp.c (rows_from_pos_range): Handle the case where the
12774 highlight ends on a newline. (Bug#10464)
12775 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
12776 he end column for display of highlight that ends on a newline
12777 before a R2L line.
12778
12779 2012-01-11 Glenn Morris <rgm@gnu.org>
12780
12781 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
12782 from load-path also when installation-directory is nil. (Bug#10208)
12783
12784 2012-01-10 Glenn Morris <rgm@gnu.org>
12785
12786 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
12787
12788 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
12789 Update template values to be closer to their typical values these days.
12790
12791 2012-01-09 Eli Zaretskii <eliz@gnu.org>
12792
12793 * xdisp.c (rows_from_pos_range): Accept additional argument
12794 DISP_STRING, and accept any glyph in a row whose object is that
12795 string as eligible for mouse highlight. Fixes mouse highlight of
12796 display strings from overlays. (Bug#10464)
12797
12798 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
12799
12800 emacs: fix an auto-save permissions race condition (Bug#10400)
12801 * fileio.c (auto_saving_dir_umask): New static var.
12802 (Fmake_directory_internal): Use it.
12803 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12804 creating the directory. The old code temporarily assigns
12805 too-generous permissions to the directory.
12806 (do_auto_save_eh): Clear it.
12807 (Fdo_auto_save): Catch all errors, not just file errors, so
12808 that the var is always cleared.
12809
12810 2012-01-07 Eli Zaretskii <eliz@gnu.org>
12811
12812 * search.c (scan_buffer): Pass character positions to
12813 know_region_cache, not byte positions. (Bug#6540)
12814
12815 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
12816
12817 * w32.c (sys_rename): Report EXDEV when rename of a directory
12818 fails because the target is on another logical disk. (Bug#10284)
12819
12820 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12821
12822 * xterm.c (x_embed_request_focus): New function.
12823
12824 * xterm.h: Add prototype.
12825
12826 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12827
12828 2012-01-05 Glenn Morris <rgm@gnu.org>
12829
12830 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12831
12832 2012-01-01 Eli Zaretskii <eliz@gnu.org>
12833
12834 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12835 Load gnutls_transport_set_lowat only if GnuTLS version is below
12836 2.11.1.
12837 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12838 GnuTLS versions below 2.11.1.
12839
12840 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12841
12842 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12843 to the doc string advising against its use for altering the way
12844 windows are scrolled.
12845
12846 2011-12-28 Kenichi Handa <handa@m17n.org>
12847
12848 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12849 coding-system ASCII compatible only when it does not produce BOM
12850 on encoding (Bug#10383).
12851
12852 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12853
12854 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12855 can scroll.
12856 (create_and_show_popup_menu): Always use menu_position_func for
12857 Gtk3 (Bug#10361).
12858
12859 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12860
12861 * callint.c (Fcall_interactively): Don't truncate prompt string.
12862
12863 2011-12-23 Eli Zaretskii <eliz@gnu.org>
12864
12865 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12866 property that ends at ZV, so that the bidi iteration could be
12867 resumed from there (after widening). (Bug#10360)
12868
12869 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12870
12871 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12872
12873 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12874
12875 * nsterm.m (x_free_frame_resources):
12876 Release f->output_data.ns->miniimage.
12877 (ns_index_color): Fix indentation. Do not retain
12878 color_table->colors[i].
12879
12880 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12881 before returning.
12882
12883 * nsfns.m (x_set_background_color): Assign return value from
12884 ns_index_color to face-background instead of NSColor*.
12885 (ns_implicitly_set_icon_type): Fix indentation.
12886 Change assignment in for loop to comparison.
12887
12888 * emacs.c (ns_pool): New variable.
12889 (main): Assign ns_pool.
12890 (Fkill_emacs): Call ns_release_autorelease_pool.
12891
12892 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12893 autorelease fdesc, release fdAttrs and tdict.
12894 (ns_get_covering_families): Release charset.
12895 (ns_findfonts): Release NSFontDescriptor created with new.
12896 (ns_uni_to_glyphs): Fix indentation.
12897 (setString): Release attrStr before assigning new value.
12898
12899 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12900
12901 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12902 and NS_IMPL_COCOA.
12903 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12904 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12905
12906 2011-12-18 David Reitter <reitter@cmu.edu>
12907
12908 * nsterm.m (ns_term_init): Subscribe for notifications
12909 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12910 to method trackingNotification in EmacsMenu.
12911
12912 * nsmenu.m (trackingMenu): New variable.
12913 (trackingNotification): New method (from Aquamacs).
12914 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
12915 from Aquamacs (Bug#7030).
12916
12917 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12918
12919 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12920 (symbol_to_nsstring): Fix indentation.
12921 (ns_symbol_to_pb): New function.
12922 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12923 (Fns_rotate_cut_buffers_internal): Remove.
12924 (Fns_store_selection_internal): Rename from
12925 Fns_store_cut_buffer_internal.
12926 (ns_get_foreign_selection, Fx_own_selection_internal)
12927 (Fx_disown_selection_internal, Fx_selection_exists_p)
12928 (Fns_get_selection_internal, Fns_store_selection_internal):
12929 Use ns_symbol_to_pb and check if return value is nil.
12930 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12931 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
12932 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12933 renamed to Sns_store_selection_internal.
12934 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12935 and remove this function.
12936 (ns_handle_selection_clear): Remove, never used.
12937 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12938 here.
12939
12940 2011-12-17 Ken Brown <kbrown@cornell.edu>
12941
12942 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12943 GID is unknown (Bug#10257).
12944
12945 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12946
12947 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12948 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12949 which caused a build failure on GNU/Linux IA-64. This problem was
12950 introduced by my 2011-10-07 patch.
12951
12952 2011-12-15 Juri Linkov <juri@jurta.org>
12953
12954 * image.c (imagemagick_error): New function. (Bug#10112)
12955 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12956 Use `imagemagick_error' where ImageMagick functions return
12957 `MagickFalse'.
12958 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12959 proper order.
12960
12961 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12962
12963 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12964 fill background (Bug#8992).
12965
12966 2011-12-13 Martin Rudalics <rudalics@gmx.at>
12967
12968 * window.c (Vwindow_combination_resize)
12969 (Vwindow_combination_limit): Use t instead of non-nil in
12970 doc-strings.
12971 (Vrecenter_redisplay): Add first sentence of doc-string on
12972 separate line.
12973 (Frecenter): Fix doc-string typo.
12974
12975 2011-12-11 Kenichi Handa <handa@m17n.org>
12976
12977 * coding.c (Funencodable_char_position): Pay attention to the
12978 buffer text relocation (Bug#9389).
12979
12980 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12981
12982 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12983 gtk_init (Bug#10100).
12984
12985 2011-12-10 Eli Zaretskii <eliz@gnu.org>
12986
12987 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12988 IT->string is nil. (Bug#10263)
12989
12990 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12991
12992 * nsterm.h (x_free_frame_resources): Declare.
12993
12994 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12995 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12996
12997 * nsterm.h (ns_get_defaults_value): Declare.
12998
12999 * nsterm.m (ns_default): Call ns_get_defaults_value.
13000
13001 2011-12-09 Eli Zaretskii <eliz@gnu.org>
13002
13003 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13004 (Bug#10170)
13005
13006 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13007
13008 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13009 that where the value of an _OBJC_* symbol points to is in the .bss
13010 section (Bug#10240).
13011
13012 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13013
13014 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
13015 after the loop to call ccl_driver at least once (Bug#8619).
13016
13017 2011-12-08 Kenichi Handa <handa@m17n.org>
13018
13019 * ftfont.c (get_adstyle_property): Fix previous change
13020 (Bug#10233).
13021
13022 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
13023
13024 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13025 dirs from the default value of EMACSLOADPATH (bug#10208).
13026
13027 2011-12-07 Glenn Morris <rgm@gnu.org>
13028
13029 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13030 installation and source directories as well. (Bug#10208)
13031
13032 2011-12-06 Chong Yidong <cyd@gnu.org>
13033
13034 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13035
13036 2011-12-06 Glenn Morris <rgm@gnu.org>
13037
13038 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13039 as an error, not just -1. (Bug#10217)
13040
13041 2011-12-05 Chong Yidong <cyd@gnu.org>
13042
13043 * keyboard.c (process_special_events): New function.
13044 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13045
13046 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13047
13048 * coding.c (encode_designation_at_bol): Don't use uninitialized
13049 local variable (Bug#9318).
13050
13051 2011-12-05 Kenichi Handa <handa@m17n.org>
13052
13053 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13054 return Qnil (Bug#8046, Bug#10193).
13055
13056 2011-12-05 Kenichi Handa <handa@m17n.org>
13057
13058 * coding.c (encode_designation_at_bol): New args charbuf_end and
13059 dst. Return the number of produced bytes. Callers changed.
13060 (coding_set_source): Return how many bytes coding->source was
13061 relocated.
13062 (coding_set_destination): Return how many bytes
13063 coding->destination was relocated.
13064 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
13065 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
13066
13067 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13068
13069 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13070 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13071 macro (Bug#9318).
13072
13073 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13074
13075 The following changes are to fix Bug#9318.
13076
13077 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
13078 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13079 (encode_coding_iso_2022, encode_coding_sjis)
13080 (encode_coding_big5, encode_coding_charset): Use the above macros.
13081
13082 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
13083
13084 * lisp.h (process_quit_flag): Fix external declaration.
13085
13086 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13087
13088 Don't macro-inline non-performance-critical code.
13089 * eval.c (process_quit_flag): New function.
13090 * lisp.h (QUIT): Use it.
13091
13092 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13093
13094 * nsfns.m (get_geometry_from_preferences): New function.
13095 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13096
13097 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13098
13099 * emacs.c (Qkill_emacs): Define.
13100 (syms_of_emacs): Initialize it.
13101 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13102 Qquit_flag to `kill-emacs' instead.
13103 (quit_throw_to_read_char): Add parameter `from_signal'.
13104 All callers changed. Call Fkill_emacs if requested and safe.
13105 * lisp.h (QUIT): Call Fkill_emacs if requested.
13106
13107 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13108
13109 * widget.c (update_wm_hints): Return if wmshell is null.
13110 (widget_update_wm_size_hints): New function.
13111
13112 * widget.h (widget_update_wm_size_hints): Declare.
13113
13114 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13115 widget_update_wm_size_hints (Bug#10104).
13116
13117 2011-12-03 Eli Zaretskii <eliz@gnu.org>
13118
13119 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13120 before a newline, prepare the bidi iterator for consuming the
13121 newline, and keep the current paragraph direction. (Bug#10183)
13122 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
13123
13124 2011-12-02 Juri Linkov <juri@jurta.org>
13125
13126 * search.c (Fword_search_regexp): New Lisp function created from
13127 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13128 (Fword_search_backward, Fword_search_forward)
13129 (Fword_search_backward_lax, Fword_search_forward_lax):
13130 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13131 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13132
13133 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13134
13135 * fileio.c (Finsert_file_contents): Move after-change-function call
13136 to before the "handled:" label, since all "goto handled" appear in
13137 cases where the *-change-functions have already been properly called
13138 (bug#10117).
13139
13140 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13141
13142 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13143 waiting for input. (Bug#10169)
13144
13145 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13146
13147 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13148 verifies glyph row's hash code--we have just reallocated the
13149 glyphs, so their contents can be complete garbage. (Bug#10164)
13150
13151 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
13152
13153 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13154
13155 2011-11-30 Eli Zaretskii <eliz@gnu.org>
13156
13157 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13158 attributes are tested _before_ calling verify_row_hash, to protect
13159 against GCC re-ordering of the tests. (Bug#10164)
13160
13161 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13162
13163 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13164
13165 * xterm.c (handle_one_xevent): Only set async_visible and friends
13166 if net_wm_state_hidden_seen is non-zero (Bug#10002)
13167 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
13168 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13169
13170 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13171
13172 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13173 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13174 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13175 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13176 All uses changed to use GCPRO1 etc.
13177 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13178 Revert to old implementation (i.e., before 2011-03-11).
13179
13180 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13181
13182 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13183 of scroll runs so as to avoid assigning disabled bogus rows and
13184 unnecessary graphics copy operations.
13185
13186 2011-11-27 Eli Zaretskii <eliz@gnu.org>
13187
13188 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13189 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13190 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13191 (malloc, free, realloc, calloc): Redirect to e_* only when
13192 compiling Emacs.
13193
13194 * lisp.h (GCTYPEBITS): Move before first use.
13195 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13196 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13197 this macro definition.
13198
13199 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13200 _MSC_VER.
13201
13202 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13203
13204 * gtkutil.c (xg_create_frame_widgets):
13205 Call gtk_window_set_has_resize_grip (FALSE) if that function is
13206 present with Gtk+ 2.0.
13207
13208 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13209
13210 * fileio.c (Finsert_file_contents): Undo previous change; see
13211 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13212
13213 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13214
13215 Rename locals to avoid shadowing.
13216 * fileio.c (Finsert_file_contents):
13217 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13218 * process.c (wait_reading_process_output):
13219 Rename inner 'proc' to 'p' to avoid shadowing.
13220 Indent for consistency with usual Emacs style.
13221
13222 2011-11-25 Eli Zaretskii <eliz@gnu.org>
13223
13224 * xdisp.c (redisplay_window): If cursor row is not fully visible
13225 after recentering, and scroll-conservatively is set to a large
13226 number, scroll window by a few more lines to make the cursor fully
13227 visible and out of scroll-margin. (Bug#10105)
13228 (start_display): Don't move to the next line if the display should
13229 start at a newline that is part of a display vector or an overlay
13230 string. (Bug#10119)
13231
13232 2011-11-24 Juri Linkov <juri@jurta.org>
13233
13234 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13235 after the `MagickPingImage' call. (Bug#10112)
13236
13237 2011-11-23 Chong Yidong <cyd@gnu.org>
13238
13239 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13240
13241 2011-11-23 Martin Rudalics <rudalics@gmx.at>
13242
13243 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13244 making another buffer current. (Bug#10114)
13245
13246 2011-11-23 Glenn Morris <rgm@gnu.org>
13247
13248 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
13249
13250 2011-11-23 Chong Yidong <cyd@gnu.org>
13251
13252 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
13253 using it (Bug#5984).
13254
13255 2011-11-22 Eli Zaretskii <eliz@gnu.org>
13256
13257 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
13258 and header-lines, as they don't have one computed for them.
13259 (Bug#10098)
13260
13261 * .gdbinit (prow): Make displayed values more self-explaining.
13262 Add row's hash code.
13263
13264 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
13265
13266 * process.c (wait_reading_process_output): Fix asynchrounous
13267 GnuTLS socket handling on some versions of the GnuTLS library.
13268 (wait_reading_process_output): Add comment and URL.
13269
13270 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13271
13272 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13273
13274 2011-11-21 Chong Yidong <cyd@gnu.org>
13275
13276 * window.c (Fnext_window, Fprevious_window): Doc fix.
13277
13278 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13279
13280 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13281
13282 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
13283
13284 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13285
13286 2011-11-20 Martin Rudalics <rudalics@gmx.at>
13287
13288 * window.c (Fset_window_combination_limit): Rename argument
13289 STATUS to LIMIT.
13290 (Vwindow_combination_limit): Remove "status" from doc-string.
13291
13292 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13293
13294 * m/ibms390.h: Remove.
13295 * m/ibms390x.h: Don't include "ibms390.h".
13296
13297 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13298
13299 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
13300 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
13301
13302 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
13303
13304 * casetab.c (Fset_case_table):
13305 * charset.c (Fcharset_after): Fix typos.
13306
13307 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
13310 Otherwise, valgrind does not work on some platforms.
13311 Problem reported by Andreas Schwab in
13312 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
13313 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13314 is set, removing the need for VIRT_ADDRESS_VARIES.
13315 (PURE_P): Use a more-efficient implementation that needs just one
13316 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
13317 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
13318 to 4 (xorl, subq, cmpq, setbe).
13319 * alloc.c (pure): Always extern now, since that's the
13320 VIRT_ADDR_VARIES behavior.
13321 (PURE_POINTER_P): Use a single comparison, not two, for
13322 consistency with the new puresize.h.
13323 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
13324 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
13325 Remove VIRT_ADDR_VARIES no longer needed.
13326
13327 2011-11-19 Eli Zaretskii <eliz@gnu.org>
13328
13329 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
13330 (erase_phys_cursor, update_window_cursor, show_mouse_face)
13331 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
13332 behave as if the cursor position were at the window margin.
13333
13334 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
13335 and the cursor position is out of bounds, behave as if the cursor
13336 position were at the window margin. (Bug#10075)
13337
13338 2011-11-18 Chong Yidong <cyd@gnu.org>
13339
13340 * window.c (Fwindow_combination_limit): Make first argument
13341 non-optional, since it is meaningless for live windows like the
13342 selected window.
13343
13344 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
13345
13346 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
13347
13348 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
13349
13350 * intervals.c: Fix grafting over the whole buffer (bug#10071).
13351 (graft_intervals_into_buffer): Simplify.
13352
13353 2011-11-18 Eli Zaretskii <eliz@gnu.org>
13354
13355 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
13356 hash values of the two rows.
13357 (copy_row_except_pointers): Preserve the used[] arrays and the
13358 hash values of the two rows. (Bug#10035)
13359 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
13360
13361 * xdisp.c (row_hash): New function, body extracted from
13362 compute_line_metrics.
13363 (compute_line_metrics): Call row_hash, instead of computing the
13364 hash code inline.
13365
13366 * dispnew.c (verify_row_hash): Call row_hash for computing the
13367 hash code of a row, instead of duplicating code from xdisp.c.
13368
13369 * dispextern.h (row_hash): Add prototype.
13370
13371 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
13372
13373 * frame.c (delete_frame): Don't delete the terminal when the last
13374 X frame is closed if emacs is built with GTK toolkit.
13375
13376 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
13377
13378 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
13379
13380 2011-11-17 Martin Rudalics <rudalics@gmx.at>
13381
13382 * window.c (Vwindow_splits): Rename to
13383 Vwindow_combination_resize. Suggested by Juri Linkov.
13384 (Fsplit_window_internal): Use Vwindow_combination_resize instead
13385 of Vwindow_splits.
13386
13387 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
13388
13389 * nsfns.m (Fns_font_name):
13390 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
13391
13392 2011-11-16 Martin Rudalics <rudalics@gmx.at>
13393
13394 * window.h (window): Rename slot "nest" to "combination_limit".
13395 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
13396 (Fset_window_nest): Rename to Fset_window_combination_limit.
13397 (Vwindow_nest): Rename to Vwindow_combination_limit.
13398 (recombine_windows, make_parent_window, make_window)
13399 (Fsplit_window_internal, saved_window)
13400 (Fset_window_configuration, save_window_save): Rename all
13401 occurrences of window_nest to window_combination_limit.
13402
13403 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
13404
13405 * image.c (imagemagick_load_image): Fix typo.
13406
13407 2011-11-14 Eli Zaretskii <eliz@gnu.org>
13408
13409 * xdisp.c (display_line): Move the call to
13410 highlight_trailing_whitespace before the call to
13411 compute_line_metrics, since the latter needs to see the final
13412 faces of all the glyphs to compute ROW's hash value.
13413 Fixes assertion violations in row_equal_p. (Bug#10035)
13414
13415 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
13416
13417 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
13418 just return (bug#10044).
13419
13420 2011-11-12 Eli Zaretskii <eliz@gnu.org>
13421
13422 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
13423 with user-defined heap size. Bump the default size of the temacs
13424 heap to 27MB, to avoid memory warning when running temacs.
13425 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
13426
13427 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
13428 current_matrix and desired_matrix. (Bug#9990)
13429 (verify_row_hash) [XASSERTS]: New function.
13430 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
13431 that the hash value of glyph rows is correct.
13432
13433 2011-11-12 Martin Rudalics <rudalics@gmx.at>
13434
13435 * window.h (window): Remove splits slot.
13436 * window.c (Fwindow_splits, Fset_window_splits): Remove.
13437 (Fdelete_other_windows_internal, make_parent_window)
13438 (make_window, Fsplit_window_internal, Fdelete_window_internal)
13439 (Fset_window_configuration, save_window_save): Don't deal with
13440 split status of windows.
13441 (saved_window): Remove splits slot.
13442 (Vwindow_splits): Rewrite doc-string.
13443
13444 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
13445
13446 * xfns.c (unwind_create_frame):
13447 * nsfns.m (unwind_create_frame):
13448 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
13449 Vframe_list (Bug#9999).
13450
13451 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
13452
13453 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
13454
13455 2011-11-11 Kenichi Handa <handa@m17n.org>
13456
13457 * callproc.c (Fcall_process): Set the member dst_multibyte of
13458 process_coding.
13459
13460 2011-11-11 Johan Bockgård <bojohan@gnu.org>
13461
13462 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
13463 avoid a crash (bug#9496).
13464
13465 2011-11-09 Chong Yidong <cyd@gnu.org>
13466
13467 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
13468 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
13469
13470 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13471
13472 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
13473
13474 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
13475
13476 Avoid some portability problems by eschewing 'extern inline' functions.
13477 The trivial performance wins aren't worth the portability hassles; see
13478 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
13479 et seq.
13480 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13481 (window_box_width, window_box_left, window_box_left_offset)
13482 (window_box_right, window_box_right_offset): Undo previous change,
13483 by removing the "extern"s.
13484 * intervals.c (adjust_intervals_for_insertion)
13485 (adjust_intervals_for_deletion): Undo previous change,
13486 making these static again.
13487 (offset_intervals, temp_set_point_both, temp_set_point)
13488 (copy_intervals_to_string): No longer inline.
13489 * xdisp.c (window_text_bottom_y, window_box_width)
13490 (window_box_height, window_box_left_offset)
13491 (window_box_right_offset, window_box_left, window_box_right)
13492 (window_box): No longer inline.
13493
13494 2011-11-08 Chong Yidong <cyd@gnu.org>
13495
13496 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
13497 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
13498 Signal an error if not a live window.
13499 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
13500 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
13501
13502 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
13503
13504 * lisp.h (syms_of_abbrev): Remove declaration.
13505 Reported by CHENG Gao <chenggao@royau.me>.
13506
13507 2011-11-07 Eli Zaretskii <eliz@gnu.org>
13508
13509 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
13510 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
13511 of temacs in GUI mode.
13512
13513 2011-11-07 Martin Rudalics <rudalics@gmx.at>
13514
13515 * window.h: Declare delete_all_child_windows instead of
13516 delete_all_subwindows.
13517 * window.c (Fwindow_nest, Fset_window_nest)
13518 (Fset_window_new_total, Fset_window_new_normal)
13519 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
13520 (delete_all_subwindows): Rename to delete_all_child_windows.
13521 (Fdelete_other_windows_internal, Fset_window_configuration):
13522 Call delete_all_child_windows instead of delete_all_subwindows.
13523 * frame.c (delete_frame): Call delete_all_child_windows instead
13524 of delete_all_subwindows.
13525
13526 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
13527
13528 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
13529 This is also needed for porting to any host where GC_MARK_STACK is
13530 not GC_MAKE_GCPROS_NOOPS.
13531 (which_symbols): Use it.
13532
13533 2011-11-07 Kenichi Handa <handa@m17n.org>
13534
13535 * coding.c (coding_set_destination): Check coding->src_pos only
13536 when coding->src_object is a buffer (bug#9910).
13537
13538 * process.c (send_process): Set the member src_multibyte of coding
13539 to 0 (bug#9911) when sending a unibyte text.
13540
13541 * callproc.c (Fcall_process): Set the member src_multibyte of
13542 process_coding to 0 (bug#9912).
13543
13544 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13545
13546 * xmenu.c (cleanup_widget_value_tree): New function.
13547 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
13548 calling free_menubar_widget_value_tree directly (Bug#9830).
13549
13550 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
13551
13552 Fix some portability problems with 'inline'.
13553 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
13554 (window_box_width, window_box_left, window_box_left_offset)
13555 (window_box_right, window_box_right_offset): Declare extern.
13556 Otherwise, these inline functions do not conform to C99 and
13557 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
13558 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
13559 * intervals.c (adjust_intervals_for_insertion)
13560 (adjust_intervals_for_deletion): Now extern, because otherwise the
13561 extern inline functions 'offset_intervals' couldn't refer to it.
13562 (static_offset_intervals): Remove.
13563 (offset_intervals): Rewrite using the old contents of
13564 static_offset_intervals. The old version didn't conform to C99
13565 because an extern inline function contained a reference to an
13566 identifier with static linkage.
13567
13568 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
13569
13570 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
13571 GC.
13572
13573 2011-11-06 Eli Zaretskii <eliz@gnu.org>
13574
13575 * xdisp.c (init_iterator, reseat_to_string): Don't set the
13576 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
13577 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
13578 return Qleft_to_right.
13579
13580 2011-11-06 Chong Yidong <cyd@gnu.org>
13581
13582 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
13583 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
13584 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
13585 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
13586 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
13587 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
13588 (Fwindow_vscroll): Doc fix.
13589 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
13590 argument, since it makes no sense to pass a live window and for
13591 consistency with window-child.
13592
13593 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
13594
13595 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
13596 support MSVC.
13597
13598 2011-11-05 Jason Rumney <jasonr@gnu.org>
13599
13600 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
13601 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
13602 fonts (Bug#6029).
13603 (add_font_entity_to_list): Fix logic errors in mixed boolean and
13604 bitwise arithmetic preventing use of unicode-sip and non-truetype
13605 opentype fonts.
13606
13607 2011-11-05 Eli Zaretskii <eliz@gnu.org>
13608
13609 * s/ms-w32.h (fstat, stat, utime): Move redirections to
13610 "emacs"-only part.
13611
13612 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
13613 initialization code to keep similarity to xfns.c after changes
13614 from 2011-11-05.
13615
13616 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
13617
13618 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
13619 (unwind_create_frame): New function (Bug#9943).
13620 (Fx_create_frame): Restructure code to be more similar to the one in
13621 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
13622 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
13623 Move terminal->reference_count++ just before making the frame official
13624 (Bug#9943).
13625
13626 * nsterm.m (x_free_frame_resources): New function.
13627 (x_destroy_window): Move code to x_free_frame_resources.
13628
13629 * xfns.c (unwind_create_frame): Fix comment.
13630 (Fx_create_frame, x_create_tip_frame):
13631 Move terminal->reference_count++ just before making the frame
13632 official. Move initialization of image_cache_refcount and
13633 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13634
13635 2011-11-05 Eli Zaretskii <eliz@gnu.org>
13636
13637 Support MSVC build with newer versions of Visual Studio.
13638 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13639 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13640 nt/gmake.defs.
13641
13642 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13643 which are not supported by MSVC.
13644 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13645 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13646 bitfields.
13647 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13648 types in bitfields.
13649 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13650
13651 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
13652
13653 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
13654
13655 Support MSVC build with newer versions of Visual Studio.
13656 * w32.c: Don't include w32api.h for MSVC.
13657 (init_environment) [_MSC_VER]: Call sys_access, not _access.
13658
13659 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
13660 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
13661 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
13662 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
13663 e_* cousins.
13664 (alloca) [_MSC_VER]: Define to _alloca.
13665
13666 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
13667
13668 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
13669
13670 2011-11-04 Eli Zaretskii <eliz@gnu.org>
13671
13672 * xdisp.c (note_mouse_highlight): If either of
13673 previous/next-single-property-change returns nil, treat that as
13674 the beginning or the end of the buffer. (Bug#9955)
13675
13676 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
13677
13678 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
13679 label is not null (Bug#9951).
13680 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
13681 may be NULL.
13682
13683 2011-11-04 Eli Zaretskii <eliz@gnu.org>
13684
13685 * window.c (Fwindow_body_size): Mention in the doc string that the
13686 return value is in frame's canonical units. (Bug#9949)
13687
13688 2011-11-03 Eli Zaretskii <eliz@gnu.org>
13689
13690 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
13691
13692 * w32fns.c (unwind_create_frame): If needed, free the glyph
13693 matrices of the partially constructed frame. (Bug#9943)
13694 * xfns.c (unwind_create_frame): Likewise.
13695
13696 2011-11-01 Eli Zaretskii <eliz@gnu.org>
13697
13698 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
13699 Don't stop backward scan on the continuation glyph, even though
13700 its CHARPOS is positive.
13701 (mouse_face_from_buffer_pos, note_mouse_highlight):
13702 Rename cover_string to disp_string.
13703
13704 2011-11-01 Martin Rudalics <rudalics@gmx.at>
13705
13706 * window.c (temp_output_buffer_show): Don't use
13707 Vtemp_buffer_show_specifiers.
13708 (Vtemp_buffer_show_specifiers): Remove unused variable.
13709
13710 2011-10-30 Eli Zaretskii <eliz@gnu.org>
13711
13712 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
13713 past the beginning of the current glyph matrix.
13714
13715 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
13716
13717 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
13718 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
13719 HAVE_GTK3 (Bug#9869).
13720
13721 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
13722 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
13723
13724 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
13725
13726 * xterm.c: Declare x_handle_net_wm_state to return int.
13727 (handle_one_xevent): Check if we are iconified but don't have
13728 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
13729 (get_current_wm_state): Return non-zero if not hidden,
13730 check for _NET_WM_STATE_HIDDEN (Bug#9893).
13731 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
13732 (x_handle_net_wm_state): Return what get_current_wm_state returns.
13733 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
13734
13735 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
13736
13737 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
13738 so that this new function doesn't get optimized away by a
13739 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
13740
13741 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13742
13743 * frame.h (MOUSE_HL_INFO): Remove excess parens.
13744
13745 2011-10-29 Eli Zaretskii <eliz@gnu.org>
13746
13747 Fix the `xbytecode' command.
13748 * .gdbinit (xprintbytestr): New command.
13749 (xwhichsymbols): Rename from `which'; all callers changed.
13750 (xbytecode): Print the byte-code string as well.
13751
13752 2011-10-29 Kim Storm <storm@cua.dk>
13753
13754 * alloc.c (which_symbols): New function.
13755
13756 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13757
13758 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
13759 line. (Bug#9903)
13760
13761 2011-10-29 Glenn Morris <rgm@gnu.org>
13762
13763 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
13764 Not clear what it was for, and it causes various bugs. (Bug#9839)
13765
13766 2011-10-28 Eli Zaretskii <eliz@gnu.org>
13767
13768 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
13769 possible random value that matches one of those tested as
13770 condition to clear the mouse face.
13771
13772 2011-10-28 Chong Yidong <cyd@gnu.org>
13773
13774 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
13775
13776 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
13777
13778 * window.c (make_window): Initialize phys_cursor_on_p.
13779
13780 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
13781
13782 * lisp.h (struct Lisp_Symbol): Update comments.
13783
13784 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
13785
13786 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
13787
13788 2011-10-28 Eli Zaretskii <eliz@gnu.org>
13789
13790 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13791 <oslsachem@gmail.com> for helping to debug this.
13792
13793 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13794 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13795 (g_b_init_get_glyph_outline_w): New static variables.
13796 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13797 (GetGlyphOutlineW_Proc): New typedefs.
13798 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
13799 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13800 New functions.
13801 (w32font_open_internal, compute_metrics):
13802 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
13803 instead of calling the "wide" APIs directly.
13804
13805 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13806
13807 * w32.h (syms_of_w32font): Add prototype.
13808
13809 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
13810
13811 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13812 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13813 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13814 (Fmove_to_window_line): Doc fix.
13815
13816 2011-10-27 Chong Yidong <cyd@gnu.org>
13817
13818 * process.c (make_process): Set gnutls_state to NULL.
13819
13820 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13821 non-NULL, regardless of GNUTLS_INITSTAGE.
13822 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13823 an error. Set process slots as soon as we allocate them.
13824
13825 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13826
13827 2011-10-27 Chong Yidong <cyd@gnu.org>
13828
13829 * gnutls.c (emacs_gnutls_deinit): New function.
13830 Deallocate credentials structures as well as calling gnutls_deinit.
13831 (Fgnutls_deinit, Fgnutls_boot): Use it.
13832
13833 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13834 (deactivate_process): Call emacs_gnutls_deinit.
13835
13836 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
13837
13838 * image.c (x_create_x_image_and_pixmap):
13839 * w32.c (sys_rename, w32_delayed_load):
13840 * w32font.c (fill_in_logfont):
13841 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13842
13843 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
13844
13845 * w32fns.c (w32_default_color_map): New function,
13846 extracted from Fw32_default_color_map.
13847 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
13848
13849 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13850
13851 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13852
13853 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13854
13855 * keyboard.c (test_undefined): New function (bug#9751).
13856 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13857
13858 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13859
13860 * sysdep.c (init_sys_modes): Fix the check for the controlling
13861 terminal (Bug#6649).
13862
13863 2011-10-20 Eli Zaretskii <eliz@gnu.org>
13864
13865 * dispextern.h (struct bidi_it): New member next_en_type.
13866
13867 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13868 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13869 current character, check also for next_en_type being WEAK_EN.
13870 (bidi_resolve_weak): Don't enter the expensive loop if the current
13871 position is before next_en_pos. Record the bidi type of the first
13872 non-ET, non-BN character we find, in addition to its position.
13873 (bidi_level_of_next_char): Invalidate next_en_type when
13874 next_en_pos is over-stepped.
13875
13876 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13877
13878 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13879 * editfns.c: Rewrite current-time-zone so that it invokes
13880 the equivalent of (format-time-string "%Z") to get the time zone name.
13881 This fixes a bug when the time zone name contains characters that
13882 need converting from the system time locale to Emacs internal format.
13883 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13884 that patch fixed format-time-string to do the conversion, but
13885 I forgot to fix current-time-zone.
13886 (format_time_string): New function, containing most of
13887 what Fformat_time_string used to contain.
13888 (Fformat_time_string): Rewrite in terms of format_time_string.
13889 This doesn't change this function's behavior.
13890 (current-time-zone): Rewrite to use format_time_string.
13891 This fixes the bug reported by Michael Schierl in
13892 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13893 Jason Rumney's 2007-06-07 change worked around this bug, but
13894 didn't fix it.
13895 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13896
13897 2011-10-19 Eli Zaretskii <eliz@gnu.org>
13898
13899 * xdisp.c (start_display): If the character at POS is displayed
13900 via a display vector, reset IT->current.dpvec_index to zero.
13901 (try_window_reusing_current_matrix): If a line ends in a display
13902 vector or the next line starts in a display vector, continue
13903 redrawing the window even though the character position of
13904 start_row was reached.
13905 (Bug#9771, part 2)
13906
13907 2011-10-18 Chong Yidong <cyd@gnu.org>
13908
13909 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13910 with nobreak-char-display too.
13911
13912 2011-10-18 Eli Zaretskii <eliz@gnu.org>
13913
13914 Fix part 3 of bug#9771.
13915 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13916 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13917 non-neutral characters if the current character is a paragraph
13918 separator (a.k.a. Newline). This avoids running the same
13919 expensive loop twice, once when we consume the preceding newline
13920 and the other time when the line actually needs to be displayed.
13921 Avoid the loop when we see neutrals on the base embedding level
13922 following a character whose directionality is the same as the
13923 paragraph's. This avoids running the expensive loop when a line
13924 ends in a long sequence of neutrals, like control characters.
13925 Add assertion against STRONG_AL type. Slightly rearrange code
13926 that determines the type of a neutral given the first non-neutral
13927 that follows it.
13928 (bidi_level_of_next_char): Set next_en_pos to zero when
13929 invalidating its info.
13930
13931 2011-10-17 Eli Zaretskii <eliz@gnu.org>
13932
13933 * xdisp.c (push_display_prop): Determine whether to record string
13934 or buffer position by IT->string, not by IT->method. Allow
13935 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
13936 (move_it_vertically_backward): Don't look for character position
13937 immediately after the newline when in a continuation line.
13938 (Bug#9771, part 1)
13939
13940 2011-10-15 Martin Rudalics <rudalics@gmx.at>
13941
13942 * window.c (coordinates_in_window): Rewrite and delabelize
13943 vertical border check. (Bug#5357) (Bug#9618)
13944
13945 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13946
13947 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13948 errors in XSetWindowBorder (bug#9310).
13949
13950 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13951
13952 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13953 avoid crash when xmalloc overrun checking is enabled.
13954
13955 2011-10-13 Eli Zaretskii <eliz@gnu.org>
13956
13957 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13958 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13959 cursor motion with <left> and <right> arrow keys.
13960
13961 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13962 some callers set that themselves.
13963
13964 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13965
13966 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13967 display string and the previous row comes from the same string and
13968 is empty. (Bug#9739) (Bug#9738)
13969
13970 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13971
13972 * doc.c (get_doc_string): Encode file name (bug#9735).
13973
13974 2011-10-12 Eli Zaretskii <eliz@gnu.org>
13975
13976 * bidi.c (bidi_level_of_next_char):
13977 * xdisp.c (get_visually_first_element): Remove old incorrect
13978 comments regarding the Unicode Line Separator character.
13979
13980 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13981
13982 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13983
13984 * alloc.c (Fgc_status): Do not access beyond zombies array
13985 boundary if nzombies > MAX_ZOMBIES.
13986 * alloc.c (dump_zombies): Add missing format specifier.
13987
13988 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13989
13990 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13991 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13992
13993 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13994 Some packages use them to denote characters with modifiers.
13995
13996 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13997
13998 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13999 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14000 matching a pp-number. Rename parameter var to var1.
14001
14002 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14003
14004 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14005
14006 2011-10-08 Glenn Morris <rgm@gnu.org>
14007
14008 * callint.c (Fcall_interactively): Give a more explicit error for the
14009 'c' case with a non-character input. (Bug#8479)
14010
14011 2011-10-08 Eli Zaretskii <eliz@gnu.org>
14012
14013 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14014 lines.
14015 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14016 lines that are hscrolled on the left.
14017
14018 * dispnew.c (buffer_posn_from_coords): Account for a possible
14019 presence of header-line. (Bug#4426)
14020
14021 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14022
14023 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14024 Don't advertise functionality which we discourage or doesn't work.
14025
14026 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14027
14028 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14029 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14030 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14031 this makes Emacs dump core during garbage collection on rare
14032 occasions. sizeof is obviously inferior to offsetof here, so
14033 stick with offsetof.
14034 (GC_POINTER_ALIGNMENT): New macro.
14035 (mark_memory): Omit 3rd (offset) arg; caller changed.
14036 Don't assume EMACS_INT alignment is the same as pointer alignment.
14037
14038 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14039
14040 * keyboard.c (read_key_sequence_remapped): New var.
14041 (read_key_sequence): Compute remapping in the right buffer.
14042 (command_loop_1): Use read_key_sequence's remapping directly.
14043
14044 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14045
14046 * dired.c (file_name_completion): Don't expand file name.
14047 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14048 before checking file name handler.
14049
14050 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14051 they've been requested explicitly (bug#9591).
14052
14053 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
14054
14055 * keymap.c (Fsingle_key_description): Use make_specified_string
14056 instead of build_string to build string from push_key_description.
14057 (Bug#5193)
14058
14059 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14060
14061 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14062 This fixes a Y2038 bug on 64-bit hosts.
14063 * buffer.c (reset_buffer):
14064 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14065 (Fclear_buffer_auto_save_failure):
14066 Use 0, not -1, to represent an unset failure time, since time_t
14067 might not be signed.
14068
14069 Remove dependency on glibc malloc internals.
14070 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14071 Move back here from lisp.h, but with their new implementations.
14072 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14073 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14074 * charset.c (charset_table_init): New static var.
14075 (syms_of_charset): Use it instead of xmalloc. This removes a
14076 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14077 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14078 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14079 Move back to alloc.c.
14080 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14081 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14082
14083 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14084
14085 * nsterm.m (windowDidResize): Call x_set_window_size only when
14086 ns_in_resize is true. Otherwise set pixelwidth/height and
14087 call change_frame_size (Bug#9628).
14088
14089 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14090
14091 Port --enable-checking=all to Fedora 14 x86-64.
14092 * charset.c (syms_of_charset): Also account for glibc malloc's
14093 internal overhead when calculating the initial malloc maximum.
14094
14095 Port --enable-checking=all to Fedora 14 x86.
14096 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14097 Move to lisp.h.
14098 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14099 (overrun_check_realloc, overrun_check_free):
14100 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14101 That way, xmalloc returns a properly-aligned pointer even if
14102 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14103 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14104 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14105 into account when calculating the initial malloc maximum.
14106 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14107 Move here from alloc.c, so that charset.c can use it too.
14108 Properly align; the old code wasn't right for common 32-bit hosts
14109 when configured with --enable-checking=all.
14110 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14111 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14112
14113 2011-09-29 Eli Zaretskii <eliz@gnu.org>
14114
14115 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
14116 use EDOM.
14117
14118 2011-09-28 Eli Zaretskii <eliz@gnu.org>
14119
14120 * xdisp.c (compute_display_string_end): If there's no display
14121 string at CHARPOS, return -1.
14122
14123 * bidi.c (bidi_fetch_char): When compute_display_string_end
14124 returns a negative value, treat the character as a normal
14125 character not covered by a display string. (Bug#9624)
14126
14127 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
14128
14129 * lread.c (Fread_from_string): Fix typo in docstring.
14130
14131 2011-09-27 Eli Zaretskii <eliz@gnu.org>
14132
14133 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14134 newline, reseat the iterator instead of bidi-iterating there one
14135 character at a time. (Bug#9610)
14136 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14137 TO_CHARPOS if the bidi iterator is at base embedding level.
14138
14139 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14140
14141 * lread.c (readevalloop): Use correct code for NBSP.
14142 (read1): Likewise. (Bug#9608)
14143
14144 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
14145
14146 * dbusbind.c (Fdbus_register_signal): When service is not
14147 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14148
14149 2011-09-25 Glenn Morris <rgm@gnu.org>
14150
14151 * buffer.c (truncate-lines): Doc fix.
14152
14153 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
14154
14155 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14156 (Fset_window_next_buffers): Doc fix.
14157
14158 2011-09-24 Glenn Morris <rgm@gnu.org>
14159
14160 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14161
14162 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14163
14164 Fix minor problems found by static checking.
14165 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
14166 * indent.c (Fvertical_motion): Fix == vs = typo.
14167
14168 2011-09-24 Eli Zaretskii <eliz@gnu.org>
14169
14170 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14171 Default value is now t. Doc fix.
14172
14173 * indent.c (Fvertical_motion): Compute and apply the overshoot
14174 logic when moving up, not only when moving down. Fix the
14175 confusing name and values of the it_overshoot_expected variable;
14176 logic changes accordingly. (Bug#9254) (Bug#9549)
14177
14178 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14179 CHARPOS is covered by a display string which includes newlines.
14180 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14181 is covered by a display string with embedded newlines.
14182
14183 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
14184
14185 * dbusbind.c (Fdbus_register_signal): Add match rule to
14186 Vdbus_registered_objects_table. (Bug#9581)
14187 (Fdbus_register_method, Vdbus_registered_objects_table):
14188 Fix docstring.
14189
14190 2011-09-24 Jim Meyering <meyering@redhat.com>
14191
14192 do not ignore write error for any output size
14193 The previous change was incomplete.
14194 While it makes emacs --batch detect the vast majority of stdout
14195 write failures, errors were still ignored whenever the output size is
14196 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14197 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14198 && echo FAIL: ignored write error
14199 FAIL: ignored write error
14200 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14201 && echo FAIL: ignored write error
14202 FAIL: ignored write error
14203 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14204
14205 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14206
14207 * emacs.c (Fkill_emacs): In noninteractive mode exit
14208 non-successfully if a write error occurred on stdout. (Bug#9574)
14209
14210 2011-09-21 Eli Zaretskii <eliz@gnu.org>
14211
14212 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14213 the xassert test.
14214
14215 * dispextern.h (struct it): Update the comment documenting what
14216 can it->OBJECT be.
14217
14218 2011-09-20 Eli Zaretskii <eliz@gnu.org>
14219
14220 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14221 a display string, extend search for cursor position to end of row.
14222 (find_row_edges): If the row ends in a newline from a display
14223 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14224 Handle the case of a display string with multiple newlines.
14225 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14226 non-empty line. Fixes confusing cursor motion with arrow keys at
14227 the beginning of a line that starts with whitespace.
14228
14229 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14230
14231 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14232 (bug#9493).
14233
14234 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
14235
14236 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14237 boolean (Bug#9154).
14238
14239 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14240
14241 * xdisp.c (display_line): Record maximum and minimum buffer
14242 positions even if no glyphs were produced (e.g., by a zero-width
14243 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14244 buffer positions that will be removed from the glyph row because
14245 they don't fit.
14246 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
14247 column is beyond frame width: don't subtract 1 "pixel" when
14248 computing width of the stretch.
14249 (reseat_at_next_visible_line_start): Undo the change made on
14250 2011-09-17 that saved paragraph information and restored it after
14251 the call to `reseat'. (Bug#9545)
14252
14253 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14254
14255 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
14256 and turn window cursor on if cleared (Bug#9415).
14257
14258 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
14259
14260 * search.c (boyer_moore): Take unibyte characters from pattern
14261 literally. (Bug#9458)
14262
14263 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14264
14265 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
14266
14267 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
14268
14269 Fix minor problem found by static checking.
14270 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14271 initialized, to pacify gcc -Wuninitialized.
14272
14273 * fileio.c: Report proper errno when syscall falls.
14274 (Finsert_file_contents): Save and restore errno,
14275 so that report_file_error outputs the correct diagnostic.
14276 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14277
14278 2011-09-18 Eli Zaretskii <eliz@gnu.org>
14279
14280 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14281
14282 2011-09-17 Eli Zaretskii <eliz@gnu.org>
14283
14284 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14285 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14286
14287 2011-09-17 Eli Zaretskii <eliz@gnu.org>
14288
14289 * xdisp.c (reseat_at_next_visible_line_start): Keep information
14290 about the current paragraph and restore it after the call to reseat.
14291
14292 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14293 (bidi_find_paragraph_start): Search back for paragraph beginning
14294 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14295 (bidi_move_to_visually_next): Only trigger paragraph-related
14296 computations when the last character is a newline or at EOB, not
14297 just any NEUTRAL_B. (Bug#9470)
14298
14299 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
14300 truncated lines if point is covered by a display string. (Bug#9524)
14301
14302 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
14303
14304 * xselect.c: Relax test for outgoing X longs (Bug#9498).
14305 (cons_to_x_long): New function.
14306 (lisp_data_to_selection_data): Use it. Correct the test for
14307 short-versus-long data; it was negated. Break out of vector
14308 loop, for efficiency, when a long datum is discovered.
14309
14310 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
14311
14312 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
14313
14314 2011-09-16 Eli Zaretskii <eliz@gnu.org>
14315
14316 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
14317 GCC PR/17406) by declaring this function with external scope.
14318
14319 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14320
14321 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
14322 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
14323
14324 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
14325
14326 * editfns.c (Fformat): Correctly handle text properties on "%%".
14327
14328 2011-09-15 Eli Zaretskii <eliz@gnu.org>
14329
14330 * xterm.c (x_draw_composite_glyph_string_foreground):
14331 * w32term.c (x_draw_composite_glyph_string_foreground):
14332 * term.c (encode_terminal_code):
14333 * composite.c (composition_update_it, get_composition_id):
14334 * xdisp.c (get_next_display_element)
14335 (fill_composite_glyph_string): Add comments about special meaning
14336 of TAB characters in a composition.
14337
14338 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
14339
14340 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
14341 This occurs when processing a multibyte format.
14342 Problem reported by Wolfgang Jenker.
14343
14344 2011-09-15 Johan Bockgård <bojohan@gnu.org>
14345
14346 * xdisp.c (try_cursor_movement): Only check for exact match if
14347 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
14348
14349 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14350
14351 Remove unused external symbols.
14352 * dispextern.h (calc_pixel_width_or_height): Remove decl.
14353 * xdisp.c (calc_pixel_width_or_height): Now static.
14354 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
14355 * indent.c (check_display_width):
14356 * w32term.c: Fix comment to match code.
14357 * xterm.c, xterm.h (x_catching_errors): Remove.
14358
14359 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
14360
14361 * xselect.c: Use signed conversions more consistently (Bug#9498).
14362 (selection_data_to_lisp_data): Assume incoming selection data are
14363 signed integers, not unsigned. This is to be consistent with
14364 outgoing selection data, which was modified to use signed integers
14365 in as part of the fix to Bug#9196 in response to Jan D.'s comment
14366 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
14367 expects long, not unsigned long.
14368
14369 2011-09-14 Eli Zaretskii <eliz@gnu.org>
14370
14371 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
14372 computation of loop end. Reported by Johan Bockgård
14373 <bojohan@gnu.org>.
14374
14375 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
14376
14377 * frame.c (Fother_visible_frames_p): Function deleted.
14378
14379 2011-09-12 Eli Zaretskii <eliz@gnu.org>
14380
14381 * indent.c (compute_motion): Process display vector front to back
14382 rather than the other way around. (Bug#2496)
14383
14384 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
14385
14386 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
14387
14388 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
14389
14390 * minibuf.c (Fread_from_minibuffer): Doc fix.
14391
14392 2011-09-11 Eli Zaretskii <eliz@gnu.org>
14393
14394 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
14395 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
14396
14397 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14398
14399 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
14400 value for non-existent files.
14401
14402 2011-09-11 Eli Zaretskii <eliz@gnu.org>
14403
14404 * fileio.c (Finsert_file_contents): If the file cannot be opened,
14405 set its "size" to -1. This will set the modtime_size field of
14406 the corresponding buffer to -1, which is what
14407 verify-visited-file-modtime expects for files that do not exist.
14408 (Bug#9139)
14409
14410 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
14411
14412 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
14413 here ...
14414 * lisp.h: ... from here. push_key_description is no longer
14415 defined in keyboard.c, so its declaration should not be in
14416 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
14417 logically belongs with push_key_description.
14418
14419 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
14420
14421 * buffer.h: Include <sys/types.h> instead of <time.h>.
14422 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
14423 Problem reported by Herbert J. Skuhra.
14424
14425 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
14426
14427 * xml.c (parse_region): Make the parsing work for
14428 non-comment-starting XML files again (bug#9144).
14429
14430 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
14431
14432 * image.c (gif_load): Fix calculation of bottom and right corner.
14433 (Bug#9468)
14434
14435 2011-09-10 Eli Zaretskii <eliz@gnu.org>
14436
14437 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
14438 redisplay in small windows.
14439
14440 2011-09-09 Eli Zaretskii <eliz@gnu.org>
14441
14442 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
14443
14444 2011-09-08 Martin Rudalics <rudalics@gmx.at>
14445
14446 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
14447 Operate on live windows only.
14448
14449 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
14450
14451 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
14452
14453 2011-09-07 Eli Zaretskii <eliz@gnu.org>
14454
14455 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
14456 only under bidi iteration.
14457
14458 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
14459
14460 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
14461
14462 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14463
14464 isnan: Fix porting problem to Solaris 10 with bundled gcc.
14465 Without this fix, the command to link temacs failed due to an
14466 undefined symbol __builtin_isnan. This is because
14467 /usr/include/iso/math_c99.h #defines isnan(x) to
14468 __builtin_isnan(x), but the bundled gcc, which identifies itself
14469 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
14470 a __builtin_isnan.
14471 * floatfns.c (isnan): #undef, and then #define to a clone of
14472 what's in data.c.
14473 (Fisnan): Always define, since it's always available now.
14474 (syms_of_floatfns): Always define isnan at the Lisp level.
14475
14476 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14477
14478 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
14479
14480 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
14481
14482 * fileio.c: Fix bugs with large file offsets (Bug#9428).
14483 The previous code assumed that file offsets (off_t values) fit in
14484 EMACS_INT variables, which is not true on typical 32-bit hosts.
14485 The code messed up by falsely reporting buffer overflow in cases
14486 such as (insert-file-contents "big" nil 1 2) into an empty buffer
14487 when "big" contains more than 2**29 bytes, even though this
14488 inserts just one byte and does not overflow the buffer.
14489 (Finsert_file_contents): Store file offsets as off_t
14490 values, not as EMACS_INT values. Check for overflow when
14491 converting between EMACS_INT and off_t. When checking for
14492 buffer overflow or for overlap, take the offsets into account.
14493 Don't use EMACS_INT for small values where int suffices.
14494 When checking for overlap, fix a typo: ZV was used where
14495 ZV_BYTE was intended.
14496 (Fwrite_region): Don't assume off_t fits into 'long'.
14497 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
14498
14499 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
14500
14501 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
14502
14503 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14504
14505 sprintf-related integer and memory overflow issues (Bug#9412).
14506
14507 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
14508 (esprintf, exprintf, evxprintf): New functions.
14509 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
14510 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
14511 (modify_event_symbol): Do not assume that the length of
14512 name_alist_or_stem is safe to alloca and fits in int.
14513 (Fexecute_extended_command): Likewise for function name and binding.
14514 (Frecursion_depth): Wrap around reliably on integer overflow.
14515 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
14516 since some callers pass EMACS_INT values.
14517 (Fsingle_key_description): Don't crash if symbol name contains more
14518 than MAX_ALLOCA bytes.
14519 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
14520 (get_minibuffer): Arg is now EMACS_INT, not int.
14521 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
14522 (esprintf, exprintf, evxprintf): New decls.
14523 * window.h (command_loop_level, minibuf_level): Reflect API changes.
14524
14525 * dbusbind.c (signature_cat): New function.
14526 (xd_signature, Fdbus_register_signal):
14527 Do not overrun buffer; instead, report string overflow.
14528
14529 * dispnew.c (add_window_display_history): Don't overrun buffer.
14530 Truncate instead; this is OK since it's just a log.
14531
14532 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
14533 even if the time zone offset is outlandishly large.
14534 Don't mishandle offset == INT_MIN.
14535
14536 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
14537 when creating daemon; the previous buffer-overflow check was incorrect.
14538
14539 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
14540 which has the guts of the old verror function.
14541
14542 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
14543 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
14544
14545 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
14546 (font_unparse_xlfd): Don't blindly alloca long strings.
14547 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
14548 fits in int, when using sprintf. Use single snprintf to count
14549 length of string rather than counting it via multiple sprintfs;
14550 that's simpler and more reliable.
14551 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
14552 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
14553 sprintf, in case result does not fit in int.
14554
14555 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
14556 (fontset_from_font): Print it.
14557
14558 * frame.c (tty_frame_count): Now printmax_t, not int.
14559 (make_terminal_frame, set_term_frame_name): Print it.
14560 (x_report_frame_params): In X, window IDs are unsigned long,
14561 not signed long, so print them as unsigned.
14562 (validate_x_resource_name): Check for implausibly long names,
14563 and don't assume name length fits in 'int'.
14564 (x_get_resource_string): Don't blindly alloca invocation name;
14565 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
14566 not fit in int.
14567
14568 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
14569 (xg_check_special_colors, xg_set_geometry):
14570 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
14571
14572 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
14573 Use esprintf, not sprintf, in case result does not fit in int.
14574
14575 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14576 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
14577 it as a large positive number.
14578 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
14579 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
14580
14581 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14582 in case result does not fit in int.
14583
14584 * print.c (float_to_string): Detect width overflow more reliably.
14585 (print_object): Make sprintf buffer a bit bigger, to avoid potential
14586 buffer overrun. Don't assume list length fits in 'int'. Treat
14587 print length of 0 as 0, not as infinity; to be consistent with other
14588 uses of print length in this function. Don't overflow print length
14589 index. Don't assume hash table size fits in 'long', or that
14590 vectorlike size fits in 'unsigned long'.
14591
14592 * process.c (make_process): Use printmax_t, not int, to format
14593 process-name gensyms.
14594
14595 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
14596
14597 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
14598 to avoid potential buffer overrun.
14599
14600 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
14601 if X resource line is longer than 512 bytes.
14602
14603 * xfns.c (x_window): Make sprintf buffer a bit bigger
14604 to avoid potential buffer overrun.
14605
14606 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
14607
14608 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
14609
14610 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14611
14612 Integer overflow fixes for scrolling, etc.
14613 Without these, Emacs silently mishandles large integers sometimes.
14614 For example, "C-u 4294967297 M-x recenter" was treated as if
14615 it were "C-u 1 M-x recenter" on a typical 64-bit host.
14616
14617 * xdisp.c (try_window_id): Check Emacs fixnum range before
14618 converting to 'int'.
14619
14620 * window.c (window_scroll_line_based, Frecenter):
14621 Check that an Emacs fixnum is in range before assigning it to 'int'.
14622 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
14623 values converted from Emacs fixnums.
14624 (Frecenter): Don't wrap around a line count if it is out of 'int'
14625 range; instead, treat it as an extreme value.
14626 (Fset_window_configuration, compare_window_configurations):
14627 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
14628
14629 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14630 that can exceed INT_MAX. Check that EMACS_INT value is in range
14631 before assigning it to the (possibly-narrower) index.
14632 (match_limit): Don't assume that a fixnum can fit in 'int'.
14633
14634 * print.c (print_object): Use ptrdiff_t, not int, for index that can
14635 exceed INT_MAX.
14636
14637 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
14638 (Fvertical_motion): Don't wrap around LINES values that don't fit
14639 in 'int'. Instead, treat them as extreme values. This is good
14640 enough for windows, which can't have more than INT_MAX lines anyway.
14641
14642 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14643
14644 * Require libxml/parser.h to avoid compilation warning.
14645
14646 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14647
14648 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14649 since this reportedly can destroy thread storage.
14650
14651 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
14652
14653 * syntax.c (find_defun_start): Update all cache variables if
14654 exiting early (Bug#9401).
14655
14656 2011-08-30 Eli Zaretskii <eliz@gnu.org>
14657
14658 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
14659
14660 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
14661 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
14662 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
14663
14664 * term.c (tty_append_glyph): New function.
14665 (produce_stretch_glyph): Static function and its prototype deleted.
14666
14667 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
14668 Add prototypes.
14669
14670 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
14671
14672 * image.c (parse_image_spec): Check for nonnegative, not for positive,
14673 when checking :margin (Bug#9390).
14674 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
14675 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
14676 so that the name doesn't mislead. All uses changed.
14677
14678 2011-08-28 Johan Bockgård <bojohan@gnu.org>
14679
14680 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
14681 set_tty_hooks.
14682
14683 2011-08-27 Eli Zaretskii <eliz@gnu.org>
14684
14685 * xdisp.c (move_it_to): Don't bail out early when reaching
14686 position beyond to_charpos, if we are scanning backwards.
14687 (move_it_vertically_backward): When DY == 0, make sure we get to
14688 the first character in the line after the newline.
14689
14690 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
14691
14692 * ccl.c: Improve and simplify overflow checking (Bug#9196).
14693 (ccl_driver): Do not generate an out-of-range pointer.
14694 (Fccl_execute_on_string): Remove unnecessary check for
14695 integer overflow, noted by Stefan Monnier in
14696 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
14697 Remove a FIXME that didn't need fixing.
14698 Simplify the newly-introduced buffer reallocation code.
14699
14700 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
14701
14702 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
14703
14704 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
14705
14706 Integer and memory overflow issues (Bug#9196).
14707
14708 * doc.c (get_doc_string): Rework so that
14709 get_doc_string_buffer_size is the actual buffer size, rather than
14710 being 1 less than the actual buffer size; this makes xpalloc more
14711 convenient.
14712
14713 * image.c (x_allocate_bitmap_record, cache_image):
14714 * xselect.c (Fx_register_dnd_atom):
14715 Simplify previous changes by using xpalloc.
14716
14717 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
14718 since either will do and ptrdiff_t is convenient with xpalloc.
14719
14720 * charset.c (charset_table_size)
14721 (struct charset_sort_data.priority): Now ptrdiff_t.
14722 (charset_compare): Don't overflow if priorities differ greatly.
14723 (Fsort_charsets): Don't assume list length fits in int.
14724 Check for size-calculation overflow when allocating sort data.
14725 (syms_of_charset): Allocate an initial charset table that is
14726 just under 64 KiB, to avoid problems with glibc malloc and mmap.
14727
14728 * cmds.c (internal_self_insert): Check for size-calculation overflow.
14729
14730 * composite.h (struct composition.glyph_len): Now int, not unsigned.
14731 The actual value is always <= INT_MAX, and leaving it unsigned made
14732 overflow checking harder.
14733
14734 * dispextern.h (struct glyph_matrix.rows_allocated)
14735 (struct face_cache.size): Now ptrdiff_t, for convenience in use
14736 with xpalloc. The values are still always <= INT_MAX.
14737
14738 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
14739
14740 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
14741 (SAFE_NALLOCA): New macro.
14742
14743 * region-cache.c (struct boundary.pos, find_cache_boundary)
14744 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
14745 (set_cache_region, invalidate_region_cache)
14746 (revalidate_region_cache, know_region_cache, region_cache_forward)
14747 (region_cache_backward, pp_cache):
14748 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
14749 so that ptrdiff_t * can be passed to xpalloc.
14750 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
14751 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
14752 (pp_cache): Don't assume cache_len fits in int.
14753 * region-cache.h: Adjust extern decls to match.
14754
14755 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
14756 EMACS_INT, since either will do, for xpalloc.
14757
14758 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
14759 (xnmalloc, xnrealloc, xpalloc): New functions.
14760
14761 * bidi.c (bidi_shelve_header_size): New constant.
14762 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
14763 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
14764
14765 * bidi.c (bidi_cache_shrink):
14766 * buffer.c (overlays_at, overlays_in, record_overlay_string)
14767 (overlay_strings):
14768 Don't update size of array until after memory allocation succeeds,
14769 because xmalloc/xrealloc may not return.
14770 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
14771 now that we have proper integer overflow checking.
14772 (record_overlay_string, overlay_strings): Catch overflows when
14773 calculating size of overlay_str_buf.
14774
14775 * callproc.c (Fcall_process): Check for size overflow when
14776 calculating size of args2.
14777 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
14778 Normally we prefer signed values, but sticking with ptrdiff_t would
14779 require adding more-complicated checks.
14780
14781 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
14782 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
14783 Redo buffer-overflow calculations to avoid integer overflow.
14784 Add a FIXME comment where memory seems to be over-allocated.
14785
14786 * character.c (Fstring): Check for size-calculation overflow.
14787
14788 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
14789 unnecessary integer overflow. Check for size overflow.
14790 (encode_coding_object): Don't update size until xmalloc succeeds.
14791
14792 * composite.c (get_composition_id): Check for overflow in glyph
14793 length calculations.
14794
14795 Integer and memory overflow fixes for display code.
14796 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14797 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14798 (scrolling_window): Check for overflow in size calculations.
14799 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14800 Don't assume glyph table len fits in int.
14801 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14802 (row_table_size): Now ptrdiff_t, not int.
14803 (scrolling_window): Avoid overflow in size calculations.
14804 Don't update size until allocation succeeds.
14805 * fns.c (concat): Check for overflow in size calculations.
14806 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14807 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14808 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14809
14810 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14811 (get_doc_string): Check for size calculation overflow.
14812 Don't update size until allocation succeeds.
14813 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14814 EMACS_INT, where ptrdiff_t will do.
14815 (Fsubstitute_command_keys): Check for string overflow.
14816
14817 * editfns.c (set_time_zone_rule): Don't assume environment length
14818 fits in int.
14819 (message_length): Now ptrdiff_t, not int.
14820 (Fmessage_box): Don't update size until allocation succeeds.
14821 Don't assume message length fits in int.
14822 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14823
14824 * emacs.c (main): Do not reallocate argv, since there is a null at
14825 the end that can be overwritten, and this way there's no need to
14826 worry about size-calculation overflow.
14827 (sort_args): Check for size-calculation overflow.
14828
14829 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14830 alloc succeeds.
14831 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14832
14833 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14834 (x_set_scroll_bar_width, x_figure_window_size):
14835 Check for integer overflow.
14836 (x_set_alpha): Do not assume XINT fits in int.
14837
14838 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14839 This is for the members text_lines, text_cols, total_lines, total_cols,
14840 where the system imposes an 'int' limit.
14841
14842 * fringe.c (Fdefine_fringe_bitmap):
14843 Don't update size until alloc works.
14844
14845 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14846 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14847
14848 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14849 Check for size-calculation overflow.
14850 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14851 do, as we prefer signed integers.
14852 (id_to_widget.max_size, id_to_widget.used)
14853 (xg_store_widget_in_map, xg_remove_widget_from_map)
14854 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14855 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14856 Use and return ptrdiff_t, not int.
14857 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14858 * gtkutil.h: Change prototypes to match the above.
14859
14860 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14861 are duplicate now that they've been promoted to lisp.h.
14862 (x_allocate_bitmap_record, x_alloc_image_color)
14863 (make_image_cache, cache_image, xpm_load):
14864 Don't update size until alloc is done.
14865 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14866 (x_detect_edges):
14867 Check for size calculation overflow.
14868 (ct_colors_allocated_max): New constant.
14869 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14870 overflow.
14871
14872 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14873 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14874 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14875 Use ptrdiff_t, not int, to count maps.
14876 (read_char_minibuf_menu_prompt): Check for overflow in size
14877 calculations. Don't update size until allocation succeeds.
14878 Redo calculations to avoid overflow.
14879 * keyboard.h: Change prototypes to match the above.
14880
14881 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14882 to count maps.
14883 (current_minor_maps): Check for size calculation overflow.
14884 * keymap.h: Change prototypes to match the above.
14885
14886 * lread.c (read1, init_obarray): Don't update size until alloc done.
14887
14888 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14889 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14890
14891 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14892 Now ptrdiff_t, not int.
14893 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14894 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14895
14896 * process.c (Fnetwork_interface_list): Check for overflow
14897 in size calculation.
14898
14899 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14900
14901 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14902 overflow. Don't bother calling xmalloc when xrealloc will do.
14903
14904 * search.c (Freplace_match): Check for size calculation overflow.
14905 (Fset_match_data): Don't assume list lengths fit in 'int'.
14906
14907 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14908 for command line length. Do not attempt to address one before the
14909 beginning of an array, as that's not portable.
14910
14911 * term.c (max_frame_lines): Remove; unused.
14912 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14913 not int.
14914 (encode_terminal_code, calculate_costs): Check for size
14915 calculation overflow.
14916 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14917 table lengths and related sizes. Don't update size until alloc
14918 done. Redo calculations to avoid overflow.
14919 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14920
14921 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14922 subtracting pointers.
14923 (gobble_line): Check for overflow more carefully. Don't update size
14924 until alloc done.
14925
14926 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14927 Don't update size until alloc done.
14928 Redo size calculations to avoid overflow.
14929 Check for size calculation overflow.
14930 (main) [DEBUG]: Fix typo in invoking tparam1.
14931
14932 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14933 Use ptrdiff_t, not int, for sizes.
14934 (store_mode_line_noprop_char): Don't update size until alloc done.
14935
14936 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14937 Use ptrdiff_t, not int, for sizes.
14938 (Finternal_make_lisp_face, cache_face):
14939 Check for size calculation overflow.
14940 (cache_face): Treat size calculation overflows as if they were
14941 memory exhaustion (the usual treatment), rather than aborting.
14942
14943 * xfns.c (x_encode_text, x_set_name_internal)
14944 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14945 sizes, since they can exceed INT_MAX in size. Check for size
14946 calculation overflow.
14947
14948 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14949 (xg_select): Check for size calculation overflow.
14950 Don't update size until alloc done.
14951
14952 * xrdb.c (get_environ_db): Don't assume path length fits in int,
14953 as sprintf is limited to int lengths.
14954
14955 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14956 (X_LONG_MIN): New macros.
14957 Use them to make the following changes clearer.
14958 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14959 This change doesn't affect the value now, but it may help remind
14960 future maintainers not to raise the value too much later.
14961 (SELECTION_QUANTUM): Remove, replacing with ...
14962 (selection_quantum): ... new function, which avoids overflow.
14963 All uses changed.
14964 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14965 assumption that selection length fits in 'int'.
14966 (x_reply_selection_request, x_handle_selection_request)
14967 (x_get_window_property, receive_incremental_selection)
14968 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14969 (lisp_data_to_selection_data, clean_local_selection_data):
14970 Use ptrdiff_t, not int, to record length of selection.
14971 (x_reply_selection_request, x_get_window_property)
14972 (receive_incremental_selection, x_property_data_to_lisp):
14973 Redo calculations to avoid overflow.
14974 (x_reply_selection_request): When sending hint, ceiling it at
14975 X_LONG_MAX rather than relying on wraparound overflow to send
14976 something.
14977 (x_get_window_property, receive_incremental_selection)
14978 (lisp_data_to_selection_data, x_property_data_to_lisp):
14979 Check for size-calculation overflow.
14980 (x_get_window_property, receive_incremental_selection)
14981 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14982 Don't store size until memory allocation succeeds.
14983 (x_get_window_property): Plug memory leak on memory exhaustion.
14984 Don't double-block input; malloc is safe here. Don't assume 2**34
14985 - 4 fits in unsigned long. Add an xassert to check
14986 XGetWindowProperty overflow. Be more careful about overflow
14987 calculations, and distinguish size from memory overflow better.
14988 (receive_incremental_selection): When tracing, don't assume
14989 unsigned int is less than INT_MAX.
14990 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14991 harmful) conversions of unsigned short to int.
14992 (lisp_data_to_selection_data): Don't assume that integers
14993 in the range -65535 through -1 fit in an X unsigned short.
14994 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14995 result parameters unless successful. Rely on cons_to_unsigned
14996 to report problems with elements; the old code wasn't right anyway.
14997 (x_check_property_data): Check for int overflow; we cannot use
14998 a wider type due to X limits.
14999 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15000
15001 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
15002
15003 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15004 (x_term_init): Check for size calculation overflow.
15005 (x_color_cells): Don't store size until memory allocation succeeds.
15006 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
15007 Don't assume alloca size is less than MAX_ALLOCA.
15008 (x_term_init): Don't assume length fits in int (sprintf is limited
15009 to int size).
15010
15011 Use ptrdiff_t for composition IDs.
15012 * character.c (lisp_string_width):
15013 * composite.c (composition_table_size, n_compositions)
15014 (get_composition_id, composition_gstring_from_id):
15015 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15016 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15017 * window.c (Frecenter):
15018 Use ptrdiff_t, not int, for composition IDs.
15019 * composite.c (get_composition_id): Check for integer overflow.
15020 * composite.h: Adjust prototypes to match the above changes.
15021
15022 Use ptrdiff_t for hash table indexes.
15023 * category.c (hash_get_category_set):
15024 * ccl.c (ccl_driver):
15025 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15026 * coding.c (coding_system_charset_list, detect_coding_system):
15027 * coding.h (struct coding_system.id):
15028 * composite.c (get_composition_id, gstring_lookup_cache):
15029 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15030 * image.c (xpm_get_color_table_h):
15031 * lisp.h (hash_lookup, hash_put):
15032 * minibuf.c (Ftest_completion):
15033 Use ptrdiff_t for hash table indexes, not int (which is too
15034 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15035 32-bit --with-wide-int hosts).
15036
15037 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15038 Add a FIXME comment about memory leaks.
15039 (syms_of_charset): Don't assume xmalloc returns.
15040
15041 Don't assume that stated character widths fit in int.
15042 * character.c (Fchar_width, c_string_width, lisp_string_width):
15043 * character.h (CHAR_WIDTH):
15044 * indent.c (MULTIBYTE_BYTES_WIDTH):
15045 Use sanitize_char_width to avoid undefined and/or bad behavior
15046 with outlandish widths.
15047 * character.h (sanitize_tab_width): Rename from sanitize_width,
15048 now that we have two such functions. All uses changed.
15049 (sanitize_char_width): New inline function.
15050
15051 Don't assume that tab-width fits in int.
15052 * character.h (sanitize_width): New inline function.
15053 (SANE_TAB_WIDTH): New macro.
15054 (ASCII_CHAR_WIDTH): Use it.
15055 * indent.c (sane_tab_width): Remove. All uses replaced by
15056 SANE_TAB_WIDTH (current_buffer).
15057 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15058
15059 * fileio.c: Integer overflow issues with file modes.
15060 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15061
15062 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15063 Remove unreachable code.
15064 (read_hex, load_charset_map_from_file): Check for integer overflow.
15065
15066 * xterm.c: Don't go over XClientMessageEvent limit.
15067 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15068 (x_send_scroll_bar_event): Likewise. Check that the size does not
15069 exceed limits imposed by XClientMessageEvent, as well as the usual
15070 ptrdiff_t and size_t limits.
15071
15072 * keyboard.c: Overflow, signedness and related fixes.
15073 (make_lispy_movement): Use same integer type in forward decl
15074 that is used in the definition.
15075 (read_key_sequence, keyremap_step):
15076 Change bufsize argument back to int, undoing my 2011-03-30 change.
15077 We prefer signed types, and int is wide enough here.
15078 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15079 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15080 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15081 length, not size_t. Use ptrdiff_t for index, not int.
15082 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15083 possibility of integer overflow.
15084
15085 Overflow, signedness and related fixes for images.
15086
15087 * dispextern.h (struct it.stack[0].u.image.image_id)
15088 (struct_it.image_id, struct image.id, struct image_cache.size)
15089 (struct image_cache.used, struct image_cache.ref_count):
15090 * gtkutil.c (update_frame_tool_bar):
15091 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15092 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15093 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15094 * nsmenu.m (update_frame_tool_bar):
15095 * xdisp.c (calc_pixel_width_or_height):
15096 * xfns.c (image_cache_refcount):
15097 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15098 on typical 64-bit hosts.
15099
15100 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15101 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15102 Omit unnecessary casts to int.
15103 (parse_image_spec): Check that integers fall into 'int' range
15104 when the callers expect that.
15105 (image_ascent): Redo ascent calculation to avoid int overflow.
15106 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15107 (lookup_image): Remove unnecessary tests.
15108 (xbm_image_p): Locals are now of int, not EMACS_INT,
15109 since parse_image_check makes sure they fit into int.
15110 (png_load, gif_load, svg_load_image):
15111 Prefer int to unsigned where either will do.
15112 (tiff_handler): New function, combining the cores of the
15113 old tiff_error_handler and tiff_warning_handler.
15114 This function is rewritten to use vsnprintf and thereby avoid
15115 stack buffer overflows. It uses only the features of vsnprintf
15116 that are common to both POSIX and native Microsoft.
15117 (tiff_error_handler, tiff_warning_handler): Use it.
15118 (tiff_load, gif_load, imagemagick_load_image):
15119 Don't assume :index value fits in 'int'.
15120 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15121 (imagemagick_load_image): Check that crop parameters fit into
15122 the integer types that MagickCropImage accepts. Don't assume
15123 Vimagemagick_render_type has a nonnegative value. Don't assume
15124 size_t fits in 'long'.
15125 (gs_load): Use printmax_t to print the widest integers possible.
15126 Check for integer overflow when computing image height and width.
15127
15128 2011-08-26 Eli Zaretskii <eliz@gnu.org>
15129
15130 * xdisp.c (redisplay_window): Don't force window start if point
15131 will be invisible in the resulting window. (Bug#9324)
15132
15133 2011-08-25 Eli Zaretskii <eliz@gnu.org>
15134
15135 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15136 the display spec is of the form `(space ...)'.
15137 (handle_display_spec): Return the value returned by
15138 handle_single_display_spec, not just 1 or zero.
15139 (handle_single_display_spec): If the display spec is of the form
15140 `(space ...)', and specifies display in the text area, return 2
15141 rather than 1.
15142 (try_cursor_movement): Check for the need to scroll more
15143 accurately, and prefer exact match for point under bidi.
15144 Don't advance `row' beyond the last row of the window.
15145
15146 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15147 into disp_prop; all users changed.
15148
15149 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15150 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15151 for the text covered by the display property.
15152
15153 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
15154
15155 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15156 Change return value to nil.
15157 (Frecord_buffer): Delete unused function.
15158
15159 2011-08-24 Eli Zaretskii <eliz@gnu.org>
15160
15161 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15162 buffers, return left-to-right.
15163 (set_cursor_from_row): Consider candidate row a win if its glyph
15164 represents a newline and point is on that newline. Fixes cursor
15165 positioning on the newline at EOL of R2L text within L2R
15166 paragraph, and vice versa.
15167 (try_cursor_movement): Check continued rows, in addition to
15168 continuation rows. Fixes unwarranted scroll when point enters a
15169 continued line of R2L text within an L2R paragraph, or vice versa.
15170 (cursor_row_p): Consider the case of point being equal to
15171 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15172 from the end of a short line to the beginning of a continued line
15173 of R2L text within L2R paragraph.
15174 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15175 composed characters.
15176
15177 * bidi.c (bidi_check_type): Use xassert.
15178 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15179 members.
15180
15181 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15182
15183 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15184 a character.
15185
15186 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
15187
15188 * nsfont.m (ns_otf_to_script): Fix typo.
15189
15190 2011-08-22 Kenichi Handa <handa@m17n.org>
15191
15192 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15193 extra slot even if the purpose is char-code-property-table.
15194
15195 2011-08-23 Eli Zaretskii <eliz@gnu.org>
15196
15197 * xdisp.c (redisplay_window): When computing centering_position,
15198 account for the height of the header line. (Bug#8874)
15199
15200 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15201 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15202 candidate is selected by the mouse, and that candidate has a
15203 composed character under the mouse.
15204
15205 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15206 coordinates reported by pos-visible-in-window-p for a composed
15207 character in column zero.
15208
15209 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15210
15211 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15212
15213 2011-08-22 Eli Zaretskii <eliz@gnu.org>
15214
15215 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15216 consider it a hit if to_charpos is anywhere in the range of the
15217 composed buffer positions.
15218
15219 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
15220
15221 * image.c (gif_load): Don't assume that each subimage has the same
15222 dimensions as the base image. Handle disposal method that is
15223 "undefined" by the gif spec (Bug#9335).
15224
15225 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
15226
15227 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
15228 (Fcondition_case): Document `debug' symbol in error handler.
15229
15230 2011-08-19 Eli Zaretskii <eliz@gnu.org>
15231
15232 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15233 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15234 from an Org mode buffer to a Speedbar frame.
15235
15236 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15237 a composition, take its buffer position from IT->cmp_it.charpos.
15238 Fixes cursor positioning at the beginning of a line that begins
15239 with a composed character.
15240
15241 2011-08-18 Eli Zaretskii <eliz@gnu.org>
15242
15243 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15244 character bidirectional type, use STRONG_L instead. Fixes crashes
15245 in a buffer produced by `describe-categories'.
15246
15247 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
15248 members before the level stack, so they would be saved and
15249 restored when copying iterator state. Fixes incorrect reordering
15250 around TABs covered by display properties.
15251
15252 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
15253
15254 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
15255
15256 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
15257
15258 * eval.c (internal_condition_case, internal_condition_case_1)
15259 (internal_condition_case_2, internal_condition_case_n):
15260 Remove unnecessary aborts (Bug#9081).
15261
15262 2011-08-17 Eli Zaretskii <eliz@gnu.org>
15263
15264 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
15265 has no `load' handler, try opening the file locally. (Bug#9311)
15266
15267 2011-08-16 Ken Brown <kbrown@cornell.edu>
15268
15269 * gmalloc.c: Expand comment.
15270
15271 2011-08-16 Eli Zaretskii <eliz@gnu.org>
15272
15273 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15274 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15275
15276 2011-08-16 Ken Brown <kbrown@cornell.edu>
15277
15278 Fix memory allocation problems in Cygwin build (Bug#9273).
15279
15280 * unexcw.c ( __malloc_initialized): Declare external variable.
15281 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15282
15283 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15284 New variables.
15285 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15286 dumped emacs.
15287 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15288 in the static heap.
15289 [CYGWIN] (special_realloc): New function.
15290 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15291 requests to realloc storage in the static heap.
15292
15293 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15294
15295 * bidi.c (bidi_initialize): Remove unused local.
15296
15297 2011-08-15 Eli Zaretskii <eliz@gnu.org>
15298
15299 * bidimirror.h:
15300 * biditype.h: Remove file.
15301 * makefile.w32-in ($(BLD)/bidi.$(O)):
15302 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
15303
15304 * dispextern.h: Fix a typo in the comment to bidi_type_t.
15305
15306 * chartab.c: Improve commentary for the uniprop_table API.
15307
15308 * bidi.c (bidi_paragraph_init): Support zero value of
15309 bidi_ignore_explicit_marks_for_paragraph_level.
15310 (bidi_initialize): Use uniprop_table instead of including
15311 biditype.h and bidimirror.h.
15312
15313 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
15314 coordinates of the iterator when restoring from ppos_it.
15315 (Bug#9296)
15316
15317 2011-08-14 Kenichi Handa <handa@m17n.org>
15318
15319 * process.c (create_process): Call setup_process_coding_systems
15320 after the pid of the process is set to -1 (Bug#8162).
15321
15322 2011-08-14 Eli Zaretskii <eliz@gnu.org>
15323
15324 * xdisp.c (move_it_in_display_line_to): Don't invoke
15325 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
15326 ppos_it. Fixes vertical cursor motion when line beginning is
15327 covered by an image. (Bug#9296)
15328
15329 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
15330
15331 * nsterm.h (ns_run_ascript): Declare.
15332 (NSAPP_DATA2_RUNASSCRIPT): Define.
15333
15334 * nsfns.m (as_script, as_result, as_status): New static variables.
15335 (ns_run_ascript): New function.
15336 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
15337 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
15338 the event loop. Get status from as_status (Bug#7276).
15339
15340 * nsterm.m (sendEvent): If event is NSApplicationDefined and
15341 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
15342 the event loop (Bug#7276).
15343
15344 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
15345
15346 * gnutls.c (QCgnutls_bootprop_priority)
15347 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
15348 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
15349 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
15350 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
15351 (QCgnutls_bootprop_verify_hostname_error)
15352 (QCgnutls_bootprop_callbacks_verify): Rename from
15353 Qgnutls_bootprop_..., all uses changed.
15354
15355 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
15356 uses changed.
15357
15358 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
15359
15360 * xfaces.c (Qframe_set_background_mode): Now static.
15361 * dispextern.h (Qframe_set_background_mode): Remove decl.
15362
15363 * process.c (Fnetwork_interface_info): Declare local only if needed.
15364
15365 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
15366
15367 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
15368 (Fnetwork_interface_list): Allocate in increments of bytes instead
15369 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
15370 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
15371 sockaddr.
15372 (struct ifflag_def): notrailers is smart on OSX.
15373 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
15374 Get hardware address with getifaddrs if available.
15375
15376 2011-08-12 Eli Zaretskii <eliz@gnu.org>
15377
15378 * xdisp.c (iterate_out_of_display_property): xassert that
15379 IT->position is set to within IT->object's boundaries. Break from
15380 the loop as soon as EOB is reached; avoids infloops in redisplay
15381 when IT->position is set up wrongly due to some bug.
15382 Set IT->current to match the bidi iterator unconditionally.
15383 (push_display_prop): Allow GET_FROM_STRING as IT->method on
15384 entry. Force push_it to save on the stack the current
15385 buffer/string position, to be restored by pop_it. Fix flags in
15386 the iterator structure wrt the object coming from a display
15387 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
15388 properties. (Bug#9284)
15389
15390 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
15391
15392 * fontset.c (fontset_get_font_group): Add proper type checks.
15393 (Bug#9172)
15394
15395 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15396
15397 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
15398 and LC_VERSION_MIN_MACOSX.
15399 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
15400 (dump_it) [LC_FUNCTION_STARTS]: Use it.
15401
15402 2011-08-08 Eli Zaretskii <eliz@gnu.org>
15403
15404 * xdisp.c (forward_to_next_line_start): Allow to use the
15405 no-display-properties-and-no-overlays under bidi display.
15406 Set disp_pos in the bidi iterator to avoid searches for display
15407 properties and overlays.
15408
15409 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
15410
15411 * editfns.c (Fset_time_zone_rule): Document relationship with the
15412 setenv function.
15413
15414 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
15415 the font entity extracted from the cache (Bug#8109).
15416
15417 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
15418
15419 * composite.c (autocmp_chars): Don't reset point. That is done by
15420 restore_point_unwind (Bug#5984).
15421
15422 2011-08-07 Juri Linkov <juri@jurta.org>
15423
15424 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
15425 to show the arg `TIME' instead of `TIMEVAL'.
15426
15427 2011-08-06 Eli Zaretskii <eliz@gnu.org>
15428
15429 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
15430 display property strides EOL and includes a newline, as in
15431 longlines-mode. (Bug#9254)
15432 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
15433 word-wrap under bidirectional display. (Bug#9224)
15434
15435 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
15436 is non-zero, even if the data buffer is NULL. Fixes a crash in
15437 vertical-motion with longlines-mode. (Bug#9254)
15438
15439 2011-08-05 Eli Zaretskii <eliz@gnu.org>
15440
15441 * bidi.c <bidi_cache_total_alloc>: Now static.
15442 (bidi_initialize): Initialize bidi_cache_total_alloc.
15443
15444 * xdisp.c (display_line): Release buffer allocated for shelved bidi
15445 cache. (Bug#9221)
15446
15447 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
15448 amount allocated this far in `bidi_cache_total_alloc'.
15449 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
15450 non-zero, only free the data buffer without restoring the cache
15451 contents. All callers changed.
15452
15453 * dispextern.h (bidi_unshelve_cache): Update prototype.
15454
15455 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
15456 (move_it_in_display_line, move_it_to)
15457 (move_it_vertically_backward, move_it_by_lines): Replace the call
15458 to xfree to an equivalent call to bidi_unshelve_cache.
15459 (move_it_in_display_line_to): Fix logic of returning
15460 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
15461
15462 2011-08-05 Eli Zaretskii <eliz@gnu.org>
15463
15464 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
15465 came from a string character with a `cursor' property. (Bug#9229)
15466
15467 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15468
15469 * Makefile.in (LIB_PTHREAD): New variable.
15470 (LIBES): Add LIB_PTHREAD (Bug#9216).
15471
15472 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
15473 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
15474
15475 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
15476
15477 * regex.c (re_iswctype): Remove some redundant boolean conversions.
15478
15479 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
15480
15481 * xterm.c (x_find_topmost_parent): New function.
15482 (x_set_frame_alpha): Find topmost parent window with
15483 x_find_topmost_parent and set the property there also (bug#9181).
15484 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
15485
15486 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
15487
15488 * callproc.c (Fcall_process): Avoid vfork clobbering
15489 the local vars buffer, coding_systems, current_dir.
15490
15491 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
15492
15493 * keymap.c (Fmake_composed_keymap): Move to subr.el.
15494
15495 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
15496
15497 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
15498 so that it is not optimized away.
15499
15500 * xdisp.c (compute_display_string_pos): Remove unused local.
15501
15502 2011-08-02 Eli Zaretskii <eliz@gnu.org>
15503
15504 Fix slow cursor motion and scrolling in large buffers with
15505 selective display, like Org Mode buffers. (Bug#9218)
15506
15507 * dispextern.h (struct bidi_it): New member disp_prop_p.
15508
15509 * xdisp.c: Remove one-slot cache of display string positions.
15510 (compute_display_string_pos): Accept an additional argument
15511 DISP_PROP_P; callers changed. Scan at most 5K characters forward
15512 for a display string or property. If found, set DISP_PROP_P
15513 non-zero.
15514
15515 * bidi.c (bidi_fetch_char): Accept an additional argument
15516 DISP_PROP_P, and pass it to compute_display_string_pos.
15517 Only handle text covered by a display string if DISP_PROP_P is returned
15518 non-zero. All callers of bidi_fetch_char changed.
15519
15520 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
15521
15522 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
15523
15524 2010-12-03 Don March <don@ohspite.net>
15525
15526 * keymap.c (Fdefine_key): Fix non-prefix key error message when
15527 last character M-[char] is translated to ESC [char] (bug#7541).
15528
15529 2011-08-02 Kenichi Handa <handa@m17n.org>
15530
15531 * lisp.h (uniprop_table): Extern it.
15532
15533 * chartab.c (uniprop_table): Make it non-static.
15534
15535 2011-08-01 Eli Zaretskii <eliz@gnu.org>
15536
15537 * xdisp.c (forward_to_next_line_start): Accept additional argument
15538 BIDI_IT_PREV, and store into it the state of the bidi iterator had
15539 on the newline.
15540 (reseat_at_next_visible_line_start): Use the bidi iterator state
15541 returned by forward_to_next_line_start to restore the state of
15542 it->bidi_it after backing up to previous newline. (Bug#9212)
15543
15544 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
15545
15546 * regex.c (re_comp): Protoize.
15547 (re_exec): Fix return type.
15548 (regexec): Fix type of `ret'. (Bug#9203)
15549
15550 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15551
15552 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
15553 This is needed if max-image-size is a floating-point number.
15554
15555 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15556
15557 * print.c (print_object): Print empty symbol as ##.
15558
15559 * lread.c (read1): Read ## as empty symbol.
15560
15561 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15562
15563 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
15564 setting frame foreground color (Bug#9175).
15565 (x_set_background_color): Likewise.
15566
15567 * nsmenu.m (-setText): Size tooltip dimensions precisely to
15568 contents (Bug#9176).
15569 (EmacsTooltip -init): Remove bezels and add shadows to
15570 tooltip windows.
15571
15572 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
15573 or scroll bar (Bug#8470).
15574
15575 * nsfont.m (nsfont_open): Remove assignment to voffset and
15576 unnecessary vars hshink, expand, hd, full_height, min_height.
15577 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
15578
15579 * nsterm.h (nsfont_info): Remove voffset field.
15580
15581 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
15582
15583 Implement strike-through and overline on NextStep (Bug#8863).
15584
15585 * nsfont.m (nsfont_open): Use underline position provided by font,
15586 instead of hard-coded value of 2.
15587 (nsfont_draw): Call ns_draw_text_decoration instead.
15588
15589 * nsterm.h: Add declaration for ns_draw_text_decoration.
15590
15591 * nsterm.m (ns_draw_text_decoration): New function for drawing
15592 underline, overline, and strike-through.
15593 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
15594 ns_draw_text_decoration. Change treatment of cursor drawing to
15595 accommodate underlining, etc.
15596
15597 2011-07-28 Eli Zaretskii <eliz@gnu.org>
15598
15599 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
15600 default.
15601
15602 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15603
15604 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
15605 Without this fix, if a signal arrives just after memory fills up,
15606 'malloc' might be invoked reentrantly.
15607
15608 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
15609 In other words, assume that every image size is allowed, on non-X
15610 hosts. This assumption is probably wrong, but it lets Emacs compile.
15611
15612 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15613
15614 * regex.c (re_iswctype): Convert return values to boolean.
15615
15616 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
15617
15618 * xdisp.c (compute_display_string_pos): Don't use cached display
15619 string position if the buffer had its restriction changed.
15620 (Bug#9184)
15621
15622 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15623
15624 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15625
15626 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15627
15628 Integer signedness and overflow and related fixes. (Bug#9079)
15629
15630 * bidi.c: Integer size and overflow fixes.
15631 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15632 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15633 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15634 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15635 (bidi_find_other_level_edge):
15636 Use ptrdiff_t instead of EMACS_INT where either will do.
15637 This works better on 32-bit hosts configured --with-wide-int.
15638 (bidi_cache_ensure_space): Check for size-calculation overflow.
15639 Use % rather than repeated addition, for better worst-case speed.
15640 Don't set bidi_cache_size until after xrealloc returns, because it
15641 might not return.
15642 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
15643 (bidi_cache_ensure_space): Also check that the bidi cache size
15644 does not exceed that of the largest Lisp string or buffer. See Eli
15645 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
15646
15647 * alloc.c (__malloc_size_t): Remove.
15648 All uses replaced by size_t. See Andreas Schwab's note
15649 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15650
15651 * image.c: Improve checking for integer overflow.
15652 (check_image_size): Assume that f is nonnull, since
15653 it is always nonnull in practice. This is one less thing to
15654 worry about when checking for integer overflow later.
15655 (x_check_image_size): New function, which checks for integer
15656 overflow issues inside X.
15657 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
15658 This removes the need for a memory_full check.
15659 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
15660 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
15661 (xbm_read_bitmap_data): Change locals back to 'int', since
15662 their values must fit in 'int'.
15663 (xpm_load_image, png_load, tiff_load):
15664 Invoke x_create_x_image_and_pixmap earlier,
15665 to avoid much needless work if the image is too large.
15666 (tiff_load): Treat overly large images as if
15667 x_create_x_image_and_pixmap failed, not as malloc failures.
15668 (gs_load): Use x_check_image_size.
15669
15670 * gtkutil.c: Omit integer casts.
15671 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
15672 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
15673
15674 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
15675
15676 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
15677 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
15678 would wrongly return t on a 64-bit host.
15679
15680 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
15681 The plain *_OVERFLOW macros run afoul of GCC bug 49705
15682 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
15683 and therefore cause GCC to emit a bogus diagnostic in some cases.
15684
15685 * image.c: Integer signedness and overflow and related fixes.
15686 This is not an exhaustive set of fixes, but it's time to
15687 record what I've got.
15688 (lookup_pixel_color, check_image_size): Remove redundant decls.
15689 (check_image_size): Don't assume that arbitrary EMACS_INT values
15690 fit in 'int', or that arbitrary 'double' values fit in 'int'.
15691 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
15692 (tiff_load, imagemagick_load_image):
15693 Check for overflow in size calculations.
15694 (x_create_x_image_and_pixmap): Remove unnecessary test for
15695 xmalloc returning NULL; that can't happen.
15696 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
15697 (xpm_color_bucket): Use better integer hashing function.
15698 (xpm_cache_color): Don't possibly over-allocate memory.
15699 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
15700 (gif_memory_source):
15701 Use ptrdiff_t, not int or size_t, to record sizes.
15702 (png_load): Don't assume values greater than 2**31 fit in 'int'.
15703 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
15704 either works, as we prefer signed integers.
15705 (tiff_read_from_memory, tiff_write_from_memory):
15706 Return tsize_t, not size_t, since that's what the TIFF API wants.
15707 (tiff_read_from_memory): Don't fail simply because the read would
15708 go past EOF; instead, return a short read.
15709 (tiff_load): Omit no-longer-needed casts.
15710 (Fimagemagick_types): Don't assume size fits into 'int'.
15711
15712 Improve hashing quality when configured --with-wide-int.
15713 * fns.c (hash_string): New function, taken from sxhash_string.
15714 Do not discard information about ASCII character case; this
15715 discarding is no longer needed.
15716 (sxhash-string): Use it. Change sig to match it. Caller changed.
15717 * lisp.h: Declare it.
15718 * lread.c (hash_string): Remove, since we now use fns.c's version.
15719 The fns.c version returns a wider integer if --with-wide-int is
15720 specified, so this should help the quality of the hashing a bit.
15721
15722 * emacs.c: Integer overflow minor fix.
15723 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
15724 Define only if GNU_LINUX.
15725 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
15726
15727 * dispnew.c: Integer signedness and overflow fixes.
15728 Remove unnecessary forward decls, that were a maintenance hassle.
15729 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
15730 All uses changed.
15731 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
15732 (scrolling_window): Use ptrdiff_t, not int, for byte count.
15733 (prepare_desired_row, line_draw_cost):
15734 Use int, not unsigned, where either works.
15735 (save_current_matrix, restore_current_matrix):
15736 Use ptrdiff_t, not size_t, where either works.
15737 (init_display): Check for overflow more accurately, and without
15738 relying on undefined behavior.
15739
15740 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
15741 Remove, replacing with the new symbols in lisp.h. All uses changed.
15742 * fileio.c (make_temp_name):
15743 * filelock.c (lock_file_1, lock_file):
15744 * xdisp.c (message_dolog):
15745 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
15746 Use pMd etc. instead.
15747 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
15748 replacing the pWIDE etc. symbols removed from editfns.c.
15749
15750 * keyboard.h (num_input_events): Now uintmax_t.
15751 This is (very slightly) less likely to mess up due to wraparound.
15752 All uses changed.
15753
15754 * buffer.c: Integer signedness fixes.
15755 (alloc_buffer_text, enlarge_buffer_text):
15756 Use ptrdiff_t rather than size_t when either will do, as we prefer
15757 signed integers.
15758
15759 * alloc.c: Integer signedness and overflow fixes.
15760 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
15761 (__malloc_size_t): Default to size_t, not to int.
15762 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
15763 (Fgarbage_collect, mark_object_loop_halt, mark_object):
15764 Prefer ptrdiff_t to size_t when either would do, as we prefer
15765 signed integers.
15766 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
15767 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
15768 Now const. Initialize with values that are in range even if char
15769 is signed.
15770 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
15771 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
15772 These functions do the right thing with sizes > 2**32.
15773 (check_depth): Now ptrdiff_t, not int.
15774 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
15775 Adjust to new way of storing sizes. Check for size overflow bugs
15776 in rest of code.
15777 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
15778 slightly wrong anyway, as it missed one instance of
15779 XMALLOC_OVERRUN_CHECK_OVERHEAD.
15780 (refill_memory_reserve): Omit needless cast to size_t.
15781 (mark_object_loop_halt): Mark as externally visible.
15782
15783 * xselect.c: Integer signedness and overflow fixes.
15784 (Fx_register_dnd_atom, x_handle_dnd_message):
15785 Use ptrdiff_t, not size_t, since we prefer signed.
15786 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
15787 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
15788 x_dnd_atoms_size and x_dnd_atoms_length.
15789
15790 * doprnt.c: Prefer signed to unsigned when either works.
15791 * eval.c (verror):
15792 * doprnt.c (doprnt):
15793 * lisp.h (doprnt):
15794 * xdisp.c (vmessage):
15795 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15796 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15797 prefer signed arithmetic to avoid comparison confusion.
15798 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15799 but is a bit tricky.
15800
15801 Assume freestanding C89 headers, string.h, stdlib.h.
15802 * data.c, doprnt.c, floatfns.c, print.c:
15803 Include float.h unconditionally.
15804 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15805 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15806 * regex.c: Likewise for stddef.h, string.h.
15807 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15808 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15809 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15810 (STDC_HEADERS): Remove obsolete defines.
15811 * sysdep.c: Include limits.h unconditionally.
15812
15813 Assume support for memcmp, memcpy, memmove, memset.
15814 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15815 * regex.c (memcmp, memcpy):
15816 Remove; we assume C89 now.
15817
15818 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15819 (__malloc_safe_bcopy): Remove; no longer needed.
15820
15821 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
15822 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15823 well either way, and we prefer signed to unsigned.
15824
15825 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15826
15827 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15828 closes the connection while we're reading (bug#9182).
15829
15830 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
15831
15832 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15833 are specified (Bug#9168).
15834
15835 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15836
15837 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15838 Found by GCC static checking and --with-wide-int on a 32-bit host.
15839
15840 2011-07-25 Eli Zaretskii <eliz@gnu.org>
15841
15842 * xdisp.c (compute_display_string_pos): Fix logic of caching
15843 previous display string position. Initialize cached_prev_pos to
15844 -1. Fixes slow-down at the beginning of a buffer.
15845
15846 2011-07-24 Eli Zaretskii <eliz@gnu.org>
15847
15848 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15849 for attrs[LFACE_FONTSET_INDEX].
15850
15851 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15852
15853 * xml.c (parse_region): Remove unused local
15854 that was recently introduced.
15855
15856 2011-07-23 Eli Zaretskii <eliz@gnu.org>
15857
15858 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15859 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15860
15861 * xdisp.c (move_it_in_display_line_to): Record the best matching
15862 position for TO_CHARPOS while scanning the line, and restore it on
15863 exit if none of the characters scanned was an exact match.
15864 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
15865 when exact match is impossible due to invisible text, and the
15866 lines are truncated.
15867
15868 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15869
15870 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15871 for OSX >= 10.7.
15872
15873 2011-07-22 Eli Zaretskii <eliz@gnu.org>
15874
15875 Fix a significant slow-down of cursor motion with C-n, C-p,
15876 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15877 auto-repeat under bidi redisplay in fontified buffers.
15878 * xdisp.c (compute_stop_pos_backwards): New function.
15879 (next_element_from_buffer): Call compute_stop_pos_backwards to
15880 find a suitable prev_stop when we find ourselves before
15881 base_level_stop.
15882 (reseat): Don't look for prev_stop, as that could mean a very long
15883 run.
15884 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15885 <cached_disp_overlay_modiff>: Cache for last found display string
15886 position.
15887 (compute_display_string_pos): Return the cached position if asked
15888 about the same buffer in the same area of character positions, and
15889 the buffer wasn't changed since the time the display string
15890 position was cached.
15891
15892 2011-07-22 Eli Zaretskii <eliz@gnu.org>
15893
15894 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15895 is an integer, which is important for empty lines. (Bug#9149)
15896
15897 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
15898
15899 * frame.c (Fmodify_frame_parameters): In tty case, update the
15900 default face if necessary (Bug#4238).
15901
15902 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
15903
15904 * editfns.c (Fstring_to_char): No need to explain what a character
15905 is in the docstring (Bug#6576).
15906
15907 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15908
15909 * xml.c (parse_region): Make sure we always return a tree.
15910
15911 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15912
15913 * xml.c (parse_region): If a document contains only comments,
15914 return that, too.
15915
15916 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15917
15918 * xml.c (make_dom): Return comments, too.
15919
15920 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15921
15922 Port to OpenBSD.
15923 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15924 and the surrounding thread.
15925 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15926 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15927 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15928 timer goes off.
15929 * s/openbsd.h (BROKEN_SIGIO): Define.
15930 * unexelf.c (unexec) [__OpenBSD__]:
15931 Don't update the .mdebug section of the Alpha COFF symbol table.
15932
15933 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15934
15935 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15936 (bug#8460).
15937
15938 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15939
15940 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15941 This fixes some race conditions on the permissions of any newly
15942 created file.
15943
15944 * alloc.c (valid_pointer_p): Use pipe, not open.
15945 This fixes some permissions issues when debugging.
15946
15947 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15948 If fchown fails to set both uid and gid, try to set just gid,
15949 as that is sometimes allowed. Adjust the file's mode to eliminate
15950 setuid or setgid bits that are inappropriate if fchown fails.
15951
15952 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15953
15954 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15955 to compare Lisp_Objects.
15956 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15957 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15958 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15959
15960 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15961
15962 * lread.c (read_integer): Unread even EOF character.
15963 (read1): Likewise. Properly record start position of symbol.
15964
15965 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15966 symbol character follows.
15967
15968 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15969
15970 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15971 This works around a problem with the previous change to Fcopy_file.
15972 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15973 and without this change, GCC might complain about discarding
15974 fchown's return value.
15975
15976 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
15977
15978 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15979
15980 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15981
15982 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15983
15984 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15985
15986 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15987 it's used from the C level.
15988
15989 * process.c: Use the same condition for POLL_FOR_INPUT in both
15990 keyboard.c and process.c (bug#1858).
15991
15992 2011-07-09 Lawrence Mitchell <wence@gmx.li>
15993
15994 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15995 (Fgnutls_boot): Use it.
15996
15997 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15998
15999 * doc.c (Fsubstitute_command_keys): Revert last change.
16000
16001 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16002
16003 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16004 quotes the next character, and doesn't affect other longer
16005 sequences (bug#8935).
16006
16007 * lread.c (syms_of_lread): Clarify that is isn't only
16008 `eval-buffer' and `eval-defun' that's affected by
16009 `lexical-binding' (bug#8460).
16010
16011 2011-07-15 Eli Zaretskii <eliz@gnu.org>
16012
16013 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
16014 bidi redisplay when a line includes both an image and is truncated.
16015
16016 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16017
16018 Fix minor problems found by static checking.
16019 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16020 (elsz): Now a signed constant, not a size_t var. We prefer signed
16021 types to unsigned, to avoid integer comparison confusion. Without
16022 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16023 "cannot optimize loop, the loop counter may overflow", a symptom
16024 of the confusion.
16025 * indent.c (Fvertical_motion): Mark locals as initialized.
16026 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16027
16028 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16029
16030 * search.c (Fre_search_backward): Mention `case-fold-search' in
16031 all the re_search_* functions (bug#8138).
16032
16033 * keyboard.c (Fopen_dribble_file): Document when the file is
16034 closed (bug#8056).
16035
16036 2011-07-14 Eli Zaretskii <eliz@gnu.org>
16037
16038 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16039 bidi_cache_idx.
16040
16041 Support bidi reordering of display and overlay strings.
16042 * xdisp.c (compute_display_string_pos)
16043 (compute_display_string_end): Accept additional argument STRING.
16044 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16045 (reseat_to_string): Initialize bidi_it->string.s and
16046 bidi_it->string.schars.
16047 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
16048 NULL (avoids a crash in bidi_paragraph_init).
16049 Initialize itb.string.lstring.
16050 (init_iterator): Call bidi_init_it only of a valid
16051 buffer position was specified. Initialize paragraph_embedding to
16052 L2R.
16053 (reseat_to_string): Initialize the bidi iterator.
16054 (display_string): If we need to ignore text properties of
16055 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16056 original value of -1 will not work with bidi.)
16057 (compute_display_string_pos): First arg is now struct
16058 `text_pos *'; all callers changed. Support display properties on
16059 Lisp strings.
16060 (compute_display_string_end): Support display properties on Lisp
16061 strings.
16062 (init_iterator, reseat_1, reseat_to_string): Initialize the
16063 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16064 when iterating on a string not from display properties).
16065 (compute_display_string_pos, compute_display_string_end):
16066 Fix calculation of the object to scan. Fixes an error when using
16067 arrow keys.
16068 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
16069 base_level_stop; instead, set base_level_stop to BEGV.
16070 Fixes crashes in vertical-motion.
16071 (next_element_from_buffer): Improve commentary for when
16072 the iterator is before prev_stop.
16073 (init_iterator): Initialize bidi_p from the default value of
16074 bidi-display-reordering, not from buffer-local value. Use the
16075 buffer-local value only if initializing for buffer iteration.
16076 (handle_invisible_prop): Support invisible properties on strings
16077 that are being bidi-reordered.
16078 (set_iterator_to_next): Support bidi reordering of C strings and
16079 Lisp strings.
16080 (next_element_from_string): Support bidi reordering of Lisp
16081 strings.
16082 (handle_stop_backwards): Support Lisp strings as well.
16083 (display_string): Support display of R2L glyph rows.
16084 Use IT_STRING_CHARPOS when displaying from a Lisp string.
16085 (init_iterator): Don't initialize it->bidi_p for strings
16086 here.
16087 (reseat_to_string): Initialize it->bidi_p for strings here.
16088 (next_element_from_string, next_element_from_c_string)
16089 (next_element_from_buffer): Add xassert's for correspondence
16090 between IT's object being iterated and it->bidi_it.string
16091 structure.
16092 (face_before_or_after_it_pos): Support bidi iteration.
16093 (next_element_from_c_string): Handle the case of the first string
16094 character that is not the first one in the visual order.
16095 (get_visually_first_element): New function, refactored from common
16096 parts of next_element_from_buffer, next_element_from_string, and
16097 next_element_from_c_string.
16098 (tool_bar_lines_needed, redisplay_tool_bar)
16099 (display_menu_bar): Force left-to-right direction. Add a FIXME
16100 comment for making that be controlled by a user option.
16101 (push_it, pop_it): Save and restore the state of the
16102 bidi iterator. Save and restore the bidi_p flag.
16103 (pop_it): Iterate out of display property for string iteration as
16104 well.
16105 (iterate_out_of_display_property): Support iteration over strings.
16106 (handle_single_display_spec): Set up it->bidi_it for iteration
16107 over a display string, and call bidi_init_it.
16108 (handle_single_display_spec, next_overlay_string)
16109 (get_overlay_strings_1, push_display_prop): Set up the bidi
16110 iterator for displaying display or overlay strings.
16111 (forward_to_next_line_start): Don't use the shortcut if
16112 bidi-iterating.
16113 (back_to_previous_visible_line_start): If handle_display_prop
16114 pushed the iterator stack, restore the internal state of the bidi
16115 iterator by calling bidi_pop_it same number of times.
16116 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16117 and we are bidi-iterating, don't decrement the iterator position;
16118 instead, set the first_elt flag in the bidi iterator, to produce
16119 the same effect.
16120 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16121 (push_display_prop): xassert that we are iterating a buffer.
16122 (push_it, pop_it): Save and restore paragraph_embedding member.
16123 (handle_single_display_spec, next_overlay_string)
16124 (get_overlay_strings_1, reseat_1, reseat_to_string)
16125 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16126 correctly. Don't assume unibyte strings are not bidi-reordered.
16127 (compute_display_string_pos)
16128 (compute_display_string_end): Fix handling the case of C string.
16129 (push_it, pop_it): Save and restore from_disp_prop_p.
16130 (handle_single_display_spec, push_display_prop): Set the
16131 from_disp_prop_p flag.
16132 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16133 (pop_it): Call iterate_out_of_display_property only if we are
16134 popping after iteration over a string that came from a display
16135 property. Fix a typo in popping stretch info. Add an assertion
16136 for verifying that the iterator position is in sync with the bidi
16137 iterator.
16138 (handle_single_display_spec, get_overlay_strings_1)
16139 (push_display_prop): Fix initialization of paragraph direction for
16140 string when that of the parent object is not yet determined.
16141 (reseat_1): Call bidi_init_it to resync the bidi
16142 iterator with IT's position. (Bug#7616)
16143 (find_row_edges): If ROW->start.pos gives position
16144 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16145 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16146 Reset the from_disp_prop_p flag.
16147 (SAVE_IT, RESTORE_IT): New macros.
16148 (pos_visible_p, face_before_or_after_it_pos)
16149 (back_to_previous_visible_line_start)
16150 (move_it_in_display_line_to, move_it_in_display_line)
16151 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16152 (try_scrolling, redisplay_window, display_line): Use them when
16153 saving a temporary copy of the iterator and restoring it back.
16154 (back_to_previous_visible_line_start, reseat_1)
16155 (init_iterator): Empty the bidi cache "stack".
16156 (move_it_in_display_line_to): If iterator ended up at
16157 EOL, but we never saw any buffer positions smaller than
16158 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16159 motion in bidi-reordered lines.
16160 (move_it_in_display_line_to): Record prev_method and prev_pos
16161 immediately before the call to set_iterator_to_next. Fixes cursor
16162 motion in bidi-reordered lines with stretch glyphs and strings
16163 displayed in margins. (Bug#8133) (Bug#8867)
16164 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16165 TO_CHARPOS.
16166 (pos_visible_p): Support positions in bidi-reordered lines.
16167 Save and restore bidi cache.
16168
16169 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16170 (bidi_paragraph_info): Delete unused struct.
16171 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16172 (bidi_cache_start): New variable.
16173 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16174 to zero.
16175 (bidi_cache_fetch_state, bidi_cache_search)
16176 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16177 (bidi_cache_find, bidi_peek_at_next_level)
16178 (bidi_level_of_next_char, bidi_find_other_level_edge)
16179 (bidi_move_to_visually_next): Compare cache index with
16180 bidi_cache_start rather than with zero.
16181 (bidi_fetch_char): Accept new argument STRING; all callers
16182 changed. Support iteration over a string. Support strings with
16183 display properties. Support unibyte strings. Fix the type of
16184 `len' according to what STRING_CHAR_AND_LENGTH expects.
16185 (bidi_paragraph_init, bidi_resolve_explicit_1)
16186 (bidi_resolve_explicit, bidi_resolve_weak)
16187 (bidi_level_of_next_char, bidi_move_to_visually_next):
16188 Support iteration over a string.
16189 (bidi_set_sor_type, bidi_resolve_explicit_1)
16190 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16191 can now be zero (for strings); special values 0 and -1 were
16192 changed to -1 and -2, respectively.
16193 (bidi_char_at_pos): New function.
16194 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16195 Call it instead of FETCH_MULTIBYTE_CHAR.
16196 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16197 initialized to valid values.
16198 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16199 values.
16200 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16201 the test for valid cached positions. Fix the logic for looking up
16202 the sentinel state in the cache. GCPRO the Lisp string we are
16203 iterating.
16204 (bidi_push_it, bidi_pop_it): New functions.
16205 (bidi_initialize): Initialize the bidi cache start stack pointer.
16206 (bidi_cache_ensure_space): New function, refactored from part of
16207 bidi_cache_iterator_state. Don't assume the required size is just
16208 one BIDI_CACHE_CHUNK away.
16209 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16210 (bidi_count_bytes, bidi_char_at_pos): New functions.
16211 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16212 always valid if bidi_cache_idx is valid.
16213 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16214 is valid if it's going to be used.
16215 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16216 (bidi_cache_fetch_state, bidi_cache_search)
16217 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16218 (bidi_cache_iterator_state, bidi_cache_find)
16219 (bidi_find_other_level_edge, bidi_cache_start_stack):
16220 All variables related to cache indices are now EMACS_INT.
16221
16222 * dispextern.h (struct bidi_string_data): New structure.
16223 (struct bidi_it): New member `string'. Make flag members be 1-bit
16224 fields, and put them last in the struct.
16225 (compute_display_string_pos, compute_display_string_end):
16226 Update prototypes.
16227 (bidi_push_it, bidi_pop_it): Add prototypes.
16228 (struct iterator_stack_entry): New members bidi_p,
16229 paragraph_embedding, and from_disp_prop_p.
16230 (struct it): Member bidi_p is now a bit field 1 bit wide.
16231 (bidi_shelve_cache, bidi_unshelve_cache):
16232 Declare prototypes.
16233
16234 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16235 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16236 and vector-like objects.
16237
16238 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16239 cache around display iteration.
16240
16241 * window.c (Fwindow_end, window_scroll_pixel_based)
16242 (displayed_window_lines, Frecenter): Save and restore the bidi
16243 cache around display iteration.
16244
16245 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16246
16247 * editfns.c (Fdelete_region): Clarify the use of the named
16248 parameters (bug#6788).
16249
16250 2011-07-14 Martin Rudalics <rudalics@gmx.at>
16251
16252 * indent.c (Fvertical_motion): Set and restore w->pointm when
16253 saving and restoring the window's buffer (Bug#9006).
16254
16255 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
16256
16257 * editfns.c (Fstring_to_char): Clarify just what is returned
16258 (bug#6576). Text by Eli Zaretskii.
16259
16260 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
16261
16262 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
16263
16264 2011-07-13 Eli Zaretskii <eliz@gnu.org>
16265
16266 * buffer.c (mmap_find): Fix a typo.
16267
16268 2011-07-13 Johan Bockgård <bojohan@gnu.org>
16269
16270 Fix execution of x selection hooks.
16271 * xselect.c (Qx_lost_selection_functions)
16272 (Qx_sent_selection_functions): New vars.
16273 (syms_of_xselect): DEFSYM them.
16274 (x_handle_selection_request): Pass Qx_sent_selection_functions
16275 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16276 (x_handle_selection_clear,x_clear_frame_selections):
16277 Pass Qx_lost_selection_functions rather than
16278 Vx_lost_selection_functions to Frun_hook_with_args.
16279
16280 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16281
16282 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
16283 The old code sometimes used this field without initializing it.
16284
16285 * alloc.c (gc_sweep): Don't read past end of array.
16286 In theory, the old code could also have corrupted Emacs internals,
16287 though it'd be very unlikely.
16288
16289 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16290
16291 * character.c (Fcharacterp): Don't advertise optional ignored
16292 argument. (Bug#4026)
16293
16294 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16295
16296 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16297 key" (bug#4257).
16298
16299 * window.c (Fset_window_start): Doc fix (bug#4199).
16300 (Fset_window_hscroll): Ditto.
16301
16302 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
16303
16304 Fix minor new problems caught by GCC 4.6.1.
16305 * term.c (init_tty): Remove unused local.
16306 * xsettings.c (store_monospaced_changed): Define this function only
16307 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
16308 not used otherwise.
16309
16310 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
16311
16312 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
16313
16314 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16315
16316 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
16317 are the mini-buffer and the echo area (bug#3320).
16318
16319 * term.c (init_tty): Remove support for supdup, c10 and perq
16320 terminals, which are no longer supported (bug#1482).
16321
16322 2011-07-10 Johan Bockgård <bojohan@gnu.org>
16323
16324 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
16325
16326 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
16327
16328 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
16329 for non-popups (Bug#3642).
16330
16331 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
16332
16333 * alloc.c (reset_malloc_hooks): Protoize.
16334 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
16335 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
16336 * cm.c (losecursor): Likewise.
16337 * data.c (fmod): Likewise.
16338 * dispnew.c (swap_glyphs_in_rows): Likewise.
16339 * emacs.c (memory_warning_signal): Likewise.
16340 * floatfns.c (float_error): Likewise.
16341 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
16342 (otf_open, font_otf_capability, generate_otf_features)
16343 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
16344 Likewise.
16345 * image.c (pbm_read_file): Likewise.
16346 * indent.c (string_display_width): Likewise.
16347 * intervals.c (check_for_interval, search_for_interval)
16348 (inc_interval_count, count_intervals, root_interval)
16349 (adjust_intervals_for_insertion, make_new_interval): Likewise.
16350 * lread.c (defalias): Likewise.
16351 * ralloc.c (r_alloc_check): Likewise.
16352 * regex.c (set_image_of_range_1, set_image_of_range)
16353 (regex_grow_registers): Likewise.
16354 * sysdep.c (strerror): Likewise.
16355 * termcap.c (valid_filename_p, tprint, main): Likewise.
16356 * tparam.c (main): Likewise.
16357 * unexhp9k800.c (run_time_remap, save_data_space)
16358 (update_file_ptrs, read_header, write_header, calculate_checksum)
16359 (copy_file, copy_rest, display_header): Likewise.
16360 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
16361 Likewise.
16362 * xdisp.c (check_it): Likewise.
16363 * xfaces.c (register_color, unregister_color, unregister_colors):
16364 Likewise.
16365 * xfns.c (print_fontset_result): Likewise.
16366 * xrdb.c (member, fatal, main): Likewise.
16367
16368 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
16369
16370 Fix minor problems found by static checking (Bug#9031).
16371 * chartab.c (char_table_set_range, map_sub_char_table):
16372 Remove unused locals.
16373 (uniprop_table): Now static.
16374 * composite.c (_work_char): Remove unused static var.
16375
16376 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
16377
16378 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
16379
16380 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
16381
16382 * gtkutil.c (qttip_cb): Remove code without function.
16383
16384 2011-07-09 Eli Zaretskii <eliz@gnu.org>
16385
16386 * w32.c (pthread_sigmask): New stub.
16387
16388 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
16389
16390 Use pthread_sigmask, not sigprocmask (Bug#9010).
16391 sigprocmask is portable only for single-threaded applications, and
16392 Emacs can be multi-threaded when it uses GTK.
16393 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
16394 (LIBES): Use it.
16395 * callproc.c (Fcall_process):
16396 * process.c (create_process):
16397 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
16398 Use pthread_sigmask, not sigprocmask.
16399
16400 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16401
16402 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
16403 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
16404 wrong (Bug#8591).
16405
16406 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16407
16408 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
16409 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
16410 (xg_hide_tooltip): Fix comment.
16411
16412 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
16413 in registerServicesMenuSendTypes.
16414 (validRequestorForSendType): Don't check ns_return_types.
16415
16416 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
16417 ns_return_type.
16418
16419 2011-07-08 Jason Rumney <jasonr@gnu.org>
16420
16421 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
16422 SH_SHOW for hidden windows (Bug#5482).
16423
16424 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
16425 frame struct members of non-existent frames (Bug#6284).
16426
16427 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
16428
16429 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
16430 variable firstTime not needed on OSX >= 10.6.
16431 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
16432 >= 10.5. Use setKnobProportion, setDoubleValue.
16433
16434 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
16435 (MAC_OS_X_VERSION_10_5): Define if not defined.
16436 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
16437 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
16438 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
16439
16440 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
16441 cString and lossyCString on OSX >= 10.4.
16442
16443 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
16444 sizeToFit on OSX >= 10.2.
16445
16446 * nsimage.m (allocInitFromFile): Don't use deprecated method
16447 bestRepresentationForDevice on OSX >= 10.6.
16448
16449 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
16450 to avoid warning.
16451
16452 * emacs.c: Declare unexec_init_emacs_zone.
16453
16454 * nsgui.h: Fix compiler warning about gnulib redefining verify.
16455
16456 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
16457
16458 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
16459 on svcsMenu (Bug#8842).
16460
16461 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
16462 ns_return_types.
16463 (Fns_list_services): Just return Qnil on 10.6, code not working there.
16464
16465 * nsterm.m (QUTF8_STRING): Declare.
16466 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
16467 (validRequestorForSendType): Return type is (id).
16468 Change indexOfObjectIdenticalTo to indexOfObject.
16469 Check if we have local selection before returning self (Bug#8842).
16470 (writeSelectionToPasteboard): Put local selection into paste board
16471 if we have a local selection (Bug#8842).
16472 (syms_of_nsterm): DEFSYM QUTF8_STRING.
16473
16474 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
16475 (ns_get_local_selection): Declare.
16476
16477 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
16478
16479 * keymap.c (describe_map_tree): Don't insert a double newline at
16480 the end of the buffer (bug#1169) and return whether we inserted
16481 something.
16482
16483 * callint.c (Fcall_interactively): Change "reading args" to
16484 "providing args" to try to clarify what it does (bug#1010).
16485
16486 2011-07-07 Kenichi Handa <handa@m17n.org>
16487
16488 * composite.c (composition_compute_stop_pos): Ignore a static
16489 composition starting before CHARPOS (Bug#8915).
16490
16491 * xdisp.c (handle_composition_prop): Likewise.
16492
16493 2011-07-07 Eli Zaretskii <eliz@gnu.org>
16494
16495 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
16496 (Bug#9015)
16497
16498 2011-07-07 Kenichi Handa <handa@m17n.org>
16499
16500 * character.h (unicode_category_t): New enum type.
16501
16502 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
16503 (Qchar_code_property_table): New variable.
16504 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
16505 (UNIPROP_COMPRESSED_FORM_P): New macros.
16506 (char_table_ascii): Uncompress the compressed values.
16507 (sub_char_table_ref): New arg is_uniprop. Callers changed.
16508 Uncompress the compressed values.
16509 (sub_char_table_ref_and_range): Likewise.
16510 (char_table_ref_and_range): Uncompress the compressed values.
16511 (sub_char_table_set): New arg is_uniprop. Callers changed.
16512 Uncompress the compressed values.
16513 (sub_char_table_set_range): Args changed. Callers changed.
16514 (char_table_set_range): Adjuted for the above change.
16515 (map_sub_char_table): Delete args default_val and parent. Add arg
16516 top. Give decoded values to a Lisp function.
16517 (map_char_table): Adjust for the above change. Give decoded
16518 values to a Lisp function. Gcpro more variables.
16519 (uniprop_table_uncompress)
16520 (uniprop_decode_value_run_length): New functions.
16521 (uniprop_decoder, uniprop_decoder_count): New variables.
16522 (uniprop_get_decoder, uniprop_encode_value_character)
16523 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
16524 New functions.
16525 (uniprop_encoder, uniprop_encoder_count): New variables.
16526 (uniprop_get_encoder, uniprop_table)
16527 (Funicode_property_table_internal, Fget_unicode_property_internal)
16528 (Fput_unicode_property_internal): New functions.
16529 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
16530 Sunicode_property_table_internal, Sget_unicode_property_internal,
16531 and Sput_unicode_property_internal. Defvar_lisp
16532 char-code-property-alist.
16533
16534 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
16535 Vunicode_category_table.
16536
16537 * font.c (font_range): Adjust for the change of
16538 Vunicode_category_table.
16539
16540 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
16541
16542 * m/iris4d.h: Remove file, move contents ...
16543 * s/irix6-5.h: ... here.
16544
16545 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
16546
16547 Remove unportable assumption about struct layout (Bug#8884).
16548 * alloc.c (mark_buffer):
16549 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
16550 (clone_per_buffer_values): Don't assume that
16551 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
16552 This isn't true in general, and it's particularly not true
16553 if Emacs is configured with --with-wide-int.
16554 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
16555 New macros, used in the buffer.c change.
16556
16557 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
16558
16559 * xsettings.c: Use both GConf and GSettings if both are available.
16560 (store_config_changed_event): Add comment.
16561 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
16562 (store_tool_bar_style_changed): New functions.
16563 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
16564 (struct xsettings): Move font inside HAVE_XFT.
16565 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
16566 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
16567 Move inside HAVE_XFT.
16568 (something_changed_gsettingsCB): Rename from something_changedCB.
16569 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
16570 also.
16571 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
16572 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
16573 (something_changed_gconfCB): Rename from something_changedCB.
16574 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
16575 (parse_settings): Move check for font inside HAVE_XFT.
16576 (read_settings, apply_xft_settings): Add comment.
16577 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
16578 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
16579 call store_font_name_changed.
16580 (xft_settings_event): Add comment.
16581 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16582 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
16583 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
16584 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
16585 (xsettings_initialize): Call init_gsettings last.
16586 (xsettings_get_system_font, xsettings_get_system_normal_font):
16587 Add comment.
16588
16589 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
16590
16591 Random fixes. E.g., (random) never returned negative values.
16592 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
16593 subseconds part to the entropy, as that's a bit more random.
16594 Prefer signed to unsigned, since the signedness doesn't matter and
16595 in general we prefer signed. When given a limit, use a
16596 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
16597 latter isn't right if USE_2_TAGS_FOR_INTS.
16598 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
16599 not 0..VALMASK. Don't discard "excess" bits that random () returns.
16600
16601 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
16602
16603 * textprop.c (text_property_stickiness):
16604 Obey Vtext_property_default_nonsticky.
16605 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
16606 * w32fns.c (syms_of_w32fns):
16607 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
16608
16609 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16610
16611 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
16612 This is more efficient than Ffile_directory_p and avoids a minor race.
16613
16614 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
16615
16616 * buffer.c (Foverlay_put): Say what the return value is
16617 (bug#7835).
16618
16619 * fileio.c (barf_or_query_if_file_exists): Check first if the file
16620 is a directory before asking whether to use the file name
16621 (bug#7564).
16622 (barf_or_query_if_file_exists): Make the "File is a directory"
16623 error be more correct.
16624
16625 * fns.c (Frequire): Remove the mention of the .gz files, since
16626 that's installation-specific, but keep the mention of
16627 `get-load-suffixes'.
16628
16629 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16630
16631 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16632 Report string overflow if the output is too long.
16633
16634 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
16635
16636 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16637 (syms_of_gnutls): Remove duplicate DEFSYM for
16638 Qgnutls_bootprop_verify_hostname_error, an error for
16639 Qgnutls_bootprop_verify_error (which is no longer used).
16640
16641 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16642 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16643 Also (re)move comments that are misplaced or no longer relevant.
16644
16645 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16646
16647 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16648
16649 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
16650
16651 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
16652 and background color parameters if they have been changed.
16653
16654 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16655
16656 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
16657
16658 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
16659
16660 * xsettings.c (SYSTEM_FONT): Define only when used.
16661 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
16662
16663 * keymap.c (access_keymap_1): Now static.
16664
16665 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
16666
16667 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
16668 leave any prefix arg for the up event (Bug#1586).
16669
16670 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
16671
16672 * lread.c (syms_of_lread): Mention single symbols defined by
16673 `defvar' or `defconst' (bug#7154).
16674
16675 * fns.c (Frequire): Mention .el.gz files (bug#7314).
16676 (Frequire): Mention get-load-suffixes.
16677
16678 2011-07-02 Martin Rudalics <rudalics@gmx.at>
16679
16680 * window.h (window): Remove clone_number slot.
16681 * window.c (Fwindow_clone_number, Fset_window_clone_number):
16682 Remove.
16683 (make_parent_window, make_window, saved_window)
16684 (Fset_window_configuration, save_window_save): Don't deal with
16685 clone numbers.
16686 * buffer.c (Qclone_number): Remove declaration.
16687 (sort_overlays, overlay_strings): Don't deal with clone numbers.
16688
16689 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
16690
16691 Add multiple inheritance to keymaps.
16692 * keymap.c (Fmake_composed_keymap): New function.
16693 (Fset_keymap_parent): Simplify.
16694 (fix_submap_inheritance): Remove.
16695 (access_keymap_1): New function extracted from access_keymap to handle
16696 embedded parents and handle lists of maps.
16697 (access_keymap): Use it.
16698 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
16699 (Fcopy_keymap): Handle embedded parents.
16700 (Fcommand_remapping, define_as_prefix): Simplify.
16701 (Fkey_binding): Simplify.
16702 (syms_of_keymap): Move minibuffer-local-completion-map,
16703 minibuffer-local-filename-completion-map,
16704 minibuffer-local-must-match-map, and
16705 minibuffer-local-filename-must-match-map to Elisp.
16706 (syms_of_keymap): Defsubr make-composed-keymap.
16707 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
16708 (parse_menu_item): Trivial simplification.
16709
16710 2011-07-01 Glenn Morris <rgm@gnu.org>
16711
16712 * Makefile.in (SETTINGS_LIBS): Fix typo.
16713
16714 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
16715
16716 * coding.c (Fencode_coding_string): Record the last coding system
16717 used, as the function doc string says (bug#8738).
16718
16719 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
16720
16721 * xsettings.c (store_monospaced_changed): Take new font as arg and
16722 check for change against current_mono_font.
16723 (EMACS_TYPE_SETTINGS): Remove this and related defines.
16724 (emacs_settings_constructor, emacs_settings_get_property)
16725 (emacs_settings_set_property, emacs_settings_class_init)
16726 (emacs_settings_init, gsettings_obj): Remove.
16727 (something_changedCB): New function for HAVE_GSETTINGS.
16728 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
16729 with value as argument.
16730 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
16731 g_settings_new (Bug#8967). Do not create gsettings_obj.
16732 Remove calls to g_settings_bind. Connect something_changedCB to
16733 "changed".
16734
16735 * xgselect.c: Add defined (HAVE_GSETTINGS).
16736 (xgselect_initialize): Ditto.
16737
16738 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
16739 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
16740 xg_select.
16741
16742 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
16743
16744 * eval.c (struct backtrace): Simplify and port the data structure.
16745 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
16746 signed bit field, as this assumption is not portable and it makes
16747 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
16748 "char debug_on_exit : 1" as this is not portable either; instead,
16749 use the portable "unsigned int debug_on_exit : 1". Remove unused
16750 member evalargs. Remove obsolete comments about cc bombing out.
16751
16752 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
16753
16754 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
16755 Let HAVE_GSETTINGS override HAVE_GCONF.
16756 (store_monospaced_changed): New function.
16757 (EMACS_SETTINGS): A new type derived from GObject to handle
16758 GSettings notifications.
16759 (emacs_settings_constructor, emacs_settings_get_property)
16760 (emacs_settings_set_property, emacs_settings_class_init):
16761 New functions.
16762 (gsettings_client, gsettings_obj): New variables.
16763 (GSETTINGS_SCHEMA): New define.
16764 (something_changedCB): Call store_monospaced_changed.
16765 (init_gsettings): New function.
16766 (xsettings_initialize): Call init_gsettings.
16767 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
16768 to NULL.
16769
16770 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
16771 GCONF_CFLAGS/LIBS.
16772
16773 2011-06-29 Martin Rudalics <rudalics@gmx.at>
16774
16775 * window.c (resize_root_window, grow_mini_window)
16776 (shrink_mini_window): Rename Qresize_root_window to
16777 Qwindow_resize_root_window and Qresize_root_window_vertically to
16778 Qwindow_resize_root_window_vertically.
16779
16780 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
16781
16782 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
16783
16784 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
16785
16786 * makefile.w32-in: Redesign dependencies so they reflect more
16787 clearly which files are directly included by each source file,
16788 and not through other includes.
16789
16790 2011-06-27 Martin Rudalics <rudalics@gmx.at>
16791
16792 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16793 (sort_overlays, overlay_strings): When an overlay's clone number
16794 matches the window's clone number process the overlay even if
16795 the overlay's window property doesn't match the current window.
16796
16797 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16798 (Fwindow_hchild): Rename to Fwindow_left_child.
16799 (Fwindow_next): Rename to Fwindow_next_sibling.
16800 (Fwindow_prev): Rename to Fwindow_prev_sibling.
16801 (resize_window_check): Rename to window_resize_check.
16802 (resize_window_apply): Rename to window_resize_apply.
16803 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16804 (Fdelete_other_windows_internal, resize_frame_windows)
16805 (Fsplit_window_internal, Fdelete_window_internal)
16806 (grow_mini_window, shrink_mini_window)
16807 (Fresize_mini_window_internal): Fix callers accordingly.
16808
16809 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16810
16811 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16812 (emacs_fixed_set_min_size): Remove.
16813 (emacs_fixed_new): Take frame as argument.
16814
16815 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16816 (_EmacsFixedPrivate): Remove minwidth/height.
16817 Add struct frame *f.
16818 (emacs_fixed_init): Initialize priv->f.
16819 (get_parent_class, emacs_fixed_set_min_size): Remove.
16820 (emacs_fixed_new): Set priv->f to argument.
16821 (emacs_fixed_get_preferred_width)
16822 (emacs_fixed_get_preferred_height): Use min_width/height from
16823 frames size_hint to set minimum and natural (Bug#8919).
16824 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16825 and use min_width/height from frames size_hint to set
16826 min_width/height (Bug#8919).
16827
16828 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
16829 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16830 Fix indentation.
16831
16832 2011-06-26 Eli Zaretskii <eliz@gnu.org>
16833
16834 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16835 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16836 called at ZV.
16837
16838 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
16839
16840 * process.c (wait_reading_process_output): Bypass select if
16841 waiting for a cell while ignoring keyboard input, and input is
16842 pending. Suggested by Jan Djärv (Bug#8869).
16843
16844 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16845
16846 Use gnulib's dup2 module instead of rolling our own.
16847 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16848
16849 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16850
16851 * dispnew.c (scrolling_window): Before scrolling, turn off a
16852 mouse-highlight in the window being scrolled.
16853
16854 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
16855
16856 Move DEFSYM to lisp.h and use everywhere.
16857
16858 * character.h (DEFSYM): Move declaration...
16859 * lisp.h (DEFSYM): ...here.
16860
16861 * gnutls.c:
16862 * minibuf.c:
16863 * w32menu.c:
16864 * w32proc.c:
16865 * w32select.c: Don't include character.h.
16866
16867 * alloc.c (syms_of_alloc):
16868 * buffer.c (syms_of_buffer):
16869 * bytecode.c (syms_of_bytecode):
16870 * callint.c (syms_of_callint):
16871 * casefiddle.c (syms_of_casefiddle):
16872 * casetab.c (init_casetab_once):
16873 * category.c (init_category_once, syms_of_category):
16874 * ccl.c (syms_of_ccl):
16875 * cmds.c (syms_of_cmds):
16876 * composite.c (syms_of_composite):
16877 * dbusbind.c (syms_of_dbusbind):
16878 * dired.c (syms_of_dired):
16879 * dispnew.c (syms_of_display):
16880 * doc.c (syms_of_doc):
16881 * editfns.c (syms_of_editfns):
16882 * emacs.c (syms_of_emacs):
16883 * eval.c (syms_of_eval):
16884 * fileio.c (syms_of_fileio):
16885 * fns.c (syms_of_fns):
16886 * frame.c (syms_of_frame):
16887 * fringe.c (syms_of_fringe):
16888 * insdel.c (syms_of_insdel):
16889 * keymap.c (syms_of_keymap):
16890 * lread.c (init_obarray, syms_of_lread):
16891 * macros.c (syms_of_macros):
16892 * msdos.c (syms_of_msdos):
16893 * print.c (syms_of_print):
16894 * process.c (syms_of_process):
16895 * search.c (syms_of_search):
16896 * sound.c (syms_of_sound):
16897 * syntax.c (init_syntax_once, syms_of_syntax):
16898 * terminal.c (syms_of_terminal):
16899 * textprop.c (syms_of_textprop):
16900 * undo.c (syms_of_undo):
16901 * w32.c (globals_of_w32):
16902 * window.c (syms_of_window):
16903 * xdisp.c (syms_of_xdisp):
16904 * xfaces.c (syms_of_xfaces):
16905 * xfns.c (syms_of_xfns):
16906 * xmenu.c (syms_of_xmenu):
16907 * xsettings.c (syms_of_xsettings):
16908 * xterm.c (syms_of_xterm): Use DEFSYM.
16909
16910 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16911
16912 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
16913
16914 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16915
16916 Integer and buffer overflow fixes (Bug#8873).
16917
16918 * print.c (printchar, strout): Check for string overflow.
16919 (PRINTPREPARE, printchar, strout):
16920 Don't set size unless allocation succeeds.
16921
16922 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16923 for sizes. Check for string overflow more accurately.
16924 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16925
16926 * macros.c: Integer and buffer overflow fixes.
16927 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16928 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16929 Use ptrdiff_t, not int, for sizes.
16930 Don't increment bufsize until after realloc succeeds.
16931 Check for size-calculation overflow.
16932 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16933
16934 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16935
16936 * lread.c: Integer overflow fixes.
16937 (read_integer): Radix is now EMACS_INT, not int,
16938 to improve quality of diagnostics for out-of-range radices.
16939 Calculate buffer size correctly for out-of-range radices.
16940 (read1): Check for integer overflow in radices, and in
16941 read-circle numbers.
16942 (read_escape): Avoid int overflow.
16943 (Fload, openp, read_buffer_size, read1)
16944 (substitute_object_recurse, read_vector, read_list, map_obarray):
16945 Use ptrdiff_t, not int, for sizes.
16946 (read1): Use EMACS_INT, not int, for sizes.
16947 Check for size overflow.
16948
16949 * image.c (cache_image): Check for size arithmetic overflow.
16950
16951 * lread.c: Integer overflow issues.
16952 (saved_doc_string_size, saved_doc_string_length)
16953 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16954 Now ptrdiff_t, not int.
16955 (read1): Don't assume doc string length fits in int. Check for
16956 out-of-range doc string lengths.
16957 (read_list): Don't assume file position fits in int.
16958 (read_escape): Check for hex character overflow.
16959
16960 2011-06-22 Leo Liu <sdl.web@gmail.com>
16961
16962 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16963 Move to minibuffer.el.
16964
16965 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16966
16967 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
16968 The following patches are for when GLYPH_DEBUG && !XASSERT.
16969 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16970 * dispnew.c (flush_stdout):
16971 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16972 Mark as externally visible.
16973 * dispnew.c (check_window_matrix_pointers): Now static.
16974 * dispnew.c (window_to_frame_vpos):
16975 * xfns.c (unwind_create_frame):
16976 * xterm.c (x_check_font): Remove unused local.
16977 * scroll.c (CHECK_BOUNDS):
16978 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16979 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16980 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16981 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16982 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16983 Now static.
16984 (debug_method_add): Use va_list and vsprintf rather than relying
16985 on undefined behavior with wrong number of arguments.
16986 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16987 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16988 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16989 since we're not interested in debugging glyphs with old libraries.
16990 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16991 GCC 4.6.0's static checking.
16992
16993 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16994
16995 Integer overflow and signedness fixes (Bug#8873).
16996 A few related buffer overrun fixes, too.
16997
16998 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16999
17000 * dispextern.h (struct face.stipple):
17001 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17002 (x_bitmap_mask, x_allocate_bitmap_record)
17003 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17004 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17005 (x_create_bitmap_from_xpm_data):
17006 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17007 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17008 (.bitmaps_last):
17009 * xfaces.c (load_pixmap):
17010 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17011 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17012 (.bitmaps_last, struct x_output.icon_bitmap):
17013 Use ptrdiff_t, not int, for bitmap indexes.
17014 (x_allocate_bitmap_record): Check for size overflow.
17015 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17016
17017 Use ptrdiff_t, not int, for overlay counts.
17018 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17019 * editfns.c (overlays_around, get_pos_property):
17020 * textprop.c (get_char_property_and_overlay):
17021 * xdisp.c (next_overlay_change, note_mouse_highlight):
17022 * xfaces.c (face_at_buffer_position):
17023 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17024 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17025 (Fnext_overlay_change, Fprevious_overlay_change)
17026 (mouse_face_overlay_overlaps, Foverlays_in):
17027 Use ptrdiff_t, not int, for sizes.
17028 (overlays_at, overlays_in): Check for size-calculation overflow.
17029
17030 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17031
17032 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17033 (x_session_initialize): Do not assume string length fits in int.
17034
17035 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17036 This is unlikely, but can occur if DPI is outlandish.
17037
17038 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
17039 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17040
17041 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17042 * xrdb.c (magic_file_p, search_magic_path):
17043 Omit last arg SUFFIX; it was always 0. All callers changed.
17044 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17045
17046 * xfont.c (xfont_match): Avoid need for strlen.
17047
17048 * xfns.c: Don't assume strlen fits in int.
17049 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17050
17051 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17052 not unsigned long, as we prefer signed integers. All callers changed.
17053 Detect integer overflow in repeat count.
17054 (message_dolog): Don't assume print length fits in 39 bytes.
17055 (display_mode_element): Don't assume strlen fits in int.
17056
17057 * termcap.c: Don't assume sizes fit in int and never overflow.
17058 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17059 (gobble_line): Check for size-calculation overflow.
17060
17061 * minibuf.c (Fread_buffer):
17062 * lread.c (intern, intern_c_string):
17063 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17064 Don't assume string length fits in int.
17065
17066 * keyboard.c (parse_tool_bar_item):
17067 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17068
17069 * font.c: Don't assume string length fits in int.
17070 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17071 Use ptrdiff_t, not int.
17072 (font_intern_prop): Don't assume string length fits in int.
17073 Don't assume integer property fits in fixnum.
17074 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
17075
17076 * filelock.c: Fix some buffer overrun and integer overflow issues.
17077 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
17078 Reformulate so as not to need the command string.
17079 Invoke gzip -cd rather than gunzip, as it's more portable.
17080 (lock_info_type, lock_file_1, lock_file):
17081 Don't assume pid_t and time_t fit in unsigned long.
17082 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17083 (current_lock_owner): Prefer signed type for sizes.
17084 Use memcpy, not strncpy, where memcpy is what is really wanted.
17085 Don't assume (via atoi) that time_t and pid_t fit in int.
17086 Check for time_t and/or pid_t out of range, e.g., via a network share.
17087 Don't alloca where an auto var works fine.
17088
17089 * fileio.c: Fix some integer overflow issues.
17090 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17091 Don't assume string length fits in int.
17092 (directory_file_name): Don't assume string length fits in long.
17093 (make_temp_name): Don't assume pid fits in int, or that its print
17094 length is less than 20.
17095
17096 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17097
17098 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17099
17100 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17101
17102 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17103 We prefer signed integers, even for size calculations.
17104
17105 * emacs.c: Don't assume string length fits in 'int'.
17106 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17107 (main): Don't invoke strlen when not needed.
17108
17109 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17110 (XD_DEBUG_MESSAGE): Don't waste a byte.
17111
17112 * callproc.c (getenv_internal_1, getenv_internal)
17113 (Fgetenv_internal):
17114 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17115
17116 * lread.c (invalid_syntax): Omit length argument.
17117 All uses changed. This doesn't fix a bug, but it simplifies the
17118 code away from its former Hollerith-constant appearance, and it's
17119 one less 'int' to worry about when looking at integer-overflow issues.
17120 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
17121
17122 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17123 This didn't break anything, but it didn't help either.
17124 It's confusing to put a bogus integer in a place where the actual
17125 value does not matter.
17126 (LIST_END_P): Remove unused macro and its bogus comment.
17127 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
17128
17129 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17130 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17131 implementation.
17132 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17133 We prefer signed types, and the value cannot exceed the EMACS_INT
17134 range anyway (because otherwise the length would not be representable).
17135 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17136 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17137 This avoids a GCC warning when WIDE_EMACS_INT.
17138
17139 * indent.c (sane_tab_width): New function.
17140 (current_column, scan_for_column, Findent_to, position_indentation)
17141 (compute_motion): Use it. This is just for clarity.
17142 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
17143
17144 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
17145
17146 * lisp.h (lint_assume): New macro.
17147 * composite.c (composition_gstring_put_cache):
17148 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17149
17150 * editfns.c, insdel.c:
17151 Omit unnecessary forward decls, to simplify future changes.
17152
17153 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17154
17155 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17156
17157 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
17158 Use much-faster test for byte-length change.
17159 Don't assume string byte-length fits in 'int'.
17160 Check that character arg fits in 'int'.
17161 (mapcar1): Declare byte as byte, for clarity.
17162
17163 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17164
17165 * fns.c (concat): Catch string overflow earlier.
17166 Do not rely on integer wraparound.
17167
17168 * dispextern.h (struct it.overlay_strings_charpos)
17169 (struct it.selective): Now EMACS_INT, not int.
17170 * xdisp.c (forward_to_next_line_start)
17171 (back_to_previous_visible_line_start)
17172 (reseat_at_next_visible_line_start, next_element_from_buffer):
17173 Don't arbitrarily truncate the value of 'selective' to int.
17174
17175 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17176
17177 * composite.c: Don't truncate sizes to 'int'.
17178 (composition_gstring_p, composition_reseat_it)
17179 (composition_adjust_point): Use EMACS_INT, not int.
17180 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17181 not EMACS_UINT, for indexes.
17182
17183 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17184
17185 * buffer.c: Include <verify.h>.
17186 (struct sortvec.priority, struct sortstr.priority):
17187 Now EMACS_INT, not int.
17188 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
17189 (struct sortstr.size, record_overlay_string)
17190 (struct sortstrlist.size, struct sortlist.used):
17191 Don't truncate size to int.
17192 (record_overlay_string): Check for size-calculation overflow.
17193 (init_buffer_once): Check at compile-time, not run-time.
17194
17195 2011-06-22 Jim Meyering <meyering@redhat.com>
17196
17197 Don't leak an XBM-image-sized buffer
17198 * image.c (xbm_load): Free the image buffer after using it.
17199
17200 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17201
17202 Port to Sun C.
17203 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17204 that Sun C diagnosed.
17205 * fns.c (secure_hash): Fix pointer signedness issue.
17206 * intervals.c (static_offset_intervals): New function.
17207 (offset_intervals): Use it.
17208
17209 2011-06-21 Leo Liu <sdl.web@gmail.com>
17210
17211 * deps.mk (fns.o):
17212 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17213 sha512.h.
17214
17215 * fns.c (secure_hash): Rename from crypto_hash_function and change
17216 the first arg to accept symbols.
17217 (Fsecure_hash): New primitive.
17218 (syms_of_fns): New symbols.
17219
17220 2011-06-20 Deniz Dogan <deniz@dogan.se>
17221
17222 * process.c (Fset_process_buffer): Clarify return value in
17223 docstring.
17224
17225 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
17226
17227 * dispnew.c (add_window_display_history): Use BVAR.
17228
17229 * xdisp.c (debug_method_add): Use BVAR.
17230 (check_window_end, dump_glyph_matrix, dump_glyph)
17231 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17232
17233 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17234 Likewise.
17235
17236 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17237 check till after the cache is created in init_frame_faces.
17238
17239 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17240
17241 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17242
17243 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17244
17245 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
17246 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
17247 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
17248
17249 Improve buffer-overflow checking (Bug#8873).
17250 * fileio.c (Finsert_file_contents):
17251 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
17252 Remove the old (too-loose) buffer overflow checks.
17253 They weren't needed, since make_gap checks for buffer overflow.
17254 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
17255 The old code merely checked for Emacs fixnum overflow, and relied
17256 on undefined (wraparound) behavior. The new code avoids undefined
17257 behavior, and also checks for ptrdiff_t and/or size_t overflow.
17258
17259 * editfns.c (Finsert_char): Don't dump core with very negative counts.
17260 Tune. Don't use wider integers than needed. Don't use alloca.
17261 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
17262
17263 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
17264
17265 * insdel.c, lisp.h (buffer_overflow): New function.
17266 (insert_from_buffer_1, replace_range, replace_range_2):
17267 * insdel.c (make_gap_larger):
17268 * editfns.c (Finsert_char):
17269 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17270
17271 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17272
17273 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17274
17275 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
17276
17277 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17278 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17279
17280 * fileio.c: Don't assume EMACS_INT fits in off_t.
17281 (emacs_lseek): New static function.
17282 (Finsert_file_contents, Fwrite_region): Use it.
17283 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17284
17285 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17286
17287 * fns.c: Don't overflow int when computing a list length.
17288 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17289 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17290 truncation on 64-bit hosts. Check for QUIT every
17291 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17292 faster and is responsive enough.
17293 (Flength): Report an error instead of overflowing an integer.
17294 (Fsafe_length): Return a float if the value is not representable
17295 as a fixnum. This shouldn't happen except in contrived situations.
17296 (Fnthcdr, Fsort): Don't assume list length fits in int.
17297 (Fcopy_sequence): Don't assume vector length fits in int.
17298
17299 * alloc.c: Check that resized vectors' lengths fit in fixnums.
17300 (header_size, word_size): New constants.
17301 (allocate_vectorlike): Don't check size overflow here.
17302 (allocate_vector): Check it here instead, since this is the only
17303 caller of allocate_vectorlike that could cause overflow.
17304 Check that the new vector's length is representable as a fixnum.
17305
17306 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
17307 The previous code was bogus. For example, next_almost_prime (32)
17308 returned 39, which is undesirable as it is a multiple of 3; and
17309 next_almost_prime (24) returned 25, which is a multiple of 5 so
17310 why was the code bothering to check for multiples of 7?
17311
17312 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
17313
17314 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
17315
17316 Variadic C functions now count arguments with ptrdiff_t.
17317 This partly undoes my 2011-03-30 change, which replaced int with size_t.
17318 Back then I didn't know that the Emacs coding style prefers signed int.
17319 Also, in the meantime I found a few more instances where arguments
17320 were being counted with int, which may truncate counts on 64-bit
17321 machines, or EMACS_INT, which may be unnecessarily wide.
17322 * lisp.h (struct Lisp_Subr.function.aMANY)
17323 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
17324 Arg counts are now ptrdiff_t, not size_t.
17325 All variadic functions and their callers changed accordingly.
17326 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
17327 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
17328 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
17329 * callint.c (Fcall_interactively): Check arg count for overflow,
17330 to avoid potential buffer overrun. Use signed char, not 'int',
17331 for 'varies' array, so that we needn't bother to check its size
17332 calculation for overflow.
17333 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
17334 * eval.c (apply_lambda):
17335 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
17336 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
17337 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
17338
17339 * callint.c (Fcall_interactively): Don't use index var as event count.
17340
17341 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
17342 * mem-limits.h (SIZE): Remove; no longer used.
17343
17344 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
17345
17346 Remove unnecessary casts.
17347 * xterm.c (x_term_init):
17348 * xfns.c (x_set_border_pixel):
17349 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
17350 These aren't needed now that we assume ANSI C.
17351
17352 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
17353 It's more likely to cause problems (due to unsigned overflow)
17354 than to cure them.
17355
17356 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
17357
17358 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
17359
17360 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
17361
17362 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
17363
17364 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
17365
17366 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
17367
17368 GLYPH_CODE_FACE returns EMACS_INT, not int.
17369 * dispextern.h (merge_faces):
17370 * xfaces.c (merge_faces):
17371 * xdisp.c (get_next_display_element, next_element_from_display_vector):
17372 Don't assume EMACS_INT fits in int.
17373
17374 * character.h (CHAR_VALID_P): Remove unused parameter.
17375 * fontset.c, lisp.h, xdisp.c: All uses changed.
17376
17377 * editfns.c (Ftranslate_region_internal): Omit redundant test.
17378
17379 * fns.c (concat): Minor tuning based on overflow analysis.
17380 This doesn't fix any bugs. Use int to hold character, instead
17381 of constantly refetching from Emacs object. Use XFASTINT, not
17382 XINT, for value known to be a character. Don't bother comparing
17383 a single byte to 0400, as it's always less.
17384
17385 * floatfns.c (Fexpt):
17386 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
17387
17388 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
17389 for characters.
17390
17391 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
17392
17393 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
17394 Without this fix, on a 64-bit host (aset S 0 4294967386) would
17395 incorrectly succeed when S was a string, because 4294967386 was
17396 truncated before it was used.
17397
17398 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
17399 Otherwise, an out-of-range integer could cause undefined behavior
17400 on a 64-bit host.
17401
17402 * composite.c: Use int, not EMACS_INT, for characters.
17403 (fill_gstring_body, composition_compute_stop_pos): Use int, not
17404 EMACS_INT, for values that are known to be in character range.
17405 This doesn't fix any bugs but is the usual style inside Emacs and
17406 may generate better code on 32-bit machines.
17407
17408 Make sure a 64-bit char is never passed to ENCODE_CHAR.
17409 This is for reasons similar to the recent CHAR_STRING fix.
17410 * charset.c (Fencode_char): Check that character arg is actually
17411 a character. Pass an int to ENCODE_CHAR.
17412 * charset.h (ENCODE_CHAR): Verify that the character argument is no
17413 wider than 'int', as a compile-time check to prevent future regressions
17414 in this area.
17415
17416 * character.c (char_string): Remove unnecessary casts.
17417
17418 Make sure a 64-bit char is never passed to CHAR_STRING.
17419 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
17420 by silently ignoring the top 32 bits, allowing some values
17421 that were far too large to be valid characters.
17422 * character.h: Include <verify.h>.
17423 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
17424 arguments are no wider than unsigned, as a compile-time check
17425 to prevent future regressions in this area.
17426 * data.c (Faset):
17427 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
17428 (Fsubst_char_in_region):
17429 * fns.c (concat):
17430 * xdisp.c (decode_mode_spec_coding):
17431 Adjust to CHAR_STRING's new requirement.
17432 * editfns.c (Finsert_char, Fsubst_char_in_region):
17433 * fns.c (concat): Check that character args are actually
17434 characters. Without this test, these functions did the wrong
17435 thing with wildly out-of-range values on 64-bit hosts.
17436
17437 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
17438 These casts should not be needed on 32-bit hosts, either.
17439 * keyboard.c (read_char):
17440 * lread.c (Fload): Remove casts to unsigned.
17441
17442 * lisp.h (UNSIGNED_CMP): New macro.
17443 This fixes comparison bugs on 64-bit hosts.
17444 (ASCII_CHAR_P): Use it.
17445 * casefiddle.c (casify_object):
17446 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
17447 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
17448 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
17449 * dispextern.h (FACE_FROM_ID):
17450 * keyboard.c (read_char): Use UNSIGNED_CMP.
17451
17452 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
17453 not to EMACS_INT, to avoid GCC warning.
17454
17455 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
17456
17457 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
17458 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
17459 isn't needed on 32-bit machines.
17460
17461 * buffer.c (Fgenerate_new_buffer_name):
17462 Use EMACS_INT for count, not int.
17463 (advance_to_char_boundary): Return EMACS_INT, not int.
17464
17465 * data.c (Qcompiled_function): Now static.
17466
17467 * window.c (window_body_lines): Now static.
17468
17469 * image.c (gif_load): Rename local to avoid shadowing.
17470
17471 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
17472 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
17473 * alloc.c (make_save_value): Integer argument is now of type
17474 ptrdiff_t, not int.
17475 (mark_object): Use ptrdiff_t, not int.
17476 * lisp.h (pD): New macro.
17477 * print.c (print_object): Use it.
17478
17479 * alloc.c: Use EMACS_INT, not int, to count objects.
17480 (total_conses, total_markers, total_symbols, total_vector_size)
17481 (total_free_conses, total_free_markers, total_free_symbols)
17482 (total_free_floats, total_floats, total_free_intervals)
17483 (total_intervals, total_strings, total_free_strings):
17484 Now EMACS_INT, not int. All uses changed.
17485 (Fgarbage_collect): Compute overall total using a double, so that
17486 integer overflow is less likely to be a problem. Check for overflow
17487 when converting back to an integer.
17488 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
17489 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
17490 These were 'int' variables that could overflow on 64-bit hosts;
17491 they were never used, so remove them instead of repairing them.
17492 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
17493 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
17494 Previously, this ceilinged at INT_MAX, but that doesn't work on
17495 64-bit machines.
17496 (allocate_pseudovector): Don't use EMACS_INT when int would do.
17497
17498 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
17499 (allocate_vectorlike): Check for ptrdiff_t overflow.
17500 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
17501 when a (possibly-narrower) signed value would do just as well.
17502 We prefer using signed arithmetic, to avoid comparison confusion.
17503
17504 * alloc.c: Catch some string size overflows that we were missing.
17505 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
17506 for convenience in STRING_BYTES_MAX.
17507 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
17508 The definition here is exact; the one in lisp.h was approximate.
17509 (allocate_string_data): Check for string overflow. This catches
17510 some instances we weren't catching before. Also, it catches
17511 size_t overflow on (unusual) hosts where SIZE_MAX <= min
17512 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
17513 and ptrdiff_t and EMACS_INT are both 64 bits.
17514
17515 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
17516 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
17517 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
17518
17519 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
17520
17521 * alloc.c (Fmake_string): Check for out-of-range init.
17522
17523 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
17524
17525 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
17526
17527 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
17528
17529 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
17530 xg_get_default_scrollbar_width.
17531
17532 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
17533 (int_gtk_range_get_value): Move to the scroll bar part of the file.
17534 (style_changed_cb): Call update_theme_scrollbar_width and call
17535 x_set_scroll_bar_default_width and xg_frame_set_char_size for
17536 all frames (Bug#8505).
17537 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
17538 Call gtk_window_set_resizable if HAVE_GTK3.
17539 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
17540 and height if HAVE_GTK3 (Bug#8505).
17541 (scroll_bar_width_for_theme): New variable.
17542 (update_theme_scrollbar_width): New function.
17543 (xg_get_default_scrollbar_width): Move code to
17544 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
17545 (xg_initialize): Call update_theme_scrollbar_width.
17546
17547 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
17548
17549 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
17550
17551 2011-06-12 Martin Rudalics <rudalics@gmx.at>
17552
17553 * frame.c (make_frame): Call other_buffer_safely instead of
17554 other_buffer.
17555
17556 * window.c (temp_output_buffer_show): Call display_buffer with
17557 second argument Vtemp_buffer_show_specifiers and reset latter
17558 immediately after the call.
17559 (Vtemp_buffer_show_specifiers): New variable.
17560 (auto_window_vscroll_p, next_screen_context_lines)
17561 (Vscroll_preserve_screen_position): Remove leading asterisks from
17562 doc-strings.
17563
17564 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
17565
17566 Fix minor problems found by GCC 4.6.0 static checking.
17567 * buffer.c (Qclone_number): Remove for now, as it's unused.
17568 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
17569 (record_buffer): Remove unused local.
17570 * frame.c (other_visible_frames, frame_buffer_list): Now static.
17571 (set_frame_buffer_list): Remove; unused.
17572 * frame.h (other_visible_frames): Remove decl.
17573 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
17574 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
17575 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
17576 if HAVE_GPM.
17577 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
17578 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
17579 Define only if HAVE_GPM.
17580 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
17581 (update_hints_inhibit): Remove; never set. All uses removed.
17582 * widgetprv.h (emacsFrameClassRec): Remove decl.
17583 * window.c (delete_deletable_window): Now returns void, since it
17584 wasn't returning anything.
17585 (compare_window_configurations): Remove unused locals.
17586 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
17587 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
17588 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
17589 the same widths as pointers. This follows up on the 2011-05-06 patch.
17590 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
17591 * xterm.h: Likewise.
17592 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
17593
17594 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
17595
17596 * makefile.w32-in: Update dependencies.
17597 (LISP_H): Add lib/intprops.h.
17598
17599 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
17600
17601 * image.c (gif_load): Add animation frame delay to the metadata.
17602 (syms_of_image): Use DEFSYM. New symbol `delay'.
17603
17604 2011-06-11 Martin Rudalics <rudalics@gmx.at>
17605
17606 * window.c (delete_deletable_window): Re-add.
17607 (Fset_window_configuration): Rewrite to handle dead buffers and
17608 consequently deletable windows.
17609 (window_tree, Fwindow_tree): Remove. Supply functionality in
17610 window.el.
17611 (compare_window_configurations): Simplify code.
17612
17613 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
17614
17615 * image.c (imagemagick_load_image): Fix type mismatch.
17616 (Fimagemagick_types): Likewise.
17617
17618 * window.h (replace_buffer_in_windows): Declare.
17619
17620 2011-06-11 Martin Rudalics <rudalics@gmx.at>
17621
17622 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
17623 Qclone_number. Remove external declaration of Qdelete_window.
17624 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
17625 code.
17626 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
17627 Run Qbuffer_list_update_hook if allowed.
17628 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17629 buffer list implementation.
17630 (other_buffer_safely): New function.
17631 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17632 calls to replace_buffer_in_windows and
17633 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17634 if allowed.
17635 (record_buffer): Inhibit quitting and rewrite using quittable
17636 functions. Run Qbuffer_list_update_hook if allowed.
17637 (Frecord_buffer, Funrecord_buffer): New functions.
17638 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17639 Move switch-to-buffer to window.el.
17640 (bury-buffer): Move to window.el.
17641 (Vbuffer_list_update_hook): New variable.
17642
17643 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17644 section.
17645
17646 * window.h (resize_frame_windows): Move up in code.
17647 (Fwindow_frame): Remove EXFUN.
17648 (replace_buffer_in_all_windows): Remove prototype.
17649 (replace_buffer_in_windows_safely): Add prototype.
17650
17651 * window.c: Declare Qdelete_window static again. Move down
17652 declaration of select_count.
17653 (Fnext_window, Fprevious_window): Rewrite doc-strings.
17654 (Fother_window): Move to window.el.
17655 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
17656 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
17657 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
17658 window.el.
17659 (replace_buffer_in_windows): Implement by calling
17660 Qreplace_buffer_in_windows.
17661 (replace_buffer_in_all_windows): Remove with some functionality
17662 moved into replace_buffer_in_windows_safely.
17663 (replace_buffer_in_windows_safely): New function.
17664 (select_window_norecord, select_frame_norecord): Move in front
17665 of run_window_configuration_change_hook. Remove now obsolete
17666 declarations.
17667 (Fset_window_buffer): Rewrite doc-string.
17668 Call Qrecord_window_buffer.
17669 (keys_of_window): Move binding for other-window to window.el.
17670
17671 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
17672
17673 * dispextern.h (struct image): Replace data member, whose int_val
17674 and ptr_val fields were not used by anything, with a single
17675 lisp_val object.
17676
17677 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
17678 (gif_clear_image, gif_load, imagemagick_load_image)
17679 (gs_clear_image, gs_load): Callers changed.
17680
17681 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
17682
17683 * buffer.h: Include <time.h>, for time_t.
17684 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
17685
17686 Fix minor problems found by static checking.
17687
17688 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
17689
17690 Make identifiers static if they are not used in other modules.
17691 * data.c (Qcompiled_function, Qframe, Qvector):
17692 * image.c (QimageMagick, Qsvg):
17693 * minibuf.c (Qmetadata):
17694 * window.c (resize_window_check, resize_root_window): Now static.
17695 * window.h (resize_window_check, resize_root_window): Remove decls.
17696
17697 * window.c (window_deletion_count, delete_deletable_window):
17698 Remove; unused.
17699 (window_body_lines): Now static.
17700 (Fdelete_other_windows_internal): Mark vars as initialized.
17701 Make sure 'resize_failed' is initialized.
17702 (run_window_configuration_change_hook): Rename local to avoid shadowing.
17703 (resize_window_apply): Remove unused local.
17704 * window.h (delete_deletable_window): Remove decl.
17705
17706 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
17707 (imagemagick_load_image): Fix pointer signedness problem by changing
17708 last arg from unsigned char * to char *. All uses changed.
17709 Also, fix a local for similar reasons.
17710 Remove unused locals. Remove locals to avoid shadowing.
17711 (fn_rsvg_handle_free): Remove; unused.
17712 (svg_load, svg_load_image): Fix pointer signedness problem.
17713 (imagemagick_load_image): Don't use garbage pointer image_wand.
17714
17715 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
17716
17717 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
17718
17719 * image.c (gif_load): Fix omitted cast error introduced by
17720 2011-06-06 change.
17721
17722 2011-06-10 Martin Rudalics <rudalics@gmx.at>
17723
17724 * window.h (resize_proportionally, orig_total_lines)
17725 (orig_top_line): Remove from window structure.
17726 (set_window_height, set_window_width, change_window_heights)
17727 (Fdelete_window): Remove prototypes.
17728 (resize_frame_windows): Remove duplicate declaration.
17729
17730 2011-06-10 Eli Zaretskii <eliz@gnu.org>
17731
17732 * window.h (resize_frame_windows, resize_window_check)
17733 (delete_deletable_window, resize_root_window)
17734 (resize_frame_windows): Declare prototypes.
17735
17736 * window.c (resize_window_apply): Make definition be "static" to
17737 match the prototype.
17738
17739 2011-06-10 Martin Rudalics <rudalics@gmx.at>
17740
17741 * window.c: Remove declarations of Qwindow_size_fixed,
17742 window_min_size_1, window_min_size_2, window_min_size,
17743 size_window, window_fixed_size_p, enlarge_window, delete_window.
17744 Remove static from declaration of Qdelete_window, it's
17745 temporarily needed by Fbury_buffer.
17746 (replace_window): Don't assign orig_top_line and
17747 orig_total_lines.
17748 (Fdelete_window, delete_window): Remove. Window deletion is
17749 handled by window.el.
17750 (window_loop): Remove DELETE_OTHER_WINDOWS case.
17751 Replace Fdelete_window calls with calls to Qdelete_window.
17752 (Fdelete_other_windows): Remove. Deleting other windows is
17753 handled by window.el.
17754 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
17755 handled in window.el.
17756 (window_min_size_2, window_min_size_1, window_min_size): Remove.
17757 Window minimum sizes are handled in window.el.
17758 (shrink_windows, size_window, set_window_height)
17759 (set_window_width, change_window_heights, window_height)
17760 (window_width, CURBEG, CURSIZE, enlarge_window)
17761 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
17762 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
17763 handled in window.el.
17764 (make_dummy_parent): Rename to make_parent_window and give it a
17765 second argument horflag.
17766 (make_window): Don't set resize_proportionally any more.
17767 (Fsplit_window): Remove. Windows are split in window.el.
17768 (save_restore_action, save_restore_orig_size)
17769 (shrink_window_lowest_first, save_restore_orig_size): Remove.
17770 Resize mini windows in window.el.
17771 (grow_mini_window, shrink_mini_window): Implement by calling
17772 Qresize_root_window_vertically, resize_window_check and
17773 resize_window_apply.
17774 (saved_window, Fset_window_configuration, save_window_save):
17775 Do not handle orig_top_line, orig_total_lines, and
17776 resize_proportionally.
17777 (window_min_height, window_min_width): Move to window.el.
17778 (keys_of_window): Move bindings for delete-other-windows,
17779 split-window, delete-window and enlarge-window to window.el.
17780
17781 * buffer.c: Temporarily extern Qdelete_window.
17782 (Fbury_buffer): Temporarily call Qdelete_window instead of
17783 Fdelete_window (Fbury_buffer will move to window.el soon).
17784
17785 * frame.c (set_menu_bar_lines_1): Remove code handling
17786 orig_top_line and orig_total_lines.
17787
17788 * dispnew.c (adjust_frame_glyphs_initially): Don't use
17789 set_window_height but set heights directly.
17790 (change_frame_size_1): Use resize_frame_windows.
17791
17792 * xdisp.c (init_xdisp): Don't use set_window_height but set
17793 heights directly.
17794
17795 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17796 Use resize_frame_windows instead of change_window_heights and run
17797 run_window_configuration_change_hook.
17798
17799 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17800 instead of change_window_heights and run
17801 run_window_configuration_change_hook.
17802
17803 2011-06-09 Martin Rudalics <rudalics@gmx.at>
17804
17805 * window.c (replace_window): Rename second argument REPLACEMENT to
17806 NEW. New third argument SETFLAG. Rewrite.
17807 (delete_window, make_dummy_parent): Call replace_window with
17808 third argument 1.
17809 (window_list_1): Move down in code.
17810 (run_window_configuration_change_hook): Move set_buffer part
17811 before select_frame_norecord part in order to unwind correctly.
17812 Rename count1 to count.
17813 (recombine_windows, delete_deletable_window, resize_root_window)
17814 (Fdelete_other_windows_internal)
17815 (Frun_window_configuration_change_hook, make_parent_window)
17816 (resize_window_check, resize_window_apply, Fresize_window_apply)
17817 (resize_frame_windows, Fsplit_window_internal)
17818 (Fdelete_window_internal, Fresize_mini_window_internal):
17819 New functions.
17820 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17821
17822 2011-06-08 Martin Rudalics <rudalics@gmx.at>
17823
17824 * window.h (window): Add some new members to window structure -
17825 normal_lines, normal_cols, new_total, new_normal, clone_number,
17826 splits, nest, prev_buffers, next_buffers.
17827 (WINDOW_TOTAL_SIZE): Move here from window.c.
17828 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
17829
17830 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17831 Remove.
17832 (make_dummy_parent): Set new members of windows structure.
17833 (make_window): Move down in code. Handle new members of window
17834 structure.
17835 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17836 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17837 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17838 (Fset_window_prev_buffers, Fwindow_next_buffers)
17839 (Fset_window_next_buffers, Fset_window_clone_number):
17840 New functions.
17841 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17842 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17843 Doc-string fixes.
17844 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17845 Argument WINDOW can be now internal window too.
17846 (Fwindow_use_time): Move up in code.
17847 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17848 Rewrite doc-string.
17849 (Fset_window_configuration, saved_window)
17850 (Fcurrent_window_configuration, save_window_save): Handle new
17851 members of window structure.
17852 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17853 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17854 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17855 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17856 Qget_mru_window, Qresize_root_window,
17857 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17858 Qauto_buffer_name; staticpro them.
17859
17860 2011-06-07 Martin Rudalics <rudalics@gmx.at>
17861
17862 * window.c (Fwindow_total_size, Fwindow_left_column)
17863 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17864 (Fwindow_list_1): New functions.
17865 (window_box_text_cols): Replace with window_body_cols.
17866 (Fwindow_width, Fscroll_left, Fscroll_right):
17867 Use window_body_cols instead of window_box_text_cols.
17868 (delete_window, Fset_window_configuration):
17869 Call delete_all_subwindows with window as argument.
17870 (delete_all_subwindows): Take a window as argument and not a
17871 structure. Rewrite.
17872 (window_loop): Remove handling of GET_LRU_WINDOW and
17873 GET_LARGEST_WINDOW.
17874 (Fget_lru_window, Fget_largest_window): Move to window.el.
17875
17876 * window.h: Extern window_body_cols instead of
17877 window_box_text_cols. delete_all_subwindows now takes a
17878 Lisp_Object as argument.
17879
17880 * indent.c (compute_motion, Fcompute_motion):
17881 Use window_body_cols instead of window_box_text_cols.
17882
17883 * frame.c (delete_frame): Call delete_all_subwindows with root
17884 window as argument.
17885
17886 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17887
17888 * fns.c (Fputhash): Document return value.
17889
17890 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
17891
17892 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17893
17894 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17895
17896 Cons<->int and similar integer overflow fixes (Bug#8794).
17897
17898 Check for overflow when converting integer to cons and back.
17899 * charset.c (Fdefine_charset_internal, Fdecode_char):
17900 Use cons_to_unsigned to catch overflow.
17901 (Fencode_char): Use INTEGER_TO_CONS.
17902 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17903 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17904 * data.c (long_to_cons, cons_to_long): Remove.
17905 (cons_to_unsigned, cons_to_signed): New functions.
17906 These signal an error for invalid or out-of-range values.
17907 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17908 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17909 * font.c (Ffont_variation_glyphs):
17910 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17911 * lisp.h: Include <intprops.h>.
17912 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17913 (cons_to_signed, cons_to_unsigned): New decls.
17914 (long_to_cons, cons_to_long): Remove decls.
17915 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17916 (Fprimitive_undo): Use CONS_TO_INTEGER.
17917 * xfns.c (Fx_window_property): Likewise.
17918 * xselect.c: Include <limits.h>.
17919 (x_own_selection, selection_data_to_lisp_data):
17920 Use INTEGER_TO_CONS.
17921 (x_handle_selection_request, x_handle_selection_clear)
17922 (x_get_foreign_selection, Fx_disown_selection_internal)
17923 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17924 (lisp_data_to_selection_data): Use cons_to_unsigned.
17925 (x_fill_property_data): Use cons_to_signed.
17926 Report values out of range.
17927
17928 Check for buffer and string overflow more precisely.
17929 * buffer.h (BUF_BYTES_MAX): New macro.
17930 * lisp.h (STRING_BYTES_MAX): New macro.
17931 * alloc.c (Fmake_string):
17932 * character.c (string_escape_byte8):
17933 * coding.c (coding_alloc_by_realloc):
17934 * doprnt.c (doprnt):
17935 * editfns.c (Fformat):
17936 * eval.c (verror):
17937 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17938 since they may not be the same number.
17939 * editfns.c (Finsert_char):
17940 * fileio.c (Finsert_file_contents):
17941 Likewise for BUF_BYTES_MAX.
17942
17943 * image.c: Use ptrdiff_t, not int, for sizes.
17944 (slurp_file): Switch from int to ptrdiff_t.
17945 All uses changed.
17946 (slurp_file): Check that file size fits in both size_t (for
17947 malloc) and ptrdiff_t (for sanity and safety).
17948
17949 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17950 if b->modtime has its maximal value.
17951
17952 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17953
17954 Don't assume time_t can fit into int.
17955 * buffer.h (struct buffer.modtime): Now time_t, not int.
17956 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17957 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17958
17959 Minor fixes for signed vs unsigned integers.
17960 * character.h (MAYBE_UNIFY_CHAR):
17961 * charset.c (maybe_unify_char):
17962 * keyboard.c (read_char, reorder_modifiers):
17963 XINT -> XFASTINT, since the integer must be nonnegative.
17964 * ftfont.c (ftfont_spec_pattern):
17965 * keymap.c (access_keymap, silly_event_symbol_error):
17966 XUINT -> XFASTINT, since the integer must be nonnegative.
17967 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17968 since it makes no difference and we prefer signed.
17969 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17970 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17971 nonnegative.
17972
17973 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17974
17975 * window.h (Fwindow_frame): Declare.
17976
17977 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17978
17979 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17980 (SPARE_MEMORY): Always define.
17981 (LARGE_REQUEST): Remove.
17982 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17983
17984 2011-06-06 Martin Rudalics <rudalics@gmx.at>
17985
17986 * lisp.h: Move EXFUNS for Fframe_root_window,
17987 Fframe_first_window and Fset_frame_selected_window to window.h.
17988
17989 * window.h: Move EXFUNS for Fframe_root_window,
17990 Fframe_first_window and Fset_frame_selected_window here from
17991 lisp.h.
17992
17993 * frame.c (Fwindow_frame, Fframe_first_window)
17994 (Fframe_root_window, Fframe_selected_window)
17995 (Fset_frame_selected_window): Move to window.c.
17996 (Factive_minibuffer_window): Move to minibuf.c.
17997 (Fother_visible_frames_p): New function.
17998
17999 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18000
18001 * window.c (decode_window, decode_any_window): Move up in code.
18002 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18003 (inhibit_frame_unsplittable): Remove unused variable.
18004 (Fwindow_buffer): Move up and rewrite doc-string.
18005 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18006 (Fwindow_prev): New functions.
18007 (Fwindow_frame): Move here from frame.c. Accept any window as
18008 argument.
18009 (Fframe_root_window, Fframe_first_window)
18010 (Fframe_selected_window): Move here from frame.c. Accept frame
18011 or arbitrary window as argument. Update doc-strings.
18012 (Fminibuffer_window): Move up in code.
18013 (Fwindow_minibuffer_p): Move up in code and simplify.
18014 (Fset_frame_selected_window): Move here from frame.c.
18015 Marginal rewrite.
18016 (Fselected_window, select_window, Fselect_window): Move up in
18017 code. Minor doc-string fixes.
18018
18019 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18020
18021 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18022 Do not assume that spare memory exists; that assumption is valid
18023 only if SYSTEM_MALLOC.
18024 (LARGE_REQUEST): New macro, so that the issue of large requests
18025 is separated from the issue of spare memory.
18026
18027 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18028
18029 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18030 format. (Bug#8806)
18031
18032 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18033
18034 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18035 before statements.
18036
18037 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18038
18039 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18040
18041 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18042
18043 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18044 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18045
18046 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
18047
18048 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18049
18050 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
18051
18052 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18053 (x_clipboard_manager_save): Add return value.
18054 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18055 New error handlers.
18056 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18057 Obey Vx_select_enable_clipboard_manager. Catch errors in
18058 x_clipboard_manager_save (Bug#8779).
18059 (Vx_select_enable_clipboard_manager): New variable.
18060 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
18061
18062 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
18063
18064 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18065
18066 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18067
18068 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18069 in the current matrix if keep_current_p is non-zero.
18070
18071 2011-06-04 Eli Zaretskii <eliz@gnu.org>
18072
18073 * bidi.c (bidi_level_of_next_char): Fix last change.
18074
18075 2011-06-03 Eli Zaretskii <eliz@gnu.org>
18076
18077 Support bidi reordering of text covered by display properties.
18078
18079 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18080 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18081 (bidi_cache_search, bidi_cache_iterator_state)
18082 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
18083 (bidi_level_of_next_char, bidi_move_to_visually_next):
18084 Support character positions inside a run of characters covered by a
18085 display string.
18086 (bidi_paragraph_init, bidi_resolve_explicit_1)
18087 (bidi_level_of_next_char): Call bidi_fetch_char and
18088 bidi_fetch_char_advance instead of FETCH_CHAR and
18089 FETCH_CHAR_ADVANCE.
18090 (bidi_init_it): Initialize new members.
18091 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18092 definitions.
18093 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18094 instead of using explicit *_CHAR codes.
18095 (bidi_resolve_explicit, bidi_resolve_weak):
18096 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
18097 bidirectional text is supported only in multibyte buffers.
18098 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18099 it to initialize the frame_window_p member of struct bidi_it.
18100 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18101 (bidi_resolve_explicit, bidi_resolve_weak)
18102 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18103 bidi_it->nchars is non-positive.
18104 (bidi_level_of_next_char): Don't try to lookup the cache for the
18105 next/previous character if nothing is cached there yet, or if we
18106 were just reseat()'ed to a new position.
18107
18108 * xdisp.c (set_cursor_from_row): Set start and stop points
18109 according to the row's direction when priming the loop that looks
18110 for the glyph on which to display cursor.
18111 (single_display_spec_intangible_p): Function deleted.
18112 (display_prop_intangible_p): Reimplement to call
18113 handle_display_spec instead of single_display_spec_intangible_p.
18114 Accept 3 additional arguments needed by handle_display_spec.
18115 This fixes incorrect cursor motion across display property with complex
18116 values: lists, `(when COND...)' forms, etc.
18117 (single_display_spec_string_p): Support property values that are
18118 lists with the argument STRING its top-level element.
18119 (display_prop_string_p): Fix the condition for processing a
18120 property that is a list to be consistent with handle_display_spec.
18121 (handle_display_spec): New function, refactored from the
18122 last portion of handle_display_prop.
18123 (compute_display_string_pos): Accept additional argument
18124 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18125 value of a `display' property is a "replacing spec".
18126 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18127 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18128 the display property, but just return a value indicating whether
18129 the display property will replace the characters it covers.
18130 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18131 frame_window_p members of struct bidi_it.
18132 (compute_display_string_pos, compute_display_string_end):
18133 New functions.
18134 (push_it): Accept second argument POSITION, where pop_it should
18135 jump to continue iteration.
18136 (reseat_1): Initialize bidi_it.disp_pos.
18137
18138 * keyboard.c (adjust_point_for_property): Adjust the call to
18139 display_prop_intangible_p to its new signature.
18140
18141 * dispextern.h (struct bidi_it): New member frame_window_p.
18142 (bidi_init_it): Update prototypes.
18143 (display_prop_intangible_p): Update prototype.
18144 (compute_display_string_pos, compute_display_string_end):
18145 Declare prototypes.
18146 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18147 EMACS_INT.
18148
18149 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
18150
18151 Malloc failure behavior now depends on size of allocation.
18152 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18153 * lisp.h: Change signatures accordingly.
18154 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18155 All callers changed. (Bug#8762)
18156
18157 * gnutls.c: Use Emacs's memory allocators.
18158 Without this change, the gnutls library would invoke malloc etc.
18159 directly, which causes problems on non-SYNC_INPUT hosts, and which
18160 runs afoul of improving memory_full behavior. (Bug#8761)
18161 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18162 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18163 xfree instead of the default malloc, realloc, free.
18164 (Fgnutls_boot): No need to check for memory allocation failure,
18165 since xmalloc does that for us.
18166
18167 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
18168 * category.c (hash_get_category_set):
18169 * ccl.c (ccl_driver):
18170 * charset.c (Fdefine_charset_internal):
18171 * charset.h (struct charset.hash_index):
18172 * composite.c (get_composition_id, gstring_lookup_cache)
18173 (composition_gstring_put_cache):
18174 * composite.h (struct composition.hash_index):
18175 * dispextern.h (struct image.hash):
18176 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18177 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18178 (hashfn_equal, hashfn_user_defined, make_hash_table)
18179 (maybe_resize_hash_table, hash_lookup, hash_put)
18180 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18181 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18182 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18183 * image.c (make_image, search_image_cache, lookup_image)
18184 (xpm_put_color_table_h):
18185 * lisp.h (struct Lisp_Hash_Table):
18186 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
18187 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
18188 for hashes and hash indexes, instead of 'unsigned' and 'int'.
18189 * alloc.c (allocate_vectorlike):
18190 Check for overflow in vector size calculations.
18191 * ccl.c (ccl_driver):
18192 Check for overflow when converting EMACS_INT to int.
18193 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18194 need to be updated by these changes.
18195 * fns.c (make_hash_table, maybe_resize_hash_table):
18196 Check for integer overflow with large hash tables.
18197 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18198 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18199 (SXHASH_REDUCE): New macro.
18200 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18201 Use it instead of discarding useful hash info with large hash values.
18202 (sxhash_float): New function.
18203 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18204 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
18205 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18206 Rewrite to use FIXNUM_BITS, as this simplifies things.
18207 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18208 Adjust signatures to match updated version of code.
18209 (consing_since_gc): Now EMACS_INT, since a single hash table can
18210 use more than INT_MAX bytes.
18211
18212 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18213
18214 Make it possible to build with GCC-4.6+ -O2 -flto.
18215
18216 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18217
18218 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18219
18220 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18221 Call minibuffer-inactive-mode.
18222
18223 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
18224
18225 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18226 Update dependencies.
18227
18228 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18229
18230 * data.c (init_data): Remove code for UTS, this system is not
18231 supported anymore.
18232
18233 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18234
18235 Don't force ./temacs to start in terminal mode.
18236
18237 * frame.c (make_initial_frame): Initialize faces in all cases, not
18238 only when CANNOT_DUMP is defined.
18239 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18240
18241 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18242
18243 * dispnew.c (add_window_display_history): Use const for the string
18244 pointer. Remove declaration, not needed.
18245
18246 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18247
18248 Use 'inline', not 'INLINE'.
18249 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
18250 * alloc.c, fontset.c (INLINE): Remove.
18251 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
18252 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
18253 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
18254 * gmalloc.c (register_heapinfo): Use inline unconditionally.
18255 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
18256
18257 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18258
18259 Make it possible to run ./temacs.
18260
18261 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
18262 syms_of_callproc does the same thing. Remove test for
18263 "initialized", do it in the caller.
18264 * emacs.c (main): Avoid calling set_initial_environment when dumping.
18265
18266 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18267
18268 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18269 (read_minibuf): Use get_minibuffer.
18270 (syms_of_minibuf): Use DEFSYM.
18271 (Qmetadata): New var.
18272 * data.c (Qbuffer): Don't make it static.
18273 (syms_of_data): Use DEFSYM.
18274
18275 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18276
18277 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18278 (CCL_CODE_MIN): New macro.
18279
18280 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18281
18282 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18283
18284 * eval.c (Qdebug): Now static.
18285 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18286 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18287 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18288
18289 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
18290
18291 * image.c: Various fixes to ImageMagick code comments.
18292 (Fimagemagick_types): Doc fix.
18293
18294 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18295
18296 Minor fixes prompted by GCC 4.6.0 warnings.
18297
18298 * xselect.c (converted_selections, conversion_fail_tag): Now static.
18299
18300 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
18301 (x_clipboard_manager_save_all): Move extern decl to ...
18302 * xterm.h: ... here, so that it can be checked for consistency.
18303
18304 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
18305
18306 * xselect.c (x_clipboard_manager_save_frame)
18307 (x_clipboard_manager_save_all): New functions.
18308 (Fx_clipboard_manager_save): Lisp function deleted.
18309
18310 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
18311 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
18312
18313 * xterm.h: Update prototype.
18314
18315 2011-05-28 William Xu <william.xwl@gmail.com>
18316
18317 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
18318 exiting (Bug#8239).
18319
18320 2011-05-28 Jim Meyering <meyering@redhat.com>
18321
18322 Avoid a sign-extension bug in crypto_hash_function.
18323 * fns.c (to_uchar): Define.
18324 (crypto_hash_function): Use it to convert some newly-signed
18325 variables to unsigned, to avoid sign-extension bugs. For example,
18326 without this change, (md5 "truc") would evaluate to
18327 45723a2aff78ff4fff7fff1114760e62 rather than the expected
18328 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
18329 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
18330
18331 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18332
18333 Integer overflow fixes.
18334
18335 * dbusbind.c: Serial number integer overflow fixes.
18336 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
18337 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
18338 to hold a serial number that is too large for a fixnum.
18339 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18340 Check for serial numbers out of range. Decode any serial number
18341 that was so large that it became a float. (Bug#8722)
18342
18343 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
18344 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18345 Use XFASTINT rather than XUINT when numbers are nonnegative.
18346 (xd_append_arg, Fdbus_method_return_internal):
18347 (Fdbus_method_error_internal): Likewise. Also, for unsigned
18348 arguments, check that Lisp number is nonnegative, rather than
18349 silently wrapping negative numbers around. (Bug#8722)
18350 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
18351 (Bug#8722)
18352
18353 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
18354
18355 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
18356
18357 ccl: Add integer overflow checks.
18358 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
18359 (IN_INT_RANGE): New macros.
18360 (ccl_driver): Use them to check for integer overflow when
18361 decoding a CCL program. Many of the new checks are whether XINT (x)
18362 fits in int; it doesn't always, on 64-bit hosts. The new version
18363 doesn't catch all possible integer overflows, but it's an
18364 improvement. (Bug#8719)
18365
18366 * alloc.c (make_event_array): Use XINT, not XUINT.
18367 There's no need for unsigned here.
18368
18369 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
18370 This follows up to the 2011-05-06 change that substituted uintptr_t
18371 for EMACS_INT. This case wasn't caught back then.
18372
18373 Rework Fformat to avoid integer overflow issues.
18374 * editfns.c: Include <float.h> unconditionally, as it's everywhere
18375 now (part of C89). Include <verify.h>.
18376 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
18377 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
18378 (Fformat): Avoid the prepass trying to compute sizes; it was only
18379 approximate and thus did not catch overflow reliably. Instead, walk
18380 through the format just once, formatting and computing sizes as we go,
18381 checking for integer overflow at every step, and allocating a larger
18382 buffer as needed. Keep track separately whether the format is
18383 multibyte. Keep only the most-recently calculated precision, rather
18384 than them all. Record whether each argument has been converted to
18385 string. Use EMACS_INT, not int, for byte and char and arg counts.
18386 Support field widths and precisions larger than INT_MAX. Avoid
18387 sprintf's undefined behavior with conversion specifications such as %#d
18388 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
18389 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
18390 formatting out-of-range floating point numbers with int
18391 formats. (Bug#8668)
18392
18393 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
18394
18395 * data.c: Avoid integer truncation in expressions involving floats.
18396 * data.c: Include <intprops.h>.
18397 (arith_driver): When there's an integer overflow in an expression
18398 involving floating point, convert the integers to floating point
18399 so that the resulting value does not suffer from catastrophic
18400 integer truncation. For example, on a 64-bit host (* 4
18401 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
18402 Do not rely on undefined behavior after integer overflow.
18403
18404 merge count_size_as_multibyte, parse_str_to_multibyte
18405 * character.c, character.h (count_size_as_multibyte):
18406 Rename from parse_str_to_multibyte; all uses changed.
18407 Check for integer overflow.
18408 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
18409 since it's now a duplicate of the other. This is more of
18410 a character than a buffer op, so better that it's in character.c.
18411 * fns.c, print.c: Adjust to above changes.
18412
18413 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
18414
18415 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
18416
18417 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
18418
18419 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18420 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
18421 (x_clipboard_manager_save): Now static.
18422 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
18423
18424 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
18425 (crypto_hash_function): Now static.
18426 Fix pointer signedness problems. Avoid unnecessary initializations.
18427
18428 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
18429
18430 * termhooks.h (Vselection_alist): Make it terminal-local.
18431
18432 * terminal.c (create_terminal): Initialize it.
18433
18434 * xselect.c: Support for clipboard managers.
18435 (Vselection_alist): Move to termhooks.h as terminal-local var.
18436 (LOCAL_SELECTION): New macro.
18437 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
18438 (symbol_to_x_atom): Remove gratuitous arg.
18439 (x_handle_selection_request, lisp_data_to_selection_data)
18440 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
18441 (x_own_selection, x_get_local_selection, x_convert_selection):
18442 New arg, specifying work frame. Use terminal-local Vselection_alist.
18443 (some_frame_on_display): Delete unused function.
18444 (Fx_own_selection_internal, Fx_get_selection_internal)
18445 (Fx_disown_selection_internal, Fx_selection_owner_p)
18446 (Fx_selection_exists_p): New optional frame arg.
18447 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
18448 (x_handle_selection_clear): Don't treat other terminals with the
18449 same keyboard specially. Use the terminal-local Vselection_alist.
18450 (x_clear_frame_selections): Use Frun_hook_with_args.
18451
18452 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
18453
18454 * xterm.h: Add support for those atoms.
18455
18456 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
18457
18458 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
18459 (converted_selections, conversion_fail_tag): New global variables.
18460 (x_selection_request_lisp_error): Free the above.
18461 (x_get_local_selection): Remove unnecessary code.
18462 (x_reply_selection_request): Args changed; handle arbitrary array
18463 of converted selections stored in converted_selections.
18464 Separate the XChangeProperty and SelectionNotify steps.
18465 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
18466 (x_convert_selection): New function.
18467 (x_handle_selection_event): Simplify.
18468 (x_get_foreign_selection): Don't ignore incoming requests while
18469 waiting for an answer; this will fail when we implement
18470 SAVE_TARGETS, and seems unnecessary anyway.
18471 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
18472 (Vx_sent_selection_functions): Doc fix.
18473
18474 2011-05-26 Leo Liu <sdl.web@gmail.com>
18475
18476 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
18477
18478 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18479
18480 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
18481
18482 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
18483 for fringe update if it has periodic bitmap.
18484 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
18485 and fringe_bitmap_periodic_p.
18486
18487 * fringe.c (get_fringe_bitmap_data): New function.
18488 (draw_fringe_bitmap_1, update_window_fringes): Use it.
18489 (update_window_fringes): Record periodicity of fringe bitmap in glyph
18490 row. Mark glyph row for fringe update if periodicity changed.
18491
18492 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
18493 for fringe update unless it has periodic bitmap.
18494
18495 2011-05-25 Kenichi Handa <handa@m17n.org>
18496
18497 * xdisp.c (get_next_display_element): Set correct it->face_id for
18498 a static composition.
18499
18500 2011-05-24 Leo Liu <sdl.web@gmail.com>
18501
18502 * deps.mk (fns.o):
18503 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
18504
18505 * fns.c (crypto_hash_function, Fsha1): New function.
18506 (Fmd5): Use crypto_hash_function.
18507 (syms_of_fns): Add Ssha1.
18508
18509 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18510
18511 * gnutls.c: Remove unused macros.
18512 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
18513 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
18514 Remove macros that are defined and never used.
18515 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
18516
18517 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
18518
18519 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
18520 (Fx_get_selection_internal): Minor cleanup.
18521 (Fx_own_selection_internal): Rename arguments for consistency with
18522 select.el.
18523
18524 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
18525
18526 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
18527
18528 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
18529
18530 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
18531
18532 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18533
18534 * dispnew.c (scrolling_window): Don't exclude the case that the
18535 last enabled row in the desired matrix touches the bottom boundary.
18536
18537 2011-05-21 Glenn Morris <rgm@gnu.org>
18538
18539 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
18540 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
18541 and add some more files.
18542
18543 2011-05-20 Eli Zaretskii <eliz@gnu.org>
18544
18545 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
18546 report_file_error introduced by the change from 2011-05-07.
18547
18548 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
18549
18550 * systime.h (Time): Define only if emacs is defined.
18551 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
18552 where the include path doesn't have X11/X.h by default. See
18553 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
18554
18555 2011-05-20 Kenichi Handa <handa@m17n.org>
18556
18557 * composite.c (find_automatic_composition): Fix previous change.
18558
18559 2011-05-20 Glenn Morris <rgm@gnu.org>
18560
18561 * lisp.mk: New file, split from Makefile.in.
18562 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
18563 (shortlisp): Remove.
18564 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
18565
18566 2011-05-19 Glenn Morris <rgm@gnu.org>
18567
18568 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
18569 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
18570 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
18571 (lisp): Set the order to that of loadup.el.
18572 (shortlisp): Make it a copy of $lisp.
18573 (SOME_MACHINE_LISP): Remove.
18574 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
18575 Use just $shortlisp, not $SOME_MACHINE_LISP too.
18576
18577 2011-05-18 Kenichi Handa <handa@m17n.org>
18578
18579 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
18580 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
18581 (find_automatic_composition): Mostly rewrite for efficiency.
18582
18583 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
18584
18585 * makefile.w32-in: Update dependencies.
18586
18587 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
18588
18589 * menu.c: Include limits.h (fixes the MS-Windows build broken by
18590 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
18591
18592 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
18593
18594 Fix some integer overflow issues, such as string length overflow.
18595
18596 * insdel.c (count_size_as_multibyte): Check for string overflow.
18597
18598 * character.c (lisp_string_width): Check for string overflow.
18599 Use EMACS_INT, not int, for string indexes and lengths; in
18600 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
18601 the resulting string length overflows an EMACS_INT; instead,
18602 report a string overflow if no precision given. When checking for
18603 precision exhaustion, use a check that cannot possibly have
18604 integer overflow. (Bug#8675)
18605 * character.h (lisp_string_width): Adjust to new signature.
18606
18607 * alloc.c (string_overflow): New function.
18608 (Fmake_string): Use it. This doesn't change behavior, but saves
18609 a few bytes and will simplify future changes.
18610 * character.c (string_escape_byte8): Likewise.
18611 * lisp.h (string_overflow): New decl.
18612
18613 Fixups, following up to the user-interface timestamp change.
18614 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
18615 for UI timestamps, instead of unsigned long.
18616 * msdos.c (mouse_get_pos): Likewise.
18617 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
18618 * w32gui.h (Time): Define by including "systime.h" rather than by
18619 declaring it ourselves. (Bug#8664)
18620
18621 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
18622 * image.c (clear_image_cache): Likewise.
18623
18624 * term.c (term_mouse_position): Don't assume time_t wraparound.
18625
18626 Be more systematic about user-interface timestamps.
18627 Before, the code sometimes used 'Time', sometimes 'unsigned long',
18628 and sometimes 'EMACS_UINT', to represent these timestamps.
18629 This change causes it to use 'Time' uniformly, as that's what X uses.
18630 This makes the code easier to follow, and makes it easier to catch
18631 integer overflow bugs such as Bug#8664.
18632 * frame.c (Fmouse_position, Fmouse_pixel_position):
18633 Use Time, not unsigned long, for user-interface timestamps.
18634 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18635 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18636 * keyboard.h (last_event_timestamp): Likewise.
18637 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18638 * menu.h (xmenu_show): Likewise.
18639 * term.c (term_mouse_position): Likewise.
18640 * termhooks.h (struct input_event.timestamp): Likewise.
18641 (struct terminal.mouse_position_hook): Likewise.
18642 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18643 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18644 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18645 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18646 what it was before.
18647 * menu.h, termhooks.h: Include "systime.h", for Time.
18648
18649 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18650 Don't assume that the difference between two unsigned long values
18651 can fit into an integer. At this point, we know button_down_time
18652 <= event->timestamp, so the difference must be nonnegative, so
18653 there's no need to cast the result if double-click-time is
18654 nonnegative, as it should be; check that it's nonnegative, just in
18655 case. This bug is triggered when events are more than 2**31 ms
18656 apart (about 25 days). (Bug#8664)
18657
18658 * xselect.c (last_event_timestamp): Remove duplicate decl.
18659 (x_own_selection): Remove needless cast to unsigned long.
18660
18661 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
18662 that always fit in int. Use a sentinel instead of a counter, to
18663 avoid a temp and to allay GCC's concerns about possible int overflow.
18664 * frame.h (struct frame): Use int for menu_bar_items_used
18665 instead of EMACS_INT, since it always fits in int.
18666
18667 * menu.c (grow_menu_items): Check for int overflow.
18668
18669 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
18670
18671 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
18672 Before, the code was not consistent. These values cannot exceed
18673 2**31 - 1 so there's no need to make them unsigned.
18674 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
18675 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
18676 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
18677 as modifiers.
18678 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
18679
18680 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
18681 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
18682 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
18683 presumably because the widths might not match.
18684
18685 * window.c (size_window): Avoid needless test at loop start.
18686
18687 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
18688
18689 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
18690
18691 2011-05-12 Drew Adams <drew.adams@oracle.com>
18692
18693 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
18694
18695 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18696
18697 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
18698 `width' to `bar_area_x' and `bar_area_width', respectively.
18699 (x_scroll_run): Take account of fringe background extension.
18700
18701 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
18702 Rename local vars `left' and `width' to `bar_area_x' and
18703 `bar_area_width', respectively.
18704 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
18705 background extension.
18706
18707 2011-05-10 Jim Meyering <meyering@redhat.com>
18708
18709 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
18710
18711 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
18712
18713 * image.c (Finit_image_library): Return t for built-in image types,
18714 like pbm and xbm. (Bug#8640)
18715
18716 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
18717
18718 * w32menu.c (set_frame_menubar): Fix submenu allocation.
18719
18720 2011-05-07 Eli Zaretskii <eliz@gnu.org>
18721
18722 * w32console.c (Fset_screen_color): Doc fix.
18723 (Fget_screen_color): New function.
18724 (syms_of_ntterm): Defsubr it.
18725
18726 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
18727 unlink the temporary file if Fcall_process didn't create it in the
18728 first place.
18729 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
18730 child process will be redirected to a file specified with `:file'.
18731 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
18732 cue to call_process_cleanup not to close that handle.
18733
18734 2011-05-07 Ben Key <bkey76@gmail.com>
18735
18736 * makefile.w32-in: The bootstrap-temacs rule now makes use of
18737 one of two shell specific rules, either bootstrap-temacs-CMD or
18738 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
18739 to the previous implementation of the bootstrap-temacs rule.
18740 The bootstrap-temacs-CMD rule is similar to the previous
18741 implementation of the bootstrap-temacs rule except that it
18742 makes use of the ESC_CFLAGS variable instead of the CFLAGS
18743 variable.
18744
18745 These changes, along with some changes to nt/configure.bat,
18746 nt/gmake.defs, and nt/nmake.defs, are required to extend my
18747 earlier fix to add support for --cflags and --ldflags options
18748 that include quotes so that it works whether make uses cmd or
18749 sh as the shell.
18750
18751 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
18752
18753 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
18754 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
18755 is a constant.
18756 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
18757 a string. Handle both cases.
18758 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
18759 (Fdbus_register_method): Use Qinvalid_function.
18760
18761 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
18762
18763 * makefile.w32-in: Update dependencies.
18764 (LISP_H): Add inttypes.h and stdin.h.
18765 (PROCESS_H): Add unistd.h.
18766
18767 2011-05-06 Eli Zaretskii <eliz@gnu.org>
18768
18769 * lread.c: Include limits.h (fixes the MS-Windows build broken by
18770 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
18771
18772 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
18773
18774 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
18775
18776 * term.c (vfatal): Remove stray call to va_end.
18777 It's not needed and the C Standard doesn't allow it here anyway.
18778
18779 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
18780 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
18781
18782 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
18783 bytes.
18784
18785 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
18786
18787 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18788
18789 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
18790
18791 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18792
18793 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18794
18795 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18796 * charset.c (Fdefine_charset_internal): Don't initialize
18797 charset.code_space[15]. The value was garbage, on hosts with
18798 32-bit int (Bug#8600).
18799
18800 * lread.c (read_integer): Be more consistent with string-to-number.
18801 Use string_to_number to do the actual conversion; this avoids
18802 rounding errors and fixes some other screwups. Without this fix,
18803 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18804 (digit_to_number): Move earlier, for benefit of read_integer.
18805 Return -1 if the digit is out of range for the base, -2 if it is
18806 not a digit in any supported base. (Bug#8602)
18807
18808 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18809
18810 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18811 to match comment at start of function. This also removes a
18812 GCC warning about overflow in a 32+64-bit port.
18813
18814 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18815
18816 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18817 Reported by Stefan Monnier in
18818 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
18819 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18820 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
18821
18822 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18823 (EMACS_UINTPTR): Likewise, with uintptr_t.
18824
18825 * lisp.h: Prefer 64-bit EMACS_INT if available.
18826 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18827 on 32-bit hosts that have 64-bit int, so that they can access
18828 large files.
18829 However, temporarily disable this change unless the temporary
18830 symbol WIDE_EMACS_INT is defined.
18831
18832 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18833
18834 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18835 This removes an assumption that EMACS_INT and long are the same
18836 width as pointers. The assumption is true for Emacs porting targets
18837 now, but we want to make other targets possible.
18838 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18839 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18840 In the rest of the code, change types of integers that hold casted
18841 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18842 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18843 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18844 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18845 No need to cast type when ORing.
18846 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18847 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18848 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18849 assume EMACS_INT is the same width as char *.
18850 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18851 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18852 Remove no-longer-needed casts.
18853 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18854 (xg_tool_bar_help_callback, xg_make_tool_item):
18855 Use EMACS_INTPTR to hold an integer
18856 that will be cast to void *; this can avoid a GCC warning
18857 if EMACS_INT is not the same width as void *.
18858 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18859 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18860 (current_message_1, set_message_1):
18861 Use a local to convert to proper width without a cast.
18862 * xmenu.c (dialog_selection_callback): Likewise.
18863
18864 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18865 Also, don't assume VALBITS / RAND_BITS is less than 5,
18866 and don't rely on undefined behavior when shifting a 1 left into
18867 the sign bit.
18868 * lisp.h (get_random): Change signature to match.
18869
18870 * lread.c (hash_string): Use size_t, not int, for hash computation.
18871 Normally we prefer signed values; but hashing is special, because
18872 it's better to use unsigned division on hash table sizes so that
18873 the remainder is nonnegative. Also, size_t is the natural width
18874 for hashing into memory. The previous code used 'int', which doesn't
18875 retain enough info to hash well into very large tables.
18876 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18877
18878 * dbusbind.c: Don't possibly lose pointer info when converting.
18879 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18880 Use XPNTR rather than XHASH, so that the high-order bits of
18881 the pointer aren't lost when converting through void *.
18882
18883 * eval.c (Fautoload): Don't double-shift a pointer.
18884
18885 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18886
18887 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
18888
18889 * gnutls.c (DEF_GNUTLS_FN):
18890 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18891
18892 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18893
18894 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18895 marker. (Bug#8610)
18896
18897 2011-05-05 Eli Zaretskii <eliz@gnu.org>
18898
18899 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18900 New version that can reserve upto 2GB of heap space.
18901
18902 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
18903
18904 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18905
18906 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18907
18908 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18909 `gnutls_certificate_set_x509_key_file'.
18910
18911 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
18912
18913 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18914 Update dependencies.
18915
18916 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18917
18918 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18919 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18920 Remove unused parameter `fildes'.
18921 * process.c (read_process_output, send_process): Don't pass it.
18922
18923 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18924
18925 Fix previous change: the library cache is defined in w32.c.
18926 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18927 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18928
18929 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
18930
18931 Implement dynamic loading of GnuTLS on Windows.
18932
18933 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18934 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18935 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18936 Declare.
18937
18938 * gnutls.c (Qgnutls_dll): Define.
18939 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18940 (gnutls_*): Declare function pointers.
18941 (init_gnutls_functions): New function to initialize function pointers.
18942 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18943 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18944 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18945 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18946 (emacs_gnutls_write, emacs_gnutls_read)
18947 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18948 (Fgnutls_available_p): New function.
18949 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18950 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18951 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18952
18953 * image.c: Include w32.h.
18954 (Vimage_type_cache): Delete.
18955 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18956 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18957 (w32_delayed_load): Move to w32.c.
18958
18959 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18960
18961 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18962 (w32_delayed_load): Move from image.c. When loading a library, record
18963 its filename in the :loaded-from property of the library id.
18964 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18965 Initialize and staticpro them.
18966 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18967
18968 * process.c: Include lisp.h before w32.h, not after.
18969 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18970 instead of gnutls_record_check_pending.
18971
18972 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18973
18974 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18975
18976 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18977 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18978 as passed in.
18979
18980 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18981
18982 * xterm.c (x_set_frame_alpha): Do not set property on anything
18983 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18984
18985 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18986
18987 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18988
18989 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
18990
18991 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18992 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18993 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18994 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18995 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18996 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18997 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18998 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18999 (Qgnutls_bootprop_callbacks_verify): Make static.
19000
19001 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19002
19003 * callproc.c: Indentation fixup.
19004
19005 * sysdep.c (wait_for_termination_1): Make static.
19006 (wait_for_termination, interruptible_wait_for_termination):
19007 Move after wait_for_termination_1.
19008
19009 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19010
19011 * sysdep.c (interruptible_wait_for_termination): New function
19012 which is like wait_for_termination, but allows keyboard
19013 interruptions.
19014
19015 * callproc.c (Fcall_process): Add (:file "file") as an option for
19016 the STDOUT buffer.
19017 (Fcall_process_region): Ditto.
19018
19019 2011-04-30 Eli Zaretskii <eliz@gnu.org>
19020
19021 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19022 rather than `XVECTOR (FOO)->size'.
19023
19024 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19025 inttypes.h, as a gnulib replacement is used if it not available in
19026 system headers.
19027
19028 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19029
19030 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19031 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19032 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19033
19034 * coding.c (coding_alloc_by_realloc): Error out if destination
19035 will grow beyond MOST_POSITIVE_FIXNUM.
19036 (decode_coding_emacs_mule): Abort if there isn't enough place in
19037 charbuf for the composition carryover bytes. Reserve an extra
19038 space for up to 2 characters produced in a loop.
19039 (decode_coding_iso_2022): Abort if there isn't enough place in
19040 charbuf for the composition carryover bytes.
19041
19042 2011-04-21 Eli Zaretskii <eliz@gnu.org>
19043
19044 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19045 aborting when %lld or %lll format is passed.
19046 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19047 %llo or %llx format is passed. (Bug#8545)
19048
19049 * window.c (window_scroll_line_based): Use a marker instead of
19050 simple variables to record original value of point. (Bug#7952)
19051
19052 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19053 produced by %s or %c overflows available buffer space. (Bug#8545)
19054
19055 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19056
19057 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
19058 (SIZE_MAX): Move defn after all includes, as they might #define it.
19059
19060 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19061
19062 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19063
19064 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19065
19066 * keyboard.c (Qdelayed_warnings_hook): Define.
19067 (command_loop_1): Run `delayed-warnings-hook'
19068 if Vdelayed_warnings_list is non-nil.
19069 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19070 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19071
19072 2011-04-28 Eli Zaretskii <eliz@gnu.org>
19073
19074 * doprnt.c (doprnt): Don't return value smaller than the buffer
19075 size if the message was truncated. (Bug#8545).
19076
19077 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
19078
19079 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19080 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19081
19082 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19083
19084 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19085
19086 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
19087
19088 * makefile.w32-in: Update dependencies.
19089
19090 2011-04-27 Eli Zaretskii <eliz@gnu.org>
19091
19092 Improve `doprnt' and its usage. (Bug#8545)
19093 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19094 `format_end'. Remove support for %l as a conversion specifier.
19095 Don't use xrealloc. Improve diagnostics when the %l size modifier
19096 is used. Update the commentary.
19097
19098 * eval.c (verror): Simplify calculation of size_t.
19099
19100 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19101 messages.
19102
19103 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19104
19105 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19106 change.
19107
19108 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19109
19110 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19111 This makes this file independent of the recent pseudovector change.
19112
19113 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
19114
19115 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19116
19117 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
19118 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
19119 Remove unused local.
19120 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
19121
19122 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
19123 GCC 4.6.0 optimizes based on type-based alias analysis.
19124 For example, if b is of type struct buffer * and v of type struct
19125 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19126 != &v->size, and therefore "v->size = 1; b->size = 2; return
19127 v->size;" must therefore return 1. This assumption is incorrect
19128 for Emacs, since it type-puns struct Lisp_Vector * with many other
19129 types. To fix this problem, this patch adds a new type struct
19130 vectorlike_header that documents the constraints on layout of vectors
19131 and pseudovectors, and helps optimizing compilers not get fooled
19132 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19133 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
19134 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19135 the size member.
19136 (XSETPVECTYPE): Rewrite in terms of new macro.
19137 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19138 This is a bit clearer, and further avoids the possibility of
19139 undesirable aliasing.
19140 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
19141 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
19142 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19143 since Lisp_Subr is a special case (no "next" field).
19144 (ASIZE): Now uses header.size rather than size.
19145 All previous uses of XVECTOR (foo)->size replaced to use this macro,
19146 to avoid the hassle of writing XVECTOR (foo)->header.size.
19147 (struct vectorlike_header): New type.
19148 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19149 object, to help avoid aliasing.
19150 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19151 (SUBRP): Likewise, since Lisp_Subr is a special case.
19152 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19153 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19154 (struct Lisp_Hash_Table): Combine first two members into a single
19155 struct vectorlike_header member. All uses of "size" and "next" members
19156 changed to be "header.size" and "header.next".
19157 * buffer.h (struct buffer): Likewise.
19158 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19159 * frame.h (struct frame): Likewise.
19160 * process.h (struct Lisp_Process): Likewise.
19161 * termhooks.h (struct terminal): Likewise.
19162 * window.c (struct save_window_data, struct saved_window): Likewise.
19163 * window.h (struct window): Likewise.
19164 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19165 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19166 * buffer.c (init_buffer_once): Likewise.
19167 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19168 special case.
19169 * process.c (Fformat_network_address): Use local var for size,
19170 for brevity.
19171
19172 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19173
19174 Make the Lisp reader and string-to-float more consistent (Bug#8525)
19175 * data.c (atof): Remove decl; no longer used or needed.
19176 (digit_to_number): Move to lread.c.
19177 (Fstring_to_number): Use new string_to_number function, to be
19178 consistent with how the Lisp reader treats infinities and NaNs.
19179 Do not assume that floating-point numbers represent EMACS_INT
19180 without losing information; this is not true on most 64-bit hosts.
19181 Avoid double-rounding errors, by insisting on integers when
19182 parsing non-base-10 numbers, as the documentation specifies.
19183 * lisp.h (string_to_number): New decl, replacing ...
19184 (isfloat_string): Remove.
19185 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
19186 (read1): Do not accept +. and -. as integers; this
19187 appears to have been a coding error. Similarly, do not accept
19188 strings like +-1e0 as floating point numbers. Do not report
19189 overflow for integer overflows unless the base is not 10 which
19190 means we have no simple and reliable way to continue.
19191 Break out the floating-point parsing into a new
19192 function string_to_number, so that Fstring_to_number parses
19193 floating point numbers consistently with the Lisp reader.
19194 (digit_to_number): Move here from data.c. Make it static inline.
19195 (E_CHAR, EXP_INT): Remove, replacing with ...
19196 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19197 (string_to_number): New function, replacing isfloat_string.
19198 This function checks for valid syntax and produces the resulting
19199 Lisp float number too. Rework it so that string-to-number
19200 no longer mishandles examples like "1.0e+". Use strtoumax,
19201 so that overflow for non-base-10 numbers is reported only when
19202 there's no portable and simple way to convert to floating point.
19203
19204 * textprop.c (set_text_properties_1): Rewrite for clarity,
19205 and to avoid GCC warning about integer overflow.
19206
19207 * intervals.h (struct interval): Use EMACS_INT for members
19208 where EMACS_UINT might cause problems. See
19209 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19210 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19211 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19212 All uses changed.
19213 (offset_intervals): Tell GCC not to worry about length overflow
19214 when negating a negative length.
19215
19216 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19217 (overrun_check_free): Likewise.
19218
19219 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19220 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19221 word size.
19222
19223 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19224 (gnutls_make_error): Rename local to avoid shadowing.
19225 (gnutls_emacs_global_deinit): ifdef out; not used.
19226 (Fgnutls_boot): Use const for pointer to readonly storage.
19227 Comment out unused local. Fix pointer signedness problems.
19228
19229 * lread.c (openp): Don't stuff size_t into an 'int'.
19230 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19231 about possible signed overflow.
19232
19233 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19234 (GDK_KEY_g): Don't define if already defined.
19235 (xg_prepare_tooltip): Avoid pointer signedness problem.
19236 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19237
19238 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19239 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19240
19241 * xfns.c (Fx_window_property): Simplify a bit,
19242 to make a bit faster and to avoid GCC 4.6.0 warning.
19243 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19244
19245 * fns.c (internal_equal): Don't assume size_t fits in int.
19246
19247 * alloc.c (compact_small_strings): Tighten assertion a little.
19248
19249 Replace pEd with more-general pI, and fix some printf arg casts.
19250 * lisp.h (pI): New macro, generalizing old pEd macro to other
19251 conversion specifiers. For example, use "...%"pI"d..." rather
19252 than "...%"pEd"...".
19253 (pEd): Remove. All uses replaced with similar uses of pI.
19254 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
19255 * alloc.c (check_pure_size): Don't overflow by converting size to int.
19256 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
19257 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
19258 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
19259 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
19260 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
19261 64-bit hosts.
19262 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
19263 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
19264 * print.c (safe_debug_print, print_object): Likewise.
19265 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
19266 to int.
19267 Use pI instead of if-then-else-abort. Use %p to avoid casts,
19268 avoiding the 0 flag, which is not portable.
19269 * process.c (Fmake_network_process): Use pI to avoid cast.
19270 * region-cache.c (pp_cache): Likewise.
19271 * xdisp.c (decode_mode_spec): Likewise.
19272 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19273 behavior on 64-bit hosts with printf arg.
19274 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
19275 (x_stop_queuing_selection_requests): Likewise.
19276 (x_get_window_property): Don't truncate byte count to an 'int'
19277 when tracing.
19278
19279 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19280 here, since it parses constructs like leading '-' and spaces,
19281 which are not wanted; and it overflows with large numbers.
19282 Instead, simply match F[0-9]+, which is what is wanted anyway.
19283
19284 * alloc.c: Remove unportable assumptions about struct layout.
19285 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19286 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19287 (allocate_vectorlike, make_pure_vector): Use the new macros,
19288 plus offsetof, to remove unportable assumptions about struct layout.
19289 These assumptions hold on all porting targets that I know of, but
19290 they are not guaranteed, they're easy to remove, and removing them
19291 makes further changes easier.
19292
19293 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19294 This doesn't fix a bug but makes the code clearer.
19295 (string_overrun_cookie): Now const. Use initializers that
19296 don't formally overflow signed char, to avoid warnings.
19297 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19298 can cause Emacs to crash when string overrun checking is enabled.
19299 (allocate_buffer): Don't assume sizeof (struct buffer) is a
19300 multiple of sizeof (EMACS_INT); it need not be, if
19301 alignof(EMACS_INT) < sizeof (EMACS_INT).
19302 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
19303
19304 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
19305
19306 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
19307
19308 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
19309
19310 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
19311 supposed to be handshaking. (Bug#8556)
19312 Reported by Paul Eggert <eggert@cs.ucla.edu>.
19313
19314 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
19315
19316 * lisp.h (Qdebug): List symbol.
19317 * eval.c (Qdebug): Restore global linkage.
19318 * keyboard.c (debug-on-event): New variable.
19319 (handle_user_signal): Break into debugger when debug-on-event
19320 matches the current signal symbol.
19321
19322 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
19323
19324 * alloc.c (check_sblock, check_string_bytes)
19325 (check_string_free_list): Convert to standard C.
19326
19327 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
19328
19329 * w32.c (emacs_gnutls_push): Fix typo.
19330
19331 2011-04-25 Eli Zaretskii <eliz@gnu.org>
19332
19333 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
19334 "cast to pointer from integer of different size".
19335
19336 Improve doprnt and its use in verror. (Bug#8545)
19337 * doprnt.c (doprnt): Document the set of format control sequences
19338 supported by the function. Use SAFE_ALLOCA instead of always
19339 using `alloca'.
19340
19341 * eval.c (verror): Don't limit the buffer size at size_max-1, that
19342 is one byte too soon. Don't use xrealloc; instead xfree and
19343 xmalloc anew.
19344
19345 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
19346
19347 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
19348 callbacks stage.
19349
19350 * gnutls.c: Renamed global_initialized to
19351 gnutls_global_initialized. Added internals for the
19352 :verify-hostname-error, :verify-error, and :verify-flags
19353 parameters of `gnutls-boot' and documented those parameters in the
19354 docstring. Start callback support.
19355 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
19356 unless a fatal error occurred. Call gnutls_alert_send_appropriate
19357 on error. Return error code.
19358 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
19359 (emacs_gnutls_read): Likewise.
19360 (Fgnutls_boot): Return handshake error code.
19361 (emacs_gnutls_handle_error): New function.
19362 (wsaerror_to_errno): Likewise.
19363
19364 * w32.h (emacs_gnutls_pull): Add prototype.
19365 (emacs_gnutls_push): Likewise.
19366
19367 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
19368 (emacs_gnutls_push): Likewise.
19369
19370 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
19371
19372 * process.c (wait_reading_process_output): Check if GnuTLS
19373 buffered some data internally if no FDs are set for TLS
19374 connections.
19375
19376 * makefile.w32-in (OBJ2): Add gnutls.$(O).
19377 (LIBS): Link to USER_LIBS.
19378 ($(BLD)/gnutls.$(0)): New target.
19379
19380 2011-04-24 Eli Zaretskii <eliz@gnu.org>
19381
19382 * xdisp.c (handle_single_display_spec): Rename the
19383 display_replaced_before_p argument into display_replaced_p, to
19384 make it consistent with the commentary. Fix typos in the
19385 commentary.
19386
19387 * textprop.c (syms_of_textprop): Remove dead code.
19388 (copy_text_properties): Delete obsolete commentary about an
19389 interface that was deleted long ago. Fix typos in the description
19390 of arguments.
19391
19392 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
19393 to changes in oldXMenu/XMenu.h from 2011-04-16.
19394 <menu_help_message, prev_menu_help_message>: Constify.
19395 (IT_menu_make_room): menu->help_text is now `const char **';
19396 adjust.
19397
19398 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
19399 to changes in oldXMenu/XMenu.h from 2011-04-16.
19400 (struct XMenu): Declare `help_text' `const char **'.
19401
19402 * xfaces.c <Qunspecified>: Make extern again.
19403
19404 * syntax.c: Include sys/types.h before including regex.h, as
19405 required by POSIX.
19406
19407 * doc.c (get_doc_string): Improve the format passed to `error'.
19408
19409 * doprnt.c (doprnt): Improve commentary.
19410
19411 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
19412
19413 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
19414 them with etags.
19415
19416 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
19417 changes in globals.h immediately force recompilation.
19418 (TAGS): Depend on $(CURDIR)/m/intel386.h and
19419 $(CURDIR)/s/ms-w32.h.
19420 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
19421
19422 * character.c (Fchar_direction): Function deleted.
19423 (syms_of_character): Don't defsubr it.
19424 <char-direction-table>: Deleted.
19425
19426 2011-04-23 Eli Zaretskii <eliz@gnu.org>
19427
19428 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
19429 * doprnt.c: Include limits.h.
19430 (SIZE_MAX): New macro.
19431 (doprnt): Return a size_t value. 2nd arg is now size_t.
19432 Many local variables are now size_t instead of int or unsigned.
19433 Improve overflow protection. Support `l' modifier for integer
19434 conversions. Support %l conversion. Don't assume an EMACS_INT
19435 argument for integer conversions and for %c.
19436
19437 * lisp.h (doprnt): Restore prototype.
19438
19439 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
19440 $(SRC)/character.h.
19441
19442 * Makefile.in (base_obj): Add back doprnt.o.
19443
19444 * deps.mk (doprnt.o): Add back prerequisites.
19445 (callint.o): Depend on character.h.
19446
19447 * eval.c (internal_lisp_condition_case): Include the handler
19448 representation in the error message.
19449 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
19450 when breaking from the loop.
19451
19452 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
19453
19454 * callint.c (Fcall_interactively): When displaying error message
19455 about invalid control letter, pass the character's codepoint, not
19456 a pointer to its multibyte form. Improve display of the character
19457 in octal and display also its hex code.
19458
19459 * character.c (char_string): Use %x to display the (unsigned)
19460 codepoint of an invalid character, to avoid displaying a bogus
19461 negative value.
19462
19463 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
19464 `error', not SYMBOL_NAME itself.
19465
19466 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
19467 character arguments to `error'.
19468
19469 * charset.c (check_iso_charset_parameter): Fix incorrect argument
19470 to `error' in error message about FINAL_CHAR argument. Make sure
19471 FINAL_CHAR is a character, and use %c when it is passed as
19472 argument to `error'.
19473
19474 2011-04-23 Eli Zaretskii <eliz@gnu.org>
19475
19476 * s/ms-w32.h (localtime): Redirect to sys_localtime.
19477
19478 * w32.c: Include <time.h>.
19479 (sys_localtime): New function.
19480
19481 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
19482
19483 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
19484
19485 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
19486
19487 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
19488
19489 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
19490 zombies (Bug#8467).
19491
19492 2011-04-19 Eli Zaretskii <eliz@gnu.org>
19493
19494 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
19495 gl_state.e_property when gl_state.object is Qt.
19496
19497 * insdel.c (make_gap_larger): Remove limitation of buffer size
19498 to <= INT_MAX.
19499
19500 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
19501
19502 * xdisp.c (lookup_glyphless_char_display)
19503 (produce_glyphless_glyph): Handle cons cell entry in
19504 glyphless-char-display.
19505 (Vglyphless_char_display): Document it.
19506
19507 * term.c (produce_glyphless_glyph): Handle cons cell entry in
19508 glyphless-char-display.
19509
19510 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
19511
19512 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
19513
19514 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
19515
19516 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
19517 definition for no-X builds.
19518
19519 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
19520
19521 Static checks with GCC 4.6.0 and non-default toolkits.
19522
19523 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
19524
19525 * process.c (keyboard_bit_set): Define only if SIGIO.
19526 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
19527 (send_process): Repair possible setjmp clobbering.
19528
19529 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
19530
19531 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
19532
19533 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
19534
19535 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
19536 Define only if needed.
19537
19538 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
19539 by pacifying GCC about it. Maybe it's time to retire it?
19540 * xfaces.c (USG, __TIMEVAL__): Likewise.
19541
19542 * dispextern.h (struct redisplay_interface): Rename param
19543 to avoid shadowing.
19544 * termhooks.h (struct terminal): Likewise.
19545 * xterm.c (xembed_send_message): Likewise.
19546
19547 * insdel.c (make_gap_smaller): Define only if
19548 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
19549
19550 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
19551 it.
19552
19553 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
19554 so that we aren't warned about unused symbols.
19555
19556 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
19557
19558 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
19559
19560 * xfns.c (x_real_positions): Mark locals as initialized.
19561
19562 * xmenu.c (xmenu_show): Don't use uninitialized vars.
19563
19564 * xterm.c: Fix problems found by static analysis with other toolkits.
19565 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
19566 (x_dispatch_event): Declare static if USE_GTK, and
19567 define if USE_GTK || USE_X_TOOLKIT.
19568 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
19569 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
19570 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
19571 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
19572
19573 * xmenu.c (menu_help_callback): Pointer type fixes.
19574 Use const pointers when pointing at readonly data. Avoid pointer
19575 signedness clashes.
19576 (FALSE): Remove unused macro.
19577 (update_frame_menubar): Remove unused decl.
19578
19579 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
19580
19581 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19582 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
19583 (single_menu_item): Rename local to avoid shadowing.
19584
19585 * keyboard.c (make_lispy_event): Remove unused local var.
19586
19587 * frame.c, frame.h (x_get_resource_string): Bring this back, but
19588 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
19589
19590 * bitmaps: Change bitmaps from unsigned char back to the X11
19591 compatible char. Avoid the old compiler warnings about
19592 out-of-range initializers by using, for example, '\xab' rather
19593 than 0xab.
19594
19595 * xgselect.c (xgselect_initialize): Check vs interface
19596 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
19597
19598 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
19599
19600 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
19601 to read-only memory.
19602
19603 * fns.c (vector): Remove; this old hack is no longer needed.
19604
19605 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
19606 Remove unused var.
19607 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
19608
19609 * xrdb.c (x_load_resources): Omit unused local.
19610
19611 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
19612 (x_window): Rename locals to avoid shadowing.
19613 (USG): Use the kludged USG macro, to pacify gcc.
19614
19615 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
19616 (x_term_init): Remove local to avoid shadowing.
19617
19618 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
19619
19620 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
19621 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
19622
19623 2011-04-16 Eli Zaretskii <eliz@gnu.org>
19624
19625 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
19626
19627 Fix regex.c, syntax.c and friends for buffers > 2GB.
19628 * syntax.h (struct gl_state_s): Declare character position members
19629 EMACS_INT.
19630
19631 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19632
19633 * textprop.c (verify_interval_modification, interval_of):
19634 Declare arguments EMACS_INT.
19635
19636 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19637 EMACS_INT.
19638
19639 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19640
19641 * indent.c (Fvertical_motion): Local variable it_start is now
19642 EMACS_INT.
19643
19644 * regex.c (re_match, re_match_2, re_match_2_internal)
19645 (bcmp_translate, regcomp, regexec, print_double_string)
19646 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19647 (re_compile_pattern, re_exec): Declare arguments and local
19648 variables `size_t' and `ssize_t' and return values `regoff_t', as
19649 appropriate.
19650 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
19651 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
19652 <compile_stack_type>: `size' and `avail' are now `size_t'.
19653
19654 * regex.h <regoff_t>: Use ssize_t, not int.
19655 (re_search, re_search_2, re_match, re_match_2): Arguments that
19656 specify buffer/string position and length are now ssize_t and
19657 size_t. Return type is regoff_t.
19658
19659 2011-04-16 Ben Key <bkey76@gmail.com>
19660
19661 * nsfont.m: Fixed bugs in ns_get_family and
19662 ns_descriptor_to_entity that were caused by using free to
19663 deallocate memory blocks that were allocated by xmalloc (via
19664 xstrdup). This caused Emacs to crash when compiled with
19665 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
19666 --enable-checking=xmallocoverrun). xfree is now used to
19667 deallocate these memory blocks.
19668
19669 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
19670
19671 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
19672
19673 emacs_write: Accept and return EMACS_INT for sizes.
19674 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
19675 et seq.
19676 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
19677 Accept and return EMACS_INT.
19678 (emacs_gnutls_write): Return the number of bytes written on
19679 partial writes.
19680 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
19681 (emacs_read, emacs_write): Remove check for negative size, as the
19682 Emacs source code has been audited now.
19683 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
19684 (emacs_read, emacs_write): Use it.
19685 * process.c (send_process): Adjust to the new signatures of
19686 emacs_write and emacs_gnutls_write. Do not attempt to store
19687 a byte offset into an 'int'; it might overflow.
19688 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
19689
19690 * sound.c: Don't assume sizes fit in 'int'.
19691 (struct sound_device.period_size, alsa_period_size):
19692 Return EMACS_INT, not int.
19693 (struct sound_device.write, vox_write, alsa_write):
19694 Accept EMACS_INT, not int.
19695 (wav_play, au_play): Use EMACS_INT to store sizes and to
19696 record read return values.
19697
19698 2011-04-15 Ben Key <bkey76@gmail.com>
19699
19700 * keyboard.c (Qundefined): Don't declare static since it is used
19701 in nsfns.m.
19702 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
19703 static since they are used in nsfont.m.
19704
19705 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
19706
19707 * process.c (Qprocessp): Don't declare static.
19708 * lisp.h (Qprocessp): Declare again.
19709
19710 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
19711
19712 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
19713
19714 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
19715
19716 Improve C-level modularity by making more things 'static'.
19717
19718 Don't publish debugger-only interfaces to other modules.
19719 * lisp.h (safe_debug_print, debug_output_compilation_hack):
19720 (verify_bytepos, count_markers): Move decls to the only modules
19721 that need them.
19722 * region-cache.h (pp_cache): Likewise.
19723 * window.h (check_all_windows): Likewise.
19724 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
19725
19726 * sysdep.c (croak): Now static, if
19727 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
19728 * syssignal.h (croak): Declare only if not static.
19729
19730 * alloc.c (refill_memory_reserve): Now static if
19731 !defined REL_ALLOC || defined SYSTEM_MALLOC.
19732 * lisp.h (refill_memory_reserve): Declare only if not static.
19733
19734 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
19735 Define only if USE_LUCID.
19736
19737 * xrdb.c (x_customization_string, x_rm_string): Now static.
19738
19739 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
19740 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
19741
19742 * xdisp.c (draw_row_with_mouse_face): Now static.
19743 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
19744
19745 * window.h (check_all_windows): Mark externally visible.
19746
19747 * window.c (window_deletion_count): Now static.
19748
19749 * undo.c: Make symbols static if they're not exported.
19750 (last_undo_buffer, last_boundary_position, pending_boundary):
19751 Now static.
19752
19753 * textprop.c (interval_insert_behind_hooks): Now static.
19754 (interval_insert_in_front_hooks): Likewise.
19755
19756 * term.c: Make symbols static if they're not exported.
19757 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
19758 (max_frame_lines, tty_set_terminal_modes):
19759 (tty_reset_terminal_modes, tty_turn_off_highlight):
19760 (get_tty_terminal): Now static.
19761 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
19762 * termhooks.h (term_mouse_moveto): Do not declare if
19763 HAVE_WINDOW_SYSTEM.
19764 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
19765 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
19766
19767 * sysdep.c: Make symbols static if they're not exported.
19768 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
19769 Now static.
19770 (sigprocmask_set, full_mask): Remove; unused.
19771 (wait_debugging): Mark as visible.
19772 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
19773 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
19774
19775 * syntax.c (syntax_temp): Define only if !__GNUC__.
19776
19777 * sound.c (current_sound_device, current_sound): Now static.
19778
19779 * search.c (searchbufs, searchbuf_head): Now static.
19780
19781 * scroll.c (scroll_cost): Remove; unused.
19782 * dispextern.h (scroll_cost): Remove decl.
19783
19784 * region-cache.h (pp_cache): Mark as externally visible.
19785
19786 * process.c: Make symbols static if they're not exported.
19787 (process_tick, update_tick, create_process, chan_process):
19788 (Vprocess_alist, proc_buffered_char, datagram_access):
19789 (fd_callback_data, send_process_frame, process_sent_to): Now static.
19790 (deactivate_process): Mark defn as static, as well as decl.
19791 * lisp.h (create_process): Remove decl.
19792 * process.h (chan_process, Vprocess_alist): Remove decls.
19793
19794 * print.c: Make symbols static if they're not exported.
19795 (print_depth, new_backquote_output, being_printed, print_buffer):
19796 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19797 (print_interval, print_number_index, initial_stderr_stream):
19798 Now static.
19799 * lisp.h (Fprinc): Remove decl.
19800 (debug_output_compilation_hack): Mark as externally visible.
19801
19802 * sysdep.c (croak): Move decl from here to syssignal.h.
19803 * syssignal.h (croak): Put it here, so the API can be checked when
19804 'croak' is called from dissociate_if_controlling_tty.
19805
19806 * minibuf.c: Make symbols static if they're not exported.
19807 (minibuf_save_list, choose_minibuf_frame): Now static.
19808 * lisp.h (choose_minibuf_frame): Remove decl.
19809
19810 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19811
19812 * lread.c: Make symbols static if they're not exported.
19813 (read_objects, initial_obarray, oblookup_last_bucket_number):
19814 Now static.
19815 (make_symbol): Remove; unused.
19816 * lisp.h (initial_obarray, make_symbol): Remove decls.
19817
19818 * keyboard.c: Make symbols static if they're not exported.
19819 (single_kboard, recent_keys_index, total_keys, recent_keys):
19820 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19821 (this_single_command_key_start, echoing, last_auto_save):
19822 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19823 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19824 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19825 (Vlispy_mouse_stem, double_click_count):
19826 Now static.
19827 (force_auto_save_soon): Define only if SIGDANGER.
19828 (ignore_mouse_drag_p): Now static if
19829 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19830 (print_help): Remove; unused.
19831 (stop_character, last_timer_event): Mark as externally visible.
19832 * keyboard.h (ignore_mouse_drag_p): Declare only if
19833 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19834 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19835 * lisp.h (echoing): Remove decl.
19836 (force_auto_save_soon): Declare only if SIGDANGER.
19837 * xdisp.c (redisplay_window): Simplify code, to make it more
19838 obvious that ignore_mouse_drag_p is not accessed if !defined
19839 USE_GTK && !defined HAVE_NS.
19840
19841 * intervals.c: Make symbols static if they're not exported.
19842 (merge_properties_sticky, merge_interval_right, delete_interval):
19843 Now static.
19844 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19845
19846 * insdel.c: Make symbols static if they're not exported.
19847 However, leave prepare_to_modify_buffer alone. It's never
19848 called from outside this function, but that appears to be a bug.
19849 (combine_after_change_list, combine_after_change_buffer):
19850 (adjust_after_replace, signal_before_change): Now static.
19851 (adjust_after_replace_noundo): Remove; unused.
19852 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
19853 (signal_before_change): Remove decls.
19854
19855 * indent.c (val_compute_motion, val_vmotion): Now static.
19856
19857 * image.c: Make symbols static if they're not exported.
19858 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19859 if USE_GTK.
19860 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19861 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19862
19863 * fringe.c (standard_bitmaps): Now static.
19864 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19865
19866 * frame.c: Make symbols static if they're not exported.
19867 (x_report_frame_params, make_terminal_frame): Now static.
19868 (get_frame_param): Now static, unless HAVE_NS.
19869 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19870 (x_get_resource_string): Remove; not used.
19871 * frame.h (make_terminal_frame, x_report_frame_params):
19872 (x_get_resource_string); Remove decls.
19873 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19874 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19875
19876 * font.c, fontset.c: Make symbols static if they're not exported.
19877 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19878 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19879 * font.c (font_close_object): Now static.
19880 * font.h (font_close_object): Remove.
19881 * fontset.c (FONTSET_OBJLIST): Remove.
19882 (free_realized_fontset) #if-0 the body, which does nothing.
19883 (face_suitable_for_char_p): #if-0, as it's never called.
19884 * fontset.h (face_suitable_for_char_p): Remove decl.
19885 * xfaces.c (face_at_string_position):
19886 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
19887 since 0 is always ASCII.
19888
19889 * fns.c (weak_hash_tables): Now static.
19890
19891 * fileio.c: Make symbols static if they're not exported.
19892 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19893 (Vwrite_region_annotation_buffers): Now static.
19894
19895 * eval.c: Make symbols static if they're not exported.
19896 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19897 * lisp.h (backtrace_list): Remove decl.
19898
19899 * emacs.c: Make symbols static if they're not exported.
19900 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19901 (fatal_error_code, fatal_error_signal_hook, standard_args):
19902 Now static.
19903 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19904 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19905 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19906 * lisp.h (fatal_error_signal_hook): Remove decl.
19907 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19908
19909 * editfns.c: Move a (normally-unused) function to its only use.
19910 * editfns.c, lisp.h (get_operating_system_release): Remove.
19911 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19912 worth the hassle of breaking this out.
19913
19914 * xterm.c: Make symbols static if they're not exported.
19915 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19916 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19917 (x_destroy_window, x_delete_display):
19918 Now static.
19919 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19920 (x_mouse_leave): Remove; unused.
19921 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19922 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19923 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19924 Remove decls.
19925 (x_mouse_leave): Declare only if WINDOWSNT.
19926 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19927 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19928 USE_X_TOOLKIT.
19929
19930 * ftxfont.c: Make symbols static if they're not exported.
19931 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19932 HAVE_FREETYPE.
19933 * font.h (ftxfont_driver): Likewise.
19934
19935 * xfns.c: Make symbols static if they're not exported.
19936 (x_last_font_name, x_display_info_for_name):
19937 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19938 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19939 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19940 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19941 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19942 (last_show_tip_args): Now static.
19943 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19944 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19945 (x_screen_planes): Remove; unused.
19946 * dispextern.h (x_screen_planes): Remove decl.
19947
19948 * dispnew.c: Make symbols static if they're not exported.
19949 * dispextern.h (redraw_garbaged_frames, scrolling):
19950 (increment_row_positions): Remove.
19951 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19952 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19953 Now static.
19954 (redraw_garbaged_frames): Remove; unused.
19955
19956 * xfaces.c: Make symbols static if they're not exported.
19957 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19958 Remove decls.
19959 * xterm.h (defined_color): Remove decls.
19960 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19961 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19962 (menu_face_changed_default, defined_color, free_realized_face):
19963 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19964 (ascii_face_of_lisp_face): Remove; unused.
19965
19966 * xdisp.c: Make symbols static if they're not exported.
19967 * dispextern.h (scratch_glyph_row, window_box_edges):
19968 (glyph_to_pixel_coords, set_cursor_from_row):
19969 (get_next_display_element, set_iterator_to_next):
19970 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19971 (show_mouse_face): Remove decls
19972 * frame.h (message_buf_print): Likewise.
19973 * lisp.h (pop_message, set_message, check_point_in_composition):
19974 Likewise.
19975 * xterm.h (set_vertical_scroll_bar): Likewise.
19976 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19977 (message_buf_print, scratch_glyph_row, displayed_buffer):
19978 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19979 (get_next_display_element, show_mouse_face, window_box_edges):
19980 (frame_to_window_pixel_xy, check_point_in_composition):
19981 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19982 (glyph_to_pixel_coords): Remove; unused.
19983
19984 * dired.c (file_name_completion): Now static.
19985
19986 * dbusbind.c (xd_in_read_queued_messages): Now static.
19987
19988 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19989 * data.c (circular_list_error): Remove.
19990
19991 * commands.h (last_point_position, last_point_position_buffer):
19992 (last_point_position_window): Remove decls.
19993 * keyboard.c: Make these variables static.
19994
19995 * coding.h (coding, code_convert_region, encode_coding_gap):
19996 Remove decls.
19997 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19998 (iso_code_class, detect_coding, code_convert_region): Now static.
19999 (encode_coding_gap): Remove; unused.
20000
20001 * chartab.c (chartab_chars, chartab_bits): Now static.
20002
20003 * charset.h (charset_iso_8859_1): Remove decl.
20004 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20005 Now static.
20006
20007 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20008 * ccl.c (Vccl_program_table): Now static.
20009 (check_ccl_update): Remove; unused.
20010
20011 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20012 * category.h: ... from here.
20013 * category.c (check_category_table, set_category_set): Now static.
20014
20015 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20016 * lisp.h: Remove these decls.
20017
20018 * buffer.c (buffer_count): Remove unused var.
20019
20020 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20021 so that it's not optimized away.
20022 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20023 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20024 exported only to the debugger.
20025
20026 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
20027 * atimer.h (run_all_atimers): Remove; not exported.
20028
20029 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20030 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20031 was inaccessible from Lisp.
20032 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20033 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20034
20035 alloc.c: Import and export fewer symbols, and remove unused items.
20036 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20037 is defined.
20038 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20039 it's not optimized away by whole-program optimization.
20040 (message_enable_multibyte, free_misc): Remove.
20041 (catchlist, handlerlist, mark_backtrace):
20042 Declare only if BYTE_MARK_STACK.
20043 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20044 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20045 (message_enable_multibyte): Remove decl.
20046 (free_misc, interval_free_list, float_block, float_block_index):
20047 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20048 (cons_free_list, last_marked_index):
20049 Now static.
20050 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20051 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20052 (mark_backtrace): Define only if BYTE_MARK_STACK.
20053 * xdisp.c (message_enable_multibyte): Now static.
20054
20055 Declare Lisp_Object Q* variables to be 'static' if not exported.
20056 This makes it easier for human readers (and static analyzers)
20057 to see whether these variables are used from other modules.
20058 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20059 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20060 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20061 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20062 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20063 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20064 * xmenu.c, xselect.c:
20065 Declare Q* vars static if they are not used in other modules.
20066 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20067 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20068 Remove decls of unexported vars.
20069 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20070
20071 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20072
20073 Make Emacs functions such as Fatom 'static' by default.
20074 This makes it easier for human readers (and static analyzers)
20075 to see whether these functions can be called from other modules.
20076 DEFUN now defines a static function. To make the function external
20077 so that it can be used in other C modules, use the new macro DEFUE.
20078 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20079 (Finit_image_library):
20080 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20081 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20082 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20083 Remove decls, since these functions are now static.
20084 (Funintern, Fget_internal_run_time): New decls, since these functions
20085 were already external.
20086
20087 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20088 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20089 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20090 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20091 * keyboard.c, keymap.c, lread.c:
20092 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20093 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20094 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20095 Mark functions with DEFUE instead of DEFUN,
20096 if they are used in other modules.
20097 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20098 decls for now-static functions.
20099 * buffer.h (Fdelete_overlay): Remove decl.
20100 * callproc.c (Fgetenv_internal): Mark as internal.
20101 * composite.c (Fremove_list_of_text_properties): Remove decl.
20102 (Fcomposition_get_gstring): New forward static decl.
20103 * composite.h (Fcomposite_get_gstring): Remove decl.
20104 * dired.c (Ffile_attributes): New forward static decl.
20105 * doc.c (Fdocumntation_property): New forward static decl.
20106 * eval.c (Ffetch_bytecode): New forward static decl.
20107 (Funintern): Remove extern decl; now in .h file where it belongs.
20108 * fileio.c (Fmake_symbolic_link): New forward static decl.
20109 * image.c (Finit_image_library): New forward static decl.
20110 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20111 * intervals.h (Fprevious_property_change):
20112 (Fremove_list_of_text_properties): Remove decls.
20113 * keyboard.c (Fthis_command_keys): Remove decl.
20114 (Fcommand_execute): New forward static decl.
20115 * keymap.c (Flookup_key): New forward static decl.
20116 (Fcopy_keymap): Now static.
20117 * keymap.h (Flookup_key): Remove decl.
20118 * process.c (Fget_process): New forward static decl.
20119 (Fprocess_datagram_address): Mark as internal.
20120 * syntax.c (Fsyntax_table_p): New forward static decl.
20121 (skip_chars): Remove duplicate decl.
20122 * textprop.c (Fprevious_property_change): New forward static decl.
20123 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20124 Now internal.
20125 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20126 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20127
20128 * editfns.c (Fformat): Remove unreachable code.
20129
20130 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20131
20132 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20133 change. (Bug#8496)
20134
20135 2011-04-13 Eli Zaretskii <eliz@gnu.org>
20136
20137 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20138 when at ZV. (Bug#8487)
20139
20140 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20141
20142 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20143 (Bug#8437)
20144 * keyboard.c (parse_tool_bar_item): Likewise.
20145 * sound.c (sound_cleanup, alsa_close): Likewise.
20146 * termcap.c (tgetent): Likewise.
20147 * xfns.c (x_default_font_parameter): Likewise.
20148 * xsettings.c (read_and_apply_settings): Likewise.
20149
20150 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20151 (overrun_check_free): Protoize.
20152
20153 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20154
20155 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20156 since callers should never pass a negative size.
20157 Change the signature to match that of plain 'read' and 'write'; see
20158 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20159 * lisp.h: Update prototypes of emacs_write and emacs_read.
20160
20161 2011-04-11 Eli Zaretskii <eliz@gnu.org>
20162
20163 * xdisp.c (redisplay_window): Don't try to determine the character
20164 position of the scroll margin if the window start point w->startp
20165 is outside the buffer's accessible region. (Bug#8468)
20166
20167 2011-04-10 Eli Zaretskii <eliz@gnu.org>
20168
20169 Fix write-region and its subroutines for buffers > 2GB.
20170 * fileio.c (a_write, e_write): Modify declaration of arguments and
20171 local variables to support buffers larger than 2GB.
20172 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20173
20174 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20175 argument, local variables, and return value.
20176
20177 * lisp.h: Update prototypes of emacs_write and emacs_read.
20178
20179 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20180
20181 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
20182
20183 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20184
20185 Fix more problems found by GCC 4.6.0's static checks.
20186
20187 * xdisp.c (vmessage): Use a better test for character truncation.
20188
20189 * charset.c (load_charset_map): <, not <=, for optimization,
20190 and to avoid potential problems with integer overflow.
20191 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
20192 * casetab.c (set_identity, shuffle): Likewise.
20193 * editfns.c (Fformat): Likewise.
20194 * syntax.c (skip_chars): Likewise.
20195
20196 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20197 This also lets GCC 4.6.0 generate slightly better loop code.
20198
20199 * callint.c (Fcall_interactively): <, not <=, for optimization.
20200 (Fcall_interactively): Count the number of arguments produced,
20201 not the number of arguments given. This is simpler and lets GCC
20202 4.6.0 generate slightly better code.
20203
20204 * ftfont.c: Distingish more carefully between FcChar8 and char.
20205 The previous code passed unsigned char * to a functions like
20206 strlen and xstrcasecmp that expect char *, which does not
20207 conform to the C standard.
20208 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20209 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20210 char * when the C standard requires it.
20211
20212 * keyboard.c (read_char): Remove unused var.
20213
20214 * eval.c: Port to Windows vsnprintf (Bug#8435).
20215 Include <limits.h>.
20216 (SIZE_MAX): Define if the headers do not.
20217 (verror): Do not give up if vsnprintf returns a negative count.
20218 Instead, grow the buffer. This ports to Windows vsnprintf, which
20219 does not conform to C99. Problem reported by Eli Zaretskii.
20220 Also, simplify the allocation scheme, by avoiding the need for
20221 calling realloc, and removing the ALLOCATED variable.
20222
20223 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20224
20225 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20226 But keep the doprint source code for now, as we might revamp it
20227 and use it again (Bug#8435).
20228 * lisp.h (doprnt): Remove.
20229 * Makefile.in (base_obj): Remove doprnt.o.
20230 * deps.mk (doprnt.o): Remove.
20231
20232 error: Print 32- and 64-bit integers portably (Bug#8435).
20233 Without this change, on typical 64-bit hosts error ("...%d...", N)
20234 was used to print both 32- and 64-bit integers N, which relied on
20235 undefined behavior.
20236 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
20237 * lisp.h (error, verror): Mark as printf-like functions.
20238 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20239 Report overflow in size calculations when allocating printf buffer.
20240 Do not truncate output string at its first null byte.
20241 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20242 Truncate the output at a character boundary, since vsnprintf does not
20243 do that.
20244 * charset.c (check_iso_charset_parameter): Convert internal
20245 character to string before calling 'error', since %c now has the
20246 printf meaning.
20247 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
20248 overflow when computing char to be passed to 'error'. Do not
20249 pass Lisp_Object to 'error'; pass the integer instead.
20250 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
20251 formatted with plain %d.
20252
20253 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
20254
20255 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
20256
20257 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
20258
20259 * xterm.c (x_catch_errors): Remove duplicate declaration.
20260
20261 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
20262
20263 * xdisp.c, lisp.h (message_nolog): Remove; unused.
20264
20265 2011-04-10 Jim Meyering <meyering@redhat.com>
20266
20267 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
20268 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20269 return ssize_t not "int", and use size_t as the buffer length.
20270 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20271 * gnutls.h: Update declarations.
20272 * process.c (read_process_output): Use ssize_t, to match.
20273 (send_process): Likewise.
20274
20275 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
20276
20277 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20278
20279 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
20280
20281 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20282 Use unsigned char, to match FcChar8 type definition.
20283
20284 * xterm.c (handle_one_xevent):
20285 * xmenu.c (create_and_show_popup_menu):
20286 * xselect.c (x_decline_selection_request)
20287 (x_reply_selection_request): Avoid type-punned deref of X events.
20288
20289 2011-04-09 Eli Zaretskii <eliz@gnu.org>
20290
20291 Fix some uses of `int' instead of EMACS_INT.
20292 * search.c (string_match_1, fast_string_match)
20293 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20294 (scan_buffer, find_next_newline_no_quit)
20295 (find_before_next_newline, search_command, Freplace_match)
20296 (Fmatch_data): Make some `int' variables be EMACS_INT.
20297
20298 * xdisp.c (display_count_lines): 3rd argument and return value now
20299 EMACS_INT. All callers changed.
20300 (pint2hrstr): Last argument is now EMACS_INT.
20301
20302 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
20303 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
20304 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
20305 (decode_coding_utf_16, decode_coding_emacs_mule)
20306 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
20307 (decode_coding_ccl, decode_coding_charset)
20308 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
20309 (decode_coding_iso_2022, decode_coding_emacs_mule)
20310 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
20311 <char_offset, last_offset>: Declare EMACS_INT.
20312 (encode_coding_utf_8, encode_coding_utf_16)
20313 (encode_coding_emacs_mule, encode_invocation_designation)
20314 (encode_designation_at_bol, encode_coding_iso_2022)
20315 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
20316 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
20317 Declare EMACS_INT.
20318 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
20319 (encode_invocation_designation): Last argument P_NCHARS is now
20320 EMACS_INT.
20321 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
20322 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
20323
20324 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
20325 All users changed.
20326
20327 * ccl.c (Fccl_execute_on_string): Declare some variables
20328 EMACS_INT.
20329
20330 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
20331
20332 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
20333
20334 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
20335
20336 * process.c (Fformat_network_address): Doc fix.
20337
20338 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
20339
20340 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
20341
20342 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
20343
20344 * keyboard.c (read_char): Call Lisp function help-form-show,
20345 instead of using internal_with_output_to_temp_buffer.
20346 (Qhelp_form_show): New var.
20347 (syms_of_keyboard): Use DEFSYM macro.
20348
20349 * print.c (internal_with_output_to_temp_buffer): Function deleted.
20350
20351 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
20352
20353 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
20354
20355 * process.c (Flist_processes): Remove to Lisp.
20356 (list_processes_1): Delete.
20357
20358 2011-04-06 Eli Zaretskii <eliz@gnu.org>
20359
20360 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
20361
20362 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
20363
20364 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
20365
20366 Fix more problems found by GCC 4.6.0's static checks.
20367
20368 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
20369
20370 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
20371
20372 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
20373
20374 * xdisp.c (vmessage): Mark as a printf-like function.
20375
20376 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
20377
20378 * sound.c (sound_warning): Don't crash if arg contains a printf format.
20379
20380 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
20381 printf-like functions.
20382 (tiff_load): Add casts to remove these marks before passing them
20383 to system-supplied API.
20384
20385 * eval.c (Fsignal): Remove excess argument to 'fatal'.
20386
20387 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
20388 This avoids several warnings with gcc -Wstrict-overflow.
20389 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
20390 directly, rather than having caller test rule sign. This avoids
20391 some unnecessary tests.
20392 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
20393 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
20394 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
20395
20396 * xfont.c (xfont_text_extents): Remove var that was set but not used.
20397 (xfont_open): Avoid unnecessary tests.
20398
20399 * composite.c (composition_gstring_put_cache): Use unsigned integer.
20400
20401 * composite.h, composite.c (composition_gstring_put_cache):
20402 Use EMACS_INT, not int, for length.
20403
20404 * composite.h (COMPOSITION_DECODE_REFS): New macro,
20405 breaking out part of COMPOSITION_DECODE_RULE.
20406 (COMPOSITION_DECODE_RULE): Use it.
20407 * composite.c (get_composition_id): Remove unused local vars,
20408 by using the new macro.
20409
20410 * textprop.c (set_text_properties_1): Change while to do-while,
20411 since the condition is always true at first.
20412
20413 * intervals.c (graft_intervals_into_buffer): Mark var as used.
20414 (interval_deletion_adjustment): Return unsigned value.
20415 All uses changed.
20416
20417 * process.c (list_processes_1, create_pty, read_process_output):
20418 (exec_sentinel): Remove vars that were set but not used.
20419 (create_pty): Remove unnecessary "volatile"s.
20420 (Fnetwork_interface_info): Avoid possibility of int overflow.
20421 (read_process_output): Do adaptive read buffering even if carryover.
20422 (read_process_output): Simplify nbytes computation if buffered.
20423
20424 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
20425
20426 * syntax.c (scan_words): Remove var that was set but not used.
20427 (update_syntax_table): Use unsigned instead of int.
20428
20429 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
20430 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
20431 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
20432
20433 * print.c (print_error_message): Avoid int overflow.
20434
20435 * font.c (font_list_entities): Redo for clarity,
20436 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
20437
20438 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
20439 (font_score): Avoid potential overflow in diff calculation.
20440
20441 * fns.c (substring_both): Remove var that is set but not used.
20442 (sxhash): Redo loop for clarity and to avoid wraparound warning.
20443
20444 * eval.c (funcall_lambda): Rename local to avoid shadowing.
20445
20446 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
20447 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
20448 can always succeed if overflow has undefined behavior.
20449
20450 * search.c (boyer_moore, wordify): Remove vars set but not used.
20451 (wordify): Omit three unnecessary tests.
20452
20453 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
20454 All callers changed. This avoids the need for an unused var.
20455
20456 * casefiddle.c (casify_region): Remove var that is set but not used.
20457
20458 * dired.c (file_name_completion): Remove var that is set but not used.
20459
20460 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
20461
20462 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
20463 (Finsert_file_contents): Remove unnecessary code checking fd.
20464
20465 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
20466 Check for integer overflow on size calculations.
20467
20468 * buffer.c (Fprevious_overlay_change): Remove var that is set
20469 but not used.
20470
20471 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
20472 Remove vars that are set but not used.
20473 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
20474 (timer_check_2): Mark vars as initialized.
20475
20476 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
20477
20478 * image.c (lookup_image): Remove var that is set but not used.
20479 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
20480
20481 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
20482 that are set but not used.
20483
20484 * xfns.c (make_invisible_cursor): Don't return garbage
20485 if XCreateBitmapFromData fails (Bug#8410).
20486
20487 * xselect.c (x_get_local_selection, x_handle_property_notify):
20488 Remove vars that are set but not used.
20489
20490 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
20491 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
20492
20493 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
20494 Remove var that is set but not used.
20495 (scroll_bar_windows_size): Now size_t, not int.
20496 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
20497 Check for overflow.
20498
20499 * xfaces.c (realize_named_face): Remove vars that are set but not used.
20500 (map_tty_color) [!defined MSDOS]: Likewise.
20501
20502 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
20503
20504 * coding.c: Remove vars that are set but not used.
20505 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
20506 All callers changed.
20507 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
20508 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
20509 (decode_coding_charset): Remove vars that are set but not used.
20510
20511 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
20512 that is set but not used.
20513
20514 * print.c (print_object): Remove var that is set but not used.
20515
20516 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
20517 The gnulib version avoids calling malloc in the usual case,
20518 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
20519 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
20520 * filelock.c (current_lock_owner): Likewise.
20521 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
20522 * sysdep.c: Include allocator.h, careadlinkat.h.
20523 (emacs_no_realloc_allocator): New static constant.
20524 (emacs_readlink): New function.
20525 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
20526 ../lib/careadlinkat.h.
20527
20528 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
20529
20530 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
20531 first non-nil return value).
20532
20533 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
20534
20535 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
20536 if not defined (Bug#8403).
20537
20538 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
20539
20540 * xdisp.c (display_count_lines): Remove parameter `start',
20541 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20542 (get_char_face_and_encoding): Remove parameter `multibyte_p',
20543 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20544 (fill_stretch_glyph_string): Remove parameters `row' and `area',
20545 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
20546 and thereabouts. All callers changed.
20547 (get_per_char_metric): Remove parameter `f', unused since
20548 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
20549
20550 2011-04-02 Jim Meyering <meyering@redhat.com>
20551
20552 do not dereference NULL upon failed strdup
20553 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
20554 (ns_get_family): Likewise.
20555
20556 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
20557
20558 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
20559
20560 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
20561
20562 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
20563 later (Bug#8403).
20564
20565 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
20566
20567 Add lexical binding.
20568
20569 * window.c (Ftemp_output_buffer_show): New fun.
20570 (Fsave_window_excursion):
20571 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
20572
20573 * lread.c (lisp_file_lexically_bound_p): New function.
20574 (Fload): Bind Qlexical_binding.
20575 (readevalloop): Remove `evalfun' arg.
20576 Bind Qinternal_interpreter_environment.
20577 (Feval_buffer): Bind Qlexical_binding.
20578 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
20579 Mark as dynamic.
20580 (syms_of_lread): Declare `lexical-binding'.
20581
20582 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
20583
20584 * keyboard.c (eval_dyn): New fun.
20585 (menu_item_eval_property): Use it.
20586
20587 * image.c (parse_image_spec): Use Ffunctionp.
20588
20589 * fns.c (concat, mapcar1): Accept byte-code-functions.
20590
20591 * eval.c (Fsetq): Handle lexical vars.
20592 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
20593 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
20594 (FletX, Flet): Obey lexical binding.
20595 (Fcommandp): Handle closures.
20596 (Feval): New `lexical' arg.
20597 (eval_sub): New function extracted from Feval. Use it almost
20598 everywhere where Feval was used. Look up vars in lexical env.
20599 Handle closures.
20600 (Ffunctionp): Move from subr.el.
20601 (Ffuncall): Handle closures.
20602 (apply_lambda): Remove `eval_flags'.
20603 (funcall_lambda): Handle closures and new byte-code-functions.
20604 (Fspecial_variable_p): New function.
20605 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
20606 but without exporting it to Lisp.
20607
20608 * doc.c (Fdocumentation, store_function_docstring):
20609 * data.c (Finteractive_form): Handle closures.
20610
20611 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
20612 interactive spec.
20613
20614 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
20615 New byte-codes.
20616 (exec_byte_code): New function extracted from Fbyte_code to handle new
20617 calling convention for byte-code-functions. Add new byte-codes.
20618
20619 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
20620
20621 * alloc.c (Fmake_symbol): Init new `declared_special' field.
20622
20623 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
20624
20625 * xdisp.c (redisplay_internal): Fix prototype.
20626
20627 2011-03-31 Eli Zaretskii <eliz@gnu.org>
20628
20629 * xdisp.c (SCROLL_LIMIT): New macro.
20630 (try_scrolling): Use it when setting scroll_limit.
20631 Limit scrolling to 100 screen lines.
20632 (redisplay_window): Even when falling back on "recentering",
20633 position point in the window according to scroll-conservatively,
20634 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20635
20636 (try_scrolling): When point is above the window, allow searching
20637 as far as scroll_max, or one screenful, to compute vertical
20638 distance from PT to the scroll margin position. This prevents
20639 try_scrolling from unnecessarily failing when
20640 scroll-conservatively is set to a value slightly larger than the
20641 window height. Clean up the case of PT below the margin at bottom
20642 of window: scroll_max can no longer be INT_MAX. When aggressive
20643 scrolling is in use, don't let point enter the opposite scroll
20644 margin as result of the scroll.
20645 (syms_of_xdisp) <scroll-conservatively>: Document the
20646 threshold of 100 lines for never-recentering scrolling.
20647
20648 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
20649
20650 * dispextern.h (move_it_by_lines):
20651 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
20652 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
20653 (message_log_check_duplicate): Remove parameters `prev_bol' and
20654 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20655 (redisplay_internal): Remove parameter `preserve_echo_area',
20656 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
20657
20658 * indent.c (Fvertical_motion):
20659 * window.c (window_scroll_pixel_based, Frecenter):
20660 Don't pass `need_y_p' to `move_it_by_lines'.
20661
20662 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
20663
20664 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
20665 steal a few bits to be more compact.
20666 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
20667 Remove unneeded casts.
20668
20669 * bytecode.c (Fbyte_code): CAR and CDR can GC.
20670
20671 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
20672
20673 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
20674 binding" message (bug#7967).
20675
20676 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
20677
20678 Fix more problems found by GCC 4.6.0's static checks.
20679
20680 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
20681 Remove unused local var.
20682
20683 * editfns.c (Fmessage_box): Remove unused local var.
20684
20685 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
20686 (note_mode_line_or_margin_highlight, note_mouse_highlight):
20687 Omit unused local vars.
20688 * window.c (shrink_windows): Omit unused local var.
20689 * menu.c (digest_single_submenu): Omit unused local var.
20690 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
20691 Omit unused local var.
20692
20693 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
20694 Don't assume string length fits in int.
20695 (keyremap_step, read_key_sequence): Use size_t for sizes.
20696 (read_key_sequence): Don't check last_real_key_start redundantly.
20697
20698 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
20699 instead of alloca (Bug#8344).
20700
20701 * eval.c (Fbacktrace): Don't assume nargs fits in int.
20702 (Fbacktrace_frame): Don't assume nframes fits in int.
20703
20704 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
20705
20706 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
20707 concerns.
20708
20709 * term.c (produce_glyphless_glyph): Remove unnecessary test.
20710
20711 * cm.c (calccost): Turn while-do into do-while, for clarity.
20712
20713 * keyboard.c (syms_of_keyboard): Use the same style as later
20714 in this function when indexing through an array. This also
20715 works around GCC bug 48267.
20716
20717 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
20718
20719 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
20720
20721 * chartab.c (sub_char_table_ref_and_range): Redo for slight
20722 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
20723
20724 * keyboard.c, keyboard.h (num_input_events): Now size_t.
20725 This avoids undefined behavior on integer overflow, and is a bit
20726 more convenient anyway since it is compared to a size_t variable.
20727
20728 Variadic C functions now count arguments with size_t, not int.
20729 This avoids an unnecessary limitation on 64-bit machines, which
20730 caused (substring ...) to crash on large vectors (Bug#8344).
20731 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
20732 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
20733 All variadic functions and their callers changed accordingly.
20734 (struct gcpro.nvars): Now size_t, not int. All uses changed.
20735 * data.c (arith_driver, float_arith_driver): Likewise.
20736 * editfns.c (general_insert_function): Likewise.
20737 * eval.c (struct backtrace.nargs, interactive_p)
20738 (internal_condition_case_n, run_hook_with_args, apply_lambda)
20739 (funcall_lambda, mark_backtrace): Likewise.
20740 * fns.c (concat): Likewise.
20741 * frame.c (x_set_frame_parameters): Likewise.
20742 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
20743 0 if not found, not -1. All callers changed.
20744
20745 * alloc.c (garbage_collect): Don't assume stack size fits in int.
20746 (stack_copy_size): Now size_t, not int.
20747 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
20748
20749 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
20750
20751 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
20752 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20753 All callers changed.
20754
20755 * lisp.h (multibyte_char_to_unibyte):
20756 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
20757 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20758 * character.h (CHAR_TO_BYTE8):
20759 * cmds.c (internal_self_insert):
20760 * editfns.c (general_insert_function):
20761 * keymap.c (push_key_description):
20762 * search.c (Freplace_match):
20763 * xdisp.c (message_dolog, set_message_1): All callers changed.
20764
20765 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
20766
20767 * keyboard.c (safe_run_hook_funcall): New function.
20768 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
20769 don't set the hook to nil, but remove the offending function instead.
20770 (Qcommand_hook_internal): Remove, unused.
20771 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
20772 Vcommand_hook_internal.
20773
20774 * eval.c (enum run_hooks_condition): Remove.
20775 (funcall_nil, funcall_not): New functions.
20776 (run_hook_with_args): Call each function through a `funcall' argument.
20777 Remove `cond' argument, now redundant.
20778 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
20779 (Frun_hook_with_args_until_failure): Adjust accordingly.
20780 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
20781
20782 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
20783
20784 * dispextern.h (string_buffer_position): Remove declaration.
20785
20786 * print.c (strout): Remove parameter `multibyte', unused since
20787 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
20788
20789 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
20790 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20791 All callers changed.
20792
20793 * w32.c (_wsa_errlist): Use braces for struct initializers.
20794
20795 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20796 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20797 All callers changed.
20798 (string_buffer_position): Likewise. Also, make static (it's never
20799 used outside xdisp.c).
20800 (cursor_row_p): Remove parameter `w', unused since
20801 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20802 (decode_mode_spec): Remove parameter `precision', introduced during
20803 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20804 All callers changed.
20805
20806 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20807
20808 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20809
20810 2011-03-27 Anders Lindgren <andlind@gmail.com>
20811
20812 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20813 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20814 (ns_update_auto_hide_menu_bar): New functions.
20815 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20816 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20817 ns_constrain_all_frames.
20818 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20819 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20820
20821 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20822
20823 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20824
20825 2011-03-27 Glenn Morris <rgm@gnu.org>
20826
20827 * syssignal.h: Replace RETSIGTYPE with void.
20828 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20829 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20830 Replace SIGTYPE with void everywhere.
20831 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20832 * s/template.h (SIGTYPE): Remove commented out definition.
20833
20834 2011-03-26 Eli Zaretskii <eliz@gnu.org>
20835
20836 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20837 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20838
20839 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
20840
20841 * w32.c (read_unc_volume): Use parameter `henum', instead of
20842 global variable `wget_enum_handle'.
20843
20844 * keymap.c (describe_vector): Remove parameters `indices' and
20845 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20846 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20847
20848 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20849
20850 * keyboard.c (timer_check): Remove parameter `do_it_now',
20851 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20852 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20853 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20854
20855 * keyboard.c (read_char):
20856 * w32menu.c (w32_menu_display_help):
20857 * xmenu.c (show_help_event, menu_help_callback):
20858 Adjust calls to `show_help_echo'.
20859
20860 * gtkutil.c (xg_maybe_add_timer):
20861 * keyboard.c (readable_events):
20862 * process.c (wait_reading_process_output):
20863 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20864
20865 * insdel.c (adjust_markers_gap_motion):
20866 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20867 (gap_left, gap_right): Don't call it.
20868
20869 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
20870
20871 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20872 incurred during fontification.
20873
20874 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
20875
20876 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20877 (DEFVAR_PER_BUFFER): Don't pass it.
20878
20879 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20880 (scrolling_window): Don't pass it.
20881
20882 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
20883
20884 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20885
20886 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20887 and `suffix'.
20888 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20889 of variables specific to SELinux and computation of `encoded_absname'.
20890
20891 * image.c (XPutPixel): Remove unused variable `height'.
20892
20893 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20894
20895 * unexw32.c (get_section_info): Remove unused variable `section'.
20896
20897 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20898 (system_process_attributes): Remove unused variable `sess'.
20899 (sys_read): Remove unused variable `err'.
20900
20901 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20902 (w32_wnd_proc): Remove unused variable `isdead'.
20903 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20904 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20905 (x_create_tip_frame): Remove unused variable `tem'.
20906
20907 * w32inevt.c (w32_console_read_socket):
20908 Remove unused variable `no_events'.
20909
20910 * w32term.c (x_draw_composite_glyph_string_foreground):
20911 Remove unused variable `width'.
20912
20913 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
20914
20915 * w32term.c (x_set_glyph_string_clipping):
20916 Don't pass uninitialized region to CombineRgn.
20917
20918 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
20919
20920 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20921 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20922 (Fx_close_connection): Remove unused variable `i'.
20923
20924 * w32font.c (w32font_draw): Return number of glyphs.
20925 (w32font_open_internal): Remove unused variable `i'.
20926 (w32font_driver): Add missing initializer.
20927
20928 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20929 (fill_in_menu): Remove unused variable `items_added'.
20930
20931 * w32term.c (last_mouse_press_frame): Remove static global variable.
20932 (w32_clip_to_row): Remove unused variable `f'.
20933 (x_delete_terminal): Remove unused variable `i'.
20934
20935 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20936 (NOTHING): Remove unused static global variable.
20937 (uniscribe_check_otf): Remove unused variable `table'.
20938 (uniscribe_font_driver): Add missing initializers.
20939
20940 2011-03-23 Julien Danjou <julien@danjou.info>
20941
20942 * term.c (Fsuspend_tty, Fresume_tty):
20943 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20944 * window.c (temp_output_buffer_show):
20945 * insdel.c (signal_before_change):
20946 * frame.c (Fhandle_switch_frame):
20947 * fileio.c (Fdo_auto_save):
20948 * emacs.c (Fkill_emacs):
20949 * editfns.c (save_excursion_restore):
20950 * cmds.c (internal_self_insert):
20951 * callint.c (Fcall_interactively):
20952 * buffer.c (Fkill_all_local_variables):
20953 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20954 Use Frun_hooks.
20955 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
20956 unconditionally since it does the check itself.
20957
20958 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
20959
20960 Fix more problems found by GCC 4.5.2's static checks.
20961
20962 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20963 the first time through the loop, since we know p0 < p1 then.
20964 This also avoids a gcc -Wstrict-overflow warning.
20965
20966 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20967 leading to a memory leak, possible in functions like
20968 load_charset_map_from_file that can allocate an unbounded number
20969 of objects (Bug#8318).
20970
20971 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20972 that could (at least in theory) be that large.
20973
20974 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20975 This is less likely to overflow, and avoids undefined behavior if
20976 overflow does occur. All callers changed. Use strtoul to scan
20977 for the unsigned long integer.
20978 (pint2hrstr): Simplify and tune code slightly.
20979 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
20980
20981 * scroll.c (do_scrolling): Work around GCC bug 48228.
20982 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20983
20984 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20985 This also avoids a warning with gcc -Wstrict-overflow.
20986 (validate_x_resource_name): Simplify count usage.
20987 This also avoids a warning with gcc -Wstrict-overflow.
20988
20989 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20990 fail (Bug#8306).
20991
20992 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
20993
20994 * process.c (Fmake_network_process): Use socklen_t, not int,
20995 where POSIX says socklen_t is required in portable programs.
20996 This fixes a porting bug on hosts like 64-bit HP-UX, where
20997 socklen_t is wider than int (Bug#8277).
20998 (Fmake_network_process, server_accept_connection):
20999 (wait_reading_process_output, read_process_output):
21000 Likewise.
21001
21002 * process.c: Rename or move locals to avoid shadowing.
21003 (list_processes_1, Fmake_network_process):
21004 (read_process_output_error_handler, exec_sentinel_error_handler):
21005 Rename or move locals.
21006 (Fmake_network_process): Define label "retry_connect" only if needed.
21007 (Fnetwork_interface_info): Fix pointer signedness.
21008 (process_send_signal): Add cast to avoid pointer signedness problem.
21009 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
21010 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
21011
21012 Make tparam.h and terminfo.c consistent.
21013 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21014 Include tparam.h instead, since it declares them.
21015 * cm.h (PC): Remove extern decl; tparam.h now does this.
21016 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21017 * terminfo.c: Include tparam.h, to check interfaces.
21018 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21019 (tparam): Adjust signature to match interface in tparam.h;
21020 this removes some undefined behavior. Check that outstring and len
21021 are zero, which they always are with Emacs.
21022 * tparam.h (PC, BC, UP): New extern decls.
21023
21024 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
21025 (xftfont_open): Rename locals to avoid shadowing.
21026
21027 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
21028 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21029 (OTF_TAG_SYM): Omit macro if not needed.
21030 (ftfont_list): Remove unused local.
21031 (get_adstyle_property, ftfont_pattern_entity):
21032 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21033 Rename locals to avoid shadowing.
21034
21035 * xfont.c (xfont_list_family): Mark var as initialized.
21036
21037 * xml.c (make_dom): Now static.
21038
21039 * composite.c (composition_compute_stop_pos): Rename local to
21040 avoid shadowing.
21041 (composition_reseat_it): Remove unused locals.
21042 (find_automatic_composition, composition_adjust_point): Likewise.
21043 (composition_update_it): Mark var as initialized.
21044 (find_automatic_composition): Mark vars as initialized,
21045 with a FIXME (Bug#8290).
21046
21047 character.h: Rename locals to avoid shadowing.
21048 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21049 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21050 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21051 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21052 to avoid shadowing.
21053
21054 * textprop.c (property_change_between_p): Remove; unused.
21055
21056 * intervals.c (interval_start_pos): Now static.
21057
21058 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21059
21060 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21061 Rename locals to avoid shadowing.
21062
21063 * sound.c (wav_play, au_play, Fplay_sound_internal):
21064 Fix pointer signedness.
21065 (alsa_choose_format): Remove unused local var.
21066 (wav_play): Initialize a variable to 0, to prevent undefined
21067 behavior (Bug#8278).
21068
21069 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21070
21071 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21072
21073 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21074 clobbering (Bug#8298).
21075 * sysdep.c (sys_subshell): Likewise.
21076 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
21077
21078 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21079 This should get cleaned up, so that child_setup has the
21080 same signature on all platforms.
21081
21082 * callproc.c (call_process_cleanup): Now static.
21083 (relocate_fd): Rename locals to avoid shadowing.
21084
21085 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
21086
21087 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21088 not to be necessary, and produces flickering.
21089
21090 2011-03-20 Glenn Morris <rgm@gnu.org>
21091
21092 * config.in: Remove file.
21093
21094 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
21095
21096 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21097 are now in src/globals.h.
21098 (syms_of_minibuf): Remove spurious & from previous change.
21099
21100 2011-03-20 Leo Liu <sdl.web@gmail.com>
21101
21102 * minibuf.c (completing-read-function): New variable.
21103 (completing-read-default): Rename from completing-read.
21104 (completing-read): Call completing-read-function.
21105
21106 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21107
21108 * xfaces.c (Fx_load_color_file):
21109 Read color file from absolute filename (bug#8250).
21110
21111 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
21112
21113 * makefile.w32-in: Update dependencies.
21114
21115 2011-03-17 Eli Zaretskii <eliz@gnu.org>
21116
21117 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21118
21119 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21120
21121 Fix more problems found by GCC 4.5.2's static checks.
21122
21123 * process.c (make_serial_process_unwind, send_process_trap):
21124 (sigchld_handler): Now static.
21125
21126 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21127 That way, the code declares only the vars that it needs.
21128 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21129 * s/cygwin.h (PTY_ITERATION): Likewise.
21130 * s/darwin.h (PTY_ITERATION): Likewise.
21131 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21132
21133 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21134 * process.c (allocate_pty): Don't declare stb unless it's needed.
21135
21136 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
21137 (CONSTANTLIM): Remove; unused.
21138 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21139 Define only if needed.
21140
21141 * unexelf.c (unexec): Name an expression,
21142 to avoid gcc -Wbad-function-cast warning.
21143 Use a different way to cause a compilation error if anyone uses
21144 n rather than nn, a way that does not involve shadowing.
21145 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
21146
21147 * deps.mk (unexalpha.o): Remove; unused.
21148
21149 New file unexec.h, the (simple) interface for unexec (Bug#8267).
21150 * unexec.h: New file.
21151 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21152 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21153 Depend on unexec.h.
21154 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21155 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21156 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
21157 Change as necessary to match prototype in unexec.h.
21158
21159 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21160 shadowing.
21161 (back_comment, skip_chars): Mark vars as initialized.
21162
21163 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21164 Rename locals to avoid shadowing.
21165
21166 * lread.c (read1): Rewrite so as not to use empty "else".
21167 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
21168
21169 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21170
21171 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21172 warning when compiling print.c.
21173
21174 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21175 instead of using an uninitialized var.
21176 (font_sort_entities): Mark var as initialized.
21177
21178 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21179
21180 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21181 pointers to constants.
21182 (font_parse_fcname): Remove unused vars.
21183 (font_delete_unmatched): Now static.
21184 (font_get_spec): Remove; unused.
21185 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21186 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21187 Rename or move locals to avoid shadowing.
21188
21189 * fns.c (require_nesting_list, require_unwind): Now static.
21190 (Ffillarray): Rename locals to avoid shadowing.
21191
21192 * floatfns.c (domain_error2): Define only if needed.
21193 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
21194
21195 * alloc.c (mark_backtrace): Move decl from here ...
21196 * lisp.h: ... to here, so that it can be checked.
21197
21198 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
21199 (Fdefvar): Rewrite so as not to use empty "else".
21200 (lisp_indirect_variable): Name an expression,
21201 to avoid gcc -Wbad-function-cast warning.
21202 (Fdefvar): Rename locals to avoid shadowing.
21203
21204 * callint.c (quotify_arg, quotify_args): Now static.
21205 (Fcall_interactively): Rename locals to avoid shadowing.
21206 Use const pointer when appropriate.
21207
21208 * lisp.h (get_system_name, get_operating_system_release):
21209 Move decls here, to check interfaces.
21210 * process.c (get_operating_system_release): Move decl to lisp.h.
21211 * xrdb.c (get_system_name): Likewise.
21212 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21213 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21214 some of which prompt warnings from gcc -Wbad-function-cast.
21215 (Fformat_time_string, Fencode_time, Finsert_char):
21216 (Ftranslate_region_internal, Fformat):
21217 Rename or remove local vars to avoid shadowing.
21218 (Ftranslate_region_internal): Mark var as initialized.
21219
21220 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21221 avoid shadowing.
21222
21223 * lisp.h (eassert): Check that the argument compiles, even if
21224 ENABLE_CHECKING is not defined.
21225
21226 * data.c (Findirect_variable): Name an expression, to avoid
21227 gcc -Wbad-function-cast warning.
21228 (default_value, arithcompare, arith_driver, arith_error): Now static.
21229 (store_symval_forwarding): Rename local to avoid shadowing.
21230 (Fmake_variable_buffer_local, Fmake_local_variable):
21231 Mark variables as initialized.
21232 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
21233
21234 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
21235 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21236 Rename locals to avoid shadowing.
21237 (mark_stack): Move local variables into the #ifdef region where
21238 they're used.
21239 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21240 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21241 needed otherwise.
21242 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21243 (GC_STRING_CHARS): Remove; not used.
21244 (Fmemory_limit): Cast sbrk's returned value to char *.
21245
21246 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
21247 avoids undefined behavior in theory.
21248
21249 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
21250
21251 Use functions, not macros, for up- and down-casing (Bug#8254).
21252 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21253 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
21254 to use the following functions instead of these macros.
21255 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
21256 EMACS_INT, since callers assume the returned value fits in int.
21257 (upcase1): Likewise, for UPCASE_TABLE.
21258 (uppercasep, lowercasep, upcase): New static inline functions.
21259 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
21260 the race-condition problem in the old DOWNCASE.
21261
21262 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
21263 Rename locals to avoid shadowing.
21264 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
21265 (regex_compile, re_search_2, re_match_2_internal):
21266 Remove unused local vars.
21267 (FREE_VAR): Rewrite so as not to use empty "else",
21268 which gcc can warn about.
21269 (regex_compile, re_match_2_internal): Mark locals as initialized.
21270 (RETALLOC_IF): Define only if needed.
21271 (WORDCHAR_P): Likewise. This one is never needed, but is used
21272 only in a comment talking about a compiler bug, so put inside
21273 the #if 0 of that comment.
21274 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21275 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21276 Remove; unused.
21277
21278 * search.c (boyer_moore): Rename locals to avoid shadowing.
21279 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21280 (PREV_CHAR_BOUNDARY): Likewise.
21281
21282 * search.c (simple_search): Remove unused var.
21283
21284 * dired.c (compile_pattern): Move decl from here ...
21285 * lisp.h: ... to here, so that it can be checked.
21286 (struct re_registers): New forward decl.
21287
21288 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21289
21290 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21291 All uses changed.
21292 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21293 Rename locals to avoid shadowing.
21294 (Fvertical_motion): Mark locals as initialized.
21295
21296 * casefiddle.c (casify_object, casify_region): Now static.
21297 (casify_region): Mark local as initialized.
21298
21299 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
21300
21301 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
21302 New macros, so that the caller can use some names other than
21303 gcpro1, gcpro2, etc.
21304 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
21305 of the new macros.
21306 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
21307 argument, for consistency with GCPRO2_VAR, etc: it is now the
21308 prefix of the variable, not the variable itself. All uses
21309 changed.
21310 * dired.c (directory_files_internal, file_name_completion):
21311 Rename locals to avoid shadowing.
21312
21313 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
21314 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
21315 dired.c's scmp function, had undefined behavior.
21316 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21317 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
21318 * buffer.h: ... to here, because these macros use current_buffer,
21319 and the new implementation with inline functions needs to have
21320 current_buffer in scope now, rather than later when the macros
21321 are used.
21322 (downcase, upcase1): New static inline functions.
21323 (DOWNCASE, UPCASE1): Reimplement using these functions.
21324 This avoids undefined behavior in expressions like
21325 DOWNCASE (x) == DOWNCASE (y), which previously suffered
21326 from race conditions in accessing the global variables
21327 case_temp1 and case_temp2.
21328 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
21329 * lisp.h (case_temp1, case_temp2): Remove their decls.
21330 * character.h (ASCII_CHAR_P): Move from here ...
21331 * lisp.h: ... to here, so that the inline functions mentioned
21332 above can use them.
21333
21334 * dired.c (directory_files_internal_unwind): Now static.
21335
21336 * fileio.c (file_name_as_directory, directory_file_name):
21337 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
21338 Now static.
21339 (file_name_as_directory): Use const pointers when appropriate.
21340 (Fexpand_file_name): Likewise. In particular, newdir might
21341 point at constant storage, so make it a const pointer.
21342 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
21343 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
21344 signedness issues.
21345 (Fset_file_times, Finsert_file_contents, auto_save_error):
21346 Rename locals to avoid shadowing.
21347
21348 * minibuf.c (choose_minibuf_frame_1): Now static.
21349 (Ftry_completion, Fall_completions): Rename or remove locals
21350 to avoid shadowing.
21351
21352 * marker.c (bytepos_to_charpos): Remove; unused.
21353
21354 * lisp.h (verify_bytepos, count_markers): New decls,
21355 so that gcc does not warn that these functions aren't declared.
21356
21357 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
21358 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
21359 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
21360 (copy_text): Remove unused local var.
21361
21362 * filelock.c (within_one_second): Now static.
21363 (lock_file_1): Rename local to avoid shadowing.
21364
21365 * buffer.c (fix_overlays_before): Mark locals as initialized.
21366 (fix_start_end_in_overlays): Likewise. This function should be
21367 simplified by using pointers-to-pointers, but that's a different
21368 matter.
21369 (switch_to_buffer_1): Now static.
21370 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
21371 (report_overlay_modification): Rename locals to avoid shadowing.
21372
21373 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
21374 Fix pointer signedness issue.
21375 (sys_subshell): Mark local as volatile if checking for lint,
21376 to suppress a gcc -Wclobbered warning that does not seem to be right.
21377 (MAXPATHLEN): Define only if needed.
21378
21379 * process.c (serial_open, serial_configure): Move decls from here ...
21380 * systty.h: ... to here, so that they can be checked.
21381
21382 * fns.c (get_random, seed_random): Move extern decls from here ...
21383 * lisp.h: ... to here, so that they can be checked.
21384
21385 * sysdep.c (reset_io): Now static.
21386 (wait_for_termination_signal): Remove; unused.
21387
21388 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
21389 (copy_keymap_item, append_key, push_text_char_description):
21390 Now static.
21391 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
21392 (DENSE_TABLE_SIZE): Remove; unused.
21393 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
21394 (describe_map_tree):
21395 Rename locals to avoid shadowing.
21396
21397 * keyboard.c: Declare functions static if they are not used elsewhere.
21398 (echo_char, echo_dash, cmd_error, top_level_2):
21399 (poll_for_input, handle_async_input): Now static.
21400 (read_char, kbd_buffer_get_event, make_lispy_position):
21401 (make_lispy_event, make_lispy_movement, apply_modifiers):
21402 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
21403 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
21404 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
21405 (read_key_sequence, read_char): Mark locals as initialized.
21406 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
21407
21408 * keyboard.h (make_ctrl_char): New decl.
21409 (mark_kboards): Move decl here ...
21410 * alloc.c (mark_kboards): ... from here.
21411
21412 * lisp.h (force_auto_save_soon): New decl.
21413
21414 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
21415 (DEFINE_DUMMY_FUNCTION): New macro.
21416 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
21417 Use it.
21418 (main): Add casts to avoid warnings
21419 if GCC considers string literals to be constants.
21420
21421 * lisp.h (fatal_error_signal): Add decl, since it's exported.
21422
21423 * dbusbind.c: Pointer signedness fixes.
21424 (xd_signature, xd_append_arg, xd_initialize):
21425 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21426 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21427 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
21428 (Fdbus_register_signal): Use SSDATA when the context wants char *.
21429
21430 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
21431 if GCC considers string literals to be constants.
21432 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
21433
21434 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
21435
21436 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
21437 (print_preprocess, print_object): New macro to fix last change.
21438
21439 * print.c (print_preprocess): Don't forget font objects.
21440
21441 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
21442
21443 * emacs.c (USAGE3): Doc fixes.
21444
21445 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
21446
21447 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
21448 structure.
21449
21450 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
21451
21452 * lisp.h (VWindow_system, Qfile_name_history):
21453 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
21454 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
21455 (w32_system_caret_x, w32_system_caret_y): Declare extern.
21456
21457 * w32select.c: Don't #include "keyboard.h".
21458 (run_protected): Add extern declaration for waiting_for_input.
21459
21460 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
21461 * w32console.c (detect_input_pending, read_input_pending)
21462 (encode_terminal_code):
21463 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
21464 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
21465 (w32_system_caret_y, Qfile_name_history):
21466 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
21467 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
21468 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
21469 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
21470 * w32proc.c (Qlocal, report_file_error):
21471 * w32term.c (Vwindow_system, updating_frame):
21472 * w32uniscribe.c (initialized, uniscribe_font_driver):
21473 Remove unneeded extern declarations.
21474
21475 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
21476
21477 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
21478
21479 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
21480
21481 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
21482 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
21483 These macros can no longer be used for assignment.
21484
21485 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
21486 Assign struct members directly, instead of using BUF_BEGV etc.
21487 (record_buffer_markers, fetch_buffer_markers): New functions for
21488 recording and fetching special buffer markers.
21489 (set_buffer_internal_1, set_buffer_temp): Use them.
21490
21491 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
21492
21493 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
21494
21495 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
21496 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
21497
21498 * xdisp.c (hscroll_window_tree):
21499 (reconsider_clip_changes): Use PT instead of BUF_PT.
21500
21501 2011-03-13 Eli Zaretskii <eliz@gnu.org>
21502
21503 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
21504 $(EMACS_ROOT)/lib/intprops.h.
21505
21506 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
21507
21508 Fix more problems found by GCC 4.5.2's static checks.
21509
21510 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
21511 to unsigned char * to avoid compiler diagnostic.
21512 (xg_free_frame_widgets): Make it clear that a local variable is
21513 needed only if USE_GTK_TOOLTIP.
21514 (gdk_window_get_screen): Make it clear that this macro is needed
21515 only if USE_GTK_TOOLTIP.
21516 (int_gtk_range_get_value): New function, which avoids a diagnostic
21517 from gcc -Wbad-function-cast.
21518 (xg_set_toolkit_scroll_bar_thumb): Use it.
21519 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
21520 diagnostic from gcc -Wbad-function-cast.
21521 (get_utf8_string, xg_get_file_with_chooser):
21522 Rename locals to avoid shadowing.
21523 (create_dialog): Move locals to avoid shadowing.
21524
21525 * xgselect.c (xg_select): Remove unused var.
21526
21527 * image.c (four_corners_best): Mark locals as initialized.
21528 (gif_load): Initialize transparent_p to zero (Bug#8238).
21529 Mark another local as initialized.
21530 (my_png_error, my_error_exit): Mark with NO_RETURN.
21531
21532 * image.c (clear_image_cache): Now static.
21533 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
21534 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
21535 (x_edge_detection): Remove unnecessary cast that
21536 gcc -Wbad-function-cast diagnoses.
21537 (gif_load): Fix pointer signedness.
21538 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
21539 (jpeg_load, gif_load): Rename locals to avoid shadowing.
21540
21541 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
21542
21543 Improve quality of tests for time stamp overflow.
21544 For example, without this patch (encode-time 0 0 0 1 1
21545 1152921504606846976) returns the obviously-bogus value (-948597
21546 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
21547 reports time overflow. See
21548 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
21549 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
21550 * editfns.c: Include limits.h and intprops.h.
21551 (TIME_T_MIN, TIME_T_MAX): New macros.
21552 (time_overflow): Move earlier, to before first use.
21553 (hi_time, lo_time): New functions, for an accurate test for
21554 out-of-range times.
21555 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
21556 (Fget_internal_run_time): Don't assume time_t fits in int.
21557 (make_time): Use list2 instead of Fcons twice.
21558 (Fdecode_time): More accurate test for out-of-range times.
21559 (check_tm_member): New function.
21560 (Fencode_time): Use it, to test for out-of-range times.
21561 (lisp_time_argument): Don't rely on undefined left-shift and
21562 right-shift behavior when checking for time stamp overflow.
21563
21564 * editfns.c (time_overflow): New function, refactoring common code.
21565 (Fformat_time_string, Fdecode_time, Fencode_time):
21566 (Fcurrent_time_string): Use it.
21567
21568 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
21569 * dired.c (make_time): Move to ...
21570 * editfns.c (make_time): ... here.
21571 * systime.h: Note the move.
21572
21573 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21574
21575 * fringe.c (update_window_fringes): Remove unused variables.
21576
21577 * unexmacosx.c (copy_data_segment): Also copy __got section.
21578 (Bug#8223)
21579
21580 2011-03-12 Eli Zaretskii <eliz@gnu.org>
21581
21582 * termcap.c [MSDOS]: Include "msdos.h".
21583 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
21584 Constify `char *' arguments and their references according to
21585 prototypes in tparam.h.
21586
21587 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
21588
21589 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
21590 Adapt all references accordingly.
21591
21592 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
21593
21594 2011-03-11 Tom Tromey <tromey@redhat.com>
21595
21596 * buffer.c (syms_of_buffer): Remove obsolete comment.
21597
21598 2011-03-11 Eli Zaretskii <eliz@gnu.org>
21599
21600 * termhooks.h (encode_terminal_code): Declare prototype.
21601
21602 * msdos.c (encode_terminal_code): Don't declare prototype.
21603
21604 * term.c (encode_terminal_code): Now external again, used by
21605 w32console.c and msdos.c.
21606
21607 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
21608 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
21609
21610 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
21611
21612 Fix some minor problems found by GCC 4.5.2's static checks.
21613
21614 * fringe.c (update_window_fringes): Mark locals as initialized
21615 (Bug#8227).
21616 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
21617
21618 * alloc.c (mark_fringe_data): Move decl from here ...
21619 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
21620 to check its interface.
21621 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
21622
21623 * fontset.c (free_realized_fontset): Now static.
21624 (Fset_fontset_font): Rename local to avoid shadowing.
21625 (fontset_font): Mark local as initialized.
21626 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
21627
21628 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21629
21630 * xselect.c (x_disown_buffer_selections): Remove; not used.
21631 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
21632 (x_own_selection, Fx_disown_selection_internal): Rename locals
21633 to avoid shadowing.
21634 (x_handle_dnd_message): Remove local to avoid shadowing.
21635
21636 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21637 so that the caller can use some name other than gcpro1.
21638 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
21639 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21640 (Fx_backspace_delete_keys_p):
21641 Use them to avoid shadowing, and rename vars to avoid shadowing.
21642 (x_decode_color, x_set_name, x_window): Now static.
21643 (Fx_create_frame): Add braces to silence GCC warning.
21644 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
21645 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21646 Remove unused locals.
21647 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21648 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21649 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21650 macros.
21651
21652 * xterm.h (x_mouse_leave): New decl.
21653
21654 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
21655 Remove unused functions.
21656 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
21657 (x_calc_absolute_position): Now static.
21658 (XTread_socket): Don't define label "out" unless it's used.
21659 Don't declare local "event" unless it's used.
21660 (x_iconify_frame, x_free_frame_resources): Don't declare locals
21661 unless they are used.
21662 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
21663 (x_fatal_error_signal): Remove; not used.
21664 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
21665 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
21666 (x_error_catcher, x_connection_closed, x_error_handler):
21667 (x_error_quitter, xembed_send_message, x_iconify_frame):
21668 (my_log_handler): Rename locals to avoid shadowing.
21669 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
21670 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
21671
21672 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
21673 Rename or move locals to avoid shadowing.
21674 (tty_defined_color, merge_face_heights): Now static.
21675 (free_realized_faces_for_fontset): Remove; not used.
21676 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
21677 does not deduce is never used uninitialized.
21678 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
21679 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
21680
21681 * terminal.c (store_terminal_param): Now static.
21682
21683 * xmenu.c (menu_highlight_callback): Now static.
21684 (set_frame_menubar): Remove unused local.
21685 (xmenu_show): Rename parameter to avoid shadowing.
21686 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
21687 since they might point to immutable storage.
21688 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
21689 since it's unused otherwise.
21690
21691 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
21692 Add a FIXME, since the code still doesn't look right. (Bug#8215)
21693 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
21694 avoids a gcc -Wuninitialized diagnostic.
21695 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
21696 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
21697 does not deduce are never used uninitialized.
21698
21699 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
21700
21701 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
21702 * window.c (window_loop, size_window):
21703 (run_window_configuration_change_hook, enlarge_window): Likewise.
21704
21705 * window.c (display_buffer): Now static.
21706 (size_window): Mark variables that gcc -Wuninitialized
21707 does not deduce are never used uninitialized.
21708 * window.h (check_all_windows): New decl, to forestall
21709 gcc -Wmissing-prototypes diagnostic.
21710 * dispextern.h (bidi_dump_cached_states): Likewise.
21711
21712 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
21713 shadowing.
21714 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
21715 Include <limits.h>.
21716 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
21717 and to avoid gcc -Wuninitialized warning.
21718 (load_charset_map): Mark variables that gcc -Wuninitialized
21719 does not deduce are never used uninitialized.
21720 (load_charset): Abort instead of using uninitialized var (Bug#8229).
21721
21722 * coding.c (coding_set_source, coding_set_destination):
21723 Use "else { /* comment */ }" rather than "else /* comment */;"
21724 for clarity, and to avoid gcc -Wempty-body warning.
21725 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
21726 a block, when the outer 'i' will do.
21727 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
21728 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
21729 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
21730 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
21731 (Fdecode_sjis_char, Fdefine_coding_system_internal):
21732 Rename locals to avoid shadowing.
21733 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
21734 * coding.c (emacs_mule_char, encode_invocation_designation):
21735 Now static, since they're not used elsewhere.
21736 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
21737 (decode_coding_object, encode_coding_object, detect_coding_system):
21738 (decode_coding_emacs_mule): Mark variables that gcc
21739 -Wuninitialized does not deduce are never used uninitialized.
21740 (detect_coding_iso_2022): Initialize a local variable that might
21741 be used uninitialized. Leave a FIXME because it's not clear that
21742 this initialization is needed. (Bug#8211)
21743 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
21744 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
21745 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
21746 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
21747 Remove unused macros.
21748
21749 * category.c (hash_get_category_set): Remove unused local var.
21750 (copy_category_table): Now static, since it's not used elsewhere.
21751 * character.c (string_count_byte8): Likewise.
21752
21753 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
21754 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
21755
21756 * chartab.c (copy_sub_char_table): Now static, since it's not used
21757 elsewhere.
21758 (sub_char_table_ref_and_range, char_table_ref_and_range):
21759 Rename locals to avoid shadowing.
21760 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
21761
21762 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
21763 (BIDI_BOB): Remove unused macro.
21764
21765 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
21766 deduce are never used uninitialized.
21767 * term.c (encode_terminal_code): Likewise.
21768
21769 * term.c (encode_terminal_code): Now static. Remove unused local.
21770
21771 * tparam.h: New file.
21772 * term.c, tparam.h: Include it.
21773 * deps.mk (term.o, tparam.o): Depend on tparam.h.
21774 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
21775 Move these decls to tparam.h, and make them agree with what
21776 is actually in tparam.c. The previous trick of using incompatible
21777 decls in different modules does not conform to the C standard.
21778 All callers of tparam changed to use tparam's actual API.
21779 * tparam.c (tparam1, tparam, tgoto):
21780 Use const pointers where appropriate.
21781
21782 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
21783 * cm.h (struct cm): Likewise.
21784 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
21785 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
21786 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
21787 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
21788 (turn_on_face, init_tty): Likewise.
21789 * termchar.h (struct tty_display_info): Likewise.
21790
21791 * term.c (term_mouse_position): Rename local to avoid shadowing.
21792
21793 * alloc.c (mark_ttys): Move decl from here ...
21794 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21795
21796 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21797
21798 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21799
21800 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
21801
21802 * search.c (compile_pattern_1): Remove argument regp, unused since
21803 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21804 (compile_pattern): Don't pass it.
21805
21806 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21807
21808 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21809 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21810 for ! HAVE_GTK3.
21811 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21812
21813 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21814
21815 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21816 gdk_window_get_screen, gdk_window_get_geometry,
21817 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21818 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21819 (xg_get_pixbuf_from_pixmap): New function.
21820 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21821 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21822 Call xg_get_pixbuf_from_pixmap instead of
21823 gdk_pixbuf_get_from_drawable.
21824 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21825 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21826 (xg_check_special_colors): Use GtkStyleContext and its functions
21827 for HAVE_GTK3.
21828 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21829 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21830 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
21831 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21832 Call gtk_widget_get_preferred_size.
21833 (xg_frame_resized): gdk_window_get_geometry only takes 5
21834 parameters.
21835 (xg_win_to_widget, xg_event_is_for_menubar):
21836 Call gdk_x11_window_lookup_for_display.
21837 (xg_set_widget_bg): New function.
21838 (delete_cb): New function.
21839 (xg_create_frame_widgets): Connect delete-event to delete_cb.
21840 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
21841 (xg_set_background_color): Call xg_set_widget_bg.
21842 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21843 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21844 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21845 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21846 if ! HAVE_GTK3.
21847 (update_frame_tool_bar): Call gtk_widget_hide.
21848 (xg_initialize): Use GDK_KEY_g.
21849
21850 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21851 if ! HAVE_GTK3
21852 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21853
21854 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21855 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21856 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21857
21858 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
21859
21860 * w32xfns.c (select_palette): Check success of RealizePalette against
21861 GDI_ERROR, not zero.
21862
21863 See ChangeLog.11 for earlier changes.
21864
21865 ;; Local Variables:
21866 ;; coding: utf-8
21867 ;; End:
21868
21869 Copyright (C) 2011-2013 Free Software Foundation, Inc.
21870
21871 This file is part of GNU Emacs.
21872
21873 GNU Emacs is free software: you can redistribute it and/or modify
21874 it under the terms of the GNU General Public License as published by
21875 the Free Software Foundation, either version 3 of the License, or
21876 (at your option) any later version.
21877
21878 GNU Emacs is distributed in the hope that it will be useful,
21879 but WITHOUT ANY WARRANTY; without even the implied warranty of
21880 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21881 GNU General Public License for more details.
21882
21883 You should have received a copy of the GNU General Public License
21884 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.