Auto-commit of generated files.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
18f2ac09
EZ
12013-03-02 Eli Zaretskii <eliz@gnu.org>
2
3 * textprop.c (Fadd_text_properties, Fremove_text_properties): If
4 the interval tree changes as a side effect of calling
5 modify_region, re-do processing starting from the call to
6 validate_interval_range. (Bug#13743)
7
929aeac6 82013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
9
10 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
11 (Bug#13546).
12
531e70ec
EZ
132013-02-27 Eli Zaretskii <eliz@gnu.org>
14
15 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
16 _SH_DENYRW flag, instead of emacs_open, to deny any other process
17 access to the lock file until it is written and closed.
18 (Bug#13807)
19
6e65b9cc
PE
202013-02-27 Paul Eggert <eggert@cs.ucla.edu>
21
22 * callint.c (Qcall_interactively):
23 * macros.c (Qexecute_kbd_macro):
24 Now static.
25
3b166f09
BG
262013-02-26 Bastien Guerry <bzg@gnu.org>
27
28 * window.c (Frecenter): Tiny docstring enhancement.
29
ecc0fdd4
PE
302013-02-26 Paul Eggert <eggert@cs.ucla.edu>
31
32 Minor textprop integer cleanup.
33 * intervals.h, textprop.c (add_text_properties_from_list):
34 Return void, not int, since nobody uses the return value.
35 * textprop.c (validate_plist, add_properties, remove_properties)
36 (Fadd_text_properties):
37 Don't assume list length fits in int.
38 (interval_has_all_properties, interval_has_some_properties)
39 (interval_has_some_properties_list, add_properties, remove_properties)
40 (Fadd_text_properties, Fremove_text_properties)
41 (Fremove_list_of_text_properties, text_property_stickiness):
42 Use bool for booleans.
43 (Fadd_text_properties, Fremove_text_properties):
44 (Fremove_list_of_text_properties):
45 Reindent do-while as per GNU style.
46
0248b0d7
EZ
472013-02-25 Eli Zaretskii <eliz@gnu.org>
48
343a2aef
EZ
49 Implement CLASH_DETECTION for MS-Windows.
50
51 * filelock.c [WINDOWSNT]: Include w32.h.
52 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
53 function of that name. Up-case the macro arguments.
54 (IS_LOCK_FILE): New macro.
55 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
56 (create_lock_file): New function, with body extracted from
57 lock_file_1.
58 [WINDOWSNT]: Implement lock files by writing a regular file with
59 the lock information as its contents.
60 (read_lock_data): New function, on Posix platforms just calls
61 emacs_readlinkat.
62 [WINDOWSNT]: Read the lock info from the file.
63 (current_lock_owner): Call read_lock_data instead of calling
64 emacs_readlinkat directly.
65 (lock_file) [WINDOWSNT]: Run the file name through
66 dostounix_filename.
67
68 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
69 just check if the process by that PID exists.
70
71 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
72 also present, as doing so will fail to error out if the file
73 already exists.
74
75 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
76
0248b0d7
EZ
77 * textprop.c (Fadd_text_properties, Fremove_text_properties)
78 (Fremove_list_of_text_properties): Skip all of the intervals in
79 the region between START and END that already have resp. don't
80 have the requested properties, not just the first one. Add
81 assertions that the loop afterwards always modifies the
82 properties. (Bug#13743)
83
b5071fc7
SM
842013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
85
86 * callint.c (Fcall_interactively): Use the right lexical environment
87 for `interactive' specs (bug#13811).
88 * eval.c (Feval): Accept a lexical environment.
89
1ddc2bd6
PE
902013-02-25 Paul Eggert <eggert@cs.ucla.edu>
91
92 Simplify data_start configuration (Bug#13783).
93 This is a followon simplification to the fix for Bug#13650.
94 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
95 (START_FILES): Remove. All uses removed.
96 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
97 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
98 (buildobj.h): Use it.
99 ($(ALLOBJS)): Depend on globals.h.
100 (temacs$(EXEEXT)): Use $(ALLOBJS).
101 * autodeps.mk (ALLOBJS): Move to Makefile.in.
102 * deps.mk (vm-limit.o):
103 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
104 Do not depend on mem-limits.h.
105 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
106 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
107 [__GNUC__ && !ORDINARY_LINK]: Remove.
108 * mem-limits.h, pre-crt0.c: Remove.
109 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
110 * unexcoff.c (etext): New decl.
111 (make_hdr): Use DATA_START instead of start_of_data.
112 * vm-limit.c: Move most of mem-limits.h's contents here.
113 (data_start): New decl. It's OK if this is approximate,
114 so simplify-away some unnecessary exactness.
115 (POINTER): Remove; all uses removed.
116 (data_space_start): Now char *, to avoid casts.
117 (exceeds_lisp_ptr): New function, replacing the old
118 EXCEEDS_LISP_PTR macro. All uses changed.
119 (check_memory_limits): Simplify and remove casts.
120 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
121 (memory_warnings): Use data_start instead of start_of_data.
122
51aa2a8b
AS
1232013-02-24 Andreas Schwab <schwab@linux-m68k.org>
124
125 * xdisp.c (set_message): Only check for debug-on-message if STRING
126 is a string. (Bug#13797)
127
1938d88c
PE
1282013-02-24 Paul Eggert <eggert@cs.ucla.edu>
129
130 Fix regression introduced by July 10 filelock.c patch.
131 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
132 2012-07-10 patch to this file. Reported by Eli Zaretskii in
133 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
134 and diagnosed by Andreas Schwab in
135 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
136
fcee5028
PE
1372013-02-22 Paul Eggert <eggert@cs.ucla.edu>
138
139 Assume C89 or better.
140 * ralloc.c (SIZE, POINTER, NIL):
141 * vm-limit.c (POINTER):
142 Remove, replacing all uses with C89 equivalents. These old
143 symbols were present only for porting to pre-C89 platforms.
144
d78cf5ed
CB
1452013-02-22 Claudio Bley <claudio.bley@gmail.com>
146
147 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
148 This avoids warning messages reported as part of Bug#13546.
149
6bcd97a4
KB
1502013-02-21 Ken Brown <kbrown@cornell.edu>
151
152 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
153
b6c2bfff
SM
1542013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
155
e11dacb5
SM
156 * sheap.c (report_sheap_usage): Prefer message1_nolog.
157
b6c2bfff
SM
158 * keyboard.c (Qcommand_execute): New var.
159 (command_loop_1, read_char): Use it.
160 (Fcommand_execute): Remove, replace by an Elisp implementation.
161 (syms_of_keyboard): Adjust accordingly.
162
d69f1120 1632013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 164
d69f1120
DC
165 * sheap.c (report_sheap_usage): Use message, not message1, so
166 that we don't try to create a buffer while we're in the middle
167 of dumping Emacs. Explain why.
b6c2bfff 168
2a14a4f1 1692013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2a14a4f1
DA
170 * search.c (find_newline): Return byte position in bytepos.
171 Adjust comment.
b6c2bfff
SM
172 (find_next_newline_no_quit, find_before_next_newline):
173 Add bytepos argument.
2a14a4f1
DA
174 * lisp.h (find_newline, find_next_newline_no_quit)
175 (find_before_next_newline): Adjust prototypes.
176 * bidi.c (bidi_find_paragraph_start):
177 * editfns.c (Fconstrain_to_field, Fline_end_position):
178 * indent.c (compute_motion, vmotion):
179 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
180 (get_visually_first_element, move_it_vertically_backward):
181 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
182
872faefb 1832013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
184
185 * w32proc.c (new_child): Avoid leaking handles if the subprocess
186 resources were not orderly released.
187
fd80c659
EZ
1882013-02-17 Eli Zaretskii <eliz@gnu.org>
189
190 * xdisp.c (x_draw_vertical_border): For a window that is neither
191 the leftmost nor the rightmost, redraw both the left and the right
192 vertical borders. (Bug#13723)
193
2f73da9c
SM
1942013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
195
196 * xml.c (init_libxml2_functions):
197 * sound.c (sound_warning):
198 * sheap.c (report_sheap_usage):
199 * process.c (wait_reading_process_output):
200 * msdos.c (XMenuActivate):
201 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
202 * keyboard.c (top_level_1):
203 * editfns.c (Fmessage, Fmessage_box):
204 * callint.c (Fcall_interactively):
205 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
206
fd9547e8
JD
2072013-02-17 Jan Djärv <jan.h.d@swipnet.se>
208
209 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
210 * frame.c (syms_of_frame): ... to here.
211
f277993b
EZ
2122013-02-16 Eli Zaretskii <eliz@gnu.org>
213
c7939585
EZ
214 * w32.c (sys_chown): Remove unused function.
215
cd91fb4b
EZ
216 * w32term.c <input_signal_count>: Declare 'volatile'
217 unconditionally. (Bug#9066)
218
f277993b
EZ
219 * w32.c (set_errno): Reset h_errno and don't set it to any other
220 value. Set errno instead.
221 (check_errno): Reset h_errno.
222 (sys_socket, socket_to_fd, sys_bind, sys_connect)
223 (sys_gethostname, sys_getservbyname, sys_getpeername)
224 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
225 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
226 h_errno.
227 (sys_gethostbyname): Set h_errno only errors detected.
228
e454145b
PE
2292013-02-15 Paul Eggert <eggert@cs.ucla.edu>
230
231 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
232
bcf7fe2a
EZ
2332013-02-15 Eli Zaretskii <eliz@gnu.org>
234
ef9c57e2
EZ
235 * keyboard.c (read_char): Fix calculation of auto-save time out
236 when auto-save-timeout is less than 4. (Bug#13720)
237
ef862e20 238 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 239 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 240
bcf7fe2a
EZ
241 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
242 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
243 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
244 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
245 make sure errno is set to an appropriate value. (Bug#13546)
246 (socket_to_fd): Add assertion against indexing fd_info[] with a
247 value that is out of bounds.
248 (sys_accept): If fd is negative, do not set up the child_process
249 structure for reading.
250
0063fdb1
DA
2512013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
252
253 * composite.c (fill_gstring_header): Remove useless prototype.
254 Break long line.
255 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
256 * print.c (PRINTDECLARE, print_object):
257 * search.c (compile_pattern, fast_looking_at, search_buffer):
258 (simple_search, boyer_moore, Freplace_match):
259 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
260 (get_overlay_arrow_glyph_row, display_mode_element):
261 (decode_mode_spec_coding, message3):
262 * xfaces.c (face_at_string_position): Use bool for booleans.
263 Adjust comments.
264
648e5523 2652013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 266
35b3a27e
PE
267 Fix AIX port (Bug#13650).
268 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
269 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
270 was #undeffed earlier, so it cannot be used as a macro here.
271 Use the constant and not the macro.
35b3a27e 272
648e5523 2732013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 274
0e4e7b74
EZ
275 * w32proc.c (new_child): If no vacant slots are found in
276 child_procs[], make another pass looking for slots whose process
277 has exited or died. (Bug#13546)
278
6e432f0c
EZ
279 * w32.c (sys_pipe): When failing due to file descriptors above
280 MAXDESC, set errno to EMFILE.
281 (_sys_read_ahead): Update cp->status when failing to read serial
282 communications input, so that the status doesn't stay at
283 STATUS_READ_IN_PROGRESS. (Bug#13546)
284
51b3a99c
JD
2852013-02-14 Jan Djärv <jan.h.d@swipnet.se>
286
287 * gtkutil.c (tb_size_cb): New function.
288 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
289
e31560a7
SM
2902013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
291
292 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
293 an event.
294
fe336261
SM
2952013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
296
297 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
298
5a655b9f
DA
2992013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
300
301 * font.c (font_range): Add pos_byte argument. Adjust comment
302 and break long line.
303 * font.h (font_range): Adjust prototype.
304 * composite.c (autocmp_chars): Pass byte position to font_range.
305 Break long line. Remove useless prototype and format comment.
306
1a359750
GM
3072013-02-13 Glenn Morris <rgm@gnu.org>
308
309 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
310
01fcc3a5 3112013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 312
f53f992a
PE
313 Improve AIX port some more (Bug#13650).
314 With this, it should be as good as it was in 23.3, though it's
315 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
316 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
317 * unexaix.c (start_of_text): Remove.
318 (_data, _text): Declare as char[], not int, as AIX manual suggests.
319 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
320 (orig_load_scnptr, orig_data_scnptr):
321 Now off_t, not long, since they are file offsets.
322 (make_hdr): Use _data, not start_of_data ().
323 This is the key part of the fix.
324 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
325 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
326
4458c255
PE
327 * pre-crt0.c (data_start): Initialize to 1.
328 This ports to compilers that optimize the external declaration
329 'int x = 0;' as if it were 'int x;' to shrink the executable.
330
227be86d
PE
331 Improve AIX port (Bug#13650).
332 This doesn't fix the bug, but it makes progress: Emacs builds now.
333 * unexaix.c: Include inttypes.h, stdarg.h.
334 (report_error, report_error_1): Mark as _Noreturn.
335 (report_error): Don't report the wrong errno.
336 (report_error_1): Now varargs. All callers changed.
337 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
338 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
339 (write_ptr): Use %p to print address rather than %lx and a cast
340 to unsigned long. Grow buffer a bit, to be safer.
341
01fcc3a5 3422013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
343
344 * bidi.c (bidi_resolve_neutral): After finding the next
345 non-neutral character, accept NEUTRAL_ON type as well, because
346 directional control characters, such as LRE and RLE, have their
347 type converted to that by bidi_resolve_weak. This avoids aborts
348 when LRE/RLE follows a run of neutrals.
349 (bidi_move_to_visually_next): Assert that return value of
350 bidi_peek_at_next_level is non-negative. Negative values will
351 cause an infloop.
352
83be8524
PE
3532013-02-13 Paul Eggert <eggert@cs.ucla.edu>
354
355 Minor getenv-related fixes.
356 * callproc.c (Fcall_process_region) [!DOS_NT]:
357 Avoid unnecessary duplicate call to getenv.
358 * callproc.c (init_callproc):
359 * dispnew.c (init_display):
360 * sysdep.c (sys_subshell):
361 Omit unnecessary cast of getenv or egetenv.
362
45b2b768
JB
3632013-02-13 Juanma Barranquero <lekktu@gmail.com>
364
365 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
366 Update dependencies.
367
33b49d71
EZ
3682013-02-12 Eli Zaretskii <eliz@gnu.org>
369
370 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
371 marker's position.
372 (display_line): Set w->region_showing to the value of
373 it->region_beg_charpos, not to -1. This fixes redisplay
374 optimization when cursor is moved up after M->. (Bug#13623)
375 (Bug#13626)
c4131562
EZ
376 (try_scrolling): Scroll text up more if point is too close to ZV
377 and inside the scroll margin. This makes sure point is moved
378 outside the scroll margin in these cases.
33b49d71
EZ
379
380 * window.h (struct window): region_showing can no longer be
381 negative.
382
b09a4810
PE
3832013-02-11 Paul Eggert <eggert@cs.ucla.edu>
384
a84b7c53
PE
385 Tune by using memchr and memrchr.
386 * doc.c (Fsnarf_documentation):
387 * fileio.c (Fsubstitute_in_file_name):
388 * search.c (find_newline, scan_newline):
389 * xdisp.c (pos_visible_p, display_count_lines):
390 Use memchr and memrchr rather than scanning byte-by-byte.
391 * search.c (find_newline): Rename from scan_buffer.
392 Omit first arg TARGET, as it's always '\n'. All callers changed.
393
b09a4810
PE
394 Clean up read_key_sequence a tiny bit more.
395 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
396 (read_key_sequence): Remove unused locals.
397
99d0d6dc
SM
3982013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
399
400 Clean up read_key_sequence a bit; reread active keymaps after first event.
401 * keyboard.c (read_char, read_char_x_menu_prompt)
402 (read_char_minibuf_menu_prompt):
403 Replace nmaps+maps with a single `map' arg.
404 (follow_key): Operate on a single map.
405 (active_maps): New function.
406 (test_undefined): Also return true for nil bindings.
407 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
408 a single (composed) keymap. Remember `first_event' to choose the right
409 set of active keymaps. Recompute the set of keymaps after receiving
410 the first event. Remove GOBBLE_FIRST_EVENT.
411 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
412 * keyboard.h (read_char): Update declaration.
413 * lread.c (read_filtered_event): Adjust call to read_char.
414
f5e1b680
EZ
4152013-02-11 Eli Zaretskii <eliz@gnu.org>
416
99d0d6dc
SM
417 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
418 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
419 in the window. (Bug#13675)
420
f74de345
DA
4212013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
422
423 * marker.c (set_marker_internal): If desired position is passed
424 as a marker, avoid call to buf_charpos_to_bytepos.
425 * window.c (Fset_window_point): Omit redundant type checking.
426 (Fset_window_start): Likewise. Format comment.
427 (window_scroll_pixel_based): Use set_marker_restricted_both
428 with character and byte positions obtained from an iterator.
429 (Fset_window_configuration): Use set_marker_restricted_both.
430 * xdisp.c (message_dolog): Likewise.
431
a4ba3963
EZ
4322013-02-10 Eli Zaretskii <eliz@gnu.org>
433
99d0d6dc
SM
434 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
435 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
436 too far. This speeds up some redisplay operations. (Bug#13675)
437
68643cde
DA
4382013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
439
440 * syntax.c (scan_sexps_forward): Fix byte position calculation
441 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
442
7ba11bee
PE
4432013-02-10 Paul Eggert <eggert@cs.ucla.edu>
444
445 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
446 that was not needed.
447
eff1c190
PE
4482013-02-09 Paul Eggert <eggert@cs.ucla.edu>
449
450 Minor hashing refactoring.
451 * fns.c (SXHASH_REDUCE): Move to lisp.h.
452 (sxhash_float): Return EMACS_UINT, for consistency with the other
453 hash functions.
454 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
455 non-static inline function and therefore can't use static vars.
456 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
457 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
458 with the other hash functions.
459
6b48c831
EZ
4602013-02-09 Eli Zaretskii <eliz@gnu.org>
461
4dde2087
EZ
462 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
463 XXXXXX part of the temporary file pattern is not downcased even
464 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 465
8549f9e8
EZ
466 * xdisp.c (decode_mode_spec): Remove handling of %t.
467
6b48c831
EZ
468 * msdos.c (careadlinkatcwd): Remove.
469
75a65c7e
SM
4702013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
471
472 * lread.c (skip_dyn_bytes): New function (bug#12598).
473 (read1): Use it. Use getc instead of READCHAR to read bytes.
474 (load_each_byte): Remove. Update users.
475
8ca30920
DA
4762013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
477
478 * search.c (scan_buffer): Calculate end byte position just once.
479 (scan_newline): Do not recalculate start_byte.
480 (search_command): Use eassert.
481 * syntax.c (struct lisp_parse_state): New member location_byte.
482 (scan_sexps_forward): Record from_byte and avoid redundant
483 character to byte position calculation ...
484 (Fparse_partial_sexp): ... here. Break too long line.
485
25721f5b
DA
4862013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
487
488 * lisp.h (make_uninit_vector): New function.
489 * alloc.c (Fvector, Fmake_byte_code):
490 * ccl.c (Fregister_ccl_program):
491 * charset.c (Fdefine_charset_internal, define_charset_internal):
492 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
493 * composite.c (syms_of_composite):
494 * font.c (Fquery_font, Ffont_info, syms_of_font):
495 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
496 * ftfont.c (ftfont_shape_by_flt):
497 * indent.c (recompute_width_table):
498 * nsselect.m (clean_local_selection_data):
499 * syntax.c (init_syntax_once):
500 * w32unsubscribe.c (uniscribe_shape):
501 * window.c (Fcurrent_window_configuration):
502 * xfaces.c (Fx_family_fonts):
503 * xselect.c (selection_data_to_lisp_data): Use it.
504
9a9d91d9
DA
5052013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
506
507 * coding.c (Fdefine_coding_system_internal): Use AREF where
508 argument is known to be a vector.
509 * fns.c (Flocale_info): Likewise for ASET.
510 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
511 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
512
6871e574
JD
5132013-02-05 Jan Djärv <jan.h.d@swipnet.se>
514
515 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
516 height.
517
518 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
519 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
520 updateCollectionBehaviour.
521
522 * nsterm.m (NEW_STYLE_FS): Remove.
523 (ns_last_use_native_fullscreen): New variable.
524 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
525 (x_set_window_size): Do not take title bar and tool bar into account
526 if isFullscreen returns YES.
527 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
528 (check_native_fs): New function.
529 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
530 (ns_term_init): Remove NEW_STYLE_FS.
531 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
532 and tool bar if isFullscreen returns NO.
533 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
534 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
535 with HAVE_NATIVE_FS.
536 (window:willUseFullScreenPresentationOptions:): New method.
537 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
538 Hide toolbar if not enabled (Bug#13444).
539 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
540 Restore tool bar if enabled, hide it otherwise (Bug#13444).
541 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
542 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
543 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
544 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
545 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
546 (syms_of_nsterm): Add ns-use-native-fullscreen.
547
3f011c7f
PE
5482013-02-04 Paul Eggert <eggert@cs.ucla.edu>
549
550 * fileio.c (Qchoose_write_coding_system): Now static.
551
86f7c0fe
EZ
5522013-02-04 Eli Zaretskii <eliz@gnu.org>
553
554 * xdisp.c (window_buffer_changed): region_showing can be negative,
555 which still means region is being displayed.
556 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
557 whole window when showing region and the mark has changed.
558 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
559 (display_line): If it->region_beg_charpos is non-zero, set the
560 window's region_showing member to -1. (Bug#13623) (Bug#13626)
561
562 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
563 not bitfield of 1 bit.
564
5257b701
DC
5652013-02-03 Daniel Colascione <dancol@dancol.org>
566
567 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
568 daemon mode works on cygw32 when Emacs is installed and not just
569 during development.
570
8ea41ea9
PE
5712013-02-02 Paul Eggert <eggert@cs.ucla.edu>
572
573 Avoid file time stamp bug on MS-Windows (Bug#13149).
574 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
575 as FAT32 doesn't update time stamps when truncating them.
576 Also, check that a file time stamp is not a multiple of 100 ns;
577 this should catch all instances of the problem on MS-Windows,
578 as its native file system resolution is 100 ns or worse, and
579 checking for a non-multiple of 100 ns should impose only a small
580 overhead on systems with ns resolution.
581
94fbc901 5822013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 583
e7ac588e
EZ
584 Avoid encoding file names on MS-Windows when they need to be run
585 through dostounix_filename.
586 * w32.c (normalize_filename): Accept an additional argument
587 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
588 downcase it even if w32-downcase-file-names is non-nil.
589 (dostounix_filename): Accept an additional argument MULTIBYTE and
590 pass it to normalize_filename.
591 (emacs_root_dir): Adjust.
592
593 * msdos.h (dostounix_filename): Adjust prototype.
594
595 * w32.h (dostounix_filename): Adjust prototype.
596
597 * msdos.c (dostounix_filename): Accept an additional argument and
598 ignore it.
599 (init_environment): Adjust callers of dostounix_filename.
600
601 * fileio.c (Ffile_name_directory, file_name_as_directory)
602 (directory_file_name, Fexpand_file_name)
603 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
604 dostounix_filename.
605 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
606 non-nil.
607 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
608 variables, as egetenv is case-insensitive for DOS_NT.
609
610 * dired.c (file_name_completion): Don't call Fdirectory_file_name
611 with an encoded file name.
612
99d0d6dc
SM
613 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
614 Adjust calls to dostounix_filename.
e7ac588e
EZ
615
616 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
617
618 * unexw32.c (unexec): Adjust call to dostounix_filename.
619
620 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
621
622 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
623 dostounix_filename.
624
625 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
626 dostounix_filename.
627
e7c3fb06
EZ
628 * callproc.c (Fcall_process): Make sure program name in PATH and
629 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
630 is passed to exec/spawnve, which fails unless the file-name
631 encoding is UTF-8.
632
18a80473
EZ
633 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
634 even if w32-quote-process-args is nil.
635
35e85499
PE
6362013-02-01 Paul Eggert <eggert@cs.ucla.edu>
637
638 Fix timestamp bug when write-region appends nothing (Bug#13149).
639 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
640 the file's time stamp doesn't change if Emacs happens to write nothing
641 to the file, and on a buggy file system this could cause Emacs to
642 incorrectly infer that the file system doesn't have the bug.
643 Avoid this problem by inhibiting the inference in this case.
644
422ff52b
DA
6452013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
646
647 * window.h (struct window): Convert base_line_number, base_line_pos
648 and column_number_displayed members from Lisp_Object to ptrdiff_t.
649 Convert region_showing member from Lisp_Object to bitfield.
650 Remove sequence_number member. Adjust comments.
651 * window.c (sequence_number): Remove.
652 (make_window): Initialize column_number_displayed.
653 * print.c (print_object): Follow the printed representation of
654 frames and print window pointer to distinguish between windows.
655 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
656 * xdisp.c (wset_base_line_number, wset_base_line_pos)
657 (wset_column_number_displayed, wset_region_showing): Remove.
658 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
659 (try_scrolling, try_cursor_movement, redisplay_window)
660 (try_window_reusing_current_matrix, try_window_id, display_line)
661 (display_mode_lines, decode_mode_spec): Adjust users.
662 * .gdbinit (pwinx): Do not print sequence_number.
663
8654f9d7
PE
6642013-02-01 Paul Eggert <eggert@cs.ucla.edu>
665
666 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
667 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
668 * dired.c: Include <fcntl.h>.
669 (open_directory): New function, which uses open and fdopendir
670 rather than opendir. DOS_NT platforms still use opendir, though.
671 (directory_files_internal, file_name_completion): Use it.
672 (file_attributes): New function, with most of the old Ffile_attributes.
673 (directory_files_internal, Ffile_attributes): Use it.
674 (file_attributes, file_name_completion_stat): First arg is now fd,
675 not dir name. All uses changed. Use fstatat rather than lstat +
676 stat.
677 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
678 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
679 (emacs_readlinkat): New function, with much of the old
680 Ffile_symlink_p, but with an fd argument for speed.
681 It uses readlinkat rather than careadlinkatcwd, so that it
682 need not assume the working directory.
683 (Ffile_symlink_p): Use it.
684 * filelock.c (current_lock_owner): Use emacs_readlinkat
685 rather than emacs_readlink.
686 * lisp.h (emacs_readlinkat): New decl.
687 (READLINK_BUFSIZE, emacs_readlink): Remove.
688 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
689 (emacs_norealloc_allocator, emacs_readlink): Remove.
690 This stuff is moved to fileio.c.
691 * w32.c (fstatat, readlinkat): New functions.
692 (careadlinkat): Don't check that fd == AT_FDCWD.
693 (careadlinkatcwd): Remove; no longer needed.
694
9dbda100
GM
6952013-01-31 Glenn Morris <rgm@gnu.org>
696
697 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
698 (Fwrite_region): Update for new choose_write_coding_system args.
699 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
700 (syms_of_fileio): Add choose-write-coding-system.
701
3f82a88a 7022013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
703
704 * w32.c (sys_open): Zero out the flags for the new file descriptor.
705 (sys_close): Zero out the flags for the file descriptor before
706 closing it. (Bug#13546)
707
806fed21 708 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
709 (logon_network_drive, stat_worker, symlink, chase_symlinks):
710 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
711 DBCS. (Bug#13553)
712
6ee4509a
EZ
713 * w32.c (w32_get_long_filename, init_environment, readlink):
714 Support file names encoded in DBCS codepages.
26854e9c
EZ
715 (readlink): Use the current file-name-coding-system, not the ANSI
716 codepage, to decode and handle targets of symlinks.
6ee4509a 717
cf01a359
EZ
7182013-01-28 Eli Zaretskii <eliz@gnu.org>
719
720 * w32.c (opendir): Now accepts a 'const char *'.
721
6fd326b7
DA
7222013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
723
724 Remove obsolete redisplay code. See the discussion at
725 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
726 * dispnew.c (preemption_period, preemption_next_check): Remove.
727 (Vredisplay_preemption_period): Likewise.
728 (update_frame, update_single_window, update_window, update_frame_1):
729 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
730 used, following the 2012-06-22 change.
731
d8cd7742
EZ
7322013-01-25 Eli Zaretskii <eliz@gnu.org>
733
734 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
735
266fee4f
DA
7362013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
737
738 * font.c (num_fonts): Remove the leftover from old
739 debugging code. Adjust comment style here and there.
59e624b3
DA
740 * insdel.c (insert_1): Remove.
741 * lisp.h (insert_1): Remove prototype.
742 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 743
830e46e6 7442013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
745
746 * w32.c (max_filename_mbslen): New function.
747 (normalize_filename, readdir): Use it to detect locales where ANSI
748 encoding of file names uses a double-byte character set (DBCS).
749 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
750 CharNextExA, instead of incrementing a 'char *' pointer.
751 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 752
81abbb95
EZ
753 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
754 request of memory reservation to 1.7GB. (Bug#13065)
755
830e46e6 7562013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
757
758 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
759 at check_extra_latin label. (Bug#13505)
760
fd3ceb09
DA
7612013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
762
763 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
764 Avoid redundant calls to strlen.
765
edfa7fa0
DA
7662013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
767
768 Drop async_visible and async_iconified fields of struct frame.
769 This is possible because async input is gone; for details, see
770 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
771 * frame.h (struct frame): Remove async_visible and async_iconified
772 members, convert garbaged to unsigned bitfield. Adjust comments.
773 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
774 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
775 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
776 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
777 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
778 * w32term.c: Ditto.
779 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
780 properly. Likewise for obscured.
781 * xterm.c: Ditto.
266fee4f 782 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
783 properly.
784 * nsterm.m: Ditto.
785 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
786
5ad86e34
DA
7872013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
788
789 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
790 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
791
b09cca6a
SM
7922013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
793
794 * xdisp.c (message2, message2_nolog): Remove functions.
795 (message3, message3_nolog): Extract nbytes and multibyteness directly
796 from the string. Change all callers.
797 (message3_nolog): Don't set message_enable_multibyte since set_message
798 will reset it anyway.
799 (message1, message1_nolog): Use message3.
800 (vmessage): Use a stack allocated buffer rather than f->message_buf.
801 (with_echo_area_buffer): Remove last two arguments. Update all callers.
802 (set_message): Drop all but the second arg, which has to be a string.
803 (set_message_1): Simplify now that we know that a1 is NULL and the
804 second arg is a string.
805 * frame.h (struct frame): Remove `message_buf' field.
806 Use glyphs_initialized_p instead.
807 (FRAME_MESSAGE_BUF): Remove macro.
808 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
809 * lisp.h (message2, message2_nolog): Remove declarations.
810 (message3, message3_nolog): Update declarations.
811 * keyboard.c (read_char_minibuf_menu_text)
812 (read_char_minibuf_menu_width): Remove vars.
813 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
814 to correctly handle multibyte strings.
815 * frame.c (delete_frame): Don't free message_buf any more.
816 * editfns.c (message_text, message_length): Remove vars.
817 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
818 * fileio.c (auto_save_error): Use message3 instead of message2.
819 * dispnew.c (adjust_frame_message_buffer): Remove function.
820
54ab1c5a
EZ
8212013-01-23 Eli Zaretskii <eliz@gnu.org>
822
823 * w32term.c (w32fullscreen_hook): Account correctly for the screen
824 real estate used for the tool bar and the menu bar.
825
6c27465b
DA
8262013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
827
828 * insdel.c (prepare_to_modify_buffer): Force redisplay if
829 hidden buffer is prepared to modification (Bug#13164).
830
9d93ce29
DA
8312013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
832
833 * window.h (struct window): Change window_end_valid member from
834 Lisp_Object to a bitfield. Adjust comments.
835 (wset_window_end_valid): Remove.
836 * window.c (adjust_window_count): Clear window_end_valid.
837 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
838 (Fwindow_line_height, set_window_buffer, Frecenter)
839 (Fsplit_window_internal, Fdelete_other_windows_internal)
840 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
841 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
842 * xdisp.c (check_window_end, reconsider_clip_changes)
843 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
844 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
845 (find_first_unchanged_at_end_row, try_window_id): Likewise.
846
1dcb8ea2
DA
8472013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
848
849 * xdisp.c (mark_window_display_accurate): Simplify the loop
850 assuming that the only one of vchild, hchild or buffer window
851 slots is non-nil. Call mark_window_display_accurate_1 for
852 the leaf windows only.
853 (mark_window_display_accurate_1): Always assume leaf window.
854 Adjust comment.
855
b41b8a7e
PE
8562013-01-22 Paul Eggert <eggert@cs.ucla.edu>
857
593a5f2e
PE
858 * emacs.c (Qkill_emacs_hook): Now static.
859
b41b8a7e
PE
860 * fileio.c (Finsert_file_contents): Simplify.
861 Remove unnecessary assignments and tests.
862
84e5ed96
EZ
8632013-01-21 Eli Zaretskii <eliz@gnu.org>
864
865 * w32.c (acl_set_file): Don't test for errors unless
866 set_file_security returns FALSE. Avoids spurious errors when
867 saving files.
868
2ef88fd4
DA
8692013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
870
871 * fileio.c (Finsert_file_contents): Revert code introduced at
872 2013-01-18 in favor of the simpler and generally better fix.
873 Save stack space by removing 'buffer' and reusing 'read_buf'
874 where appropriate.
875
d7a0a7c9
PE
8762013-01-19 Paul Eggert <eggert@cs.ucla.edu>
877
878 * lisp.h (eabs): Define unconditionally (Bug#13419).
879 The old "#if !defined (eabs)" was an unnecessary revenant of back
880 when this macro was called "abs". Document 'eabs' better.
881
795e7a5b 8822013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
883
884 * fns.c (Frandom): Doc fix.
885
59ac2d13
EZ
8862013-01-19 Eli Zaretskii <eliz@gnu.org>
887
888 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
889 segfault when there are lots of overlays.
890
891 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
892 when there are lots of overlays.
893 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
894 for the details and a way to reproduce.
895
b3fbb395
PE
8962013-01-19 Paul Eggert <eggert@cs.ucla.edu>
897
3a955a1f
PE
898 * fileio.c: Use O_APPEND to append.
899 This corresponds better to the natural interpretation of "append",
900 and avoids the need to open the output file twice, or to invoke
901 lseek when APPEND is neither nil nor a number.
902 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
903 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
904 file possibly twice, and lseeking to its end; this avoids the
905 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
906 at the same time: the combination is never needed and apparently
907 it doesn't work with DOS_NT.
908
21cd50b8
PE
909 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
910 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
911
b3fbb395
PE
912 Allow floating-point file offsets.
913 Problem reported by Vitalie Spinu in
914 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
915 * fileio.c (emacs_lseek): Remove.
916 (file_offset): New function.
917 (Finsert_file_contents, Fwrite_region): Use it.
918
73c14218
CY
9192013-01-19 Chong Yidong <cyd@gnu.org>
920
921 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
922 aborting on Fsignal (Bug#13289).
923
6a9465f3
EZ
9242013-01-19 Eli Zaretskii <eliz@gnu.org>
925
926 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
927 set_file_security as failure due to insufficient privileges.
928 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 929 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 930
fa705c99
PE
9312013-01-19 Paul Eggert <eggert@cs.ucla.edu>
932
9fe43ff6
PE
933 Work around bug in CIFS and vboxsf file systems (Bug#13149).
934 The bug was observed on Ubuntu operating inside a virtual machine,
935 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
936 The workaround introduces a race condition on non-buggy hosts,
937 but it's an unlikely race and anyway there's a nearly identical
938 nearby race that can't be fixed.
939 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
940 New static vars.
941 (Fwrite_region): Test for file system time stamp bug.
942 (init_fileio): New function.
943 * lisp.h (init_fileio): Declare it.
944 * emacs.c (main): Call it.
945
fa705c99
PE
946 * fileio.c (Finsert_file_contents): Simplify new diagnostic
947 and make it more consistent with other stat-failure diagnostics.
948
e07469fa
DA
9492013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
950
99d0d6dc
SM
951 Fix crash when inserting data from non-regular files.
952 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
953 for the error description produced by valgrind.
954 * fileio.c (read_non_regular): Rename to read_contents.
955 Free Lisp_Save_Value object used to pass parameters.
956 (read_non_regular_quit): Rename to read_contents_quit.
957 (Finsert_file_contents): Redesign internal file reading loop to adjust
958 gap and end positions after each read and so help make_gap to work
959 properly. Do not signal an I/O error too early and so do not leave
960 not yet decoded characters in a buffer, which was the reason of
961 redisplay crash. Use list2 to build return value. Adjust comments.
962
67722112
PE
9632013-01-17 Paul Eggert <eggert@cs.ucla.edu>
964
965 Close a race when statting and reading files (Bug#13149).
966 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
967 This avoids a race if the file is renamed between stat and open.
968 This race is not the problem originally noted in Bug#13149;
969 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
970
468afbac
DA
9712013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
972
973 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
974 objects, related functions and macros.
975 (make_save_value): Adjust prototype.
976 (make_save_pointer): New prototype.
977 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
978 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
979 * alloc.c (format_save_value): Rename to make_save_value.
980 (make_save_pointer): New function.
981 (record_xmalloc): Use make_save_pointer.
982 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
983 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
984 Change users of make_save_value to make_save_pointer.
985 Likewise for format_save_value and make_save_value.
986
0e70695a
DA
9872013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
988
989 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
990 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
991 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
992 debugging stubs.
993
963ea40f
PE
9942013-01-15 Paul Eggert <eggert@cs.ucla.edu>
995
996 * alloc.c (free_save_value): Now static.
997
3346c1d0
DA
9982013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
999
1000 * keymap.c (map_keymap_internal): Use format_save_value.
1001 (map_keymap_char_table_item): Adjust accordingly.
1002 * fileio.c (non_regular_fd, non_regular_inserted)
1003 (non_regular_nbytes): Remove.
99d0d6dc
SM
1004 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1005 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
1006 (read_non_regular): Use XSAVE_ macros to extract parameters.
1007 Adjust comment.
1008 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1009 format_save_value.
1010 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1011
2b30549c
DA
10122013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1013
1014 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1015 extraction from any Lisp_Save_Value slot. Add type checking.
1016 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1017 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1018 * xselect.c: All users changed.
1019
1b971ac1
DA
10202013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1021
1022 Some convenient bits to deal with Lisp_Save_Values.
1023 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1024 (allocate_misc): Remove prototype.
1025 (format_save_value): New prototype.
1026 * alloc.c (allocate_misc): Revert back to static.
1027 (format_save_value): New function to build Lisp_Save_Value
1028 object with the specified internal structure.
1029 (make_save_value): Reimplement using format_save_value.
1030 * editfns.c (save_excursion_save): Use format_save_value.
1031 (save_excursion_restore): Use XSAVE_OBJECT.
1032
c50cf2ea
PE
10332013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1034
1035 Avoid needless casts with XSAVE_POINTER.
1036 * alloc.c (mark_object) [GC_MARK_STACK]:
1037 * dired.c (directory_files_internal_unwind):
1038 * fileio.c (do_auto_save_unwind):
1039 * gtkutil.c (pop_down_dialog):
1040 * keymap.c (map_keymap_char_table_item):
1041 * lread.c (load_unwind):
1042 * nsmenu.m (pop_down_menu):
1043 * print.c (print_object) [GC_MARK_STACK]:
1044 * xfns.c (clean_up_file_dialog):
1045 * xmenu.c (cleanup_widget_value_tree):
1046 Omit casts between XSAVE_POINTER and a pointer type.
1047
9d5a1260
DA
10482013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1049
1050 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1051 * eval.c (eval_sub): Protect `form' from being GCed before its
1052 car and cdr becomes protected with the backtrace entry.
1053
73ebd38f
DA
10542013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1055
1056 Make Lisp_Save_Value more versatile storage for up to four objects.
1057 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1058 (struct Lisp_Save_Value): New layout. Adjust comments.
1059 (XSAVE_POINTER): New macro.
1060 (XSAVE_INTEGER): Likewise.
1061 (allocate_misc): Add prototype.
1062 (free_misc): Likewise.
1063 * alloc.c (allocate_misc): Now global.
1064 (free_misc): Likewise. Adjust comment.
1065 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1066 (free_save_value): Likewise.
1067 (mark_object): Likewise.
1068 * editfns.c (save_excursion_save): Pack everything within
1069 Lisp_Save_Value and so avoid xmalloc.
1070 (save_excursion_restore): Adjust to match new layout. Use free_misc
1071 because we do not allocate extra memory any more. Add eassert.
1072 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1073 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1074 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1075 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1076 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1077
b826986f
JD
10782013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1079
1080 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1081 (nsfont_draw): Remove disabling of LCD smoothing.
1082 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 1083 Bug#11484 with LCD smoothing on.
b826986f 1084
c0511b57 10852013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 1086
b6f960a0
PE
1087 Fix SIGDANGER handlers, for AIX (Bug#13408).
1088 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1089 Move handlers here from emacs.c; they were out of place.
1090
616763d5
JD
10912013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1092
1093 * xterm.c (syms_of_xterm): Adjust documentation for
1094 scroll-bar-adjust-thumb-portion.
1095
0b59090b 10962012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
1097
1098 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1099 determine whether scroll bar thumb size should be adjusted or
1100 not. Use variable for MOTIF.
1101
1102 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1103 GTK.
1104
7bc916b4
JD
11052013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1106
eac4d08f
JD
1107 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1108 event is generated.
1109 (doCommandBySelector:): Set processingCompose to NO.
1110
7bc916b4
JD
1111 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1112 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1113 (nsfont_list_family): Add block/unblock_input calls.
1114 (nsfont_open): Move block_input earlier. Add unblock_input before early
1115 return.
1116 (nsfont_draw): Add block/unblock_input calls.
1117
bdc9b756
PE
11182013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1119
1120 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1121 for old_charpos and old_bytepos.
1122
ee56a6dc
PE
11232013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1124
1125 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1126 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1127 Clear tzvalbuf_in_environ if this workaround is in effect.
1128 Problem and fix reported by Kazuhiro Ito.
1129
9fc9a531
AH
11302013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1131
99d0d6dc
SM
1132 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1133 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
1134
1135 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1136 doc string cross-reference(s).
1137
1138 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1139 string cross-reference(s).
1140
6020559a
DA
11412013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1142
1143 Avoid unnecessary byte position calculation for the gap movement.
1144 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1145 anyway, all of them should use move_gap_both instead.
1146 * lisp.h (move_gap): Remove prototype.
1147 * insdel.c (move_gap): Remove.
1148 (move_gap_both): Add eassert.
1149 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1150 * xml.c (parse_region): Likewise.
1151
b8956427
PE
11522013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1153
1154 emacsclient -t should not suspend Emacs server (Bug#13387)
1155 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1156 New functions.
1157 * term.c (init_tty): Use them instead of rolling our own code.
1158 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1159 switches from 'signal' to 'pthread_sigmask', which is safer in
1160 multithreaded applications.
1161 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1162 which has already arranged for that.
1163 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1164 This is the main part of the bug fix.
1165
0b59090b 11662013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
1167
1168 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1169 x_last_font_name (Bug#13403).
1170
58cc0a01
DA
11712013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1172
1173 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1174 the type of per-buffer values where appropriate.
1175 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1176 predicate, which is how it's really used now. Adjust comment.
1177 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1178 * buffer.c (buffer_slot_type_mismatch): Remove.
1179 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1180 predicate. Adjust comment.
1181 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1182 fill-column, left-margin, tab-width, buffer-saved-size,
1183 left-margin-width, right-margin-width, left-fringe-width,
1184 right-fringe-width, scroll-bar-width and buffer-display-count.
1185 Use Qstringp for default-directory, buffer-file-name,
1186 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1187 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1188 line-spacing.
1189 * data.c (store_symval_forwarding): Adjust to call the predicate.
1190
5104861e
JB
11912013-01-09 Juanma Barranquero <lekktu@gmail.com>
1192
1193 * w32.c (get_name_and_id, acl_set_file):
1194 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1195
eefd7278
DA
11962013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1197
1198 * lisp.h (make_gap_1): New prototype.
1199 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1200 gap size values.
1201 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1202 naming convention.
1203 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 1204 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
1205 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1206 (make_gap_1): New function to adjust the gap of any buffer.
1207 * coding.c (coding_alloc_by_making_gap): Use it.
1208 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1209 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1210
073ca75b
JL
12112013-01-08 Juri Linkov <juri@jurta.org>
1212
1213 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1214 of (supports :underline (:style wave)). (Bug#13000)
1215
3bace969
AH
12162013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1217
1218 * undo.c (Fprimitive_undo): Move to simple.el.
1219 (syms_of_undo): Remove declarations for Sprimitive_undo.
1220
63a63bd4
SM
12212013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1222
1223 * keyboard.c (echo_add_key): Rename from echo_add_char.
1224
56ed110a
CY
12252013-01-06 Chong Yidong <cyd@gnu.org>
1226
1227 * keyboard.c (echo_add_char): New function, factored out from
1228 echo_char. Don't add a space if the previous echo string was
1229 empty (Bug#13255).
1230 (echo_char): Use it.
1231 (read_key_sequence): When echoing mock input, ensure that the
1232 trailing dash is properly added.
1233
b630991b
EZ
12342013-01-05 Eli Zaretskii <eliz@gnu.org>
1235
1236 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1237 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
1238 digits for buffer positions, before misalignment starts.
1239 Display "0" for integer "object" field.
b630991b
EZ
1240 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1241 Display the newline glyph more unambiguously.
1242
f032a318
YM
12432013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1244
1245 * nsterm.m (ns_draw_underwave):
1246 * w32term.c (w32_draw_underwave):
1247 * xterm.c (x_draw_underwave): Make underwave look more triangular
1248 and also degrade gracefully for small fonts. (Bug#13000)
1249
4240dd3c
YM
1250 * nsterm.m (ns_draw_text_decoration):
1251 * w32term.c (x_draw_glyph_string):
1252 * xterm.c (x_draw_glyph_string): Don't use previous underline
1253 thickness and position if previous underline type is underwave.
1254
553081a5
SM
12552013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1256
1257 * fileio.c (Ffile_acl): Undocument return format.
1258
9539d465 12592013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
1260
1261 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1262
71376d4b
PE
12632013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1264
1265 Simplify via eabs.
1266 * dired.c (file_name_completion):
1267 * doc.c (get_doc_string):
1268 * floatfns.c (round2):
1269 * font.c (font_score, font_delete_unmatched):
1270 * fringe.c (compute_fringe_widths):
1271 * lread.c (read_list):
1272 * minibuf.c (Ftry_completion):
1273 * term.c (tty_ins_del_lines):
1274 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1275 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1276
a7f11948
EZ
12772012-12-31 Eli Zaretskii <eliz@gnu.org>
1278
1279 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
1280 correctly.
1281 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
1282 for the bug this caused.
1283
84cc1ab6
PE
12842012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1285
1286 * coding.c (Qmac): Now static.
1287
5a1d858b
JD
12882012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1289
1290 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1291 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1292 handlebox_widget. Set toolbar_in_hbox to false/true, set
1293 toolbar_is_packed to true.
1294 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1295 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1296 Show all on TOOLBAR_TOP_WIDGET.
1297 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1298 by TOOLBAR_TOP_WIDGET.
1299 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1300 Check toolbar_is_packed.
8b745d92
JD
1301 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1302 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1303 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1304 false.
1305 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1306 (xg_update_menubar): Update title only if
1307 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1308 (xg_update_submenu): Skip tearoff only if
1309 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1310 (xg_initialize): Initialize xg_detached_menus only if
1311 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1312
1313 * xterm.h (struct x_output): Surround handlebox_widget with
1314 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1315 toolbar_in_hbox is bool.
1316
d5e5e7b4 13172012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1318
1319 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1320 (LIBS_GNUSTEP): Define.
1321 (LIBES): Add $(LIBS_GNUSTEP).
1322 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1323
d5e5e7b4 13242012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1325
1326 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1327 continuation glyph on a TTY with an indication of an empty line.
1328 (Bug#13277)
1329
e7ae8039
EZ
13302012-12-29 Eli Zaretskii <eliz@gnu.org>
1331
ccad023b
EZ
1332 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1333 file's SELinux context or ACLs successfully set, nil otherwise.
1334 (Bug#13298)
8d23a331 1335 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1336
e7ae8039
EZ
1337 * w32proc.c (reader_thread): Avoid passing NULL handles to
1338 SetEvent and WaitForSingleObject.
1339
7456e13f
PE
13402012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1341
1342 Port EXTERNALLY_VISIBLE to Clang 3.2.
1343 * conf_post.h (__has_attribute): New macro.
1344 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1345
1ab0c851
GM
13462012-12-27 Glenn Morris <rgm@gnu.org>
1347
1348 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1349 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1350
82e2a1f0 13512012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1352
63a63bd4
SM
1353 * fileio.c (file_name_as_directory, directory_file_name):
1354 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1355 came from a multibyte or a unibyte Lisp string; all callers
1356 adjusted. Don't assume the input string is always multibyte.
1357 (Bug#13262)
1358 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1359 don't ENCODE_FILE them, and return a unibyte string if the input
1360 was unibyte.
1361 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1362 don't assume the input strings will always be multibyte. If the
1363 input strings are multibyte, decode strings obtained from C
1364 library functions.
1365
8847a0de
DA
13662012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1367
1368 * lisp.h (toplevel): Add two notices to the comment about
1369 defining a new Lisp data type.
6cda572a
DA
1370 * print.c (print_object): If Lisp_Save_Value object's pointer
1371 is the address of a memory area containing Lisp_Objects, try
1372 to print them.
1373 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 1374
4b298d5a
DA
13752012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1376
1377 * keyboard.c (record_asynch_buffer_change): Initialize an event
1378 only if it's really needed.
1379 * frame.h (enum output_method): Remove output_mac member since
1380 it's a leftover from the deleted code.
1381 * frame.c (Fframep): Adjust user here ...
1382 * terminal.c (Fterminal_live_p): ... and here.
1383 * coding.c (Qmac): Now here because it's only used to denote
1384 end-of-line encoding type.
1385 (syms_of_coding): DEFSYM it.
1386 * frame.h (Qmac): Remove duplicated declaration.
1387
12384b01
PE
13882012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1389
1390 * window.c (select_window_1): Now static, since it's used only here.
1391
f1665bdc
EZ
13922012-12-25 Eli Zaretskii <eliz@gnu.org>
1393
1394 * window.c (window_body_cols): Subtract display margins from the
1395 window body width on TTYs as well. See
1396 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1397 for the original report.
1398
9a0d4f34
DA
13992012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1400
1401 * xdisp.c (redisplay_window): Remove inner local variable
1402 because the outer shadowed one has the same meaning.
cd78d9b1
DA
1403 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1404 set but never used.
1405 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1406 (xg_create_tool_bar): Adjust users.
9a0d4f34 1407
f9e7c67e
DA
14082012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1411 * buffer.c (Fget_buffer_create): Use it to set compact field of
1412 struct buffer_text to avoid accessing an uninitialized value
1413 when compact_buffer is called for the first time.
1414 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
1415 (Fset_buffer_modified_p): Use buffer_window_count to check
1416 whether the buffer is displayed in some window.
1417 * xdisp.c (message_dolog): Likewise.
f9e7c67e 1418
299614f3
EZ
14192012-12-23 Eli Zaretskii <eliz@gnu.org>
1420
40ff07a5
EZ
1421 * w32.c (acl_set_file): If setting the file security descriptor
1422 fails, and the new DACL is identical to the existing one, silently
1423 return success. This fixes problems for users backing up their
1424 own files without having the necessary privileges for setting
1425 security descriptors.
1426
299614f3
EZ
1427 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1428 values.
1429 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1430 after WaitForSingleObject returns normally. This expedites reader
1431 thread shutdown when delete_child triggers it.
1432 (reap_subprocess): More accurate commentary for why we call
1433 delete_child only when cp->fd is negative.
1434
1435 * w32.c (sys_close): Do not call delete_child on a subprocess
1436 whose handle is not yet closed. Instead, set its file descriptor
1437 to a negative value, so that reap_subprocess will call
63a63bd4
SM
1438 delete_child on that subprocess when its SIGCHLD arrives.
1439 This avoids closing handles used for communications between sys_select
299614f3
EZ
1440 and reader_thread, which doesn't give sys_select a chance to
1441 notice that the process exited and invoke the SIGCHLD handler for
1442 it.
1443
cf162aee
JD
14442012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1445
1446 * nsfns.m (Fns_do_applescript): Run event loop until script has
1447 been executed (Bug#12969).
1448 (ns_run_ascript): Chech as_script for nil, set to nil after
1449 executing script.
1450
94900bfe
MR
14512012-12-22 Martin Rudalics <rudalics@gmx.at>
1452
1453 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1454
b2faf49c
EZ
14552012-12-22 Eli Zaretskii <eliz@gnu.org>
1456
1457 * w32term.c (w32fullscreen_hook): New function.
1458 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1459
7efa3fb3
EZ
14602012-12-21 Eli Zaretskii <eliz@gnu.org>
1461
bb085aed
EZ
1462 * fileio.c (Finsert_file_contents): Doc fix.
1463
7efa3fb3
EZ
1464 * w32proc.c (new_child, delete_child, find_child_pid): For a
1465 subprocess, consider its slot being in use as long as its process
1466 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1467 slot when a new process is started immediately after killing
1468 another one, without waiting enough time for the first process to
1469 be reaped and resources allocated for it be orderly freed.
1470 (Bug#13086)
1471 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1472
c1f02afa
CY
14732012-12-21 Chong Yidong <cyd@gnu.org>
1474
1475 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1476
5bec25eb
CY
1477 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1478
a4b0cca1 14792012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
1480
1481 * w32.c (get_name_and_id): Always pass NULL as the first argument
1482 of lookup_account_sid. Avoids crashes with UNC file names that
1483 refer to DFS domains, not to specific machine names. (Bug#12621)
1484 Remove now unused argument FNAME; all callers changed.
1485 (get_file_owner_and_group): Remove now unused argument FNAME; all
1486 callers changed.
1487
34b4b7eb
CY
14882012-12-21 Chong Yidong <cyd@gnu.org>
1489
1490 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1491 error for invalid chars, don't check for a nil return value.
1492
13002885
DA
14932012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1494
1495 Avoid calls to CHAR_TO_BYTE if byte position is known.
1496 * editfns.c (make_buffer_string_both): Use move_gap_both.
1497 (Fbuffer_string): Use make_buffer_string_both.
1498 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1499 Adjust comment.
1500 (buf_bytepos_to_charpos): Likewise.
1501 (charpos_to_bytepos): Remove.
1502 * fileio.c (Finsert_file_contents): Use move_gap_both.
1503 * search.c (Freplace_match): Likewise.
9a0d4f34 1504 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
1505 names for byte positions.
1506 * lisp.h (charpos_to_bytepos): Remove prototype.
1507 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1508 * insdel.c (move_gap): Likewise.
1509
99e9311c
PE
15102012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1511
1512 * xdisp.c (redisplay_internal): Remove now-unused local.
1513
e02230bf
SM
15142012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1515
1516 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1517 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 1518 proper value of frame-local variables (bug#13225).
e02230bf 1519
1687fb14
DA
15202012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1521
1522 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1523 Rename 4th argument since it may be buffer or string. Adjust comment.
1524 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1525
a2f07cd2
DA
15262012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1527
1528 * coding.c (Fdetect_coding_region): Do not check start and end with
1529 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1530 (code_convert_region): Likewise.
1531
474d441e
EZ
15322012-12-18 Eli Zaretskii <eliz@gnu.org>
1533
1534 * w32.c (acl_get_file, acl_set_file): Run the file name through
1535 map_w32_filename, and resolve any symlinks in the file name, like
1536 Posix platforms do.
1537 (acl_set_file): Call revert_to_self, if any privileges were
1538 enabled.
1539
8725c076
JB
15402012-12-17 Juanma Barranquero <lekktu@gmail.com>
1541
1542 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1543 ($(BLD)/w32.$(O)): Update dependencies.
1544
1e101a4b
SM
15452012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1546
1547 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1548 propagate redisplay's scrolling (if any) to the right window.
1549 (redisplay_internal): Use ensure_selected_frame.
1550 (display_mode_lines): Complete last fix.
1551 * window.c (select_window_1): New func, extracted from select_window.
1552 (select_window): Use it.
1553 * window.h (select_window_1): Declare.
1554
66447e07
EZ
15552012-12-17 Eli Zaretskii <eliz@gnu.org>
1556
1557 Emulate Posix ACL APIs on MS-Windows.
1558 * w32.c: Include sddl.h and sys/acl.h.
1559 (SDDL_REVISION_1): Define if not already defined.
1560 (g_b_init_get_security_descriptor_dacl)
1561 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1562 (g_b_init_is_valid_security_descriptor)
1563 (g_b_init_set_file_security): New static flags.
1564 (globals_of_w32): Initialize them to zero.
1565 (SetFileSecurity_Name): New string constant.
1566 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1567 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1568 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1569 (IsValidSecurityDescriptor_Proc): New typedefs.
1570 (get_file_security, get_security_descriptor_owner)
1571 (get_security_descriptor_group): Set errno to ENOTSUP.
1572 (set_file_security, get_security_descriptor_dacl)
1573 (is_valid_security_descriptor, convert_sd_to_sddl)
1574 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1575 (acl_free, acl_get_file, acl_set_file): New functions.
1576
1577 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1578
207a7ef0
PE
15792012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1580
1581 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1582 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1583 for some of that bug's symptoms can now cause Emacs to abort.
1584 Remove the workaround.
1585 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1586 The bug that caused SIGCHLD to get lost has been fixed, and the
1587 workaround for it can now cause Emacs to abort.
1588
17fdfc15
PE
15892012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1592 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1593 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1594
7c3d167f
RF
15952012-12-16 Romain Francoise <romain@orebokech.com>
1596
1597 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1598 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1599 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1600 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1601
1602 * Makefile.in (LIBACL_LIBS): New macro.
1603 (LIBES): Use it.
1604
7d80ea23
PE
16052012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1606
1607 * fileio.c (internal_delete_file): Use bool for boolean.
1608
b0728617
EZ
16092012-12-15 Eli Zaretskii <eliz@gnu.org>
1610
1611 Fix bug #13079 on MS-Windows with temp files not being deleted.
1612 * w32.h (_child_process): New members input_file and
1613 pending_deletion.
1614 (register_child): First argument is now pid_t.
1615 (record_infile, record_pending_deletion): New prototypes.
1616
1617 * w32proc.c (new_child): Initialize input_file and
1618 pending_deletion members of the child.
1619 (delete_child): Delete the child's temporary input file, if any,
1620 that is pending deletion.
1621 (register_child): First argument is now pid_t.
1622 (record_infile, record_pending_deletion): New functions.
1623 (reap_subprocess): Fix a typo in DebPrint string.
1624 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
1625
1626 * fileio.c (internal_delete_file): Return an int again: non-zero
1627 if delete-file succeeds, zero otherwise.
1628
1629 * lisp.h (internal_delete_file): Adjust prototype.
1630
1631 * callproc.c (Fcall_process): Don't overwrite infile with result
1632 of DECODE_FILE.
1633 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
1634 asynchronous subprocess, record the name of the input file name,
1635 if any.
1636 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
1637 delete the file, record it as pending deletion when the subprocess
1638 exits.
1639
7e90af26
EZ
16402012-12-14 Eli Zaretskii <eliz@gnu.org>
1641
1642 * editfns.c [HAVE_PWD_H]: Include grp.h.
1643
1644 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
1645
97976f9f
PE
16462012-12-14 Paul Eggert <eggert@cs.ucla.edu>
1647
1648 Fix permissions bugs with setgid directories etc. (Bug#13125)
1649 * dired.c (Ffile_attributes): Return t as the 9th attribute,
1650 to mark it as a placeholder. The old value was often wrong.
1651 The only user of this attribute has been changed to use
1652 file-ownership-preserved-p instead, with its new group arg.
1653 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
1654
26ec1f49
SM
16552012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
1656
ad966fe7
SM
1657 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
1658 Keep selected_window and selected_frame in sync.
26ec1f49 1659
5c207910
EZ
16602012-12-14 Eli Zaretskii <eliz@gnu.org>
1661
1662 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
1663 try to get accurate owner and group information from NT file
1664 security APIs. This is to make most callers of 'stat' and
1665 'lstat', which don't need that information, much faster.
1666
26ec1f49
SM
1667 * dired.c (Ffile_attributes) [WINDOWSNT]:
1668 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
1669 owner and group information from 'lstat'.
1670
893f52d8
PE
16712012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1672
4c95c9a5
PE
1673 * fileio.c (Finsert_file_contents): Don't put tail into head area,
1674 as that confuses set-auto-coding, so insist on the head-read
1675 returning the full 1024 bytes. Let lseek compute the tail offset;
1676 less work for us. Do not ignore I/O errors when reading the tail.
1677
893f52d8
PE
1678 * xdisp.c: Minor style fixes.
1679 (init_iterator): Hoist assignment out of if-expression.
1680 (markpos_of_region): Callers now test for sign, not for -1.
1681
40d1e434
DA
16822012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
1683
1684 Minor redisplay optimization when the region length is zero.
1685 * xdisp.c (markpos_of_region): New function.
1686 (init_iterator): Do not highlight the region of zero length.
1687 (redisplay_window): Check whether the region is of non-zero length.
1688 (try_cursor_movement): Allow if the region length is zero.
1689 (try_window_reusing_current_matrix, try_window_id): Likewise.
1690
727f9739 16912012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
1692
1693 * search.c (search_buffer): Check the inverse translations of each
1694 character in pattern when the buffer being searched is unibyte.
1695 (Bug#13084)
1696
727f9739 16972012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
1698
1699 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
1700 files, fixing a regression from 24.2.
645c6a30 1701 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 1702
d20704ef
PE
17032012-12-13 Paul Eggert <eggert@cs.ucla.edu>
1704
1705 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
1706 fstat shouldn't fail, and if it does fail copy-file should not proceed.
1707 Remove unnecessary S_ISLNK test, as (contra the comments) this
1708 function can't copy symlinks. Improve quality of error message
1709 when attempting to copy files that are neither regular files nor
1710 directories.
1711
2dd61a9b
DA
17122012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
1713
1714 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
1715 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
1716 * window.c (Frecenter):
1717 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
1718 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
1719
cc98b684
DC
17202012-12-12 Daniel Colascione <dancol@dancol.org>
1721
1e101a4b 1722 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
1723 the dumped Emacs is not a sparse file, greatly improving Cygwin
1724 "make bootstrap" performance.
1725
38e791fd
MA
17262012-12-11 Michael Albinus <michael.albinus@gmx.de>
1727
1728 * inotify.c (inotify_callback): Generate an Emacs event for every
1729 incoming inotify event.
1730
f9d1448f
EZ
17312012-12-11 Eli Zaretskii <eliz@gnu.org>
1732
1733 * xdisp.c (handle_face_prop): Fix logic of computing
1734 it->start_of_box_run_p.
1735 (append_space_for_newline): If the glyph row is R2L, reset the
1736 iterator's end_of_box_run_p flag before prepending the space glyph.
1737 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
1738 iterator's start_of_box_run_p flag before prepending the stretch.
1739 (append_glyph, produce_image_glyph, append_composite_glyph)
1740 (append_stretch_glyph, append_glyphless_glyph): Reverse the
1741 left_box_line_p and right_box_line_p flags of the glyph for R2L
1742 glyph rows. (Bug#13011)
1743
c6afe371
DA
17442012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1745
1746 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
1747 if changed buffer is not shown in a window.
1748 * insdel.c (prepare_to_modify_buffer): Likewise.
1749 * window.c (replace_buffer_in_windows_safely): Do nothing
1750 if buffer is not shown in a window.
1751 (Fforce_window_update): Likewise if string or buffer argument
1752 is passed.
1753
1b47babd
EZ
17542012-12-11 Eli Zaretskii <eliz@gnu.org>
1755
1756 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
1757 encoded_file_name, which is what it is.
1758
4c1acb95
DA
17592012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
1760
1761 Consistently use marker_position and marker_byte_position.
1762 * fringe.c (Ffringe_bitmaps_at_pos):
1763 * indent.c (Fvertical_motion):
1764 * insdel.c (prepare_to_modify_buffer):
1765 * keyboard.c (make_lispy_position):
1766 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
1767 (window_scroll_pixel_based, displayed_window_lines)
1768 (Fset_window_configuration):
1769 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
1770 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
1771 Replace direct access to marker fields with calls
1772 to marker_position and/or marker_byte_position.
1773
0eeb69fe
JB
17742012-12-11 Juanma Barranquero <lekktu@gmail.com>
1775
1776 * makefile.w32-in (SIG2STR_H): New macro.
1777 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
1778 ($(BLD)/w32notify.$(O)): Update dependencies.
1779
1cf1bbd5
DC
17802012-12-10 Daniel Colascione <dancol@dancol.org>
1781
8db4b52f
DC
1782 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
1783 Windows file notification functionality unless WINDOWSNT.
1784
1cf1bbd5
DC
1785 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
1786 declarations.
1787
1788 * w32fns.c (cache_system_info): Initialize the global hinst
1789 variable here so various initialization calls DTRT.
1790
1e101a4b 1791 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
1792 (hinst): Remove unneeded extern declaration.
1793 (_start): Remove initialization of above variables; remove
1794 initialization of hinst, as cache_system_info now does that.
1795
1796 * emacs.c (main): Call cache_system_info early in startup; we
1797 previously weren't calling it in Cygwin builds.
1798
26ec1f49
SM
1799 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
1800 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
1801 and link it to Emacs.
1802
98a07056
DA
18032012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
1804
1805 Per-buffer window counters.
1806 * buffer.h (struct buffer): New member window_count.
1807 (buffer_window_count): New function.
1808 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1809 Initialize window_count.
1810 (Fkill_buffer): Verify window_count for the buffer being killed.
1811 (modify_overlay): Do not force redisplay if buffer is not shown
1812 in any window.
1813 (init_buffer_once): Initialize window_count for buffer_defaults
1814 and buffer_local_symbols.
1815 * window.h (buffer_shared): Remove declaration.
1816 (wset_buffer): Convert from inline ...
1817 * window.c (wset_buffer): ... to an ordinary function.
1818 (adjust_window_count): New function.
1819 (make_parent_window): Use it.
1820 * xdisp.c (buffer_shared): Remove.
1821 (redisplay_internal, redisplay_window): Adjust users.
1822 (buffer_shared_and_changed): Use per-buffer window counter.
1823
2b8c9064
EZ
18242012-12-10 Eli Zaretskii <eliz@gnu.org>
1825
1826 Support for filesystem notifications on MS-Windows.
1827 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
1828 and this is a TTY frame, signal the caller that keyboard input is
1829 available.
1830
1831 * w32xfns.c (drain_message_queue): Now returns an int: an
1832 indication whether any WM_EMACS_FILENOTIFY messages were found in
1833 the queue.
1834
1835 * w32inevt.c (handle_file_notifications): New function.
1836 (w32_console_read_socket): Call it to process file notifications.
1837
1838 * w32console.c (initialize_w32_display): Record the main thread ID
1839 in dwMainThreadId.
1840
1841 * deps.mk (inotify.o): New dependency list.
1842
1843 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
1844
1845 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
1846 (WM_EMACS_END): Bump value by 1.
1847 (notification_buffer_in_use, file_notifications)
1848 (notifications_size, notifications_desc): Declare.
1849 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
1850 Add prototypes.
1851
1852 * w32term.c (lispy_file_action, queue_notifications): New functions.
1853 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
1854 <Qrenamed_to>: New symbols.
1855 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
1856
1857 * w32notify.c: New file, implements file event notifications for
1858 MS-Windows.
1859
1860 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
1861 by posting it to the w32_read_socket queue.
1862
1e101a4b 1863 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
1864
1865 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
1866 (GLOBAL_SOURCES): Add w32notify.c
1867 ($(BLD)/w32notify.$(O)): New set of dependencies.
1868
1869 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
1870
1e101a4b
SM
1871 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
1872 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
1873 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
1874 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
1875 w32notify-handle-event by default.
1876
1877 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
1878 syms_of_w32notify.
1879
81606b10
RS
18802012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
1881
2b8c9064 1882 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 1883 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
1884
1885 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
1886
1887 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
1888 (syms_of_keyboard): DEFSYM it.
1889 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
1890 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
1891 Qfile_inotify events.
1892 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
1893 special-event-map to inotify-handle-event.
1894
1895 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
1896
1897 * Makefile.in (base_obj): Add inotify.o.
1898
1899 * inotify.c: New file.
1900
265c2fbf 19012012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
1902
1903 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
1904
265c2fbf 19052012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
1906
1907 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
1908 DWORD_PTR, for compatibility with 64-bit builds.
1909
a06ae17d 1910 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
1911 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
1912 (system_process_attributes): Use SIZE_T rather than DWORD, for
1913 compatibility with 64-bit builds.
1914
265c2fbf 19152012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
1916
1917 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
1918
265c2fbf 19192012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
1920
1921 * indent.c (Fvertical_motion): If a display string will be
1922 displayed on the left or the right margin, don't consider it as a
1923 factor in cursor positioning. (Bug#13108)
1924
265c2fbf 19252012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
1926
1927 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
1928
5f460827
PE
19292012-12-10 Paul Eggert <eggert@cs.ucla.edu>
1930
1931 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
1932 for string length.
1933
a16e75cd
EZ
19342012-12-08 Eli Zaretskii <eliz@gnu.org>
1935
1936 * w32.c (unsetenv): Return 0 if the input string is too long.
1937
5745a7df
PE
19382012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1939
1940 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
1941 * alloc.c (xputenv): New function.
1942 * dbusbind.c (Fdbus_init_bus):
1943 * emacs.c (main):
1944 * xterm.c (x_term_init):
1945 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
1946 * editfns.c (initial_tz): Move static var decl up.
1947 (tzvalbuf_in_environ): New static var.
1948 (init_editfns): Initialize these two static vars.
1949 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
1950 Save old TZ value on stack, if it's small.
1951 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
1952 instead, use xputenv+unsetenv to set and restore TZ.
1953 (environbuf): Remove static var. All uses removed.
1954 (Fset_time_zone_rule): Do not save TZ and environ;
1955 no longer needed here.
1956 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
1957 Move to inside set_time_zone_rule; they don't need file scope any more.
1958 (set_time_zone_rule): Maintain the TZ=value string separately.
1959 (syms_of_editfns): Don't initialize initial_tz;
1960 init_editfns now does it.
1961 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
1962 * lisp.h (xputenv): New decl.
1963
c56efa40
FP
19642012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
1965
1966 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
1967
75ceee05
EZ
19682012-12-08 Eli Zaretskii <eliz@gnu.org>
1969
1970 * w32.c (unsetenv, sys_putenv): New functions.
1971
1b6dbfeb
CY
19722012-12-08 Chong Yidong <cyd@gnu.org>
1973
1974 * editfns.c (Finsert_char): Make the error message more
1975 informative (Bug#12992).
1976
d983a10b
PE
19772012-12-08 Paul Eggert <eggert@cs.ucla.edu>
1978
7be78020
PE
1979 Simplify get_lim_data.
1980 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
1981 Remove USG and vlimit methods; no longer used these days.
1982 Add #error catchall just in case.
1983
d983a10b
PE
1984 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
1985 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
1986 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
1987 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
1988 (deleted_pid_list, Fdelete_process, create_process)
1989 (record_child_status_change, handle_child_signal, deliver_child_signal)
1990 (init_process_emacs, syms_of_process):
1991 Assume SIGCHLD is defined.
1992 (parse_signal): Remove. All uses removed.
1993 (abbr_to_signal): New static function.
1994 (Fsignal_process): Use it to convert signal names to ints.
1995 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
1996 kill (getpgrp (), ...).
1997 (emacs_sigaction_init): Assume SIGCHLD is defined.
1998 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
1999 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2000 * syssignal.h (EMACS_KILLPG): Remove.
2001 All uses replaced by 'kill' with a negative pid.
2002 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2003 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2004
9cdde1e2
PE
20052012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2006
2007 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2008 This will cause a production Emacs to dump core instead of
2009 infinite-looping.
2010
822995f8
DA
20112012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2012
2013 * frame.c (make_frame): Do not set window's buffer to t.
2014 * window.c (Fsplit_window_internal): Likewise. Previously it was
2015 used to indicate that the window is being set up. Now we use
2016 set_window_buffer for all new windows, so the condition in ...
2017 (Fset_window_buffer): ... is always true and can be removed.
2018
ed08365b
DA
20192012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2020
2021 Convenient macro to check whether the buffer is hidden.
2022 * buffer.h (BUFFER_HIDDEN_P): New macro.
2023 * frame.c (make_frame): Use it. Adjust comment.
2024 * buffer.c (candidate_buffer): New function.
2025 (Fother_buffer, other_buffer_safely): Use it.
2026
e86f5134
EZ
20272012-12-06 Eli Zaretskii <eliz@gnu.org>
2028
2029 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2030 if the child process is still running. Instead, exit the wait
2031 loop and return zero. (Bug#13086)
2032
1700db3c
DA
20332012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2034
2035 * frame.h (x_char_width, x_char_height): Remove prototypes.
2036 * w32term.h (x_char_width, x_char_height): Likewise.
2037 * xfns.c (x_char_width, x_char_height): Remove.
2038 * w32fns.c (x_char_width, x_char_height): Likewise.
2039 * nsfns.c (x_char_width, x_char_height): Likewise.
2040 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2041 all window frames.
2042 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2043 * keyboard.c (command_loop_1): Remove prototype.
2044 (command_loop_2, top_level_1): Add static to match prototype.
2045
35fb8050
PE
20462012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2047
2048 Fix a recently-introduced delete-process race condition.
2049 * callproc.c, process.h (record_kill_process):
2050 New function, containing part of the old call_process_kill.
2051 (call_process_kill): Use it.
2052 This does not change call_process_kill's behavior.
2053 * process.c (Fdelete_process): Use record_kill_process to fix a
2054 race condition that could cause Emacs to lose track of a child.
2055
565212e5
DA
20562012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2057
2058 Avoid code duplication between prev_frame and next_frame.
2059 * frame.c (candidate_frame): New function. Add comment.
2060 (prev_frame, next_frame): Use it. Adjust comment.
2061
d8ad4d3f 20622012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
2063
2064 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2065 fails, signal an error instead of continuing with an empty
2066 string. (Bug#13079)
7c2fcf9b
EZ
2067 Encode expanded temp file pattern before passing it to mkstemp or
2068 mktemp.
d3cefd13 2069
2e7cddd3
EZ
2070 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2071 Encode the file name before passing it to dostounix_filename, in
2072 case it will downcase it (under w32-downcase-file-names).
2073 (Bug#12933)
2074
644d3f0d
PE
20752012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2076
2077 Minor call-process cleanups.
2078 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2079 at the same time as other platforms, to simplify analysis.
2080 No need for fd0_volatile since we have synch_process_fd.
2081 Avoid needless emacs_close; arg is always negative.
2082
396376f1
AS
20832012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2084
2085 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2086 processes.
2087
350f51ad
DA
20882012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2089
2090 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2091 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2092 and mouse_face_hidden members to a bitfields.
2093 * frame.h (struct frame): Remove set-but-not-used space_width member.
2094 (FRAME_SPACE_WIDTH): Remove.
2095 * nsterm.m, w32term.c, xterm.c: Adjust users.
2096 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2097 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2098 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2099 members to a bitfields.
2100
bc9dbce6
PE
21012012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2102
bb5f74ee
PE
2103 Don't let call-process be a zombie factory (Bug#12980).
2104 Fixing this bug required some cleanup of the signal-handling code.
2105 As a side effect, this change also fixes a longstanding rare race
2106 condition whereby Emacs could mistakenly kill unrelated processes,
2107 and it fixes a bug where a second C-g does not kill a recalcitrant
2108 synchronous process in GNU/Linux and similar platforms.
2109 The patch should also fix the last vestiges of Bug#9488,
2110 a bug which has mostly been fixed on the trunk by other changes.
2111 * callproc.c, process.h (synch_process_alive, synch_process_death)
2112 (synch_process_termsig, sync_process_retcode):
2113 Remove. All uses removed, to simplify analysis and so that
2114 less consing is done inside critical sections.
2115 * callproc.c (call_process_exited): Remove. All uses replaced
2116 with !synch_process_pid.
2117 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2118 These take the role of what used to be in unwind-protect arg.
2119 All uses changed.
2120 (block_child_signal, unblock_child_signal):
2121 New functions, to avoid races that could kill innocent-victim processes.
2122 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2123 (call_process_kill): Record killed processes as deleted, so that
2124 zombies do not clutter up the system. Do this inside a critical
2125 section, to avoid a race that would allow the clutter.
2126 (call_process_cleanup): Fix code so that the second C-g works again
2127 on common platforms such as GNU/Linux.
2128 (Fcall_process): Create the child process in a critical section,
2129 to fix a race condition. If creating an asynchronous process,
2130 record it as deleted so that zombies do not clutter up the system.
2131 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2132 light of these changes. Omit unnecessary call to emacs_close
2133 before failure, as the unwind-protect code does that.
2134 * callproc.c (call_process_cleanup):
2135 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2136 * process.c (record_deleted_pid): New function, containing
2137 code refactored out of Fdelete_process.
2138 (Fdelete_process): Use it.
2139 (process_status_retrieved): Remove. All callers changed to use
2140 child_status_change.
2141 (record_child_status_change): Remove, folding its contents into ...
2142 (handle_child_signal): ... this signal handler. Now, this
2143 function is purely a handler for SIGCHLD, and is not called after
2144 a synchronous waitpid returns; the synchronous code is moved to
2145 wait_for_termination. There is no need to worry about reaping
2146 more than one child now.
2147 * sysdep.c (get_child_status, child_status_changed): New functions.
2148 (wait_for_termination): Now takes int * status and bool
2149 interruptible arguments, too. Do not record child status change;
2150 that's now the caller's responsibility. All callers changed.
2151 Reimplement in terms of get_child_status.
2152 (wait_for_termination_1, interruptible_wait_for_termination):
2153 Remove. All callers changed to use wait_for_termination.
2154 * syswait.h: Include <stdbool.h>, for bool.
2155 (record_child_status_change, interruptible_wait_for_termination):
2156 Remove decls.
2157 (record_deleted_pid, child_status_changed): New decls.
2158 (wait_for_termination): Adjust to API changes noted above.
2159
bc9dbce6
PE
2160 * bytecode.c, lisp.h (Qbytecode): Remove.
2161 No longer needed after 2012-11-20 interactive-p changes.
2162
3cf3c607
EZ
21632012-12-03 Eli Zaretskii <eliz@gnu.org>
2164
2165 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2166 the scroll margin, move point outside the margin. (Bug#13055)
2167
005c8d13
JD
21682012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2169
2170 * gtkutil.c (my_log_handler): New function.
2171 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2172
20edc1c9
DA
21732012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2174
2175 * lisp.h (modify_region): Rename to...
2176 (modify_region_1): ...new prototype.
2177 * textprop.c (modify_region): Now static. Adjust users.
2178 * insdel.c (modify_region): Rename to...
2179 (modify_region_1): ...new function to work with current buffer.
2180 Adjust comment and users. Use true and false for booleans.
2181
62c2e5ed
DA
21822012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2183
2184 * alloc.c (free_save_value): New function.
2185 (safe_alloca_unwind): Use it.
2186 * lisp.h (free_save_value): New prototype.
2187 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2188 Add comment.
2189 (save_excursion_restore): Adjust to match saved data structure.
2190 Use free_save_value to offload some work from GC. Drop obsolete
2191 #if 0 code.
2192
c5bc2d1d 21932012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
2194
2195 * fileio.c (Vauto_save_list_file_name): Doc fix.
2196
c5bc2d1d 21972012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
2198
2199 * w32fns.c: Remove prototype of atof.
1e101a4b 2200 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 2201 builds.
1e101a4b 2202 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
2203
2204 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2205 with 64-bit builds.
2206
2207 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2208 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2209 defined.
2210
c5bc2d1d 22112012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 2212
a9de9f0c 2213 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 2214
21e54a94
PE
22152012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2216
2dd2e622
PE
2217 Fix xpalloc confusion after memory is exhausted.
2218 * alloc.c (xpalloc): Comment fix.
2219 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2220 and signals an error, do not clear charset_table_size, as
2221 charset_table is still valid.
2222 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2223
21e54a94
PE
2224 Use execve to avoid need to munge environ (Bug#13054).
2225 * callproc.c (Fcall_process):
2226 * process.c (create_process):
2227 Don't save and restore environ; no longer needed.
2228 * callproc.c (child_setup):
2229 Use execve, not execvp, to preserve environ.
2230
3e5490f7
PE
22312012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2232
2233 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2234
75b4f59c
YM
22352012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2236
2237 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2238 display for sliced images (Bug#10500).
2239
2240 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2241
f8aff4c6
JB
22422012-11-30 Juanma Barranquero <lekktu@gmail.com>
2243
2244 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2245 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2246
3940b924
DA
22472012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2248
2249 * xdisp.c (window_outdated): Remove eassert since it hits
2250 some suspicious corner cases (see Bug#13007 and Bug#13012).
2251 (mode_line_update_needed): New function.
2252 (redisplay_internal, redisplay_window): Use it.
2253 (ensure_selected_frame): New function.
2254 (redisplay_internal, unwind_redisplay): Use it.
2255 (redisplay_internal): Move comment about buffer_shared...
2256 (buffer_shared_and_changed): ...near to its real use.
2257
4a9204fe
PE
22582012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2259
2260 * callproc.c (Fcall_process): Don't misreport vfork failure.
2261
60aeceb8
PE
22622012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2263
2264 * callproc.c (Fcall_process): Fix vfork portability problems.
2265 Do not assume that fd[0], count, filefd, and save_environ survive
2266 vfork. Fix bug whereby wrong errno value could be reported for
2267 pipe failure. Some minor cleanups, too, as follows. Move buf and
2268 bufsize to the context where they're needed. Change new_argv to
2269 be of type char **, as this is more convenient and avoids casts.
2270 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2271 Now local constants, not macros.
2272
00dc3ead
KH
22732012-11-18 Kenichi Handa <handa@gnu.org>
2274
2275 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2276 for the variable "f".
2277
e1bf05c1
KH
22782012-11-13 Kenichi Handa <handa@gnu.org>
2279
2280 * font.c (font_unparse_xlfd): Exclude special characters from the
2281 generating XLFD name.
2282
22626a85
PE
22832012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2284
350e0088
PE
2285 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2286 * dired.c (stat_uname, stat_gname):
2287 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2288
22626a85
PE
2289 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2290 * dired.c (directory_files_internal, file_name_completion):
2291 Assume EAGAIN and EINTR are defined.
350e0088 2292
22626a85
PE
2293 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2294 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2295 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2296 * lread.c (readbyte_from_file): Assume EINTR is defined.
2297 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2298 Assume EIO and EAGAIN are defined.
2299 * unexcoff.c (write_segment): Assume EFAULT is defined.
2300
5c9cf0a3 23012012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2302
2303 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2304 (Bug#11964)
2305
22294a56
EZ
2306 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2307 highlighting on the frame was cleared. Prevents assertion
2308 violations when repeatedly clicking on the "Top" link of the
2309 "bread-crumbs" in Info buffers.
2310
5fbab051
PE
23112012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2312
2313 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2314
bcd77a2b
KB
23152012-11-24 Ken Brown <kbrown@cornell.edu>
2316
2317 * keyboard.c (HAVE_MOUSE):
2318 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2319 were always defined.
2320
d125ca15 23212012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2322
24becea4
EZ
2323 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2324 between bpos_covered and bpos_max. This fixes cursor display when
2325 several display strings follow each other.
2326
8654a41b
EZ
2327 * .gdbinit (pgx): If the glyph's object is a string, display the
2328 pointer to string data, rather than the value of the string object
2329 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2330
cb5867b1
EZ
2331 * indent.c (Fvertical_motion): If the starting position is covered
2332 by a display string, return to one position before that, to avoid
2333 overshooting it inside move_it_to. (Bug#12930)
2334
f418b22e
DA
23352012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2336
2337 * frame.h (struct frame): Remove display_preempted member
2338 since all users are dead long ago.
2339 * nsterm.h (struct x_output): Use the only dummy member.
2340 * w32menu.c (pending_menu_activation): Remove since not
2341 really used.
2342 (set_frame_menubar): Adjust user.
2343 * w32term.h (struct x_output): Drop outdated #if 0 code.
2344 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2345 asked_for_visible and menubar_active members.
2346 Drop unused pending_menu_activation member.
f418b22e
DA
2347 * xterm.h (struct x_output): Drop outdated #if 0 code.
2348 Use bitfields for explicit_parent, asked_for_visible,
2349 has_been_visible and net_wm_state_hidden_seen members.
2350
a879f0ea
EZ
23512012-11-23 Eli Zaretskii <eliz@gnu.org>
2352
2353 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2354 of a literal "/". (Bug#12955)
2355 (gl-stamp): Invoke fc.exe directly, not through cmd.
2356
95ef7787
PE
23572012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2358
2359 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2360 * dired.c: Assume HAVE_DIRENT_H.
2361 (NAMLEN): Remove, replacing with ...
2362 (dirent_namelen): New function. All uses changed. Use the GNU macro
2363 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2364 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2365 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2366 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2367 $(NT_INC)/dirent.h.
2368 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2369 * ndir.h: Rename to ../nt/inc/dirent.h.
2370 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2371 Do not include <dirent.h>; no longer needed.
2372 * w32.c: Include <dirent.h> rather than "ndir.h".
2373
12645ae6
CY
23742012-11-23 Chong Yidong <cyd@gnu.org>
2375
2376 * xftfont.c (xftfont_open): Remove duplicate assignment.
2377
5c747675
DA
23782012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 * alloc.c (Fgarbage_collect): Unblock input after clearing
2381 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2382 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2383 * msdos.c (IT_frame_up_to_date): Use it here...
2384 * w32term.c (w32_frame_up_to_date): ...here...
2385 * xterm.c (XTframe_up_to_date): ...and here...
2386 * nsterm.m (ns_frame_up_to_date): ...but not here.
2387 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2388 Adjust users.
2389 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2390 Do not check whether GC is in progress.
2391
6ceeb5f1
DA
23922012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2393
2394 * xdisp.c (window_buffer_changed): New function.
2395 (update_menu_bar, update_tool_bar): Use it to
2396 simplify large 'if' statements.
2397 (redisplay_internal): Generalize commonly used
2398 'tail' and 'frame' local variables.
2399
ec84768f
EZ
24002012-11-22 Eli Zaretskii <eliz@gnu.org>
2401
2402 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2403 with Windows system header.
2404
9239d970
PE
24052012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2406
2407 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2408 * alloc.c: Assume unistd.h exists.
2409 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2410 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2411 (getwd) [USG]: Remove; no longer needed.
2412 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2413 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2414 * w32.h (getcwd): Remove decl.
2415
954bba56
SM
24162012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2417
2418 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2419 Make it set selected_window as well.
2420 (update_tool_bar): Use it.
2421
6ef2e5ef 24222012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
2423
2424 * emacs.c (main): Set the G_SLICE environment variable for all
2425 Cygwin builds, not just GTK builds. See
2426 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2427
6ef2e5ef 24282012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
2429
2430 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2431 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2432 Define for the MSVC compiler.
2433
6ef2e5ef 2434 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
2435
2436 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2437 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2438 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
2439 dostounix_filename assumes it gets a unibyte string.
2440 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
2441 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2442
eadf1faa
SM
24432012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2444
2445 Conflate Qnil and Qunbound for `symbol-function'.
2446 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2447 * lread.c (init_obarray): Set `function' fields to Qnil.
2448 * eval.c (Fcommandp): Ignore Qunbound.
2449 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2450 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2451 Test NILP rather than Qunbound.
2452 (Ffmakunbound): Set to Qnil.
2453 (Fsymbol_function): Never signal an error.
2454 (Finteractive_form): Ignore Qunbound.
2455
b83fdfa9
PE
24562012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2457
2458 * eval.c (interactive_p): Remove no-longer-used decl.
2459
952580c5
DA
24602012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2461
2462 * xdisp.c (buffer_shared): Adjust comment.
2463 (buffer_shared_and_changed): New function.
2464 (prepare_menu_bars, redisplay_internal): Use it to
2465 decide whether all windows or frames should be updated.
ea6de9b1
DA
2466 (window_outdated): New function.
2467 (text_outside_line_unchanged_p, redisplay_window): Use it.
2468 (redisplay_internal): Likewise. Fix indentation.
952580c5 2469
23ba2705
SM
24702012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2471
2472 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2473 (syms_of_eval): Remove corresponding defsubr.
2474 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2475
6e9f7997
DC
24762012-11-19 Daniel Colascione <dancol@dancol.org>
2477
2478 * w32fns.c (Fx_file_dialog):
2479 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2480 cygwin_convert_file_name*.
2481
2482 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2483 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2484
552a1590
PE
24852012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2486
2487 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2488
2ac9538d 24892012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
2490
2491 * w32select.c: Include w32common.h before w32term.h, so that
2492 windows.h gets included before w32term.h uses some of its
2493 features, see below.
2494
23ba2705
SM
2495 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2496 New typedefs.
2497 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2498 New prototypes.
d8715cdf
EZ
2499 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2500
2ac9538d 25012012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
2502
2503 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2504 (ns_select): Return at once if events are held (Bug#12834).
2505
2ac9538d 25062012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 2507
2508 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2509 Needed following 2012-10-20 change. (Bug#12902)
2510
c1f7ba3a
JB
25112012-11-18 Juanma Barranquero <lekktu@gmail.com>
2512
2513 * w32proc.c (waitpid): Remove unused label get_result.
2514
a75ce9d3
JB
25152012-11-17 Juanma Barranquero <lekktu@gmail.com>
2516
2517 * makefile.w32-in (SYSWAIT_H): New macro.
2518 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2519 ($(BLD)/sysdep.$(O)): Update dependencies.
2520
49cdacda
PE
25212012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2522
2523 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2524 * callproc.c (relocate_fd): Assume F_DUPFD.
2525 * emacs.c, term.c (O_RDWR): Remove.
2526 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2527 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2528 * nsterm.m: Assume <fcntl.h> exists.
2529 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2530 (create_pty, Fmake_network_process, server_accept_connection)
2531 (wait_reading_process_output, init_process_emacs):
2532 Assume O_NONBLOCK.
2533 (wait_reading_process_output): Put in a special case for WINDOWSNT
2534 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2535 It's not clear this is needed, but it's a more-conservative change.
2536 (create_process): Assume FD_CLOEXEC.
2537 (create_process, create_pty): Assume O_NOCTTY.
2538 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2539 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2540 Omit if not DOS_NT, since F_GETFL is not defined there.
2541 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2542 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2543 (O_NOCTTY): Remove.
2544 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2545 lack it, since gnulib guarantees this.
2546 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2547
22bae83f
EZ
25482012-11-17 Eli Zaretskii <eliz@gnu.org>
2549
6ad30855
EZ
2550 * w32.c (faccessat): Pretend that directories have the execute bit
2551 set. Emacs expects that, e.g., in files.el:cd-absolute.
2552
22bae83f
EZ
2553 * w32proc.c (create_child): Don't clip the PID of the child
2554 process to fit into an Emacs integer, as this is no longer a
2555 restriction.
2556 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2557 reaping only the process specified by PID argument, if that is
2558 positive. Use PID instead of dead_child to know which process to
2559 reap. Wait for the child to die only if WNOHANG is not in
2560 OPTIONS.
2561 (sys_select): Don't set dead_child.
2562
2563 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2564 as it is no longer needed.
2565
2566 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2567 no longer needed.
2568 (record_child_status_change): Remove the setting of
2569 record_at_most_one_child for the !WNOHANG case.
2570
a631d0e0
PE
25712012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 Fix problems in ns port found by static checking.
2574 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2575 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2576 not to process group.
2577 (ns_select): Use emacs_write, not write, as that's more robust
2578 in the presence of signals.
2579 (fd_handler:): Check for read errors.
2580
d56f2e49
GM
25812012-11-16 Glenn Morris <rgm@gnu.org>
2582
2583 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2584
96e05507 25852012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2586
2587 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2588
96e05507 25892012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2590
2591 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2592 use the same value of thread handle.
2593 (start_timer_thread): If the timer thread exited (due to error),
2594 clean up by closing the two handles it used. Duplicate the caller
2595 thread's handle here, so it gets duplicated only once, when
2596 launching the timer thread. Set priority of the timer thread, not
2597 the caller thread.
2598 (getitimer): Don't duplicate the caller thread's handle here.
2599 (Bug#12832)
2600
96e05507 26012012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2602
2603 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2604 called (Bug#12834).
2605
3d082a26
PE
26062012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2607
2608 Remove no-longer-used pty_max_bytes variable.
2609 * process.c (pty_max_bytes): Remove; unused.
2610 (send_process): Do not set it.
2611
b72c161c
JB
26122012-11-15 Juanma Barranquero <lekktu@gmail.com>
2613
2614 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2615 Update dependencies.
2616
bf20ea80
PE
26172012-11-15 Paul Eggert <eggert@cs.ucla.edu>
2618
2619 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
2620 This follows up on the 2012-09-29 patch that removed indirection
2621 for the 'function' field. Reported by Sergey Vinokurov in
2622 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
2623
14f20728
EZ
26242012-11-14 Eli Zaretskii <eliz@gnu.org>
2625
2626 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
2627 different name, as the MS runtime does not have such a function,
2628 and probably never will.) All callers changed. Ignore DIRFD
2629 value if PATH is an absolute file name, to match Posix spec
2630 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
2631 symlinks.
2632
77731919
DA
26332012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
2634
2635 * xdisp.c (echo_area_display, redisplay_internal):
2636 Omit redundant check whether frame_garbaged is set.
2637
73dcdb9f
PE
26382012-11-14 Paul Eggert <eggert@cs.ucla.edu>
2639
2640 Use faccessat, not access, when checking file permissions (Bug#12632).
2641 This fixes a bug that has been present in Emacs since its creation.
2642 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
2643 which must set some sort of record. (Torek's bug report was against
2644 a predecessor of GNU Emacs, but GNU Emacs happened to have the
2645 same common flaw.) See Torek's Usenet posting
2646 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
2647 Posted: Fri Apr 8 14:18:56 1983.
2648 * Makefile.in (LIB_EACCESS): New macro.
2649 (LIBES): Use it.
2650 * callproc.c (init_callproc):
2651 * charset.c (init_charset):
2652 * fileio.c (check_existing, check_executable, check_writable)
2653 (Ffile_readable_p):
2654 * lread.c (openp, load_path_check):
2655 * process.c (allocate_pty):
2656 * xrdb.c (file_p):
2657 Use effective UID when checking permissions, not real UID.
2658 * callproc.c (init_callproc):
2659 * charset.c (init_charset):
2660 * lread.c (load_path_check, init_lread):
2661 Test whether directories are accessible, not merely whether they exist.
2662 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
2663 * fileio.c (check_existing, check_executable, check_writable)
2664 (Ffile_readable_p):
2665 Use symbolic names instead of integers for the flags, as they're
2666 portable now.
2667 (check_writable): New arg AMODE. All uses changed.
2668 Set errno on failure.
2669 (Ffile_readable_p): Use faccessat, not stat + open + close.
2670 (Ffile_writable_p): No need to call check_existing + check_writable.
2671 Just call check_writable and then look at errno. This saves a syscall.
2672 dir should never be nil; replace an unnecessary runtime check
2673 with an eassert. When checking the parent directory of a nonexistent
2674 file, check that the directory is searchable as well as writable, as
2675 we can't create files in unsearchable directories.
2676 (file_directory_p): New function, which uses 'stat' on most platforms
2677 but faccessat with D_OK (for efficiency) if WINDOWSNT.
2678 (Ffile_directory_p, Fset_file_times): Use it.
2679 (file_accessible_directory_p): New function, which uses a single
2680 syscall for efficiency.
2681 (Ffile_accessible_directory_p): Use it.
2682 * xrdb.c (file_p): Use file_directory_p.
2683 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
2684 * lread.c (openp): When opening a file, use fstat rather than
2685 stat, as that avoids a permissions race. When not opening a file,
2686 use file_directory_p rather than stat.
2687 (dir_warning): First arg is now a usage string, not a format.
2688 Use errno. All uses changed.
2689 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
2690 that merely introduced a race.
2691 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
2692 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
2693 and similarly for the other O_* flags.
2694 * w32.c (sys_faccessat): Rename from sys_access and switch to
2695 faccessat's API. All uses changed.
2696 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
2697 (magic_db): Rename from magic_file_p.
2698 (magic_db, search_magic_path): Return an XrmDatabase rather than a
2699 char *, so that we don't have to test for file existence
2700 separately from opening the file for reading. This removes a race
2701 fixes a permission-checking problem, and simplifies the code.
2702 All uses changed.
2703 (file_p): Remove; no longer needed.
2704
2a14f83b
DA
27052012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
2706
2707 Omit glyphs initialization at startup.
2708 * dispnew.c (glyphs_initialized_initially_p): Remove.
2709 (adjust_frame_glyphs_initially): Likewise. Adjust users.
2710 (Fredraw_frame): Move actual code from here...
c7085245 2711 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
2712 (Fredraw_display): Use redraw_frame.
2713 * xdisp.c (clear_garbaged_frames): Likewise.
2714
f78ee6af 27152012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
2716
2717 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
2718 passed to pint2str and pint2hrstr to be at most the size of the
2719 frame's decode_mode_spec_buffer. This avoids crashes with very
2720 large values of FIELD_WIDTH argument to decode_mode_spec.
2721 (Bug#12867)
2722
b95a9c0c
PE
27232012-11-13 Paul Eggert <eggert@cs.ucla.edu>
2724
2725 Fix a race with verify-visited-file-modtime (Bug#12863).
2726 Since at least 1991 Emacs has ignored an mtime difference of no
2727 more than one second, but my guess is that this was to work around
2728 file system bugs that were fixed long ago. Since the race is
2729 causing problems now, let's remove that code.
2730 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
2731 whose time stamp is off by no more than a second. Insist that the
2732 file time stamps match exactly.
2733
be49ba74
DA
27342012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2735
2736 * frame.h (struct frame): Convert external_tool_bar member to
2737 1-bit unsigned bitfield.
2738 * termhooks.h (struct terminal): Remove mouse_moved member since
2739 all users are long dead. Adjust comment on mouse_position_hook.
2740
5b04e9f9
DA
27412012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
2742
2743 Simplify by using FOR_EACH_FRAME here and there.
2744 * frame.c (next_frame, prev_frame, other_visible_frames)
2745 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
2746 * w32term.c (x_window_to_scroll_bar): Likewise.
2747 * window.c (window_list): Likewise.
2748 * xdisp.c (x_consider_frame_title): Likewise.
2749 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
2750 * xfns.c (x_window_to_frame, x_any_window_to_frame)
2751 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
2752 * xmenu.c (menubar_id_to_frame): Likewise.
2753 * xselect.c (frame_for_x_selection): Likewise.
2754 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
2755 (x_window_to_menu_bar): Likewise.
2756 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
2757
76ae24d7
PE
27582012-11-12 Paul Eggert <eggert@cs.ucla.edu>
2759
12cc4337
PE
2760 * data.c (Qdefalias_fset_function): Now static.
2761
76ae24d7
PE
2762 Another tweak to vectorlike_header change.
2763 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
2764 Remove, and replace all uses with ...
2765 (next_in_free_list, set_next_in_free_list):
2766 New functions, which respect C's aliasing rules better.
2767
1479c557
PE
27682012-11-11 Paul Eggert <eggert@cs.ucla.edu>
2769
2770 * window.c (list4i): Rename from 'quad'. All uses changed.
2771 Needed because <sys/types.h> defines 'quad' on Solaris 10.
2772
11235c03
JB
27732012-11-11 Juanma Barranquero <lekktu@gmail.com>
2774
2775 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
2776 warning about mixing declarations and code in ISO C90.
2777
6baf66d5 27782012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
2779
2780 * window.c (Fsplit_window_internal): Set combination limit of
2781 new parent window to t iff Vwindow_combination_limit is t;
2782 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 2783 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 2784
6baf66d5 27852012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
2786
2787 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
2788 amount when the scroll margins are too large. When scrolling
2789 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
2790 scroll margin within a reasonable number of screen lines.
2791 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
2792 point is positioned many lines beyond the window top/bottom.
2793 (Bug#12811)
2794
508f51f5
EZ
2795 * ralloc.c (relinquish): If real_morecore fails to return memory
2796 to the system, don't crash; instead, leave the last heap
2797 unchanged and return. (Bug#12774)
2798
32e5c58c
SM
27992012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2800
2801 * lisp.h (AUTOLOADP): New macro.
2802 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
2803 * data.c (Ffset): Remove special ad-advice-info handling.
2804 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
2805 (Fsubr_arity): CSE.
2806 (Finteractive_form): Simplify.
2807 (Fquo): Don't insist on having at least 2 arguments.
2808 (Qdefalias_fset_function): New var.
2809
719b0aa5
JD
28102012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2811
4ab15c3e
JD
2812 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
2813
719b0aa5
JD
2814 * nsfont.m (Qcondensed, Qexpanded): New variables.
2815 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
2816 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
2817
535cc8e9
DA
28182012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2819
2820 Fix recently introduced crash on MS-Windows (Bug#12839).
2821 * w32term.h (struct scroll_bar): Use convenient header.
2822 (SCROLL_BAR_VEC_SIZE): Remove.
2823 * w32term.c (x_scroll_bar_create): Use VECSIZE.
2824
7d377c48
DA
28252012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
2826
2827 Tweak last vectorlike_header change.
2828 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
2829 vectorlike object on the free list. This is introduced to avoid
2830 some (but not all) pointer casting and aliasing problems, see
2831 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
2832 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
2833 objects.
2834 (xvectype, xvecsize): Use them to examine Lisp_Object values.
2835
7ad27466
JD
28362012-11-09 Jan Djärv <jan.h.d@swipnet.se>
2837
32e5c58c 2838 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
2839 been removed, so remove them here also.
2840
57618ecf
SM
28412012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2842
2843 * doc.c (Fdocumentation): Handle new property
2844 dynamic-docstring-function to replace the old ad-advice-info.
2845
53371430
PE
28462012-11-09 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 * fns.c (Qeql, hashtest_eq): Now static.
2849
61ddb1b9
SM
28502012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2851
2852 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
2853 * fns.c (hashfn_eq, hashfn_eql, sxhash):
2854 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
2855 * buffer.c (compare_overlays): Use XLI rather than XHASH.
2856
04a2d0d3
PE
28572012-11-08 Paul Eggert <eggert@cs.ucla.edu>
2858
2859 Use same hash function for hashfn_profiler as for hash_string etc.
2860 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
2861 * lisp.h (sxhash_combine): New inline function, with the contents
2862 of the old SXHASH_COMBINE.
2863 * profiler.c (hashfn_profiler): Use it, instead of having a
2864 special hash function containing a comparison that always yields 1.
2865
de5ef41a
SM
28662012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2867
2868 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
2869 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
2870 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
2871 Remove unused vars.
2872
a23c4171
JD
28732012-11-08 Jan Djärv <jan.h.d@swipnet.se>
2874
2875 * image.c (xpm_make_color_table_h): Fix compiler error because
2876 make_hash_table changed.
2877
0b59090b 28782012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
2879
2880 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
2881
b7432bb2
SM
28822012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
2883
2884 Use ad-hoc comparison function for the profiler's hash-tables.
2885 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
2886 (make_log): Use them.
2887 (handle_profiler_signal): Don't inhibit quit any longer since we don't
2888 call Fequal any more.
2889 (Ffunction_equal): New function.
2890 (cmpfn_profiler, hashfn_profiler): New functions.
2891 (syms_of_profiler): Initialize them.
2892 * lisp.h (struct hash_table_test): New struct.
2893 (struct Lisp_Hash_Table): Use it.
2894 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
2895 * fns.c (make_hash_table): Take a struct to describe the test.
2896 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2897 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
2898 (hash_lookup, hash_remove_from_table): Move assertion checking of
2899 hashfn result here. Check hash-equality before calling cmpfn.
2900 (Fmake_hash_table): Adjust call to make_hash_table.
2901 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
2902 (syms_of_fns): Initialize them.
2903 * emacs.c (main): Move syms_of_fns earlier.
2904 * xterm.c (syms_of_xterm):
2905 * category.c (hash_get_category_set): Adjust call to make_hash_table.
2906 * print.c (print_object): Adjust to new hash-table struct.
2907 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
2908
88002743
EZ
29092012-11-08 Eli Zaretskii <eliz@gnu.org>
2910
2911 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
2912 value of w32-scroll-lock-modifier is neither nil nor one of the
2913 known key modifiers. (Bug#12806)
2914
914adc42
DA
29152012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2916
2917 Shrink struct vectorlike_header to the only size field.
2918 * lisp.h (enum pvec_type): Avoid explicit enum member values.
2919 Adjust comment.
2920 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
2921 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
2922 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
2923 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
2924 information from the vector header. Adjust comment.
2925 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
2926 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
2927 layout.
2928 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
2929 (struct vectorlike_header): Remove next member. Adjust comment.
2930 (struct Lisp_Subr): Add convenient header. Adjust comment.
2931 (allocate_pseudovector): Adjust prototype.
2932 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
2933 (sweep_string, lisp_malloc): Remove useless prototypes.
2934 (enum mem_type): Adjust comment.
2935 (NEXT_IN_FREE_LIST): New macro.
2936 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
2937 (Fmake_bool_vector): Likewise.
2938 (struct large_vector): New type to represent allocation unit for
2939 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
2940 (large_vectors): Change type to struct large_vector.
2941 (allocate_vector_from_block): Simplify.
2942 (PSEUDOVECTOR_NBYTES): Replace with...
2943 (vector_nbytes): ...new function. Adjust users.
2944 (sweep_vectors): Adjust processing of large vectors.
2945 (allocate_vectorlike): Likewise.
2946 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
2947 Add easserts. Adjust XSETPVECTYPESIZE usage.
2948 (allocate_buffer): Use BUFFER_PVEC_INIT.
2949 (live_vector_p): Adjust to match large vector.
2950 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
2951 * buffer.h (struct buffer): Add next member.
2952 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
2953 New macros.
2954 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
2955 * fns.c (internal_equal): Adjust to match enum pvec_type change.
2956 (copy_hash_table): Adjust to match vector header change.
2957 * lread.c (defsubr): Use XSETPVECTYPE.
2958 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
2959 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
2960 (xvecsize): New command.
2961
c66f21ea
DA
29622012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
2963
2964 * keyboard.c (event_to_kboard): Do not dereference
2965 frame_or_window field of SELECTION_REQUEST_EVENT
2966 and SELECTION_CLEAR_EVENT events (Bug#12814).
2967 * xterm.h (struct selection_input_event): Adjust comment.
2968
eb147960
EZ
29692012-11-07 Eli Zaretskii <eliz@gnu.org>
2970
dab72075
EZ
2971 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
2972 such as Scroll Lock, if the respective keys are treated as
2973 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 2974 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 2975
5890e400
DA
29762012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
2977
2978 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
2979
b6b3b294
PE
29802012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2981
2982 Restore some duplicate definitions (Bug#12814).
2983 This undoes part of the 2012-11-03 changes. Some people build
2984 with plain -g rather than with -g3, and they need the duplicate
2985 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
2986 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
2987 Define as macros, as well as as enums or as constants.
2988
e770aad5
JD
29892012-11-06 Jan Djärv <jan.h.d@swipnet.se>
2990
2991 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
2992 to keypad keys (Bug#12816).
2993
68f8f1c0
PE
29942012-11-06 Paul Eggert <eggert@cs.ucla.edu>
2995
2996 Minor adjustments of recently-changed frame functions.
2997 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
2998 known to be a frame (we're in the FRAMEP branch).
2999 * lisp.h (Qframep): Remove decl. frame.h declares this.
3000 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3001 since they're meant for Lisp fixnum values.
3002
72f94d4b
DA
30032012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3004
3005 * window.c (Fwindow_combination_limit): Revert to the only
3006 required argument and adjust docstring as suggested in
3007 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3008 by Martin Rudalics <rudalics@gmx.at>.
3009
d9f07150
DA
30102012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3011
3012 Widely used frame validity and checking functions.
3013 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3014 * frame.c (decode_live_frame, decode_any_frame): New functions.
3015 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3016 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3017 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3018 (Fframe_pointer_visible_p): Use decode_any_frame.
3019 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3020 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3021 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3022 (Fframe_focus): Likewise. Allow zero number of arguments.
3023 Adjust docstring.
3024 (frame_buffer_list, frame_buffer_predicate): Remove.
3025 * lisp.h (frame_buffer_predicate): Remove prototype.
3026 * buffer.c (Fother_buffer): Use decode_any_frame.
3027 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3028 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3029 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3030 (Fclose_font, Ffont_info): Use decode_live_frame.
3031 * fontset.c (check_fontset_name): Likewise.
3032 * terminal.c (Fframe_terminal): Likewise.
3033 * w32fns.c (check_x_frame): Likewise.
3034 * window.c (Fminibuffer_window, Fwindow_at)
3035 (Fcurrent_window_configuration): Likewise.
3036 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3037 Likewise. Allow zero number of arguments. Adjust docstring.
3038 * dispnew.c (Fredraw_frame): Likewise.
3039 * xfaces.c (frame_or_selected_frame): Remove.
3040 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3041 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3042 (Fframe_face_alist): Use decode_live_frame.
3043 * xfns.c (check_x_frame): Likewise.
3044
89bc0592
DA
30452012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3046
3047 * window.c (quad): New function.
3048 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3049 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3050 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3051 (Fwindow_line_height): Use it.
3052 (Fwindow_fringes): Use list3.
3053 (Fwindow_scroll_bars): Use list4.
3054 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3055 (Fwindow_combination_limit): Allow zero number of arguments.
3056
c8e3a9c3
EZ
30572012-11-05 Eli Zaretskii <eliz@gnu.org>
3058
3059 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3060
8e2417bf 3061 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 3062 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 3063 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 3064
209c6a58
CY
30652012-11-05 Chong Yidong <cyd@gnu.org>
3066
3067 * process.c (wait_reading_process_output): Revert previous change.
3068
8148369c
PE
30692012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3070
dd0333b6
PE
3071 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3072 This removes code that has been obsolete since around 1990.
3073 * callproc.c (Fcall_process):
3074 * emacs.c (main):
3075 * process.c (create_process):
3076 * term.c (dissociate_if_controlling_tty):
3077 Assume setsid exists.
3078 * callproc.c (child_setup): Assume setpgid exists and behaves as
3079 per POSIX.1-1988 or later.
3080 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3081 * emacs.c (shut_down_emacs):
3082 * sysdep.c (sys_suspend, init_foreground_group):
3083 Assume getpgrp behaves as per POSIX.1-1998 or later.
3084 * msdos.c (setpgrp): Remove.
3085 (tcgetpgrp, setpgid, setsid): New functions.
3086 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3087 * term.c (no_controlling_tty): Remove; unused.
3088 * w32proc.c (setpgrp): Remove.
3089 (setsid, tcgetpgrp): New functions.
3090
8148369c
PE
3091 Simplify by assuming __fpending.
3092 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3093 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3094 Do not assume that __fpending's result fits in int.
3095
76abf5e5
PE
30962012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3097
06b63c9b
PE
3098 Remove EMACS_OUTQSIZE+sleep hack.
3099 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
3100 than 2400 bps, which throttled Emacs by having it sleep.
3101 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
3102 was added, and anyway those old terminals are long dead.
3103 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3104 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3105
76abf5e5
PE
3106 Fix data-loss with --version (Bug#9574).
3107 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3108 as we can't assume that emacs_strerror is initialized, and strerror
3109 is good enough here.
3110 (main): Invoke atexit earlier, to catch earlier instances of
3111 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3112
8f31e74b
MM
31132012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3114
3115 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3116 (keyDown): Remap keypad keys to X11 virtual key codes.
3117
0d879dca
PE
31182012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3119
7ccfb720
PE
3120 Fix data-loss with --batch (Bug#9574).
3121 * emacs.c: Include <close-stream.h>.
3122 (close_output_streams): New function.
3123 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3124 and handles errors appropriately.
3125 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3126 does that now.
3127
0b3d4a47
PE
3128 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3129 The symptom is a diagnostic "GLib-WARNING **: In call to
3130 g_spawn_sync(), exit status of a child process was requested but
3131 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3132 waitpid(), so exit status can't be returned." The diagnostic
3133 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3134 The real bug is a race condition between Emacs and glib: Emacs
3135 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3136 so that glib can't find it. Work around the bug by invoking
3137 waitpid only on subprocesses that Emacs itself creates.
3138 * process.c (create_process, record_child_status_change):
3139 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
3140 know the pid rather than having the callee infer it.
3141 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
3142 (create_process): Set new 'alive' member if child is created.
3143 (process_status_retrieved): New function.
3144 (record_child_status_change): Use it.
3145 Accept negative 1st argument, which means to wait for the
3146 processes that Emacs already knows about. Move special-case code
3147 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3148 processes that have already been waited for, by testing and
3149 clearing new 'alive' member.
3150 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3151 now does this internally.
3152 (handle_child_signal): Let record_child_status_change do all
3153 the work, since we do not want to reap all exited child processes,
3154 only the child processes that Emacs itself created.
3155 * process.h (Lisp_Process): New boolean member 'alive'.
3156
0d879dca
PE
3157 Omit duplicate definitions no longer needed with gcc -g3.
3158 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3159 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3160 Define only as macros. There's no longer any need to also define
3161 these symbols as enums or as constants, since we now assume
3162 gcc -g3 when debugging.
3163
3478f4b5
EZ
31642012-11-03 Eli Zaretskii <eliz@gnu.org>
3165
3166 * lisp.mk: Adjust comments to the fact that term/internal is now
3167 loaded from loadup.el.
3168
3169 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3170 (msdos_fatal_signal): New function.
3171 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3172 its argument list.
3173
3174 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3175 for GCC versions before 4.
3176 (emacs_raise): Define to call msdos_fatal_signal.
3177
3178 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3179 iterator when starting in the middle of a display or overlay
3180 string. (Bug#12745)
3181
85fabcb7
CY
31822012-11-03 Chong Yidong <cyd@gnu.org>
3183
3184 * process.c (wait_reading_process_output): Clean up the last
3185 change.
3186
893cc455
CY
31872012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3188
3189 * process.c (wait_reading_process_output): Avoid a race condition
3190 with SIGIO delivery (Bug#11536).
3191
0f7b074f
CY
31922012-11-03 Chong Yidong <cyd@gnu.org>
3193
3194 * buffer.c (cursor_type): Untabify docstring.
3195
3737fee7
DA
31962012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3197
3198 * frame.h (struct frame): Drop can_have_scroll_bars member
3199 which is meaningless for a long time. Adjust comments.
3200 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3201 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3202
b6a9e8b1
DA
32032012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3204
3205 * window.c (decode_next_window_args): Update window arg after
3206 calling decode_live_window and so fix crash reported at
3207 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3208 by Juanma Barranquero <lekktu@gmail.com>.
3209 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3210 * font.c (Ffont_at): Likewise.
3211
600d4768
JD
32122012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3213
3214 * widget.c (resize_cb): New function.
3215 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3216 (EmacsFrameResize): Check if all is up to date before changing frame
3217 size.
3218
1005b4b9
EZ
32192012-11-02 Eli Zaretskii <eliz@gnu.org>
3220
3221 Implement backtrace output for fatal errors on MS-Windows.
3222 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3223 (BACKTRACE_LIMIT_MAX): New macro.
3224 (w32_backtrace): New function.
3225 (emacs_abort): Use w32_backtrace when the user chooses not to
3226 attach a debugger. Update the text of the abort dialog.
3227
b9e9df47
DA
32282012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3229
3230 Window-related stuff cleanup here and there.
3231 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3232 Use decode_any_window.
3233 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3234 * xdisp.c (Fformat_mode_line): Likewise.
3235 * font.c (Ffont_at): Use decode_live_window.
3236 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3237 * window.c (decode_next_window_args): Likewise.
3238 (decode_any_window): Remove static.
3239 * window.h (decode_any_window): Add prototype.
3240 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3241 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3242 respectively.
3243
2b371ff7
DA
32442012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3245
3246 Remove pad from struct input_event.
3247 * termhooks.h (struct input_event): Remove padding field.
3248 Adjust comment.
3249 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3250 member is never cons for a long time. Adjust comment.
3251 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3252 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3253 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3254 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3255
7e8b50d9
EZ
32562012-11-01 Eli Zaretskii <eliz@gnu.org>
3257
3258 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3259
322aea6d
PE
32602012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3261
3262 Fix crash when using Emacs as commit editor for git (Bug#12697).
3263 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3264 and it is configured in conf_post.h.
3265 (Fcall_process): Don't invoke both setsid and setpgid; the former
3266 is enough, if it exists.
3267 * callproc.c (Fcall_process, child_setup):
3268 * process.c (create_process): Use setpgid.
3269 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3270 for the real thing.
3271 * dispnew.c (init_display): Initialize the foreground group
3272 if we are running a tty display.
3273 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3274 * lisp.h (init_foreground_group): New decl.
3275 * sysdep.c (inherited_pgroup): New static var.
3276 (init_foreground_group, tcsetpgrp_without_stopping)
3277 (narrow_foreground_group, widen_foreground_group): New functions.
3278 (init_sys_modes): Narrow foreground group.
3279 (reset_sys_modes): Widen foreground group.
3280
220cb2bd
MA
32812012-10-31 Michael Albinus <michael.albinus@gmx.de>
3282
3283 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3284
218e997a
MR
32852012-10-31 Martin Rudalics <rudalics@gmx.at>
3286
3287 * minibuf.c (read_minibuf): Restore current buffer since
3288 choose_minibuf_frame calling Fset_frame_selected_window may
3289 change it (Bug#12766).
3290
02615da0
JD
32912012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3292
3293 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3294
aee5b18e
KH
32952012-10-30 Kenichi Handa <handa@gnu.org>
3296
3297 * font.c (Ffont_at): If WINDOW is specified and it is not
3298 displaying the current buffer, signal an error.
3299
ba116008
DC
33002012-10-29 Daniel Colascione <dancol@dancol.org>
3301
de5ef41a
SM
3302 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3303 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3304 here...
3305
3306 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3307 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3308 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3309
640bf8ad
EZ
33102012-10-28 Eli Zaretskii <eliz@gnu.org>
3311
3312 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3313 (timer_loop, getitimer, setitimer): Use it instead of
3314 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3315 'clock'.
3316 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3317 literal 10000.
3318
64ccff5f
JD
33192012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3320
3321 * nsterm.m (NO_APPDEFINED_DATA): New define.
3322 (last_appdefined_event_data): New variable
3323 (last_appdefined_event): Remove.
3324 (ns_select): Initialize t from last_appdefined_event_data instead
3325 of [last_appdefined_event data1].
3326 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3327 remove last_appdefined_event (Bug#12698).
3328
e483264c
SM
33292012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3330
3331 * frame.c (x_set_font): Catch internal error.
3332
6c16c13e
EZ
33332012-10-27 Eli Zaretskii <eliz@gnu.org>
3334
e483264c
SM
3335 Avoid overflow in w32 implementation of interval timers.
3336 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3337 actually executes.
3338 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3339 'volatile ULONGLONG' types. All the other data which was
3340 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3341 (GetThreadTimes_Proc): New typedef.
3342 (w32_get_timer_time): New function, returns a suitable time value
3343 for the timer.
3344 (timer_loop): Enter critical section when accessing ULONGLONG
3345 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3346 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3347 Remove unused variable.
6c16c13e
EZ
3348 (init_timers): Initialize s_pfn_Get_Thread_Times.
3349 (start_timer_thread): Don't assign itimer->caller_thread here.
3350 (getitimer): Assign itimer->caller_thread here.
3351 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3352 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3353
ccc83f50
EZ
33542012-10-26 Eli Zaretskii <eliz@gnu.org>
3355
3356 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3357 mouse movement events if the menu bar is active. This avoids
3358 producing a busy "hour-glass" cursor by Windows if the mouse
3359 pointer is positioned over a tooltip shown for some menu item.
3360
69deda53
PE
33612012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3362
3363 Don't assume process IDs fit in int.
3364 * emacs.c (shut_down_emacs) [!DOS_NT]:
3365 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3366 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3367 Use pid_t, not int, to store process IDs, as 'int'
3368 is not wide enough on a few platforms (e.g., AIX and IRIX).
3369
7e70a152
KH
33702012-10-23 Kenichi Handa <handa@gnu.org>
3371
3372 The following change is to make face-font-rescale-alist work
3373 correctly for non-ASCII fonts.
3374
3375 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3376 (font_open_for_lface): Handle Vface_font_rescale_alist.
3377
49238e7f
CY
33782012-10-23 Chong Yidong <cyd@gnu.org>
3379
3380 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3381
5ec86886
JD
33822012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3383
ef446959
JD
3384 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3385 for screen font.
3386 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3387
5ec86886
JD
3388 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3389 event (Bug#12681).
3390
ee7a418d
GM
33912012-10-21 Glenn Morris <rgm@gnu.org>
3392
3393 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3394
4973679b
PE
33952012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3396
3397 Port to OpenBSD 5.1.
3398 * frame.c (Fmouse_position, Fmouse_pixel_position):
3399 * xdisp.c (produce_stretch_glyph):
3400 Declare local vars only when they're needed.
3401 This is clearer and avoids a warning on OpenBSD about unused vars.
3402 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3403 This is safer, and avoids OpenBSD warnings about unused vars.
3404 * keyboard.c (record_menu_key): Remove unnecessary decl.
3405 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3406 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3407 as our definition clashes with OpenBSD's.
3408 * xfaces.c (load_face_colors, check_lface_attrs)
3409 (get_lface_attributes_no_remap, get_lface_attributes)
3410 (lface_fully_specified_p, x_supports_face_attributes_p)
3411 (tty_supports_face_attributes_p, face_fontset, realize_face)
3412 (realize_x_face, realize_tty_face):
3413 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3414 merely Lisp_Object *. This is more informative and avoids
3415 a warning on OpenBSD about accessing beyond an object's size.
3416
c664f463
CY
34172012-10-20 Chong Yidong <cyd@gnu.org>
3418
3419 * lread.c (Fload): Doc fix (Bug#12592).
3420
6ec83f92 34212012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
3422
3423 * font.c (Ffont_at): Fix previous change.
3424
d2824928
EZ
34252012-10-19 Eli Zaretskii <eliz@gnu.org>
3426
e483264c
SM
3427 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3428 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
3429 for the reasons.
3430
d2824928
EZ
3431 * alloc.c (NSTATICS): Decrease to 0x800.
3432
f60d391f
SM
34332012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3434
4a0e1924 3435 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
3436 error (bug#12677).
3437
1a9327d5
JD
34382012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3439
3440 * nsterm.m (ns_select): Check writefds before call to
3441 FD_ISSET (Bug#12668).
3442
14145a1e
DC
34432012-10-18 Daniel Colascione <dancol@dancol.org>
3444
3445 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3446 (staticpro): If we run out of staticpro slots, die with an
3447 informative error instead of just calling emacs_abort.
3448
1f76f6f5
MR
34492012-10-18 Martin Rudalics <rudalics@gmx.at>
3450
3451 Fix two flaws reported by Dmitry Antipov.
3452 * window.c (Ftemp_output_buffer_show): Remove.
3453 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3454 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3455
fcf14875
EZ
34562012-10-17 Eli Zaretskii <eliz@gnu.org>
3457
1f76f6f5
MR
3458 * makefile.w32-in ($(BLD)/w32.$(O)):
3459 ($(BLD)/vm-limit.$(O)):
3460 ($(BLD)/term.$(O)):
3461 ($(BLD)/unexw32.$(O)):
3462 ($(BLD)/fileio.$(O)):
a68089e4
EZ
3463 ($(BLD)/dispnew.$(O)): Update dependencies.
3464
3465 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3466 Add prototypes.
3467
3468 * w32proc.c: Include ctype.h.
3469
3470 * w32.h (init_environment, check_windows_init_file)
3471 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3472 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3473 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3474 (sys_link): Add prototypes.
3475
3476 * w32.c: Include w32select.h.
3477 (sys_access, e_malloc, sys_select): Add prototypes.
3478 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3479
3480 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3481
3482 * unexw32.c: Include lisp.h and w32.h.
3483
3484 * term.c [WINDOWSNT]: Include w32term.h.
3485
3486 * process.c [WINDOWSNT]: Add prototype of sys_select.
3487
3488 * fileio.c [WINDOWSNT]: Include w32.h.
3489
3490 * dispnew.c [WINDOWSNT]: Include w32.h.
3491
fcf14875
EZ
3492 * cygw32.c (Fcygwin_convert_path_to_windows)
3493 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3494 Lisp_Object values. (Bug#12661)
3495
3496 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3497 to Lisp_Object. (Bug#12661)
3498
fe0b1ec4
KH
34992012-10-17 Kenichi Handa <handa@gnu.org>
3500
3501 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3502 invalidate.
3503
d556ebf9
DA
35042012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3505
3506 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 3507 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 3508
f0863a54
DA
35092012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3510
3511 Do not verify indirection counters of killed buffers (Bug#12579).
3512 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3513 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3514
12fbe755
DA
35152012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3516
3517 * alloc.c (Fmake_byte_code): Fix typo in comment.
3518 * print.c (print_interval): Define as static to match prototype.
3519 * indent.c (disptab_matches_widthtab, recompute_width_table):
3520 Convert to eassert.
3521
61655b89
DA
35222012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3523
3524 * editfns.c (get_system_name): Remove.
3525 * lisp.h (get_system_name): Remove prototype.
3526 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3527 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3528
9520f2f2
DC
35292012-10-15 Daniel Colascione <dancol@dancol.org>
3530
3531 * dbusbind.c: Add comment explaining reason for previous change.
3532
dca778d5
MR
35332012-10-15 Martin Rudalics <rudalics@gmx.at>
3534
3535 * window.c (Fwindow_end): Rewrite check whether cached position
3536 can be used (Bug#12600).
3537 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3538 Set windows_or_buffers_changed.
3539
3e0341b0
DC
35402012-10-15 Daniel Colascione <dancol@dancol.org>
3541
3542 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3543 enabled by undefining the symbol "interface", which the platform
3544 headers define to something incompatible.
3545
33d4113c
DC
35462012-10-14 Daniel Colascione <dancol@dancol.org>
3547
3548 * image.c (init_tiff_functions, init_imagemagick_functions)
3549 (init_svg_functions): Fix cygw32 build break by using these
3550 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3551
a36fb15e
JD
35522012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3553
3554 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3555
537f336d
JD
35562012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3557
3558 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3559
0ba06a77
KH
35602012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3561
3562 * coding.c (detect_coding): Set coding->id before calling
3563 this->detector.
3564
ce2fe65a
AS
35652012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3566
3567 * fileio.c: Formatting fixes.
3568
d6453ce4
PE
35692012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 Fix some stat-related races.
3572 * fileio.c (Fwrite_region): Avoid race condition if a file is
3573 removed or renamed by some other process immediately after Emacs
3574 writes it but before Emacs stats it. Do not assume that stat (or
3575 fstat) succeeds.
3576 * image.c (slurp_file): Resolve the file name with fopen + fstat
3577 rather than stat + fopen.
3578 (pbm_read_file) [0]: Remove unused code with stat race.
3579 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3580 Remove ineffective code with stat race.
3581
06485aa8
SM
35822012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3583
3584 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3585
167e3640
JD
35862012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3587
3588 * nsterm.m (hold_event_q): New static variable.
3589 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3590 ! q_event_ptr.
3591 (hold_event): New function.
3592 (ns_read_socket): If hold_event_q have events, store them and
3593 return (Bug#12384).
3594 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3595 is zero (Bug#12384).
3596
c40239df
JB
35972012-10-12 Juanma Barranquero <lekktu@gmail.com>
3598
3599 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3600
bb385a92
EZ
36012012-10-12 Eli Zaretskii <eliz@gnu.org>
3602
2a9f1099
EZ
3603 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3604
bb385a92
EZ
3605 * fileio.c (check_existing): New function.
3606 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3607 instead of calling 'stat', when what's needed is to check whether
3608 a file exists. This avoids expensive system calls on MS-Windows.
3609 (Bug#12587)
3610
8599b23a 3611 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3612
3613 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3614 determine whether a file exists and is not a directory.
3615
3616 * lisp.h (check_existing): Add prototype.
3617
2b9c2e68
JD
36182012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3619
3620 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
3621
81749a23
GM
36222012-10-12 Glenn Morris <rgm@gnu.org>
3623
3624 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
3625
5253a5fd
SM
36262012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3627
389a94a5
SM
3628 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
3629
5253a5fd
SM
3630 * eval.c (Fautoload): Remember previous autoload status in load-history.
3631
7cded46f
PE
36322012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3633
3634 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
3635 * lread.c (load_each_byte, new_backquote_flag, readchar)
3636 (read_filtered_event, lisp_file_lexically_bound_p)
3637 (safe_to_load_version, Fload, complete_filename_p, openp)
3638 (build_load_history, readevalloop, read_escape, read1)
3639 (string_to_number, read_vector, read_list):
3640 * macros.c (Fstart_kbd_macro):
3641 * marker.c (CONSIDER):
3642 * menu.c (parse_single_submenu, digest_single_submenu)
3643 (find_and_return_menu_selection, Fx_popup_menu):
3644 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
3645 (Ftry_completion):
3646 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
3647 (ns_menu_show):
3648 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
3649 (xmenu_show, xdialog_show):
3650 Use bool for booleans.
3651 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
3652 as it's not a predicate. All uses changed. Omit unnecessary
3653 buffer termination.
3654
549c3414
DA
36552012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
3656
3657 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
3658 (save_excursion_restore): Do not restore mark if it was not saved.
3659
e85aafe7
PE
36602012-10-11 Paul Eggert <eggert@cs.ucla.edu>
3661
fd2f90cf
PE
3662 * marker.c (cached_modiff): EMACS_INT, not int.
3663
c1af190b
PE
3664 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
3665 instead of having a wrong decl.
e85aafe7
PE
3666 * nsmenu.m (waiting_for_input): Remove wrong decl.
3667
e738ca56
PE
36682012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3669
9fa1de30
PE
3670 keyboard.c, keymap.c: Use bool for booleans.
3671 * dispnew.c (sit_for): Distinguish between 3-way display_option
3672 and boolean do_display.
3673 * keyboard.c (single_kboard, this_command_key_count_reset)
3674 (waiting_for_input, echoing, immediate_quit, input_pending)
3675 (interrupt_input, interrupts_deferred, pop_kboard)
3676 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
3677 (command_loop_1, adjust_point_for_property)
3678 (safe_run_hooks_error, input_polling_used, read_char):
3679 (help_char_p, readable_events, kbd_buffer_events_waiting)
3680 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
3681 (lucid_event_type_list_p, get_input_pending):
3682 (gobble_input, menu_separator_name_p, menu_bar_item)
3683 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
3684 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
3685 (keyremap_step, test_undefined, read_key_sequence)
3686 (detect_input_pending, detect_input_pending_ignore_squeezables)
3687 (detect_input_pending_run_timers, requeued_events_pending_p)
3688 (quit_throw_to_read_char, Fset_input_interrupt_mode):
3689 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
3690 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
3691 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
3692 (accessible_keymaps_1, Fkey_description, push_key_description):
3693 (shadow_lookup, struct where_is_internal_data)
3694 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
3695 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
3696 (describe_map, describe_vector):
3697 * menu.c (single_menu_item):
3698 * nsmenu.m (ns_update_menubar):
3699 * process.c (wait_reading_process_output):
3700 * search.c (scan_buffer, scan_newline):
3701 Use bool for boolean.
3702 * keyboard.c (timers_run, swallow_events)
3703 (detect_input_pending_run_timers):
3704 * process.c (wait_reading_process_output):
3705 Use unsigned for counter where wraparound-on-overflow is desired,
3706 since unsigned is guaranteed to have that behavior and signed is not.
3707 (read_char): Use ptrdiff_t for string length.
3708 (get_input_pending): Remove first argument, since it was always
3709 the same pointer-to-int (now pointer-to-boolean) &input_pending,
3710 and behave as if it had that value. Return new value of
3711 input_pending. All callers changed.
3712 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
3713 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
3714 a string length.
3715 * keymap.c (push_key_description): Omit last arg, which was always 1.
3716 All callers changed.
3717
e738ca56
PE
3718 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
3719
29f21cdf
JB
37202012-10-10 Juanma Barranquero <lekktu@gmail.com>
3721
3722 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
3723 ($(BLD)/term.$(O)): Update dependencies.
3724
6aea7528
DA
37252012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3726
3727 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
3728 * lisp.h (enum pvec_type): Adjust comments and omit explicit
3729 initializer for PVEC_NORMAL_VECTOR.
3730
5f3f57be
PE
37312012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3732
3733 Clean out old termopts cruft.
3734 * termopts.h (flow_control, meta_key): Remove unused decls.
3735 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
3736 Don't include termopts.h.
3737
3e98c68e
DA
37382012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
3739
3740 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
3741
77e344e5
PE
37422012-10-10 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 * commands.h (immediate_quit): Remove duplicate decl.
3745
5683d7cd
JD
37462012-10-09 Jan Djärv <jan.h.d@swipnet.se>
3747
3748 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
3749 caching.
3750 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 3751 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 3752
cf5fc6db
EZ
37532012-10-09 Eli Zaretskii <eliz@gnu.org>
3754
b15736e6
EZ
3755 * w32fns.c (w32_last_error): Change the return value to DWORD, to
3756 match what GetLastError returns. Explain why the function is
3757 needed.
3758
cf5fc6db
EZ
3759 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
3760 'is_tooltip_frame', to avoid confusion with its global namesake.
3761
f99714ce
DC
37622012-10-08 Daniel Colascione <dancol@dancol.org>
3763
3764 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
3765 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
3766 build that caused Emacs to display the hourglass cursor forever.
f99714ce 3767
fd59cb29
GM
3768 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
3769 which is broken under remote desktop, calculate the number of
3770 colors available for a display based on the display's number of
3771 planes and number of bits per pixel per plane. (bug#10397).
3772
62c480c9 37732012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 3774
62c480c9
JD
3775 * nsfont.m (Vfonts_in_cache): New variable.
3776 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
3777 are used. Add cached fonts to Vfonts_in_cache.
3778 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
3779
607446ba
JB
37802012-10-08 Juanma Barranquero <lekktu@gmail.com>
3781
fd5125ad
JB
3782 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
3783 in nt/config.nt.
46979e0b
JB
3784 (FONT_H): Define after FRAME_H.
3785 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
3786 Update dependencies.
fd5125ad 3787
607446ba
JB
3788 * w32term.c: Remove leftover declaration of keyboard_codepage.
3789
b6f4e300
EZ
37902012-10-08 Eli Zaretskii <eliz@gnu.org>
3791
c54ebba4
EZ
3792 * makefile.w32-in (FONT_H): Add $(FRAME_H).
3793 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
3794 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
3795 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
3796 ($(BLD)/unexw32.$(O)):
3797 ($(BLD)/w32.$(O)):
3798 ($(BLD)/w32console.$(O)):
3799 ($(BLD)/w32fns.$(O)):
3800 ($(BLD)/w32heap.$(O)):
3801 ($(BLD)/w32menu.$(O)):
15c720a3 3802 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 3803
b6f4e300
EZ
3804 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
3805 'const char *'.
3806 (x_to_w32_color): Don't modify the argument, modify a copy instead.
3807
501199a3
DC
38082012-10-08 Daniel Colascione <dancol@dancol.org>
3809
3810 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
3811 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
3812 accidental message numbering hole. Change other messages to
3813 match.
3814
3815 * w32select.h (HAVE_W32SELECT): Remove.
3816
3817 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 3818 w32common.h instead of w32heap.h.
501199a3
DC
3819
3820 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
3821 (get_allocation_unit, get_processor_type, get_w32_major_version)
3822 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3823 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3824 (OS_NT, os_subtype, cache_system_info): Move declarations to
3825 w32common.
3826
3827 * w32heap.c: Include w32common.h.
3828 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
3829 (w32_minor_version, w32_build_number, w32_subtype):
3830 Remove duplicate definitions.
501199a3
DC
3831
3832 * w32fns.c: Include w32common.h; include w32heap.h only in
3833 WINDOWSNT.
3834
3835 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
3836 Use `report_file_error' instead of `error' in order to better
3837 inform users of what went wrong. Increase NTGUI_UNICODE file
3838 dialog box file name length to 32k, the maximum allowed by the NT
3839 kernel.
3840
3841 * w32common.h: New file.
3842 (ROUND_UP, ROUND_DOWN, get_page_size)
3843 (get_allocation_unit, get_processor_type, get_w32_major_version)
3844 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
3845 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
3846 (OS_NT, os_subtype, cache_system_info): Move here.
3847
3848 * unexw32.c, unexcw.c: Include w32common.h.
3849
3850 * emacs.c (main): Use (defined (WINDOWSNT) || defined
3851 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
3852 to call syms_of_w32select.
3853
3854 * cygw32.h: Remove obsolete EXFUN declarations.
3855
3856 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
3857
3858 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
3859 of w32inevt.o from SOME_MACHINE_OBJECTS.
3860
93aa5c81
DC
38612012-10-08 Daniel Colascione <dancol@dancol.org>
3862
3863 * image.c: Permanent fix for JPEG compilation issue --- limit
3864 jpeglib `boolean' redefinition to Cygwin builds.
3865
d424f3d8
EZ
38662012-10-08 Eli Zaretskii <eliz@gnu.org>
3867
8ee4c6ce
EZ
3868 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
3869
d424f3d8
EZ
3870 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
3871 Cygwin.
3872
e08348a0
DC
38732012-10-08 Daniel Colascione <dancol@dancol.org>
3874
3875 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
3876 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
3877 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
3878 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
3879 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
3880 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
3881 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
3882 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
3883 now a supported configuration.
3884
3885 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 3886 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
3887
3888 * conf_post.h:
3889 (_DebPrint) declare tracing facility for W32 debugging. We need
3890 to unify tracing later.
3891
3892 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
3893 unconditional use of W32 Unicode functions. Cygwin runs only on
3894 100% Unicode operating systems.
3895
3896 * cygw32.c: New file. Define Cygwin-specific facilities.
3897 (Fcygwin_convert_path_to_windows)
3898 (Fcygwin_convert_path_from_windows): New user functions for
3899 accessing Cygwin path-munging routines.
3900
3901 * cygw32.h: New file.
3902 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
3903 UTF-16LE strings temporarily inside non-Lisp-visible string
3904 objects.
3905
3906 (w32_strerror): Just what it says on the tin.
3907
3908 * emacs.c: Make the NS fork-then-exec code for daemon-launching
3909 also run for Cygwin; both systems have the same problem with using
3910 GUI facilities in a forked child. Also call syms_of_cygw32,
3911 syms_of_w32select in correct places.
3912
3913 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
3914 needs fork-then-exec for daemon launching.
3915
3916 * font.h: Include frame.h.
3917
3918 * image.c: Use the image library cache machinery only when we're
3919 compiling for native WINDOWSNT; Cygwin can use shared libraries
3920 like any other Unixlike system.
3921
3922 * keyboard.c: Clarify a comment regarding the input loop.
3923
3924 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
3925 functions directly instead of trying to detect at runtime that our
3926 host operating system supports them. We make this change for two
3927 reasons: Cygwin lacks support for the multibyte character
3928 conversion functions used by the legacy menu code, and Cygwin
3929 never needs to rely on non-Unicode APIs.
3930
3931 * unexw32.c (hinst): Declare extern.
3932
3933 * w32.c: Change header order;
3934 (w32_strerror): Move to w32fns.c because we need it for
3935 non-WINDOWSNT builds.
3936
3937 * w32.h: Add #error macro to make sure we don't include w32.h for
3938 Cygwin builds. Remove w32select declarations.
3939
3940 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 3941 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
3942
3943 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
3944 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
3945 POSIXy alternative.
3946 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
3947 (w32_major_version, w32_minor_version, w32_build_number)
3948 (os_subtype, sound_type): Define here
3949 (w32_defined_color): Make color parameter const for consistency
3950 with other _defined_color functions.
3951 (w32_createwindow): Unconditionally call w32_init_class instead of
3952 doing so only when hprevinst is non-NULL. Plumbing hprevinst
3953 through the code is complex and unnecessary because class
3954 registration is practically free.
3955 (w32_name_of_message): New EMACSDEBUG-only function.
3956 (Fset_message_beep): Move here
3957 (Fx_open_connection): Require that the display name for Windows be
3958 "w32" for consistency, emacsclient disambiguation, and maybe, one
3959 day, multi-window-system support.
3960 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
3961 Cygwin files for W32 GUI facilities, since these clearly don't
3962 expect Cygwin names.
3963 (_DebPrint): Define.
3964 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
3965 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
3966 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
3967 (w32_last_error): Remove.
3968
3969 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
3970
3971 * w32heap.c (syspage_mask): Declare here.
3972 (cache_system_info): Remove.
3973
3974 * w32inevt.c (faked_key): Define globally, not statically.
3975 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
3976 (w32_console_toggle_lock_key): Move to w32fns.c.
3977
3978 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
3979
3980 * w32proc.c (_DebPrint): Move to w32fns.c.
3981 * w32select.c: Include string.h, stdio.h for Cygwin.
3982 * w32select.h: New File.
3983
3984 * w32term.c: Include io.h for non-CYGWIN builds; needed for
3985 get_osfhandle.
3986 (w32_message_fd): New variable. Under Cygwin, holds the file
3987 descriptor the system used to tell us about pending thread
3988 messages.
3989
3990 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
3991 that prevented compilation under non-WINDOWSNT systems.
3992
3993 (w32_initialize): Open /dev/windows and assign it to
3994 w32_message_fd. Provide w32 feature.
3995
3996 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
3997 (WM_EMACS_INPUT_READY): add.
3998 (prepend_msg, w32_message_fd): Declare globally.
3999
4000 * w32xfns.c:
4001 (keyboard_handle): Use only when WINDOWSNT.
4002 (notify_msg_ready): New function. Posts a message to the main
4003 thread's message queue under CYGWIN, which wakes up the main
4004 thread from select(2) by making the /dev/windows file descriptor
4005 ready. Under WINDOWSNT, it sets an event the same way the old
4006 code did.
4007
4008 (post, prepend_msg): Actually call notify_msg_ready instead of
4009 setting the input event directly.
4010
98daa893
EZ
40112012-10-07 Eli Zaretskii <eliz@gnu.org>
4012
4013 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4014 but it still has blocs in it, don't return it to the system,
4015 instead of aborting. (Bug#12402)
4016
3bc0a2f7
JD
40172012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4018
8ad5b73b 4019 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 4020
335f5ae4
JD
4021 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4022 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
4023 (syms_of_nsterm): Remove comment about Panther and above for
4024 ns-antialias-text.
335f5ae4
JD
4025 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4026 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4027 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4028
4029 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4030 MAC_OS_X_VERSION_10_4.
4031
8ad5b73b
JD
4032 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4033 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
4034
4035 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4036
4037 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4038 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4039
3bc0a2f7
JD
4040 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4041 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
4042 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4043 Remove ns_in_resize check.
3bc0a2f7
JD
4044 (ns_clear_frame_area): Remove resize handle code.
4045
4046 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
4047 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4048 Remove ns_in_resize check.
3bc0a2f7 4049
c622b48f
PE
40502012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4051
4052 Improve sys_siglist detection.
4053 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4054 defined as a macro, as is done in Solaris.
4055 (sys_siglist_entries): New macro.
4056 (save_strsignal): Use it.
4057 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4058 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4059
04fafa46
JD
40602012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4061
4062 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4063 fullscreen/Fullscreen.
4064
4065 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4066 tobar_height is new.
4067
4068 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4069 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4070 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4071 (windowDidResize:): Check for correct window if old style fullscreen.
4072 Capitalize word in comment. Remove incorrect comment.
4073 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4074 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4075 error in drawing background.
1f9f395d 4076 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
4077 Set toolbar values to zero, save old height in tobar_height.
4078 Restore tool bar height when leaving fullscreen.
4079 (canBecomeMainWindow): New function.
4080
c6e21c03
PE
40812012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4084
0d9f584b
EZ
40852012-10-05 Eli Zaretskii <eliz@gnu.org>
4086
a65fbb5f
EZ
4087 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4088
0d9f584b 4089 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
4090 that time stamps of directories could also be changed.
4091 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
4092 FILE_WRITE_ATTRIBUTES access rights.
4093
4094 * fileio.c (Fset_file_times): Special-case ignoring errors for
4095 directories only on MSDOS, not on MS-Windows.
4096
e8757f09 40972012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
4098
4099 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4100
7604f298
EZ
41012012-10-04 Eli Zaretskii <eliz@gnu.org>
4102
4103 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4104 see whether CreateFile failed.
4105
88d69b7d
PE
41062012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4109 to avoid similar races.
4110 * keyboard.c (pending_signals): Now bool, not int.
4111
7509f454
PE
4112 Port timers to OpenBSD, plus check for timer failures.
4113 OpenBSD problem reported by Han Boetes.
4114 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4115 and/or setitimer.
4116 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4117 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4118 like OpenBSD, which has timer_settime but does not declare it.
4119 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4120 whether to use itimerspec-related primitives. All uses of
4121 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4122
a3c5c0c5
PE
41232012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4124
4125 * profiler.c (handle_profiler_signal): Fix a malloc race
4126 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4127
914e743b
JD
41282012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4129
4130 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4131
d8ab37a8
EZ
41322012-10-02 Eli Zaretskii <eliz@gnu.org>
4133
4134 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4135 consistent with the change in return value of 'safe_strsignal'.
4136
b3ecad33
PE
41372012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4138
0a99eee1
PE
4139 Prefer plain 'static' to 'static inline' (Bug#12541).
4140 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4141 (bidi_set_sor_type, bidi_push_embedding_level)
4142 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4143 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4144 (bidi_cache_search, bidi_cache_ensure_space)
4145 (bidi_cache_iterator_state, bidi_cache_find)
4146 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4147 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4148 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4149 Now 'static', not 'static inline'.
4150
b3ecad33
PE
4151 Count overruns when profiling; change units to ns.
4152 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4153 Give extra weight to samples after overruns, to attempt to count
4154 the time more accurately.
4155 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4156 the underlying primitives nominally do ns.
4157 (Fprofiler_cpu_start): Document the change. Mention that
4158 the sampling intervals are only approximate.
4159
090cf9db
SM
41602012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4161
4162 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4163
4164 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4165 case for the special 0 coding-system.
4166
4167 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4168 (Fmake_overlay): Remove redundant tests.
64edc777 4169 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 4170
81550bf4
JB
41712012-10-02 Juanma Barranquero <lekktu@gmail.com>
4172
4173 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4174 Update dependencies.
4175
aa1ba90e
PE
41762012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4177
4178 Fix a malloc race condition involving strsignal.
4179 A signal can arrive in the middle of a malloc, and Emacs's signal
4180 handler can invoke strsignal, which can invoke malloc, which is
4181 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4182 Fix it by altering the signal handler so that it does not invoke
4183 strsignal.
4184 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4185 * process.c (status_message): Use const pointer, in case strsignal
4186 is #defined to safe_strsignal.
4187 * sysdep.c (sys_siglist, init_signals): Always define and
4188 initialize a substitute sys_siglist if the system does not define
4189 one, even if HAVE_STRSIGNAL.
4190 (safe_strsignal): Rename from strsignal. Always define,
4191 using sys_siglist. Return a const pointer.
4192 * syssignal.h (safe_strsignal): New decl.
4193 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4194
ace917bd
EZ
41952012-10-01 Eli Zaretskii <eliz@gnu.org>
4196
4197 * w32proc.c (timer_loop): Fix code that waits for timer
4198 expiration, to avoid high CPU usage.
4199
9eb71b9c
SM
42002012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4201
4202 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4203 (sweep_weak_table): Remove redundant prototypes.
4204
b3317662
FP
42052012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4206
4207 * emacs.c: Move the inclusion of TERM_HEADER after including
4208 windows.h on WINDOWSNT. This avoids compilation problems with
4209 MSVC.
4210
f0e5f225
EZ
42112012-10-01 Eli Zaretskii <eliz@gnu.org>
4212
2d7d1608
EZ
4213 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4214 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4215 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4216 as the previous version used 'void *'.
4217
4218 * ralloc.c (ROUNDUP): Fix last change.
4219 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4220 'size_t'.
4221
f0e5f225
EZ
4222 * w32proc.c <disable_itimers>: New static flag.
4223 (init_timers): Initialize it to zero, after creating the critical
4224 sections used by the timer threads.
4225 (term_timers): Set to 1 before deleting the critical sections.
4226 (getitimer, setitimer): If disable_itimers is non-zero, return an
4227 error indication without doing anything. Reported by Fabrice
4228 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
4229 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4230 return results.
4231 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4232 support timers.
f0e5f225
EZ
4233
4234 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4235 term_ntproc after all the other bookkeeping, to get timers working
4236 as long as possible.
4237
82ef37c1
PE
42382012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4239
b3a4c387
PE
4240 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4241 Suggested by Juri Linkov in
4242 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4243
b0ab8123
PE
4244 Prefer plain 'static' to 'static inline' (Bug#12541).
4245 With static functions, modern compilers inline pretty well by
4246 themselves; advice from programmers often hurts as much as it helps.
4247 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4248 this change shrinks the text size of the Emacs executable by 1.1%
4249 without affecting CPU significantly in my benchmark.
4250 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4251 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4252 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4253 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4254 (bset_auto_fill_function, bset_auto_save_file_format)
4255 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4256 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4257 (bset_cache_long_line_scans, bset_case_fold_search)
4258 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4259 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4260 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4261 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4262 (bset_header_line_format, bset_indicate_buffer_boundaries)
4263 (bset_indicate_empty_lines, bset_invisibility_spec)
4264 (bset_left_fringe_width, bset_major_mode, bset_mark)
4265 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4266 (bset_name, bset_overwrite_mode, bset_pt_marker)
4267 (bset_right_fringe_width, bset_save_length)
4268 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4269 (bset_scroll_up_aggressively, bset_selective_display)
4270 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4271 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4272 (set_buffer_overlays_after):
4273 * category.c (bset_category_table):
4274 * charset.c (read_hex):
4275 * coding.c (produce_composition, produce_charset)
4276 (handle_composition_annotation, handle_charset_annotation)
4277 (char_encodable_p):
4278 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4279 (assign_row, set_frame_matrix_frame, make_current)
4280 (add_row_entry):
4281 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4282 * fns.c (maybe_resize_hash_table):
4283 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4284 * gmalloc.c (register_heapinfo):
4285 * image.c (lookup_image_type):
4286 * intervals.c (set_interval_object, set_interval_left)
4287 (set_interval_right, copy_interval_parent, rotate_right)
4288 (rotate_left, balance_possible_root_interval):
4289 * keyboard.c (kset_echo_string, kset_kbd_queue)
4290 (kset_keyboard_translate_table, kset_last_prefix_arg)
4291 (kset_last_repeatable_command, kset_local_function_key_map)
4292 (kset_overriding_terminal_local_map, kset_real_last_command)
4293 (kset_system_key_syms, clear_event, set_prop):
4294 * lread.c (digit_to_number):
4295 * marker.c (attach_marker, live_buffer, set_marker_internal):
4296 * nsterm.m (ns_compute_glyph_string_overhangs):
4297 * process.c (pset_buffer, pset_command)
4298 (pset_decode_coding_system, pset_decoding_buf)
4299 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4300 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4301 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4302 * syntax.c (bset_syntax_table, dec_bytepos):
4303 * terminal.c (tset_param_alist):
4304 * textprop.c (interval_has_some_properties)
4305 (interval_has_some_properties_list):
4306 * window.c (wset_combination_limit, wset_dedicated)
4307 (wset_display_table, wset_hchild, wset_left_fringe_width)
4308 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4309 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4310 (wset_right_fringe_width, wset_right_margin_cols)
4311 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4312 (wset_vertical_scroll_bar_type, wset_window_parameters):
4313 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4314 (wset_column_number_displayed, wset_region_showing)
4315 (window_box_edges, run_window_scroll_functions)
4316 (append_glyph_string_lists, prepend_glyph_string_lists)
4317 (append_glyph_string, set_glyph_string_background_width)
4318 (append_glyph, append_composite_glyph)
4319 (take_vertical_position_into_account):
4320 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4321 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4322 (lface_hash, lface_same_font_attributes_p, lookup_face):
4323 * xml.c (libxml2_loaded_p):
4324 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4325 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4326 Now 'static', not 'static inline'.
4327
05584c31
PE
4328 * bidi.c: Tune.
4329 (bidi_copy_it): Do the whole copy with a single memcpy.
4330 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4331
86ec63ba
PE
4332 Revert the FOLLOW-SYMLINKS change for file-attributes.
4333 Doing it right would require several changes to Tramp, and there's
4334 not enough time to get that tested before the freeze today.
4335 * dired.c (directory_files_internal, Ffile_attributes):
4336 Undo last change.
4337
82ef37c1
PE
4338 * frame.c (x_report_frame_params): Port better to wider ints.
4339 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4340 or that pointers can be printed in 15 decimal digits.
4341 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4342
62aba0d4
FP
43432012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4344
4345 Support x64 build on MS-Windows.
4346 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4347 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4348 compatibility with x64.
5e4daaf3 4349 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4350
4351 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4352 defining an XRectangle structure.
4353
4354 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4355 arithmetics for compatibility with x64.
4356
4357 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4358 compatibility with x64.
4359
4360 * w32heap.h: Adjust prototypes and declarations.
4361
4362 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4363 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4364 DWORD, long, and unsigned long, for compatibility with x64.
4365 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4366 (sbrk): Argument is now of type ptrdiff_t.
4367
4368 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4369 less than 0x0500.
4370 (w32_msg_pump): Use WPARAM type for 'result'.
4371
4372 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4373 architecture.
4374 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4375 compatibility with x64.
4376
4377 * vm-limit.c (lim_data): Now size_t.
4378 (check_memory_limits): Adjust prototypes of real_morecore and
4379 __morecore to receive argument of type ptrdiff_t. Use size_t for
4380 five_percent and data_size.
4381
4382 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4383 variables, for compatibility with x64.
4384 (rva_to_section, offset_to_section, relocate_offset)
4385 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4386 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4387 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4388 for compatibility with x64.
4389
4390 * sysdep.c (STDERR_FILENO): Define if not already defined.
4391
4392 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4393 (__morecore): Argument type is now ptrdiff_t.
4394 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4395 (relinquish): Use ptrdiff_t type for 'excess'.
4396 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4397
4398 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4399 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4400 instead of a literal number.
4401
4402 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4403 (min): Define only if not already defined.
4404
4405 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4406 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4407 hosts.
4408
4409 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4410 'bitmaps' is a pointer.
4411
4412 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4413
4414 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4415
e7a2937b
PE
44162012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4417
4418 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4419 * dired.c (directory_files_internal, Ffile_attributes):
4420 New arg follow_symlinks. All uses changed.
4421
b43d62ae
SM
44222012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4423
4424 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4425
c06c382a
EZ
44262012-09-30 Eli Zaretskii <eliz@gnu.org>
4427
4428 Support atimers and CPU profiler via profile.c on MS-Windows.
4429 * w32proc.c (sig_mask, crit_sig): New static variables.
4430 (sys_signal): Support SIGALRM and SIGPROF.
4431 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 4432 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
4433 sigfillset, and sigprocmask are no longer no-ops.
4434 (sigismember): New function.
4435 (struct itimer_data): New definition.
4436 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4437 (crit_prof): New static variables.
4438 (MAX_SINGLE_SLEEP): New definition.
4439 (timer_loop, stop_timer_thread, term_timers, init_timers)
4440 (start_timer_thread, getitimer, setitimer): New functions.
4441 (alarm): No longer a no-op, calls setitimer.
4442
4443 * w32.c (term_ntproc): Call term_timers.
4444 (init_ntproc): Make sure all signals are unblocked at startup, to
4445 erase any traces of dumping. Call init_timers.
4446
4447 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4448 Windows-specific code to display the hourglass mouse pointer is no
4449 longer used.
4450 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4451 to hourglass timer expiration.
4452 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4453 Remove, no longer used.
b43d62ae
SM
4454 (w32_note_current_window, show_hourglass, hide_hourglass):
4455 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
4456 window systems.
4457 (syms_of_w32fns): Don't initialize hourglass_timer.
4458
4459 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4460 WINDOWSNT as well.
4461 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4462
4463 * w32.h (init_timers, term_timers): Add prototypes.
4464
95402d5f
KH
44652012-09-30 Kenichi Handa <handa@gnu.org>
4466
4467 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4468 to the buffer relocation which may be caused by ccl_driver.
4469
dd946752
JD
44702012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4471
d7e642cc
JD
4472 * xfns.c (Fx_file_dialog): Update comment.
4473
4474 * w32fns.c (Fx_file_dialog): Update comment.
4475
4476 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4477 Initialize panel name field if OSX >= 10.6.
4478
4479 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4480
dd946752
JD
4481 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4482
4483 * nsterm.m (NEW_STYLE_FS): New define.
4484 (ns_fullscreen_hook, windowWillEnterFullScreen)
4485 (windowDidEnterFullScreen, windowWillExitFullScreen)
4486 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4487 (setFSValue): New functions.
4488 (EmacsFSWindow): New implementation.
4489 (canBecomeKeyWindow): New function for EmacsFSWindow.
4490 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4491 (dealloc): Release nonfs_window if in fullscreen.
4492 (updateFrameSize:): Call windowDidMove to update top/left.
4493 (windowWillResize:toSize:): Check if frame is still maximized.
4494 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4495 next_maximized, maximized_width, maximized_height and nonfs_window.
4496 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4497 tbar_height.
4498 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 4499 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
4500
4501 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4502 (EmacsView): Add variables for fullscreen.
4503 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4504 (EmacsFSWindow): New interface for fullscreen.
4505
427730eb
JB
45062012-09-30 Juanma Barranquero <lekktu@gmail.com>
4507
4508 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4509
48de8b12
CY
45102012-09-30 Chong Yidong <cyd@gnu.org>
4511
4512 * fns.c (Frandom): Doc fix.
4513
5938d519
MR
45142012-09-30 Martin Rudalics <rudalics@gmx.at>
4515
4516 * window.c (Vwindow_combination_limit): New default value.
4517 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4518
cb5b0266
PE
45192012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4520
4521 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4522 Suggested by Eli Zaretskii in
4523 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4524
84f72efd
EZ
45252012-09-30 Eli Zaretskii <eliz@gnu.org>
4526
4527 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4528 HAVE_TIMER_SETTIME is defined.
4529
9d4dcdc9
PE
45302012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4531
d89460ed
PE
4532 Profiler improvements: more-accurate timers, overflow checks.
4533 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4534 signal.h, setjmp.h. Include systime.h instead.
4535 (saturated_add): New function.
4536 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4537 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4538 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4539 New static vars.
84f72efd 4540 (enum profiler_cpu_running): New enum.
d89460ed
PE
4541 (profiler_cpu_running): Now of that enum type, not bool.
4542 All uses changed to store the new value.
4543 (handle_profiler_signal): Rename from sigprof_handler_1,
4544 for consistency with other handlers. Do not check whether
4545 cpu_log is a hash-table if garbage collecting, since it
4546 doesn't matter in that case.
4547 (deliver_profiler_signal): Rename from sigprof_handler,
4548 for consistency with other handlers.
4549 (setup_cpu_timer): New function, with much of what used to be in
4550 Fprofiler_cpu_start. Check for out-of-range argument.
4551 Prefer timer_settime if available, and prefer
4552 thread cputime clocks, then process cputime clocks, then
4553 monotonic clocks, to the old realtime clock. Use make_timeval
4554 to round more-correctly when falling back to setitimer.
4555 (Fprofiler_cpu_start): Use it.
4556 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4557 Don't assume that passing NULL as the 2nd argument of setitimer
4558 is the same as passing a pointer to all-zero storage.
4559 Ignore SIGPROF afterwards.
4560 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4561 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4562 non-fatal signal handlers. Ignore SIGPROF on startup.
4563 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4564 in profiler.c, since sysdep.c now uses it.
4565
9d4dcdc9
PE
4566 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4567 Suggested by Eli Zaretskii in
4568 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4569
8e5691a0
JB
45702012-09-29 Juanma Barranquero <lekktu@gmail.com>
4571
4572 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4573
e7c1b6ef
SM
45742012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4575
4576 * lisp.h (struct backtrace): Remove indirection for `function' field.
4577 * xdisp.c (redisplay_internal):
4578 * profiler.c (record_backtrace, sigprof_handler_1):
4579 * alloc.c (Fgarbage_collect):
4580 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4581 (Fbacktrace_frame): Adjust accordingly.
4582
e61d39cd 45832012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4584
4585 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4586 (Frun_hook_with_args_until_failure): Doc fixes.
4587
404043ea
EZ
45882012-09-28 Eli Zaretskii <eliz@gnu.org>
4589
4590 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4591 Qautomatic_redisplay and change the symbol name. All users changed.
4592
704d3f45
TM
45932012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4594
4595 * profiler.c (sigprof_handler): Fix race condition.
4596
757140ff
GM
45972012-09-28 Glenn Morris <rgm@gnu.org>
4598
4599 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4600
a615a3ae
PE
46012012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 Check more robustly for timer_settime.
89d17fd0
PE
4604 * Makefile.in (LIB_TIMER_TIME): New macro.
4605 (LIBES): Add it.
a615a3ae
PE
4606 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4607 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4608 call timer_settime.
4609
3670daf7
TM
46102012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4611
4612 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4613
6a586b7f
JB
46142012-09-26 Juanma Barranquero <lekktu@gmail.com>
4615
4616 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4617
41c8bfcf
PE
46182012-09-26 Paul Eggert <eggert@cs.ucla.edu>
4619
4620 * character.h (MAYBE_UNIFY_CHAR): Remove.
4621 * charset.c, charset.h (maybe_unify_char): Now static.
4622 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
4623 Since this stuff is now private to charset.c, there's no need for
4624 a public macro and no need to inline by hand.
4625
3a880af4
SM
46262012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4627 Stefan Monnier <monnier@iro.umontreal.ca>
4628 Juanma Barranquero <lekktu@gmail.com>
611b7507 4629
3a880af4
SM
4630 * profiler.c: New file.
4631 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
4632 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
4633 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
4634 * emacs.c (main): Call syms_of_profiler.
4635 * alloc.c (Qautomatic_gc): New constant.
4636 (MALLOC_PROBE): New macro.
4637 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
4638 (total_bytes_of_live_objects): New function.
4639 (Fgarbage_collect): Use it. Record itself in backtrace_list.
4640 Call malloc_probe for the memory profiler.
4641 (syms_of_alloc): Define Qautomatic_gc.
4642 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
4643 race condition.
4644 (struct backtrace): Move definition...
4645 * lisp.h (struct backtrace): ..here.
4646 (Qautomatic_gc, profiler_memory_running): Declare vars.
4647 (malloc_probe, syms_of_profiler): Declare functions.
4648 * xdisp.c (Qautomatic_redisplay): New constant.
4649 (redisplay_internal): Record itself in backtrace_list.
4650 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 4651
5938d519 46522012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
46532012-09-25 Juanma Barranquero <lekktu@gmail.com>
4654
4655 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
4656
e26fd2e4
PE
46572012-09-25 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 Prefer POSIX timers if available.
4660 They avoid a race if the timer is too close to the current time.
4661 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
4662 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 4663 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 4664
eedec3ee
EZ
46652012-09-25 Eli Zaretskii <eliz@gnu.org>
4666
4667 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
4668 CHAR_STRING_ADVANCE.
4669 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
4670 STRING_CHAR_ADVANCE.
4671
aa15c6bb
JB
46722012-09-25 Juanma Barranquero <lekktu@gmail.com>
4673
4674 Move Vlibrary_cache to emacs.c and reset before dumping.
4675
4676 * lisp.h (reset_image_types): Declare.
4677 [WINDOWSNT] (Vlibrary_cache): Declare.
4678
4679 * image.c (reset_image_types): New function.
4680
4681 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
4682 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
4683 (Fdump_emacs): Reset Vlibrary_cache and image_types.
4684
4685 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
4686 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
4687
4688 * w32.h (Vlibrary_cache): Do not declare.
4689
54d629be
EZ
46902012-09-25 Eli Zaretskii <eliz@gnu.org>
4691
16b22fef
EZ
4692 * w32proc.c (sys_signal): Handle all signals defined by the
4693 MS-Windows runtime, not just SIGCHLD. Actually install the signal
4694 handlers for signals supported by Windows. Don't override
4695 term_ntproc as the handler for SIGABRT.
4696 (sigaction): Rewrite to call sys_signal instead of duplicating its
4697 code.
4698 (sys_kill): Improve commentary.
4699
4700 * w32.c (term_ntproc): Accept (and ignore) one argument, for
4701 consistency with a signature of a signal handler. All callers
4702 changed.
4703 (init_ntproc): Accept an argument DUMPING. If dumping, don't
4704 install term_ntproc as a signal handler for SIGABRT, as that
4705 should be done by the dumped Emacs.
4706
4707 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
4708
4709 * w32select.c (term_w32select): Protect against repeated
4710 invocation by setting clipboard_owner to NULL after calling
4711 DestroyWindow.
4712
4713 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
4714 and term_ntproc to their modified signatures.
4715
54d629be
EZ
4716 * character.c (char_string, string_char): Remove calls to
4717 MAYBE_UNIFY_CHAR. See the discussion starting at
4718 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
4719 for the details.
4720
59f7af81
CY
47212012-09-25 Chong Yidong <cyd@gnu.org>
4722
4723 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
4724
22e8cf4a
SM
47252012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
4726
4727 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
4728 when encountering an unknown bytecode.
4729
578098f3
PE
47302012-09-24 Paul Eggert <eggert@cs.ucla.edu>
4731
4732 image.c, indent.c: Use bool for booleans.
4733 * dispextern.h (struct image_type): Members valid_p, load, init
4734 now return bool, not int. All uses changed.
4735 * image.c: Omit unnecessary static decls.
4736 (x_create_bitmap_mask, x_build_heuristic_mask):
4737 Return void, not int, since callers don't care about the return value.
4738 (x_create_bitmap_mask, define_image_type, valid_image_p)
4739 (struct image_keyword, parse_image_spec, image_spec_value)
4740 (check_image_size, image_background)
4741 (image_background_transparent, x_clear_image_1)
4742 (postprocess_image, lookup_image, x_check_image_size)
4743 (x_create_x_image_and_pixmap, xbm_image_p)
4744 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
4745 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
4746 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
4747 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
4748 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
4749 (png_image_p, init_png_functions, png_load_body, png_load)
4750 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
4751 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
4752 (init_gif_functions, gif_load, imagemagick_image_p)
4753 (imagemagick_load_image, imagemagick_load, svg_image_p)
4754 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
4755 (gs_load):
4756 * nsimage.m (ns_load_image):
4757 * nsterm.m (ns_defined_color):
4758 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
4759 * xfns.c (x_defined_color):
4760 * xterm.c (x_alloc_lighter_color_for_widget)
4761 (x_alloc_nearest_color_1, x_alloc_nearest_color)
4762 (x_alloc_lighter_color):
4763 * indent.c (disptab_matches_widthtab, current_column)
4764 (scan_for_column, string_display_width, indented_beyond_p)
4765 (compute_motion, vmotion, Fvertical_motion):
4766 Use bool for booleans.
4767
a5f2b6ec
CY
47682012-09-24 Chong Yidong <cyd@gnu.org>
4769
4770 * chartab.c (Fset_char_table_default): Obsolete function removed.
4771
18e27ea8
PE
47722012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4773
afea8a8a
PE
4774 Move pid_t related decls out of lisp.h.
4775 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
4776 (interruptible_wait_for_termination):
4777 Move these decls from lisp.h to syswait.h, since they use pid_t.
4778 Needed on FreeBSD; see Herbert J. Skuhra in
4779 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
4780 * callproc.c: Include syswait.h.
4781
18e27ea8
PE
4782 gnutls.c, gtkutil.c: Use bool for boolean.
4783 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
4784 (emacs_gnutls_handle_error):
4785 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
4786 (xg_hide_tooltip, xg_create_frame_widgets)
4787 (create_dialog, xg_uses_old_file_dialog)
4788 (xg_get_file_with_chooser, xg_get_file_with_selection)
4789 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
4790 (xg_item_label_same_p, xg_update_menubar)
4791 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
4792 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
4793 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
4794 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
4795 (update_frame_tool_bar, free_frame_tool_bar):
4796 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
4797 * nsmenu.m (ns_update_menubar):
4798 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
4799 * xfns.c (Fx_show_tip) [USE_GTK]:
4800 Use bool for boolean.
4801 * gtkutil.c (xg_update_frame_menubar):
4802 * xmenu.c (update_frame_menubar):
4803 Return void, not int, since caller ignores return value.
4804 * gtkutil.c (xg_change_toolbar_position):
4805 Return void, not 1.
4806
af0e9f75
JB
48072012-09-23 Juanma Barranquero <lekktu@gmail.com>
4808
4809 * makefile.w32-in (BLOCKINPUT_H): Remove.
4810 (SYSSIGNAL_H): New macro.
4811 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
4812 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
4813 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
4814 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
4815 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
4816 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
4817 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
4818 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
4819 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
4820 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
4821 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
4822 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
4823 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
4824 ($(BLD)/w32xfns.$(O)): Update dependencies.
4825
5101529e
EZ
48262012-09-23 Eli Zaretskii <eliz@gnu.org>
4827
4828 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
4829 fatal_error_backtrace.
4830
4831 * w32proc.c (sys_kill): Undo last change: don't do anything when
4832 invoked to deliver SIGABRT to our own process. This is now
4833 handled by emacs_raise.
4834
2c3ee0ad
JB
48352012-09-23 Juanma Barranquero <lekktu@gmail.com>
4836
4837 * w32term.c (w32_read_socket): Remove leftover reference to
4838 interrupt_input_pending.
4839
62a1d661
PE
48402012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4841
4842 Do not use SA_NODEFER.
4843 Problem reported by Dani Moncayo in
4844 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
4845 * alloc.c (die):
4846 * sysdep.c (emacs_abort): Do not reset signal handler.
4847 * emacs.c (terminate_due_to_signal): Reset signal handler here.
4848 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
4849 wanted even on POSIXish hosts, and it doesn't work on Windows.
4850
a0942b9a
JD
48512012-09-23 Jan Djärv <jan.h.d@swipnet.se>
4852
4853 * xterm.c (x_term_init): Call fixup_locale before and after calling
4854 gtk_init (Bug#12392).
4855
d07ff9db
CY
48562012-09-23 Chong Yidong <cyd@gnu.org>
4857
4858 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
4859 Vdynamic_library_alist.
4860
4861 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
4862 (Fgnutls_available_p): Caller changed.
4863
4864 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
4865 (Flibxml_parse_xml_region): Likewise.
4866
4867 * dispextern.h (struct image_type): Remove arg from init function.
4868
4869 * image.c (Finit_image_library, lookup_image_type)
4870 (define_image_type): Remove now-unneeded second arg.
4871 (init_xpm_functions, init_png_functions, init_jpeg_functions)
4872 (init_tiff_functions, init_gif_functions, init_svg_functions):
4873 Arglist and w32_delayed_load calling convention changed.
4874 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 4875 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 4876
4d7e6e51
PE
48772012-09-23 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 Simplify and avoid signal-handling races (Bug#12471).
4880 * alloc.c (die):
4881 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
4882 Avoid recursive loop if there's a fatal error in the function itself.
4883 * atimer.c (pending_atimers):
4884 * blockinput.h: Don't include "atimer.h"; no longer needed.
4885 (interrupt_input_pending): Remove. All uses removed.
4886 pending_signals now counts both atimers and ordinary interrupts.
4887 This is less racy than having three separate pending-signal flags.
4888 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
4889 (input_blocked_p):
4890 Rename from their upper-case counterparts BLOCK_INPUT,
4891 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
4892 INPUT_BLOCKED_P, and turn into functions. All uses changed.
4893 This makes it easier to access volatile variables more accurately.
4894 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
4895 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
4896 that's more reliable if the code is buggy and sets
4897 interrupt_input_blocked to a negative value. All uses changed.
4898 * atimer.c (deliver_alarm_signal):
4899 Remove. No need to deliver this to the parent; any thread can
4900 handle this signal now. All uses replaced by underlying handler.
4901 * atimer.c (turn_on_atimers):
4902 * dispnew.c (handle_window_change_signal):
4903 * emacs.c (handle_danger_signal):
4904 * keyboard.c (kbd_buffer_get_event):
4905 Don't reestablish signal handler; not needed with sigaction.
4906 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
4907 (UNBLOCK_INPUT_TO):
4908 Rework to avoid unnecessary accesses to volatile variables.
4909 (UNBLOCK_INPUT_TO): Now a function.
4910 (totally_unblock_input, unblock_input): New decls.
4911 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
4912 (init_data): Remove. Necessary stuff now done in init_signal.
4913 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
4914 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
4915 (fatal_error_code): Remove; no longer needed.
4916 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
4917 it doesn't always backtrace. All uses changed. No need to reset
4918 signal to default, since sigaction and/or die does that for us now.
4919 Use emacs_raise (FOO), not kill (getpid (), FOO).
4920 (main): Check more-accurately whether we're dumping.
4921 Move fatal-error setup to sysdep.c
4922 * floatfns.c: Do not include "syssignal.h"; no longer needed.
4923 * gtkutil.c (xg_get_file_name, xg_get_font):
4924 Remove no-longer-needed signal-mask manipulation.
4925 * keyboard.c, process.c (POLL_FOR_INPUT):
4926 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
4927 * keyboard.c (read_avail_input): Remove.
4928 All uses replaced by gobble_input.
4929 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
4930 (kbd_buffer_store_event_hold, gobble_input):
4931 (record_asynch_buffer_change) [USABLE_SIGIO]:
4932 (store_user_signal_events):
4933 No need to mess with signal mask.
4934 (gobble_input): If blocking input and there are terminals, simply
4935 set pending_signals to 1 and return. All hooks changed to not
4936 worry about whether input is blocked.
4937 (process_pending_signals): Clear pending_signals before processing
4938 them, in case a signal comes in while we're processing.
4939 By convention callers now test pending_signals before calling us.
4940 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
4941 New functions, to support changes to blockinput.h.
4942 (handle_input_available_signal): Now extern.
4943 (reinvoke_input_signal): Remove. All uses replaced by
4944 handle_async_input.
4945 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
4946 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
4947 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
4948 Clear sigmask reliably, even if Fsignal returns, which it can.
4949 Omit unnecessary accesses to volatile var.
4950 (quit_throw_to_read_char): No need to restore sigmask.
4951 * keyboard.c (gobble_input, handle_user_signal):
4952 * process.c (wait_reading_process_output):
4953 Call signal-handling code rather than killing ourselves.
4954 * lisp.h: Include <float.h>, for...
4955 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
4956 (pending_signals): Now volatile.
4957 (syms_of_data): Now const if IEEE floating point.
4958 (handle_input_available_signal) [USABLE_SIGIO]:
4959 (terminate_due_to_signal, record_child_status_change): New decls.
4960 * process.c (create_process): Avoid disaster if memory is exhausted
4961 while we're processing a vfork, by tightening the critical section
4962 around the vfork.
4963 (send_process_frame, process_sent_to, handle_pipe_signal)
4964 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
4965 ignores SIGPIPE.
4966 (send_process): No need for setjmp/longjmp any more, since the
4967 SIGPIPE stuff is now gone. Instead, report an error if errno
4968 is EPIPE.
4969 (record_child_status_change): Now extern. PID and W are now args.
4970 Return void, not bool. All callers changed.
4971 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
4972 Remove. All uses removed. This bug should be fixed now in a
4973 different way.
4974 (wait_for_termination_1): Use waitpid rather than sigsuspend,
4975 and record the child status change directly. This avoids the
4976 need to futz with the signal mask.
4977 (process_fatal_action): Move here from emacs.c.
4978 (emacs_sigaction_flags): New function, containing
4979 much of what used to be in emacs_sigaction_init.
4980 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
4981 caught by emacs, to make races less likely.
4982 (deliver_process_signal): Rename from handle_on_main_thread.
4983 All uses changed.
4984 (BACKTRACE_LIMIT_MAX): Now at top level.
4985 (thread_backtrace_buffer, threadback_backtrace_pointers):
4986 New static vars.
4987 (deliver_thread_signal, deliver_fatal_thread_signal):
4988 New functions, for more-accurate delivery of thread-specific signals.
4989 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
4990 (deliver_arith_signal): Handle in this thread, not
4991 in the main thread, since it's triggered by this thread.
4992 (maybe_fatal_sig): New function.
4993 (init_signals): New arg DUMPING so that we can be more accurate
4994 about whether we're dumping. Caller changed.
4995 Treat thread-specific signals differently from process-general signals.
4996 Block all signals while handling fatal error; that's safer.
4997 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
4998 on IEEE hosts.
4999 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5000 Ignore SIGPIPE unless batch.
5001 (emacs_backtrace): Output backtrace for the appropriate thread,
5002 which is not necessarily the main thread.
5003 * syssignal.h: Include <stdbool.h>.
5004 (emacs_raise): New macro.
5005 * xterm.c (x_connection_signal): Remove; no longer needed
5006 now that we use sigaction.
5007 (x_connection_closed): No need to mess with sigmask now.
5008 (x_initialize): No need to reset SIGPIPE handler here, since
5009 init_signals does this for us now.
5010
8f4635e9
JD
50112012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5012
5013 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 5014 background rect may be larger (Bug#12245).
8f4635e9 5015
3296976d
CY
50162012-09-23 Chong Yidong <cyd@gnu.org>
5017
5018 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5019
d41e491e
PE
50202012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 * .gdbinit: Just stop at fatal_error_backtrace.
5023 See Stefan Monnier's request in
5024 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5025 Remove no-longer-used query of system type.
5026
c88b867f
CY
50272012-09-22 Chong Yidong <cyd@gnu.org>
5028
5029 * search.c (Freplace_match): Doc fix (Bug#12325).
5030
5031 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5032
5033 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5034 (Fline_end_position): Doc fix.
5035
5036 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5037
bb4d86b4
CY
50382012-09-22 Chong Yidong <cyd@gnu.org>
5039
5040 * dispextern.h (struct image_type): Add new slot, storing a type
5041 initialization function.
5042
5043 * image.c (define_image_type): Call the image initializer function
5044 if it is defined. Arguments and return value changed.
5045 (valid_image_p, make_image): Callers changed.
5046 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
5047 (gif_type, imagemagick_type, svg_type, gs_type):
5048 Add initialization functions.
bb4d86b4
CY
5049 (Finit_image_library): Call lookup_image_type.
5050 (CHECK_LIB_AVAILABLE): Macro deleted.
5051 (lookup_image_type): Call define_image_type here, rather than via
5052 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5053 (syms_of_image): Move define_image_type calls for xbm_type and
5054 pbm_type to lookup_image_type.
5055
df9685f3
EZ
50562012-09-22 Eli Zaretskii <eliz@gnu.org>
5057
5058 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5059 'idle_timers' from here ...
5060 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5061 lists, to avoid infloops when the timer does something stupid,
5062 like reinvoke itself with the same or smaller time-out.
5063 (Bug#12447)
5064
8e17c9ba
MR
50652012-09-22 Martin Rudalics <rudalics@gmx.at>
5066
5067 * window.c (Fsplit_window_internal): Handle only Qt value of
5068 Vwindow_combination_limit separately.
5069 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
5070 (Vwindow_combination_limit): New default value.
5071 Rewrite doc-string.
8e17c9ba 5072
589bd69b
EZ
50732012-09-22 Eli Zaretskii <eliz@gnu.org>
5074
5075 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5076 the new overlay string. (Bug#10159)
5077
01108e3f
PE
50782012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5079
5080 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5081 or that fprintf is async-signal-safe. POSIX doesn't require
5082 either assumption.
5083
82f8cd94
CY
50842012-09-22 Chong Yidong <cyd@gnu.org>
5085
5086 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5087 (Bug#8207).
5088
3cccbd87
KH
50892012-09-22 Kenichi Handa <handa@gnu.org>
5090
5091 * composite.c (composition_reseat_it): Handle the case that a
5092 grapheme cluster is not covered by a single font (Bug#12352).
5093
09c01941
CY
50942012-09-21 Chong Yidong <cyd@gnu.org>
5095
5096 * image.c (define_image_type): Avoid adding duplicate types to
5097 image_types (Bug#12463). Suggested by Jörg Walter.
5098
acfa068f 50992012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
5100
5101 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5102 (print_load_command_name): Add case LC_DATA_IN_CODE.
5103 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5104
acfa068f 51052012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
5106
5107 * eval.c (Frun_hook_with_args_until_success)
5108 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5109
acfa068f 51102012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
5111
5112 * fileio.c (Ffile_selinux_context): Only call freecon when
5113 lgetfilecon succeeded.
5114 (Fset_file_selinux_context): Likewise. (Bug#12444)
5115
acfa068f 51162012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
5117
5118 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5119 reordering, locate the cursor by calling set_cursor_from_row; if
5120 that fails, clear the desired glyph matrix before returning a
5121 failure indication to the caller. Fixes leaving garbled display
5122 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
5123 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5124 scrolling through multibyte text.
aa36e4d2 5125
e99f70c8
SM
51262012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5127
5128 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5129 calling mark_vectorlike since that's the one that marks the window.
5130 (mark_discard_killed_buffers): Mark the final cdr.
5131 * window.h (struct window): Move prev/next_buffers to the
5132 non-standard fields.
5133 * window.c (make_window): Initialize prev/next_buffers manually.
5134
f75beb47
PE
51352012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5136
5137 Omit unused arg EXPECTED from socket hooks.
5138 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5139 * nsterm.m (ns_term_init):
5140 * termhooks.h (struct terminal.read_socket_hook):
5141 * w32inevt.c (w32_console_read_socket):
5142 * w32term.c (w32_read_socket):
5143 * xterm.c (XTread_socket):
5144 Omit unused arg EXPECTED. All callers changed.
5145 (store_user_signal_events): Return void, not int, since callers no
5146 longer care about the return value. All uses changed.
5147
b019b76a
JB
51482012-09-20 Juanma Barranquero <lekktu@gmail.com>
5149
5150 * w32gui.h (XParseGeometry): Do not declare.
5151
05642592
PE
51522012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5153
e4bce92a 5154 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 5155 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
5156 <http://bugs.gnu.org/12471#8> (last line).
5157
05642592
PE
5158 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5159 (XParseGeometry): Now static. Substitute extremal values for
5160 values that are out of range.
5161
e543ae91
JD
51622012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5163
5164 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5165
5166 * nsfns.m (XParseGeometry): Remove.
5167 (Fx_create_frame): Call x_set_offset to correctly interpret
5168 top_pos in geometry.
5169
3a880af4 5170 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
5171 (Fx_parse_geometry): If there is a space in string, call
5172 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5173
45ba16c7
EZ
51742012-09-17 Eli Zaretskii <eliz@gnu.org>
5175
c8b9f1bc
EZ
5176 * search.c (scan_buffer): Use character positions in calls to
5177 region_cache_forward and region_cache_backward, not byte
5178 positions. (Bug#12196)
5179
b4c932a2
EZ
5180 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5181 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5182
45ba16c7
EZ
5183 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5184 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5185 emacs_blocked_malloc, now deleted.
5186
eeceac93
PE
51872012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5188
5189 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5190 The workaround was for improving performance on Solaris 2.4, but
5191 is getting in the way now. Emacs will still work if someone is
5192 still running Solaris 2.4 in a museum somewhere; Sun dropped
5193 support for Solaris 2.4 in 2003.
5194 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5195 * process.c (create_process) [HAVE_WORKING_VFORK]:
5196 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5197 since Emacs no longer uses vfork on that platform.
5198
78f83752
GM
51992012-09-17 Glenn Morris <rgm@gnu.org>
5200
5201 * emacs.c: Use COPYRIGHT.
5202
634b8cac
PE
52032012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5204
0caaedb1
PE
5205 Remove configure's --without-sync-input option (Bug#12450).
5206 When auditing signal-handling in preparation for cleaning it up,
5207 I found that SYNC_INPUT has race conditions and would be a real
5208 pain to fix. Since it's an undocumented and deprecated
5209 configure-time option, now seems like a good time to remove it.
5210 Also see <http://bugs.gnu.org/11080#16>.
5211 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5212 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5213 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5214 (malloc_hysteresis):
5215 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5216 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5217 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5218 (dont_register_blocks, bytes_used_when_reconsidered)
5219 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5220 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5221 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 5222 Remove. All uses removed.
0caaedb1
PE
5223 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5224 implementation, one that depends on whether the new macro
5225 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5226 is defined.
5227 * atimer.c (run_timers, handle_alarm_signal):
5228 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5229 (handle_async_input, process_pending_signals)
5230 (handle_input_available_signal, init_keyboard):
5231 * nsterm.m (ns_read_socket):
5232 * process.c (wait_reading_process_output):
5233 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5234 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5235 (emacs_write):
5236 * xterm.c (XTread_socket):
5237 Assume SYNC_INPUT.
5238 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5239 * eval.c (handling_signal): Remove. All uses removed.
5240 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5241 All uses replaced with the SYNC_INPUT version.
5242 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5243 Remove decls.
5244 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5245 Now static.
5246
634b8cac
PE
5247 * font.c (Ffont_shape_gstring): Remove unused local.
5248
83da1b55
GM
52492012-09-16 Glenn Morris <rgm@gnu.org>
5250
518650a5
GM
5251 * Makefile.in (clean): No longer run nextstep's clean.
5252
83da1b55
GM
5253 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5254 (ns_frag): Remove.
5255 (ns-app): Move here from ns.mk, and simplify.
5256 (clean): Simplify nextstep entry.
5257 * ns.mk: Remove file.
5258
85a43e2e
KH
52592012-09-17 Kenichi Handa <handa@gnu.org>
5260
5261 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5262 not covert the last few charactes.
5263
ba13e616 52642012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
5265
5266 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5267 here, but just check the validity of glyphs in the glyph-string.
5268
a8c729af
MR
52692012-09-16 Martin Rudalics <rudalics@gmx.at>
5270
3a880af4
SM
5271 * window.c (Fwindow_parameter, Fset_window_parameter):
5272 Accept any window as argument (Bug#12452).
a8c729af 5273
c077c059
JD
52742012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5275
5276 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5277 to ns_term_init to avoid memory leak.
5278
5279 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5280 explicit retain/release.
5281 (ns_term_init): Only allow one display. Initialize outerpool and
5282 ns_*_types.
5283
39a57ad0
PE
52842012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5285
5286 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5287 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5288 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5289 the Microsoft problem in a different way, by altering ../nt/config.nt.
5290
7105c8cb
EZ
52912012-09-15 Eli Zaretskii <eliz@gnu.org>
5292
5293 * w32xfns.c:
5294 * w32uniscribe.c:
5295 * w32term.c:
5296 * w32select.c:
5297 * w32reg.c:
5298 * w32proc.c:
5299 * w32menu.c:
5300 * w32inevt.c:
5301 * w32heap.c:
5302 * w32font.c:
5303 * w32fns.c:
5304 * w32console.c:
5305 * w32.c:
5306 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5307 by lisp.h. This completes removal of setjmp.h inclusion
5308 erroneously announced in the previous commit. (Bug#12446)
5309
5310 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5311 more accurate.
5312
5313 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5314 not defined as a macro. The latter happens on MS-Windows.
5315 (Bug#12446)
5316
0328b6de
PE
53172012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5320 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5321 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5322 only reason for the instance was because "lisp.h" was included.
5323 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5324 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5325 and _longjmp with the new symbols. Emacs already uses _setjmp if
5326 available, so this change affects only POSIXish hosts that have
5327 sigsetjmp but not _setjmp, such as some versions of Solaris and
5328 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5329 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5330 (png_load_body) [HAVE_PNG]:
5331 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5332 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5333 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5334 since PNG requires jmp_buf. This is the only exception to the
5335 general rule that we now use sys_setjmp and sys_longjmp.
5336 This exception is OK since this code does not change the signal
5337 mask or longjmp out of a signal handler.
5338
2af03429
PE
53392012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5340
5341 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5342 Include "syssignal.h", for 'main_thread'.
5343
2f294edf
DA
53442012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5345
5346 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5347 * insdel.c (replace_range, replace_range_2):
5348 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5349 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5350 Remove redundant check before calling offset_intervals.
5351
6b533e9c
MR
53522012-09-14 Martin Rudalics <rudalics@gmx.at>
5353
5354 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5355 current buffer (Bug#12387).
5356
2a7931e3
JB
53572012-09-14 Juanma Barranquero <lekktu@gmail.com>
5358
5359 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5360
c18e885b
PE
53612012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5362
5363 Use a more backwards-compatible timer format (Bug#12430).
5364 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5365 vector element, not from the 4th, since PSECS is now at the end.
5366 (Fcurrent_idle_time): Doc fix.
5367
d59a1afb
DA
53682012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5369
5370 Function to mark objects and remove killed buffers at once.
5371 * alloc.c (discard_killed_buffers): Rename to ...
5372 (mark_discard_killed buffers) ... new name. Add marking
5373 of remaining objects. Fix comment. Adjust users.
5374 (mark_object): Do not touch frame buffer lists here.
5375 * frame.c (delete_frame): Reset frame buffer lists here.
5376
5f0cb45a
PE
53772012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5378
8ea47e3a
PE
5379 Better workaround for GNOME bug when --enable-gcc-warnings.
5380 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5381 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5382 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5383
4a4bbad2
PE
5384 Simplify SIGIO usage (Bug#12408).
5385 The code that dealt with SIGIO was crufty and confusing, e.g., it
5386 played tricks like "#undef SIGIO" but these tricks were not used
5387 consistently. Simplify mostly by not #undeffing standard symbols,
5388 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5389 or not as we please) rather than "defined SIGIO" (standard symbol
5390 that we probably shouldn't #undef).
5391 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5392 Modules that need it can include it.
5393 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5394 * dispextern.h (ignore_sigio): New decl.
5395 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5396 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5397 * emacs.c (shut_down_emacs):
5398 * keyboard.c (kbd_buffer_store_event_hold):
5399 Use ignore_sigio rather than invoking 'signal' directly.
5400 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5401 for FIONREAD.
5402 (FIONREAD, SIGIO): Do not #undef.
5403 (tty_read_avail_input): Use #error rather than a syntax error.
5404 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5405 for I_PIPE, used by SETUP_SLAVE_PTY.
5406 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5407 * sysdep.c (croak): Remove; no longer needed. This bit of
5408 temporary code, with Fred N. Fish's comment that it's temporary,
5409 has been in Emacs since at least 1992!
5410 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5411 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5412 * syssignal.h (croak): Remove decl.
5413 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5414 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5415 now that we're termios-only.
5416 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5417 * term.c (dissociate_if_controlling_tty): Use #error rather than
5418 a run-time error.
5419
5f0cb45a
PE
5420 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5421 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5422 to work around GNOME bug 683906.
5423 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5424 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5425 This works around GCC bug 54561.
5426
40bce90b
PE
54272012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5428
5429 More fixes for 'volatile' and setjmp/longjmp.
5430 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5431 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5432 (png_load_body) [HAVE_PNG]:
5433 (jpeg_load_body) [HAVE_JPEG]:
5434 New function, with most of the old parent function's body.
5435 (png_load) [HAVE_PNG]:
5436 (jpeg_load) [HAVE_JPEG]:
5437 Invoke the new function, to avoid longjmp munging our locals.
5438 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5439 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5440 longjmp is passed 2, as the C standard doesn't guarantee this.
5441 Instead, store the failure code into mgr->failure_code.
5442
bfeae2cf
SM
54432012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5444
5445 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5446 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5447 (syms_of_keyboard): Remove support for unread-command-char.
5448
8099e36b
EZ
54492012-09-12 Eli Zaretskii <eliz@gnu.org>
5450
5451 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5452 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5453 violation. (Bug#12426)
5454
92547ff9
PE
54552012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5456
5457 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5458
45b82ad0
SM
54592012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5460
5461 * eval.c: Add `inhibit-debugger'.
5462 (Qinhibit_debugger): New symbol.
5463 (call_debugger): Bind it instead of Qdebug_on_error.
5464 (maybe_call_debugger): Test Vinhibit_debugger.
5465 (syms_of_eval): Define inhibit-debugger.
5466 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5467 (syms_of_xdisp): Remove inhibit-debug-on-message.
5468
5779a1dc
PE
54692012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5470
50f2e553
PE
5471 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5472 If a nonvolatile local variable is written before a _longjmp to
5473 the frame containing the variable, and is read after the _longjmp,
5474 the value read is indeterminate. Some local variables of type
5475 'struct handler' and 'struct catchtag' are used in this way, so
5476 mark each of their slots as volatile if the slot can be set before
5477 _longjmp and read afterwards.
5478 * lisp.h (struct handler): var and chosen_clause are now volatile.
5479 (struct catchtag): val, next, and pdlcount are now volatile.
5480
ae1d87e2
PE
5481 * bidi.c (bidi_push_it, bidi_pop_it):
5482 * fns.c (copy_hash_table):
5483 * image.c (define_image_type):
5484 * keyboard.c (kbd_buffer_store_event_hold):
5485 * process.c (Fprocess_send_eof):
5486 * xfaces.c (x_create_gc) [HAVE_NS]:
5487 * xgselect.c (xg_select):
5488 Prefer assignment to memcpy when either will do.
5489
5779a1dc
PE
5490 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5491 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5492 time an item is removed. No need to mark this function 'inline';
5493 the compiler knows better than we do.
5494
c4c9756b
JD
54952012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5496
5497 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5498 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5499 to change_frame_size (Bug#12388).
5500 (windowDidResize:): Pass YES to updateFrameSize.
5501
5502 * nsterm.h: Add delay parameter to updateFrameSize.
5503
d73e321c
DA
55042012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5505
5506 Discard killed buffers from deleted window and frame objects.
5507 This reduces an amount of references to killed buffers and
5508 helps GC to reclaim them faster.
5509 * alloc.c (discard_killed_buffers): New function.
5510 (mark_object): Use it for deleted windows and frames.
5511 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 5512 or deleted frame, restore its global binding.
d73e321c
DA
5513 * data.c (swap_in_global_binding): Add GC notice.
5514 (swap_in_symval_forwarding): Use convenient set_blv_where.
5515 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5516 * window.h: ... to here.
5517
e578f381
DA
55182012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5519
5520 Convenient macro to check whether the buffer is live.
5521 * buffer.h (BUFFER_LIVE_P): New macro.
5522 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5523 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5524
3057e615
YM
55252012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5526
5527 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5528 composition cases (Bug#12364).
5529
5530 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5531 overhang of succeeding glyphs overlapping box cursor.
5532
5533 * w32term.c (x_draw_glyph_string): Likewise.
5534
6fda35f2
PE
55352012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5536
c990426a
PE
5537 Simplify, document, and port floating-point (Bug#12381).
5538 The porting part of this patch fixes bugs on non-IEEE platforms
5539 with frexp, ldexp, logb.
5540 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5541 Now static.
5542 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5543 support, by removing commented-out code and briefly listing the
5544 C89 functions excluded. The commented-out stuff was confusing
5545 maintenance, e.g., we thought we needed cbrt but it was commented out.
5546 (logb): Remove decl; no longer needed.
5547 (isfinite): New macro, if not already supplied.
5548 (isnan): Don't replace any existing macro.
5549 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5550 are present on all C89 platforms.
5551 (Ffrexp): Do not special-case zero, as frexp does the right thing
5552 for that case.
5553 (Flogb): Do not use logb, as it doesn't have the desired meaning
5554 on hosts that use non-base-2 floating point. Instead, stick with
5555 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5556 frexp, to avoid getting an unspecified result.
5557
6fda35f2
PE
5558 * xdisp.c (Qinhibit_debug_on_message): Now static.
5559
16130a58
JD
55602012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5561
5562 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5563 NSBezierPath (Bug#12131).
5564
d105a573
CY
55652012-09-10 Chong Yidong <cyd@gnu.org>
5566
5567 * fns.c (Fdelq, Fdelete): Doc fix.
5568
ff55dfe8
PE
55692012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5570
5571 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5572 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5573
e7032e7c
SM
55742012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5575
5576 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5577 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5578 Use it.
5579
e9957956
EZ
55802012-09-09 Eli Zaretskii <eliz@gnu.org>
5581
aba05ce9
EZ
5582 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5583 left fringe if the window has a left margin. This avoids leaving
5584 traces of the cursor because its leftmost pixel is not drawn over.
5585
e9957956
EZ
5586 * dispnew.c (update_window_line): When the left margin area of a
5587 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5588 that screen line. (Bug#12277)
5589
f6196b87
PE
55902012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5591
5592 Assume C89 or later for math functions (Bug#12381).
5593 This simplifies the code, and makes it a bit smaller and faster,
5594 and (most important) makes it easier to clean up signal handling
5595 since we can stop worring about floating-point exceptions in
5596 library code. That was a problem before C89, but the problem
5597 went away many years ago on all practical Emacs targets.
5598 * data.c, image.c, lread.c, print.c:
5599 Don't include <math.h>; no longer needed.
5600 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5601 might be autoconfigured, as that never happens.
5602 * data.c (fmod):
5603 * doprnt.c (DBL_MAX_10_EXP):
5604 * print.c (DBL_DIG):
5605 Remove. C89 or later always defines these.
5606 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5607 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5608 (arith_error, domain_error, domain_error2):
5609 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5610 no longer needed -- we simply return what C returns. All uses removed.
5611 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5612 the wrapped code.
5613 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5614 Remove. All uses expanded, as these macros are no longer used
5615 more than once and are now more trouble than they're worth.
5616 (Ftan): Use tan, not sin / cos.
5617 (Flogb): Assume C89 frexp.
5618 (fmod_float): Assume C89 fmod.
5619 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
5620 (init_floatfns): Remove. All uses removed.
5621
9d7f1863
JD
56222012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5623
5624 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
5625 compositeToPoint for OSX < 10.6 (Bug#12390).
5626
eabf0404
PE
56272012-09-08 Paul Eggert <eggert@cs.ucla.edu>
5628
5629 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
5630 This produces more-accurate results.
5631
0b3b1d23
JD
56322012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5633
5634 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
5635 changes (Bug#12088).
5636
6dcef6ec
CY
56372012-09-08 Chong Yidong <cyd@gnu.org>
5638
5639 * syntax.c (Fstring_to_syntax): Doc fix.
5640
aa7d57c5
JD
56412012-09-08 Jan Djärv <jan.h.d@swipnet.se>
5642
5643 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
5644 in the internal border.
5645 (x_set_window_size): Remove static variables and their usage.
5646 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
5647 (ns_after_update_window_line, ns_draw_fringe_bitmap):
5648 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
5649 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
5650 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
5651 (ns_fix_rect_ibw): Remove.
5652 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
5653 (ns_dumpglyphs_box_or_relief): Ditto.
5654 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
5655 adjustment.
5656 (ns_dumpglyphs_image): Ditto.
fc0c31f8 5657 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
5658 border adjustment.
5659 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
5660 their usage. Add fringe_extended_p and its use as in other terms.
5661 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
5662 scroll bar was removed.
5663 (updateFrameSize): New function.
5664 (windowDidResize): Move code to updateFrameSize and call it.
5665
5666 * nsterm.h (EmacsView): Add updateFrameSize.
5667
1a5432bc
CY
56682012-09-07 Chong Yidong <cyd@gnu.org>
5669
b4f5313e
CY
5670 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
5671
1a5432bc
CY
5672 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
5673
1a4f1e9b
PE
56742012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
5677 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
5678 Problem introduced when merging patches. Noted by Eli Zaretskii in
5679 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
5680 * floatfns.c: Comment fix.
5681 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
5682 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
5683 and anyway the declaration is harmless even if SIGDANGER is not defined.
5684 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
5685 defined BROKEN_FIONREAD). systty.h formerly did this, but other
5686 source files not surprisingly expected syssignal.h to define, or
5687 not define, SIGIO, and it's cleaner to do it that way, for consistency.
5688 Include <sys/ioctl.h>, for FIONREAD.
5689 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
5690 This eliminates a problem whereby other files mysteriously had
5691 to include "syssignal.h" before including "systty.h" if they
5692 wanted to use "#ifdef SIGIO".
5693
bc8000ff
EZ
56942012-09-07 Eli Zaretskii <eliz@gnu.org>
5695
3e6d6928
EZ
5696 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
5697
5698 * w32.c (sigemptyset): Empty the set.
5699 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
5700
bc8000ff
EZ
5701 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
5702
b4fa72f2
DA
57032012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
5704
5705 * alloc.c (mark_buffer): Revert unsafe marking optimization.
5706 (mark_object): Likewise for frame objects.
5707
30730c93
PE
57082012-09-07 Paul Eggert <eggert@cs.ucla.edu>
5709
5710 * syssignal.h (handle_on_main_thread): Always declare,
5711 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
5712 This ports to platforms without HAVE_PTHREAD.
5713
2fe28299
PE
57142012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5715
5716 Signal-handler cleanup (Bug#12327).
5717 Emacs's signal handlers were written in the old 4.2BSD style with
5718 sigblock and sigmask and so forth, and this led to some
5719 inefficiencies and confusion. Rewrite these to use
5720 pthread_sigmask etc. without copying signal sets around. Also,
5721 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
5722 'signal', and instead use functions that do not attempt to take
5723 over the system name space. This patch causes Emacs's text
5724 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
5725 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
5726 Do not include <signal.h> or "syssignal.h", as these
5727 modules do not use signals.
5728 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
5729 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
5730 Do not include <signal.h>, as "syssignal.h" does that for us now.
5731 * atimer.c (sigmask_atimers): New function.
5732 (block_atimers, unblock_atimers): New functions,
5733 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
5734 All uses replaced.
5735 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
5736 no longer needed here.
5737 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 5738 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
5739 * sysdep.c (struct save_signal): New member 'action', replacing
5740 old member 'handler'.
5741 (save_signal_handlers, restore_signal_handlers):
5742 Use sigaction instead of 'signal' to save and restore.
5743 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
5744 New function. All users of 'signal' modified to use set_sighandler
5745 if they're writeonly, and to use sys_signal if they're read+write.
5746 (emacs_sigaction_init, forwarded_signal): New functions.
5747 (sys_signal): Remove. All uses replaced by calls to sigaction
5748 and emacs_sigaction_init, or by direct calls to 'signal'.
5749 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
5750 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
5751 all uses replaced by pthread_sigmask etc. calls.
5752 * syssignal.h: Include <signal.h>.
5753 (emacs_sigaction_init, forwarded_signal): New decls.
5754 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
5755 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
5756 (sigmask, sys_sigmask): Remove; no longer needed.
5757 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
5758 (sigblock, sigunblock, sigfree):
5759 (sigsetmask) [!defined sigsetmask]:
5760 Remove. All uses replaced by pthread_sigmask.
5761 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
5762 no longer need to be replaced, and its typical old uses
5763 are now done via emacs_sigaction_init and sigaction.
5764 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
5765 (sys_sigdel): Remove; unused.
5766 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
5767
0216c128
EZ
57682012-09-06 Eli Zaretskii <eliz@gnu.org>
5769
5770 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
5771 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
5772
c752cfa9
DA
57732012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5774
5775 Explicitly mark buffer_defaults and buffer_local_symbols.
5776 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
5777 mark_local_symbols here.
5778 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
5779 since special buffers aren't marked here any more.
5780 (allocate_buffer): Chain new buffer with all_buffers here...
5781 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
5782 not here.
5783 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
5784 (syms_of_buffer): Remove staticpro of the above.
5785 (init_buffer_once): Set names for buffer_defaults and
5786 buffer_local_symbols.
5787
a864ef14
PE
57882012-09-06 Paul Eggert <eggert@cs.ucla.edu>
5789
5790 Use bool for booleans in font-related modules.
5791 * font.c (font_intern_prop, font_style_to_value)
5792 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
5793 (generate_otf_features, font_check_otf_features, font_check_otf)
5794 (font_match_p, font_list_entities, font_at):
5795 * fontset.c (fontset_id_valid_p, reorder_font_vector
5796 (fontset_find_font, Fset_fontset_font)
5797 (face_suitable_for_char_p) [0]:
5798 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
5799 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
5800 (m17n_flt_initialized, ftfont_shape_by_flt):
5801 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
5802 * nsfont.m (nsfont_draw):
5803 * w32font.c (w32font_draw):
5804 * w32term.c (x_draw_glyphless_glyph_string_foreground):
5805 Use bool for booleans.
5806 * font.h: Adjust to above API changes.
5807 (struct font, struct font_driver, struct font_driver_list):
5808 Use bool for booleans.
5809 (struct font): Remove useless member encoding_type.
5810 All users removed.
5811 * fontset.c, xftfont.c: Omit unnecessary static decls.
5812
0699fc18
DA
58132012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
5814
5815 * alloc.c (mark_object): Revert window marking code
5816 since it's unsafe for the Fset_window_configuration.
5817
20ef56db
PE
58182012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5819
2fe28299 5820 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
5821 Be more systematic about preserving errno whenever a signal
5822 handler returns, even if it's not in the main thread. Do this by
5823 renaming signal handlers to distinguish between signal delivery
5824 and signal handling. All uses changed.
5825 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
5826 * data.c (deliver_arith_signal): Rename from arith_error.
5827 * dispnew.c (deliver_window_change_signal): Rename from
5828 window_change_signal.
5829 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
5830 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
5831 * keyboard.c (deliver_input_available_signal): Rename from
5832 input_available_signal.
5833 (deliver_user_signal): Rename from handle_user_signal.
5834 (deliver_interrupt_signal): Rename from interrupt_signal.
5835 * process.c (deliver_pipe_signal): Rename from send_process_trap.
5836 (deliver_child_signal): Rename from sigchld_handler.
5837 * atimer.c (handle_alarm_signal):
5838 * data.c (handle_arith_signal):
5839 * dispnew.c (handle_window_change_signal):
5840 * emacs.c (handle_fatal_signal, handle_danger_signal):
5841 * keyboard.c (handle_input_available_signal):
5842 * keyboard.c (handle_user_signal, handle_interrupt_signal):
5843 * process.c (handle_pipe_signal, handle_child_signal):
5844 New functions, with the actual signal-handling code taken from the
5845 original respective signal handlers, sans the sporadic attempts to
5846 preserve errno, since that's now done by handle_on_main_thread.
5847 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
5848 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
5849 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5850 Move to sysdep.c.
5851 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5852 Move initialization of main_thread to sysdep.c's init_signals.
5853 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
5854 our usage, and simplifies the mainline code.
5855 (record_child_status_change): New static function, as a helper
5856 for handle_child_signal, and with most of the old child handler's
5857 contents.
5858 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
5859 (handle_child_signal): Use the above.
5860 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5861 Moved here from emacs.c.
5862 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
5863 code moved here from emacs.c's main function.
5864 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
5865 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
5866 This lets callers save and restore errno properly.
20ef56db 5867
e3ccf108
DA
58682012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5869
5870 Remove redundant or unused things here and there.
5871 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
5872 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
5873 * editfns.c (Fcompare_buffer_substrings): Likewise.
5874 * frame.h (struct terminal, struct font_driver_list):
5875 Remove redundant declarations.
5876 * window.h (Qleft, Qright): Likewise.
5877
697e1e39
DA
58782012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5879
5880 Do not mark objects from deleted buffers, windows and frames.
5881 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
5882 (mark_object): Likewise for windows and frames.
5883
c1ca42ca
DA
58842012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
5885
5886 * alloc.c (valid_lisp_object_p): Treat killed buffers,
5887 buffer_defaults and buffer_local_symbols as valid objects.
5888 Return special value to denote them.
5889
014d93be
PE
58902012-09-05 Paul Eggert <eggert@cs.ucla.edu>
5891
f75d7a91
PE
5892 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
5893 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
5894 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
5895 (file_name_absolute_p, Fsubstitute_in_file_name):
5896 (check_executable, check_writable, Ffile_accessible_directory_p)
5897 (Fset_file_selinux_context, Fdefault_file_modes)
5898 (Finsert_file_contents, choose_write_coding_system)
5899 (Fwrite_region, build_annotations, a_write, e_write)
5900 (Fdo_auto_save):
5901 * filelock.c (boot_time_initialized, get_boot_time)
5902 (get_boot_time_1, lock_file_1, within_one_second):
5903 * floatfns.c (in_float):
5904 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
5905 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
5906 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
5907 * lisp.h (struct Lisp_Hash_Table.cmpfn):
5908 * window.c (compare_window_configurations):
5909 Use bool for booleans.
5910 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
5911 (Fdefault_file_modes): Now mode_t, not int, for modes.
5912 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
5913 (internal_delete_file): Now returns void, not a (boolean) int,
5914 since nobody was looking at the return value.
5915 * lisp.h, window.h: Adjust to above API changes.
5916
014d93be
PE
5917 * xdisp.c (set_message): Simplify and reindent last change.
5918
776f29e1
JB
59192012-09-05 Juanma Barranquero <lekktu@gmail.com>
5920
5921 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
5922
7f7e0167
LI
59232012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
5924
5925 * eval.c (call_debugger): Make the function non-static so that we
5926 can call it from set_message.
5927
5928 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
5929 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
5930
cf29dd84
PE
59312012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5932
5933 Give more-useful info on a fatal error (Bug#12328).
5934 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
5935 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
5936 of doing the work ourselves.
5937 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
5938 do most of the work.
5939 (fatal_error_backtrace): New function, taken from the guts
5940 of the old fatal_error_signal, but with a new option to output
5941 a backtrace.
5942 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
5943 info about the signal than just its number.
5944 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
5945 * sysdep.c: Include <execinfo.h>
5946 (emacs_backtrace): New function, taken partly from the previous
5947 code of the 'die' function.
5948 (emacs_abort): Call fatal_error_backtrace rather than abort.
5949
972debf2
SM
59502012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
5951
5952 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
5953 eager (load-time) macro-expansion.
5954 * lisp.mk (lisp): Add macroexp.
5955
1088b922
PE
59562012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5957
5958 Simplify redefinition of 'abort' (Bug#12316).
5959 Do not try to redefine the 'abort' function. Instead, redo
5960 the code so that it calls 'emacs_abort' rather than 'abort'.
5961 This removes the need for the NO_ABORT configure-time macro
5962 and makes it easier to change the abort code to do a backtrace.
5963 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
5964 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
5965 Remove; sysdep.c's emacs_abort now takes its place.
5966 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
5967 'abort' changed to use 'emacs_abort'.
5968 * msdos.c (dos_abort) [defined abort]: Remove; not used.
5969 (abort) [!defined abort]: Rename to ...
5970 (emacs_abort): ... new name.
5971 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
5972 the place of the old 'abort' in emacs.c.
5973 * w32.c, w32fns.c (abort): Do not #undef.
5974 * w32.c (emacs_abort): Rename from w32_abort.
5975
30934d33
EZ
59762012-09-04 Eli Zaretskii <eliz@gnu.org>
5977
5978 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
5979 offsets[j].dv, since the y axis of the screen coordinates points
5980 down, while the y axis of the font definition coordinates points
5981 up. This fixes display of Arabic diacritics such as KASRA and
5982 KASRATAN. (Bug#11860)
5983
af26b72c
PE
59842012-09-04 Paul Eggert <eggert@cs.ucla.edu>
5985
5986 Be more systematic about _setjmp vs setjmp.
5987 * alloc.c (test_setjmp, mark_stack):
5988 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
5989 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
5990 (png_load, my_error_exit, jpeg_load):
5991 * process.c (send_process_trap, send_process):
5992 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
5993 The underscored versions are up to 30x faster on some hosts.
5994 Formerly, the code used setjmp+longjmp sometimes and
5995 _setjmp+_longjmp at other times, with no particular reason to
5996 prefer setjmp+longjmp.
5997
26d4541d
PE
59982012-09-03 Paul Eggert <eggert@cs.ucla.edu>
5999
d42f4f0f 6000 Fix minor problem found by static checking.
26d4541d 6001 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 6002
c5e28e39
MR
60032012-09-03 Martin Rudalics <rudalics@gmx.at>
6004
6005 * buffer.c (Fdelete_all_overlays): New function.
6006
3eab3ca9
CY
60072012-09-03 Chong Yidong <cyd@gnu.org>
6008
6009 * gtkutil.c: Add extern decl for Qxft.
6010
c04889f8
PE
60112012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6012
1882aa38
PE
6013 * emacs.c, eval.c: Use bool for boolean.
6014 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6015 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6016 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6017 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6018 (main, decode_env_path, Fdaemon_initialized):
6019 * eval.c (call_debugger, Finteractive_p, interactive_p):
6020 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6021 (maybe_call_debugger, Fbacktrace):
6022 * process.c (read_process_output, exec_sentinel):
6023 Use bool for booleans.
6024 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6025 All callers changed.
6026 * eval.c (interactive_p): Omit always-true boolean argument
6027 EXCLUDE_SUBRS_P. All callers changed.
6028 * dispextern.h, lisp.h: Reflect above API changes.
6029 * firstfile.c (dummy): Use the address of 'main', whose signature
6030 won't change, instead of the address of 'initialize', whose
6031 signature just changed from int to bool.
6032 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6033 * msdos.c (fatal_error_in_progress): ... from here.
6034 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6035 of incrementing it.
6036 (redisplay_internal, unwind_redisplay): Simply clear
6037 REDISPLAYING_P when unwinding, instead of saving its previous,
6038 always-false value and then restoring it.
6039
a411ac43
PE
6040 Clean up some extern decls.
6041 Mostly, this hoists extern decls out of .c files and into .h files.
6042 That way, we're more likely to catch errors if the interfaces change.
6043 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6044 declare xg_mark_data.
6045 * dispextern.h (x_frame_parm_handlers):
6046 * font.h (Qxft):
6047 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6048 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6049 (Qultra_bold, Qoblique, Qitalic):
6050 Move extern decl here from .c file.
6051 * alloc.c (xg_mark_data) [USE_GTK]:
6052 * doc.c (Qclosure):
6053 * eval.c (Qlexical_binding):
6054 * fns.c (time) [!HAVE_UNISTD_H]:
6055 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6056 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6057 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6058 * lread.c (Qinternal_interpreter_environment):
6059 * minibuf.c (Qbuffer):
6060 * process.c (QCfamily, QCfilter):
6061 * widget.c (free_frame_faces):
6062 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6063 * xfont.c (x_clear_errors):
6064 * xterm.c (x_frame_parm_handlers):
6065 Remove now-redundant extern decls.
6066 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6067 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6068 Now static.
6069 * xfaces.c: Remove unnecessary static decls.
6070 * xterm.c (updating_frame): Remove decl of nonexistent object.
6071
c04889f8
PE
6072 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6073 when building globals.h, as the objects that are not built on
6074 this host are not needed to compile C files on this host.
6075
8b339673
JD
60762012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6077
6078 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6079
6080 * frame.h: Add missing prototype for x_wm_set_size_hint.
6081
a08d4ba7
PE
60822012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6083
6084 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6085 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6086 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6087 (Fsubstitute_command_keys):
6088 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6089 (save_excursion_save, save_excursion_restore)
6090 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6091 (format_time_string, general_insert_function)
6092 (make_buffer_string, make_buffer_string_both)
6093 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6094 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6095 (copy_text, insert_1, insert_1_both, insert_from_string)
6096 (insert_from_string_before_markers, insert_from_string_1)
6097 (insert_from_buffer, insert_from_buffer_1, replace_range)
6098 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6099 (del_range_2, modify_region):
6100 * intervals.c (intervals_equal, balance_possible_root_interval)
6101 (adjust_intervals_for_insertion, merge_properties_sticky)
6102 (graft_intervals_into_buffer, lookup_char_property)
6103 (adjust_for_invis_intang, set_point_both)
6104 (get_property_and_range, compare_string_intervals)
6105 (set_intervals_multibyte_1, set_intervals_multibyte):
6106 * keyboard.c (decode_timer):
6107 Use bool for boolean.
6108 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6109 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6110
48c948de
CY
61112012-09-02 Chong Yidong <cyd@gnu.org>
6112
6113 * keymap.c (push_key_description): Print M-TAB as C-M-i
6114 (Bug#11758).
6115
6c49a40b
JB
61162012-09-02 Juanma Barranquero <lekktu@gmail.com>
6117
6118 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6119 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6120 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6121 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6122 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6123 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6124 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6125
4dfbd238
EZ
61262012-09-01 Eli Zaretskii <eliz@gnu.org>
6127
7e510e28
EZ
6128 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6129 more than one grapheme cluster passed to the shaper: compute the
6130 offset adjustment values separately for each cluster. (Bug#11860)
6131
4dfbd238
EZ
6132 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6133 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6134 about implicit conversions from integer to pointer.
6135
86571ae0
DC
61362012-09-01 Daniel Colascione <dancol@dancol.org>
6137
6138 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6139 system used too early.
6140
0e23ef9d
PE
61412012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 Better seed support for (random).
6144 * emacs.c (main): Call init_random.
6145 * fns.c (Frandom): Set the seed from a string argument, if given.
6146 Remove long-obsolete Gentzel cruft.
6147 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6148 (init_random): New function.
6149
17a2cbbd
DC
61502012-09-01 Daniel Colascione <dancol@dancol.org>
6151
6152 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6153 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6154 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6155 x_wm_set_size_hint, x_query_colors, x_real_positions,
6156 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6157 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6158 all of which have been moved to common code.
6159
6160 * xfaces.c: Include TERM_HEADER instead of listing all possible
6161 window-system headers.
6162
6163 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6164 to match header.
6165
6166 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6167 directly accessing frame internals.
6168
f18cbb28 6169 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
6170 globals_of_w32font.
6171
6172 * process.c: Include TERM_HEADER instead of listing all possible
6173 window-system headers.
6174
3a880af4
SM
6175 * nsterm.h: Remove declarations now in frame.h.
6176 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
6177
6178 * menu.c: Include TERM_HEADER instead of listing all possible
6179 window-system headers.
6180
6181 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6182 window system.
6183
6184 * keyboard.c: Include TERM_HEADER instead of listing all possible
6185 window-system headers.
6186
6187 * image.c: Include TERM_HEADER instead of listing all possible
6188 window-system headers. Declare Vlibrary_cache when compiling for
6189 Windows.
6190
6191 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6192 window system declarations.
6193
6194 * frame.h: Move common functions here: set_frame_menubar,
6195 x_set_window_size, x_sync, x_get_focus_frame,
6196 x_set_mouse_position, x_set_mouse_pixel_position,
6197 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6198 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6199 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6200 x_activate_menubar, x_real_positions, x_bitmap_icon,
6201 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6202 and x_query_colors.
6203
6204 * frame.c: Include TERM_HEADER instead of listing all possible
6205 window-system headers.
6206
6207 * font.c: Include TERM_HEADER instead of listing all possible
6208 window-system headers.
6209
6210 * emacs.c: Include TERM_HEADER.
6211
f18cbb28
EZ
6212 * dispnew.c: Include TERM_HEADER instead of listing all possible
6213 window-system headers.
17a2cbbd 6214
f18cbb28 6215 * ccl.h: Include character.h.
17a2cbbd
DC
6216
6217 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6218 the current window system; include in list of objects to link into
6219 Emacs.
6220
c650a5de
DA
62212012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6222
6223 Remove mark_ttys function and fix tty_display_info initialization.
6224 * lisp.h (mark_ttys): Remove prototype.
6225 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6226 to mark_ttys because all possible values of 'top_frame' slot are
6227 the frames which are reachable from Vframe_list.
6228 * term.c (mark_ttys): Remove.
6229 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6230
4e0f6479
DA
62312012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6232
6233 Change struct frame bitfields from unsigned char to unsigned.
6234 * frame.h (struct frame): Change type of 'display_preempted',
6235 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6236 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6237 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6238 bitfields from unsigned char to unsigned.
6239
8b96a52c
DA
62402012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6241
6242 Remove unused member of struct x_output and struct w32_output.
6243 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6244 * w32term.h (struct w32_output): Likewise.
6245
b4444c8a
JD
62462012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6247
6248 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6249 does not become zero (Bug#12234).
6250
b98521db
PE
62512012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6252
6253 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6254 for GCC 4.7.1 x86-64.
6255
31d02438
GM
62562012-08-30 Glenn Morris <rgm@gnu.org>
6257
6258 * lread.c (init_lread): For out-of-tree builds, only add the
6259 source directory's site-lisp dir to the load-path if it exists,
6260 consistent with in-tree builds. (Bug#12302)
6261
7f8941d8
JD
62622012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6263
6264 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 6265 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
6266 (windowShouldClose:): Set window_closed.
6267 (dealloc): New member, free button_values.
fc0c31f8
JB
6268 (process_dialog:): Make member function. Remove window argument,
6269 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
6270 in button_values.
6271 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 6272 with tag. Remove return self, declare return value as void.
7f8941d8
JD
6273 (addString:row:): Remove return self, declare return value as void.
6274 (addSplit): Remove return self, declare return value as void.
6275 (clicked:): Remove return self, declare return value as void.
fc0c31f8 6276 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
6277 (initFromContents:isQuestion:): Adjust call to process_dialog.
6278 Code formatting change.
6279 (timeout_handler:): Set timer_fired to YES.
6280 (runDialogAt:): Set timer_fired to NO.
6281 Handle click on close button as quit.
6282
6283 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6284 Add window_closed and button_values. Add void as return value for
6285 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6286 Add process_dialog as new member.
6287
eada0861 62882012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6289
eada0861
GM
6290 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6291 is not one of the heaps we manage. (Bug#12242)
6292
62932012-08-28 Glenn Morris <rgm@gnu.org>
6294
6295 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6296
457294dd
MR
62972012-08-28 Martin Rudalics <rudalics@gmx.at>
6298
6299 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6300 auto-buffer-name window parameter. Install revision of reverted
6301 fix.
457294dd 6302
4f2daf31
DA
63032012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6304
6305 Do not allow to set major mode for a dead buffer.
6306 * buffer.c (Fset_buffer_major_mode): Signal an error
6307 if the buffer is dead.
6308 (Fother_buffer, other_buffer_safely): Remove redundant
6309 nested declaration.
6310
66322887
DA
63112012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6312
6313 Always use set_buffer_if_live to restore original buffer at unwind.
6314 * buffer.h (record_unwind_current_buffer): New function.
6315 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6316 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6317 * undo.c, window.c: Adjust users.
6318 * buffer.c (set_buffer_if_live): Fix comment.
6319
a3d794a1
DA
63202012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6321
6322 Fix usage of set_buffer_internal.
6323 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6324 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6325 * coding.c (decode_coding): Omit redundant test.
6326 * fileio.c (decide_coding_unwind): Likewise.
6327 * fns.c (secure_hash): Likewise.
6328 * insdel.c (modify_region): Likewise.
6329 * keyboard.c (command_loop_1): Likewise.
6330 * print.c (PRINTFINISH): Likewise.
6331 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6332
59ea14cd
PE
63332012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 * dispnew.c: Use bool for boolean.
6336 (frame_garbaged, display_completed, delayed_size_change)
6337 (fonts_changed_p, add_window_display_history)
6338 (add_frame_display_history, verify_row_hash)
6339 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6340 (row_equal_p, realloc_glyph_pool)
6341 (allocate_matrices_for_frame_redisplay)
6342 (showing_window_margins_p)
6343 (adjust_frame_glyphs_for_frame_redisplay)
6344 (build_frame_matrix_from_leaf_window, make_current)
6345 (mirrored_line_dance, mirror_line_dance, update_frame)
6346 (update_window_tree, update_single_window)
6347 (check_current_matrix_flags, update_window, update_text_area)
6348 (update_window_line, set_window_update_flags, scrolling_window)
6349 (update_frame_1, scrolling, buffer_posn_from_coords)
6350 (do_pending_window_change, change_frame_size)
6351 (change_frame_size_1, sit_for):
6352 Use bool for boolean.
6353 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6354 and remove last int (actually boolean) argument, which was always 0.
6355 All callers changed.
6356 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6357 * dispextern.h (struct composition_it): Use bool for boolean.
6358 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6359 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6360 * dired.c (file_name_completion):
6361 Use bool for boolean. (This was missed in an earlier change.)
6362
95072a94
MR
63632012-08-27 Martin Rudalics <rudalics@gmx.at>
6364
6365 * window.c (Fset_window_configuration): Revert first part of
6366 last change.
6367
0f19feff
JD
63682012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6369
6370 * nsterm.h (NSPanel): New class variable dialog_return.
6371
3a880af4
SM
6372 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6373 Initialize dialog_return.
0f19feff
JD
6374 (windowShouldClose:): Use stop instead of stopModalWithCode.
6375 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6376 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6377 event.
6378 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6379 modal loop returns.
6380
f10fe38f
PE
63812012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6382
de1339b0
PE
6383 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6384 * composite.c (find_composition, composition_gstring_p)
6385 (composition_reseat_it, find_automatic_composition):
6386 * data.c (let_shadows_buffer_binding_p)
6387 (let_shadows_global_binding_p, set_internal, make_blv)
6388 (Fmake_variable_buffer_local, Fmake_local_variable)
6389 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6390 (cons_to_signed, arith_driver):
6391 * dbusbind.c (xd_in_read_queued_messages):
6392 * dired.c (directory_files_internal, file_name_completion):
6393 Use bool for booleans.
6394 * dired.c (file_name_completion):
6395 * process.h (fd_callback):
6396 Omit int (actually boolean) argument. It wasn't being used.
6397 All uses changed.
6398 * composite.h, lisp.h: Reflect above API changes.
6399
f10fe38f
PE
6400 * cmds.c, coding.c: Use bool for booleans.
6401 * cmds.c (move_point, Fself_insert_command):
6402 * coding.h (struct composition status, struct coding_system):
6403 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6404 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6405 (emacs_mule_char, decode_coding_emacs_mule)
6406 (encode_coding_emacs_mule, detect_coding_iso_2022)
6407 (decode_coding_iso_2022, encode_invocation_designation)
6408 (encode_designation_at_bol, encode_coding_iso_2022)
6409 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6410 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6411 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6412 (encode_coding_raw_text, detect_coding_charset)
6413 (decode_coding_charset, encode_coding_charset, detect_eol)
6414 (detect_coding, get_translation_table, produce_chars)
6415 (consume_chars, reused_workbuf_in_use)
6416 (make_conversion_work_buffer, code_conversion_save)
6417 (decode_coding_object, encode_coding_object)
6418 (detect_coding_system, char_encodable_p)
6419 (Funencodable_char_position, code_convert_region)
6420 (code_convert_string, code_convert_string_norecord)
6421 (Fset_coding_system_priority):
6422 * fileio.c (Finsert_file_contents):
6423 Use bool for booleans.
6424 * coding.h, lisp.h: Reflect above API changes.
6425 * coding.c: Remove unnecessary static function decls.
6426 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6427 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6428 not a boolean 'int', since callers never look at the return value.
6429 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6430 * coding.h (decoding_buffer_size, encoding_buffer_size)
6431 (emacs_mule_string_char): Remove unused extern decls.
6432 (struct iso_2022_spec, struct coding_system):
6433 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6434 (struct emacs_mule_spec): Remove unused field 'full_support'.
6435 All initializations removed.
6436 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6437
5474c384
DA
64382012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6439
f10fe38f 6440 Fix spare memory change (Bug#12286).
5474c384
DA
6441 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6442 (valid_lisp_object_p): Likewise.
6443
c4b6914d
MR
64442012-08-27 Martin Rudalics <rudalics@gmx.at>
6445
6446 * window.c (Fset_window_configuration): Record any window's old
6447 buffer if it's replaced (see Bug#8789). If the new current
6448 buffer doesn't appear in the selected window, go to its old
6449 point (Bug#12208).
6450
35aaa1ea
DA
64512012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6452
6453 Special MEM_TYPE_SPARE to denote reserved memory.
6454 * alloc.c (enum mem_type): New memory type.
6455 (refill_memory_reserve): Use new type for spare memory.
6456 This prevents live_cons_p and live_string_p from incorrect
6457 detection of uninitialized objects from spare memory as live.
6458
6af64513
PE
64592012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6460
8b2e00a3
PE
6461 Spelling fixes.
6462 * Makefile.in (.PHONY): versioclean -> versionclean.
6463
b52d6985
PE
6464 Remove unused external symbols.
6465 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6466 * window.c (Qwindow_valid_p, decode_valid_window):
6467 Now static, not extern.
6468 * data.c (Qinterval): Remove; unused.
6469 (syms_of_data): Do not define 'interval'.
6470 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6471 * window.h (decode_valid_window):
6472 Remove decls.
6473
d5172d4f
PE
6474 * character.c, charset.c, chartab.c: Use bool for booleans.
6475 * character.c (lisp_string_width, string_count_byte8)
6476 (string_escape_byte8):
6477 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6478 (load_charset_map_from_file, map_charset_chars)
6479 (Fdefine_charset_internal, define_charset_internal)
6480 (Fdeclare_equiv_charset, find_charsets_in_text)
6481 (Ffind_charset_region, char_charset, Fiso_charset):
6482 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6483 (sub_char_table_set, sub_char_table_set_range)
6484 (char_table_set_range, optimize_sub_char_table)
6485 (map_sub_char_table):
6486 Use bool for boolean.
6487 * character.c (str_to_unibyte): Omit last boolean argument; it was
6488 always 0. All callers changed.
6489 * character.h, charset.h: Adjust to match previous changes.
6490 * character.h (char_printable_p): Remove decl of nonexistent function.
6491 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6492 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6493 are all boolean, so make them single-bit bitfields.
6494
6af64513
PE
6495 * lisp.h (ASET): Remove attempt to detect side effects.
6496 It was meant to be temporary and it often doesn't work,
6497 because when IDX has side effects the behavior of IDX==IDX
6498 is undefined. See Stefan Monnier in
6499 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6500
e1f29348
BR
65012012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6502
6503 * lisp.h (functionp): New function (extracted from Ffunctionp).
6504 (FUNCTIONP): Use it.
6505 * eval.c (Ffunctionp): Use it.
6506
17c05d74
PE
65072012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6508
0f46bc75
PE
6509 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6510 as that's faster and simpler than static storage. Don't bother
6511 with the g_main_context_query overhead if g_main_context_pending
6512 says no events are pending.
6513 (gfds, gfds_size): Remove these static vars.
6514 (xgselect_initialize): Remove; no longer needed.
6515 All uses and decls removed.
6516
ee4c0f69
PE
6517 * emacs.c (fatal_error_signal_hook): Remove.
6518 All uses removed. This leftover from old code was always 0.
6519
17c05d74
PE
6520 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6521 * casefiddle.c (casify_object, casify_region):
6522 * casetab.c (set_case_table):
6523 * category.c, category.h (word_boundary_p):
6524 * category.h (CHAR_HAS_CATEGORY):
6525 Use bool for booleans, instead of int.
6526
391ceac5
EZ
65272012-08-25 Eli Zaretskii <eliz@gnu.org>
6528
6529 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6530
2f221583
PE
65312012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6532
f4a681b0
PE
6533 On assertion failure, print backtrace if available.
6534 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6535 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6536 * Makefile.in (LIB_EXECINFO): New macro.
6537 (LIBES): Use it.
6538
2f221583
PE
6539 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6540 * bytecode.c (exec_byte_code):
6541 * callint.c (check_mark, Fcall_interactively):
6542 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6543 (getenv_internal, sync_process_alive, call_process_exited):
6544 * lisp.h (USE_SAFE_ALLOCA):
6545 Use bool for booleans, instead of int.
6546 * lisp.h, process.h: Adjust prototypes to match above changes.
6547 * callint.c (Fcall_interactively): Don't assume the mark's
6548 offset fits in 'int'.
6549
37ef52bb
PE
65502012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6551
6552 * buffer.c, buffer.h: Use bool for boolean.
6553 * buffer.c (reset_buffer_local_variables)
6554 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6555 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6556 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6557 (overlay_touches_p, overlay_strings, Foverlay_put)
6558 (report_overlay_modification, call_overlay_mod_hooks):
6559 (mmap_enlarge, mmap_set_vars):
6560 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6561 Use bool for booleans, instead of int.
6562 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6563 since the 1-or-0 return value is always ignored anyway.
6564 (mmap_initialized_p):
6565 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6566 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6567
2cc21167
PE
65682012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6569
6570 * bidi.c: Use bool for boolean.
6571 This is a bit more readable, and makes the text segment of bidi.o
6572 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6573 Presumably it's faster too.
6574 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6575 Now bool.
6576 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6577 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6578 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6579 (bidi_explicit_dir_char, bidi_level_of_next_char)
6580 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6581 Use bool for booleans, instead of int.
6582 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6583 (bidi_unshelve_cache): Adjust decls to match code.
6584
7db4ddf4
MR
65852012-08-23 Martin Rudalics <rudalics@gmx.at>
6586
6587 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6588 argument.
6589
b1bb8011
PE
65902012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6591
6592 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6593 * atimer.h: Include <stdbool.h>.
6594
ff687885
DN
65952012-08-22 Dan Nicolaescu <dann@gnu.org>
6596
6597 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6598 compile time tests instead of run time tests on systems that do
6599 not use them.
6600 (FRAME_MAC_P): Remove leftover from deleted code.
6601 * frame.c (syms_of_frame): Remove leftover from deleted code.
6602
4ce7a138
JD
66032012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6604
6605 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6606
d733ec6d
PE
66072012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6608
6609 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6610 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6611 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6612 (fontset_add): Return void, for FONTSET_ADD.
6613
d0d2d26f
PE
66142012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6615
fce31d69
PE
6616 * alloc.c: Use bool for booleans.
6617 (gc_in_progress, abort_on_gc)
6618 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6619 (dont_register_blocks) [GC_MALLOC_CHECK]:
6620 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
6621 (check_string_bytes, make_specified_string, memory_full)
6622 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
6623 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
6624 (mark_stack, valid_pointer_p, make_pure_string)
6625 (Fgarbage_collect, survives_gc_p, gc_sweep):
6626 Use bool for booleans, instead of int.
6627 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
6628 Remove unused local.
6629 * alloc.c (PURE_POINTER_P):
6630 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
6631 * editfns.c (Fformat):
6632 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
6633 (Fdo_auto_save):
6634 * fns.c (sweep_weak_table):
6635 * lisp.h (suppress_checking, push_message, survives_gc_p)
6636 (make_pure_string, gc_in_progress, abort_on_gc):
6637 * lread.c (readchar, read1):
6638 * print.c (Fprin1_to_string):
6639 * xdisp.c (push_message):
6640 Use bool for booleans affected directly or indirectly by
6641 alloc.c's changes.
6642
d0d2d26f
PE
6643 Make recently-introduced setters macros.
6644 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
6645 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
6646 (set_fontset_default, set_fontset_fallback): Rename from their
6647 upper-case counterparts, and make them functions rather than macros.
6648 This is more consistent with the other recently-introduced setters.
6649 These don't need to be inline, since they're local.
6650
d18e2bb6
JD
66512012-08-21 Jan Djärv <jan.h.d@swipnet.se>
6652
6653 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
6654 the loop (Bug#12247).
6655
1b9d9d16
PE
66562012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6657
6658 * lisp.h (vcopy): Use memcpy rather than our own loop.
6659 This fixes a performance regression introduced by the recent
6660 addition of vcopy. This means 'vcopy' will need to be modified
6661 for a copying collector, but that's OK. Also, tighten the
6662 checking in the assertion.
6663
b2f09701
EZ
66642012-08-21 Eli Zaretskii <eliz@gnu.org>
6665
6666 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
6667 components for RTL text (Bug#11860). Adjust X-OFFSET of each
6668 non-base glyph for the width of the base character, according to
e1f29348
BR
6669 what x_draw_composite_glyph_string_foreground expects.
6670 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
6671 expectations, to produce correct width of the composed character.
6672 Reverse the sign of the DU offset produced by ScriptPlace.
6673
9b994fed
PE
66742012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6675
6676 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
6677
086ca913
DA
66782012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6679
6680 Avoid direct writes to contents member of struct Lisp_Vector.
6681 * lisp.h (vcopy): New function to copy data into vector.
6682 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
6683 * fns.c (Ffillarray): Use ASET.
6684 * keyboard.c (timer_check_2): Use AREF and ASET.
6685 (append_tool_bar_item, Frecent_keys): Use vcopy.
6686 * lread.c (read_vector): Use ASET.
6687 * msdos.c (Frecent_doskeys): Use vcopy.
6688 * xface.c (Finternal_copy_lisp_face): Use vcopy.
6689 (Finternal_merge_in_global_face): Use ASET and vcopy.
6690 * xfont.c (xfont_list_pattern): Likewise.
6691
5481664a
MR
66922012-08-21 Martin Rudalics <rudalics@gmx.at>
6693
6694 * window.c (Fwindow_point): For the selected window always return
6695 the position of its buffer's point.
6696 (Fset_window_point): For the selected window always go in its
6697 buffer to the specified position.
6698
6d470bdd
DA
66992012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
6700
6701 Setter macros for fontsets.
6702 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
6703 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
6704 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
6705 Adjust users.
6706
24564fe1
GM
67072012-08-20 Glenn Morris <rgm@gnu.org>
6708
6709 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
6710 Don't assume that `ln -f' works.
6711
0a05a035
EZ
67122012-08-20 Eli Zaretskii <eliz@gnu.org>
6713
6714 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
6715 and later about non-assignments with no effect. See discussion at
6716 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
6717 details.
6718
e46f2325
DA
67192012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6720
6721 Inline setter functions for Lisp_Objects slots of struct specbinding.
6722 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
6723 Adjust users.
6724
734fbd86
MR
67252012-08-20 Martin Rudalics <rudalics@gmx.at>
6726
6727 * window.c (select_window): Always make selected window's buffer
6728 current.
6729
f1a95992
DA
67302012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6731
6732 Use AREF and ASET for docstrings of category tables.
6733 * category.h (CATEGORY_DOCSTRING): Use AREF.
6734 (SET_CATEGORY_DOCSTRING): Use ASET.
6735 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
6736
e83064be
DA
67372012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6738
6739 Inline setter functions for hash table members.
6740 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
6741 (set_hash_hash, set_hash_index): Rename with _slot suffix.
6742 (set_hash_key_and_value, set_hash_index, set_hash_next)
6743 (set_hash_hash): New functions.
6744 * charset.c, fns.c: Adjust users.
6745
4ce60d2e
DA
67462012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
6747
6748 Inline getter and setter functions for per-buffer values.
6749 * buffer.h (per_buffer_default, set_per_buffer_default)
6750 (per_buffer_value, set_per_buffer_value): New functions.
6751 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
6752 * buffer.c, data.c: Adjust users.
6753
c06c9690
JB
67542012-08-20 Juanma Barranquero <lekktu@gmail.com>
6755
6756 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
6757
32bd4250
PE
67582012-08-19 Paul Eggert <eggert@cs.ucla.edu>
6759
bad03192 6760 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
6761 as gnulib does this if the system doesn't.
6762 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
6763 Remove declaration. MS-Windows declares it on stdlib.h which is
6764 included by conf_post.h.
b69a6d22
PE
6765 * emacs.c (environ) [DOUG_LEA_MALLOC]:
6766 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
6767 * vm-limit.c: Include <unistd.h>, for 'environ'.
6768
22d7feb2
PE
6769 * unexaix.c, unexcoff.c: Include "mem-limits.h".
6770 (start_of_data): Remove decl; mem-limits.h provides it.
6771
32bd4250
PE
6772 * xdisp.c (handle_invisible_prop): Make it a bit faster
6773 and avoid a gcc -Wmaybe-uninitialized diagnostic.
6774
450809af
CY
67752012-08-19 Chong Yidong <cyd@gnu.org>
6776
6777 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
6778 ends (Bug#3874).
6779
9e677988
AS
67802012-08-19 Andreas Schwab <schwab@linux-m68k.org>
6781
6b1319ce
AS
6782 * .gdbinit: Use call instead of set when calling a function in the
6783 inferior.
6784
9e677988
AS
6785 * data.c (set_internal): Don't use set_blv_found.
6786 (Fkill_local_variable): Likewise.
6787
d7191076
AA
67882012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
6789
6790 * nsfont.m (ns_ascii_average_width): Ensure the string
6791 ascii_printable is initialized with a null-terminated character
6792 array. Otherwise, it can contain undesired extra characters.
6793
e757f1c6
PE
67942012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 port new setting code to Sun C 5.8 2005/10/13
6797 * chartab.c, lisp.h (char_table_set, char_table_set_range):
6798 Return void, not Lisp_Object. Otherwise, the compiler
6799 complains about (A?B:C) where B is void and C is Lisp_Object
6800 when compiling CHAR_TABLE_SET, due to the recent change to
6801 the API of sub_char_table_set_contents.
6802
a999ce26
CY
68032012-08-18 Chong Yidong <cyd@gnu.org>
6804
6805 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
6806 for the string case (Bug#3874).
6807
3f22b86f
PE
68082012-08-18 Paul Eggert <eggert@cs.ucla.edu>
6809
39eb03f1
PE
6810 * buffer.h (BSET): Remove (Bug#12215).
6811 Replace all uses with calls to new setter functions.
6812 (bset_bidi_paragraph_direction, bset_case_canon_table)
6813 (bset_case_eqv_table, bset_directory, bset_display_count)
6814 (bset_display_time, bset_downcase_table)
6815 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
6816 (bset_last_selected_window, bset_local_var_alist)
6817 (bset_mark_active, bset_point_before_scroll, bset_read_only)
6818 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
6819 (bset_width_table):
6820 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6821 (bset_auto_fill_function, bset_auto_save_file_format)
6822 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6823 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6824 (bset_cache_long_line_scans, bset_case_fold_search)
6825 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6826 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6827 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6828 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6829 (bset_header_line_format, bset_indicate_buffer_boundaries)
6830 (bset_indicate_empty_lines, bset_invisibility_spec)
6831 (bset_left_fringe_width, bset_major_mode, bset_mark)
6832 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6833 (bset_name, bset_overwrite_mode, bset_pt_marker)
6834 (bset_right_fringe_width, bset_save_length)
6835 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6836 (bset_scroll_up_aggressively, bset_selective_display)
6837 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6838 (bset_word_wrap, bset_zv_marker):
6839 * category.c (bset_category_table):
6840 * syntax.c (bset_syntax_table):
6841 New setter functions.
6842
6a09a33b
PE
6843 * process.h (PSET): Remove (Bug#12215).
6844 Replace all uses with calls to new setter functions.
6845 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6846 (PROCESS_INLINE): New macro.
6847 (pset_childp): New setter function.
6848 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
6849 * process.c (PROCESS_INLINE):
6850 Define to EXTERN_INLINE, so that the corresponding functions
6851 are compiled into code.
6852 (pset_buffer, pset_command, pset_decode_coding_system)
6853 (pset_decoding_buf, pset_encode_coding_system)
6854 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
6855 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
6856 (pset_type, pset_write_queue): New setter functions.
6857
e8c17b81
PE
6858 * window.h (WSET): Remove (Bug#12215).
6859 Replace all uses with calls to new setter functions.
6860 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6861 (WINDOW_INLINE): New macro.
6862 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
6863 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
6864 (wset_total_lines, wset_vertical_scroll_bar)
6865 (wset_window_end_pos, wset_window_end_valid)
6866 (wset_window_end_vpos): New setter functions.
6867 * window.c (WINDOW_INLINE):
6868 Define to EXTERN_INLINE, so that the corresponding functions
6869 are compiled into code.
6870 (wset_combination_limit, wset_dedicated, wset_display_table)
6871 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
6872 (wset_new_normal, wset_new_total, wset_next_buffers)
6873 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6874 (wset_prev_buffers, wset_right_fringe_width)
6875 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
6876 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
6877 (wset_window_parameters):
6878 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6879 (wset_column_number_displayed, wset_region_showing):
6880 New setter functions.
6881
3f22b86f
PE
6882 * termhooks.h (TSET): Remove (Bug#12215).
6883 Replace all uses with calls to new setter functions.
6884 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6885 (TERMHOOKS_INLINE): New macro.
6886 (tset_charset_list, tset_selection_alist): New setter functions.
6887 * terminal.c (TERMHOOKS_INLINE):
6888 Define to EXTERN_INLINE, so that the corresponding functions
6889 are compiled into code.
6890 (tset_param_alist): New setter function.
6891
742af32f
PE
68922012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6893
15dbb4d6
PE
6894 * keyboard.h (KSET): Remove (Bug#12215).
6895 Replace all uses with calls to new setter functions.
6896 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6897 (KEYBOARD_INLINE): New macro.
6898 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
6899 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
6900 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
6901 New setter functions.
6902 * keyboard.c (KEYBOARD_INLINE):
6903 Define to EXTERN_INLINE, so that the corresponding functions
6904 are compiled into code.
6905 (kset_echo_string, kset_kbd_queue)
6906 (kset_keyboard_translate_table, kset_last_prefix_arg)
6907 (kset_last_repeatable_command, kset_local_function_key_map)
6908 (kset_overriding_terminal_local_map, kset_real_last_command)
6909 (kset_system_key_syms): New setter functions.
6910
f00af5b1
PE
6911 * frame.h (FSET): Remove (Bug#12215).
6912 Replace all uses with calls to new setter functions.
6913 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6914 (FRAME_INLINE): New macro.
6915 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
6916 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
6917 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
6918 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
6919 (fset_param_alist, fset_root_window, fset_scroll_bars)
6920 (fset_selected_window, fset_title, fset_tool_bar_items)
6921 (fset_tool_bar_position, fset_tool_bar_window): New functions.
6922 * frame.c (FRAME_INLINE):
6923 Define to EXTERN_INLINE, so that the corresponding functions
6924 are compiled into code.
6925 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
6926
0c94c8d6
PE
6927 A few more naming-convention fixes for getters and setters.
6928 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
6929 and rename from buffer_overlays_set_before.
6930 (set_buffer_overlays_after): Move here from buffer.h, and rename
6931 from buffer_overlays_set_after.
6932 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
6933 All uses changed.
6934 (set_buffer_intervals): Rename from buffer_set_intervals.
6935 * intervals.c (set_interval_object): Move here from intervals.h,
6936 and rename from interval_set_object.
6937 (set_interval_left): Move here from intervals.h, and rename from
6938 interval_set_left.
6939 (set_interval_right): Move here from intervals.h, and rename from
6940 interval_set_right.
6941 (copy_interval_parent): Move here from intervals.h, and rename from
6942 interval_copy_parent.
6943 * intervals.h (set_interval_parent): Rename from interval_set_parent.
6944 (set_interval_plist): Rename from interval_set_plist.
6945 Return void, not Lisp_Object, since no caller uses the result.
6946 * lisp.h (string_intervals): Rename from string_get_intervals.
6947 (set_string_intervals): Rename from string_set_intervals.
6948
34dabdb7
PE
6949 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
6950 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 6951 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
6952 All uses changed. See the end of
6953 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
6954
742af32f
PE
6955 * lisp.h (CSET): Remove (Bug#12215).
6956 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
6957 (set_char_table_purpose): New functions,
6958 replacing CSET. All uses changed. For example, replace
6959 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 6960 "set_char_table_parent (char_table, parent);".
742af32f
PE
6961 The old version was confusing because it used the same name
6962 'parent' for two different things.
6963
a04e2c62
DA
69642012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6965
6966 Functions to get and set Lisp_Object fields of buffer-local variables.
6967 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
6968 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
6969 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
6970 * data.c, eval.c, frame.c: Adjust users.
6971
383dcbf9
CY
69722012-08-17 Chong Yidong <cyd@gnu.org>
6973
6974 * xfaces.c (merge_face_vectors): If the target font specfies a
6975 font spec, make the font's attributes take precedence over
6976 directly-specified attributes.
6977 (merge_face_ref): Recognize :font.
6978
44386687
DA
69792012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
6980
6981 Do not use memcpy for copying intervals.
6982 * intervals.c (reproduce_interval): New function.
6983 (reproduce_tree, reproduce_tree_obj): Use it.
6984 (reproduce_tree_obj): Remove prototype.
6985
927c7216
PE
69862012-08-17 Paul Eggert <eggert@cs.ucla.edu>
6987
6988 * lisp.h (duration_to_sec_usec): Remove unused decl.
6989
93044f7b
AA
69902012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
6991
6992 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
6993 to an allocated instance of NSString, not to the class itself.
6994
9851e4a5
JB
69952012-08-17 Juanma Barranquero <lekktu@gmail.com>
6996
6997 * makefile.w32-in (C_CTYPE_H): New macro.
6998 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
6999 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7000 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7001
620f13b0
PE
70022012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7003
7004 Use ASCII tests for character types.
7005 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7006 * xfns.c, xterm.c:
7007 Don't include <ctype.h>; was not needed.
7008 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7009 * sysdep.c, xfaces.c:
7010 Include <c-ctype.h> instead of <ctype.h>.
7011 * nsterm.m: Include <c-ctype.h>.
7012 * charset.c (read_hex):
7013 * doc.c (Fsnarf_documentation):
7014 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7015 (DRIVE_LETTER) [DOS_NT]:
7016 (Ffile_name_directory, Fexpand_file_name)
7017 (Fsubstitute_in_file_name):
7018 * font.c (font_parse_xlfd, font_parse_fcname):
7019 * frame.c (x_set_font_backend):
7020 * gtkutil.c (xg_get_font):
7021 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7022 * nsimage.m (hexchar):
7023 * nsterm.m (ns_xlfd_to_fontname):
7024 * sysdep.c (system_process_attributes):
7025 * xfaces.c (hash_string_case_insensitive):
7026 Use C-locale tests instead of locale-specific tests for character
7027 types, since we want the ASCII interpretation here, not the
7028 interpretation suitable for whatever happens to be the current locale.
7029
52162052
MR
70302012-08-16 Martin Rudalics <rudalics@gmx.at>
7031
7032 Consistently check windows for validity/liveness
7033 (Bug#11984, Bug#12025, Bug#12026).
7034 * lisp.h (CHECK_VALID_WINDOW): New macro.
7035 * window.c (decode_window): Rename to decode_live_window.
7036 (decode_valid_window, Fwindow_valid_p): New functions.
7037 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7038 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7039 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7040 (Fwindow_prev_sibling, Fwindow_combination_limit)
7041 (Fset_window_combination_limit, Fwindow_use_time)
7042 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7043 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7044 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7045 (Fwindow_hscroll, Fset_window_hscroll)
7046 (Fwindow_redisplay_end_trigger)
7047 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7048 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7049 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7050 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7051 (Fwindow_end, Fset_window_point, Fset_window_start)
7052 (Fpos_visible_in_window_p, Fwindow_line_height)
7053 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7054 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7055 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7056 (Fset_window_parameter, Fwindow_display_table)
7057 (Fset_window_display_table, Fdelete_other_windows_internal)
7058 (Fset_window_buffer, Fset_window_new_total)
7059 (Fset_window_new_normal, Fdelete_window_internal)
7060 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7061 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7062 (Fwindow_scroll_bars): Check whether argument window is a valid or
7063 live window. Update doc-strings.
7064 (syms_of_window): New symbol Qwindow_valid_p.
7065 * keyboard.c (Fposn_at_x_y): Check whether argument
7066 frame_or_window denotes a valid window.
7067
2751c80f
DA
70682012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7069
7070 Fix previous char table change.
7071 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7072 * chartab.c (optimize_sub_char_table): Likewise.
7073
032a42c8
CY
70742012-08-16 Chong Yidong <cyd@gnu.org>
7075
a2d19368
CY
7076 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7077
032a42c8
CY
7078 * xfont.c (xfont_open):
7079 * xftfont.c (xftfont_open): Set the font's max_width field.
7080
7081 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7082 min_width to space_width and average_width to the average over
7083 printable ASCII characters.
7084 (ns_char_width): Code cleanup.
7085 (ns_ascii_average_width): New utility function.
7086
7087 * font.h (struct font): Update comments.
7088
a098c930
DA
70892012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7090
032a42c8 7091 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
7092 * lisp.h (CSET): New macro.
7093 (char_table_set_extras, char_table_set_contents)
7094 (sub_char_table_set_contents): New function.
7095 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7096 * syntax.c: Adjust users.
7097
8be3a09c
SM
70982012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7099
7100 * eval.c (eval_sub): Bind lexical-binding.
7101 * lread.c (Qlexical_binding): Make non-static.
7102
ac4845a6
JD
71032012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7104
ddee6515
JD
7105 * nsmenu.m (popupSession): Remove.
7106 (pop_down_menu): Remove endModalSession.
7107 (timeout_handler:): New method.
7108 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7109 Call runModalForWindow. Check timer_fired when it returns.
7110 If not set, cancel timer and break out of loop.
7111 Otherwise loop again, with a new timeout.
7112
7113 * nsterm.m: Include fcntl.h if present.
7114 (fd_entry, t_readfds, inNsSelect): Remove.
7115 (select_writefds, select_valid, select_timeout, selfds)
7116 (select_mutex, apploopnr): Add.
7117 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7118 Otherwise call kbd_buffer_store_event.
7119 (ns_send_appdefined): Remove release of fd_entry.
7120 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7121 Increment and decrement apploopnr.
7122 (ns_select): If no file descriptors, just do a NSTimer.
7123 Otherwise copy read/write masks and start select thread (fd_handler).
7124 Start main loop and wait for application defined event.
7125 Inform select thread to stop selecting after main loop is exited.
7126 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 7127 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
7128 (fd_handler:): Loop forever, wait for info from the main thread
7129 to either start or stop selecting. When select returns, send
7130 and appdefined event.
7131 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7132 If not call kbd_buffer_store_event.
7133
7134 * nsterm.h (EmacsApp): fd_handler takes id argument.
7135 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7136
ac4845a6
JD
7137 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7138
eb424fe3
EZ
71392012-08-15 Eli Zaretskii <eliz@gnu.org>
7140
7141 * region-cache.c (move_cache_gap): Update gap_len using the actual
7142 growth of the boundaries array. Do not change cache_len.
7143 (Bug#12196)
7144
4e6a86c6
DA
71452012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7146
7147 Generalize and cleanup font subsystem checks.
7148 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
7149 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7150 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 7151
5bf192ca
DA
71522012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7153
7154 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7155
f2045622
CY
71562012-08-15 Chong Yidong <cyd@gnu.org>
7157
8be3a09c
SM
7158 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7159 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7160 extract the font descriptor instead of just the font name.
7161 In that case, return a font spec instead of a string.
f2045622
CY
7162 (x_last_font_name): Move to this file from xfns.c.
7163
7164 * xfns.c (Fx_select_font): The return value can also be a font
7165 spec. Move x_last_font_name management to gtkutil.c.
7166
7167 * xfaces.c: Make font weight and style symbols non-static.
7168
7f6feb56
SM
71692012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7170
7171 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7172 (bug#12117).
7173
fecbd8ff
SM
71742012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7175
7176 * alloc.c (Fgarbage_collect): Use plural form consistently.
7177
9b8d5165
EZ
71782012-08-14 Eli Zaretskii <eliz@gnu.org>
7179
7180 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7181 iteration through the command loop. Fixes a problem whereby mouse
7182 movements are ignored until the first mouse click.
7183
f5d9e83a
PE
71842012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 Use bool, not int, for Lisp booleans.
7187 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7188 makes Emacs a bit smaller and presumably a bit faster.
7189 * lisp.h: Include <stdbool.h>.
7190 (struct Lisp_Boolfwd, defvar_bool):
7191 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7192 * regex.c [!emacs]: Include <stdbool.h>.
7193 (false, true): Remove; <stdbool.h> does this for us now.
7194
55802e4a
CY
71952012-08-14 Chong Yidong <cyd@gnu.org>
7196
4abcdac8
CY
7197 * character.c (Fcharacterp): Doc fix (Bug#12076).
7198
7199 * data.c (Findirect_variable): Doc fix (Bug#11040).
7200
55802e4a
CY
7201 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7202
7203 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 7204 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 7205
8e99d072
BR
72062012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7207
7208 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7209 (bug#12022).
7210
08908aca
MR
72112012-08-14 Martin Rudalics <rudalics@gmx.at>
7212
7213 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7214 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7215 * minibuf.c (choose_minibuf_frame, read_minibuf):
7216 * w32fns.c (x_create_tip_frame):
7217 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7218 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7219
56120d6f
PE
72202012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7221
7222 * intervals.c (offset_intervals): Remove obsolete comment.
7223
67b77c0b
AS
72242012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7225
7226 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7227
f48b82fd
GR
72282012-08-14 Gergely Risko <gergely@risko.hu>
7229
7230 * coding.c (decode_coding): Record buffer modification before
7231 disabling undo_list (Bug#11773).
7232
fd318b54
DA
72332012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7234
7235 Revert and cleanup some recent overlay changes.
7236 * buffer.h (enum overlay_type): Remove.
7237 (buffer_get_overlays, buffer_set_overlays): Likewise.
7238 (buffer_set_overlays_before, buffer_set_overlays_after):
7239 New function. Adjust users.
7240 (unchain_both): Add eassert.
7241
41a62dd9
DA
72422012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7243
7244 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7245
5884c324
PE
72462012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7247
7248 * gtkutil.c (xg_mark_data): Don't assume C99.
7249
ca06f160
JD
72502012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7251
7252 * gtkutil.c (xg_frame_tb_info): New struct.
7253 (TB_INFO_KEY): New define.
7254 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7255 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7256 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7257 if not present.
7258 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 7259 is up to date. Otherwise store new data.
ca06f160
JD
7260 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7261
7864a3f7
DA
72622012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7263
7264 Use KSET for write access to Lisp_Object members of struct kboard.
7265 * keyboard.h (KSET): New macro.
7266 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7267 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7268 * xterm.c: Adjust users.
7269
4c31be61
DA
72702012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7271
7272 Use BSET for write access to Lisp_Object members of struct buffer.
7273 * buffer.h (BSET): New macro.
7274 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7275 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7276 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7277 * window.c, xdisp.c, xfns.c: Adjust users.
7278
14ae4239
BT
72792012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7280
7281 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7282
32bcadb4
JD
72832012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7284
3d29b2ce 7285 * nsterm.m (not_in_argv): New function.
fc0c31f8 7286 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7287 (application:openFileWithoutUI:, application:openFiles:): Open file
7288 if not_in_argv returns non-zero (bug#12171).
7289
32bcadb4 7290 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7291 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7292 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7293 (xg_get_font_name): Use those functions/macros here.
7294 Reported by Frans Oilinki <moilinki@gmail.com>.
7295
9ff9402d 72962012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7297
7298 * unexmacosx.c (copy_data_segment): Copy initialized data in
7299 statically linked libraries from input file rather than memory.
7300
db74a5fc
YM
7301 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7302 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7303 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7304
25e65510
GM
73052012-08-10 Glenn Morris <rgm@gnu.org>
7306
7307 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7308 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7309
7961135c
DA
73102012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7311
7312 Fix last change to allow compilation with low optimization levels.
7313 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7314 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7315
42b3a444
DA
73162012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7317
7318 Use common inline syntax in intervals.h.
7319 * intervals.h (INTERVALS_INLINE): New macro.
7320 Change all users from LISP_INLINE.
7321
9fb0c957
DA
73222012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7323
7324 Define Qnone once for all platforms.
7325 * frame.c (Qnone): Define here.
7326 (syms_of_frame): DEFSYM it.
7327 * lisp.h (Qnone): New declaration.
7328 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7329 * xfns.c: Remove duplication. Adjust users.
7330
65e8ee52
DA
73312012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7332
7333 Remove unused macros from intervals.h.
7334 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7335 * intervals.c: Adjust comment.
7336
9b855fd6
EZ
73372012-08-10 Eli Zaretskii <eliz@gnu.org>
7338
7339 * w32fns.c <w32_unicode_gui>: New static variable.
7340 (globals_of_w32fns): Initialize it according to os_subtype.
7341 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7342 testing os_subtype.
7343
39cb9e56 73442012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7345 Eli Zaretskii <eliz@gnu.org>
7346
7347 Fix bug #10299 with Unicode characters sent by customized
7348 keyboards created by MSKLC.
7349 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7350 (w32_init_class): Use it to initialize the Emacs class with either
7351 ANSI or Unicode API calls.
7352 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7353 later.
7354 (w32_wnd_proc): If the character code sent by WM_CHAR or
7355 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7356 original message. Call DefWindowProcW on NT and later.
7357
9374581a
GM
73582012-08-10 Glenn Morris <rgm@gnu.org>
7359
4b94e8cf
GM
7360 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7361
9374581a
GM
7362 * lisp.h (DIRECTORY_SEP): Let configure set it.
7363
a2752828
DA
73642012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7365
7366 Use TSET for write access to Lisp_Object slots of struct terminal.
7367 * termhooks.h (TSET): New macro.
7368 * coding.c, terminal.c, xselect.c: Adjust users.
7369
cc92c454
SM
73702012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7371
7372 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7373 the failing expression, include them in the error message.
7374 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7375 * lisp.h (internal_condition_case_n): Update declaration.
7376
4cb3e6b3
DA
73772012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7378
7379 Inline functions to examine and change buffer overlays.
7380 * buffer.c (unchain_both): New function.
7381 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7382 (buffer_has_overlays): New function.
7383 (enum overlay_type): New enum.
7384 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7385 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7386
8707c1e5
DA
73872012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7388
7389 Inline functions to examine and change buffer intervals.
7390 * alloc.c (mark_interval_tree): Remove.
7391 (MARK_INTERVAL_TREE): Simplify.
7392 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7393 * intervals.c (buffer_balance_intervals): New function.
7394 (graft_intervals_into_buffer): Adjust indentation.
7395 (set_intervals_multibyte): Simplify.
7396 * buffer.h (BUF_INTERVALS): Remove.
7397 (buffer_get_intervals, buffer_set_intervals): New function.
7398 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7399 * intervals.c, textprop.c: Adjust users.
7400
ad8c997f
DA
74012012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7402
7403 Inline functions to examine and change string intervals.
7404 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7405 (string_get_intervals, string_set_intervals): New function.
7406 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7407 * lread.c, print.c, textprop.c: Adjust users.
7408
32ac3a6b
GM
74092012-08-08 Glenn Morris <rgm@gnu.org>
7410
7411 * lisp.mk (lisp): Remove language/persian.elc.
7412
77c7bcb1
DA
74132012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7414
7415 Cleanup intervals.
7416 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7417 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
7418 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7419 Adjust comment. Move under #if 0.
77c7bcb1
DA
7420 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7421 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7422
9c08a8d4
DA
74232012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7424
7425 Check total length of intervals with eassert.
7426 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7427 * intervals.c: Change all users to eassert.
7428
26d16b35
EZ
74292012-08-07 Eli Zaretskii <eliz@gnu.org>
7430
14ae4239
BT
7431 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7432 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
7433 INTERNAL_FIELD in Lisp_Cons.
7434
c644523b
DA
74352012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7436
7437 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7438 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7439 name since all xname users are fixed long time ago. Do not
7440 use INTERNAL_FIELD.
7441 (set_symbol_name, set_symbol_function, set_symbol_plist):
7442 (set_symbol_next, set_overlay_plist): New function.
7443 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7444 (struct Lisp_Overlay): Likewise.
7445 (CVAR, MVAR, SVAR): Remove.
7446 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7447 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7448 * xterm.c: Adjust users.
7449 * .gdbinit: Change to use name field of struct Lisp_Symbol
7450 where appropriate.
7451
6a3d20cc
DA
74522012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7453
7454 Basic functions to set Lisp_Object and pointer slots of intervals.
7455 * intervals.h (interval_set_parent, interval_set_object):
7456 (interval_set_left, interval_set_right, interval_set_plist):
7457 (interval_copy_parent): New function.
7458 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
7459 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7460 Adjust indentation.
6a3d20cc
DA
7461 (INTERVAL_SIZE): Remove. Adjust users.
7462 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7463
4d2b044c
DA
74642012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7465
7466 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7467 * process.h (PGET): Remove.
7468 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7469 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7470
d3d50620
DA
74712012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7472
7473 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7474 * window.h (WGET): Remove.
7475 (struct window): Do not use INTERNAL_FIELD.
7476 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7477 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7478 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7479 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7480 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7481 Adjust users.
7482
d10a51dc
CY
74832012-08-07 Chong Yidong <cyd@gnu.org>
7484
7485 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7486 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7487 (Fdelete_window_internal): Signal an error if the window is not on
7488 a live frame (Bug#12025).
7489
e69b0960
DA
74902012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7491
7492 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7493 * frame.h (FGET): Remove.
7494 (struct frame): Do not use INTERNAL_FIELD.
7495 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7496 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7497 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7498 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7499
25a20a3a
JB
75002012-08-06 Juanma Barranquero <lekktu@gmail.com>
7501
7502 * w32.c: Silence compiler warnings.
7503 (map_w32_filename): Remove unused variable `is_fat'.
7504 (chase_symlinks): Add parentheses around expression.
7505
1c6f11f4
GM
75062012-08-06 Glenn Morris <rgm@gnu.org>
7507
1db4583a
GM
7508 * sysdep.c: Respect BROKEN_GETWD.
7509
1c6f11f4
GM
7510 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7511 Let configure handle it.
7512 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7513
2b90362b
DA
75142012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7515
7516 Use GCALIGNMENT where appropriate.
7517 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7518 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7519 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7520
5f50daf2
EZ
75212012-08-06 Eli Zaretskii <eliz@gnu.org>
7522
14ae4239
BT
7523 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7524 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 7525
cbcc7007
SM
75262012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7527
7528 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7529 that should be sufficient for everyone.
7530
4d365fa4
JD
75312012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7532
7533 * keyboard.c (timer_check_2): Add break so timer_check returns next
7534 timeout.
7535
dd86bd82
DA
75362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7537
7538 Fix Windows build errors introduced after converting to WGET and WSET.
7539 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7540 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7541
054e1668
JD
75422012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7543
7544 * nsterm.m (ns_frame_rehighlight): Use FSET.
7545
7546 * nsmenu.m (ns_update_menubar): Use FSET.
7547
21238f11
DA
75482012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7549
7550 Separate read and write access to Lisp_Object slots of Lisp_Process.
7551 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7552 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7553
077288cf
DA
75542012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7555
7556 Separate read and write access to Lisp_Object slots of struct window.
7557 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7558 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7559 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7560 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7561 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7562 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7563 Adjust users.
7564
71688bd7
DA
75652012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7566
7567 Fix Windows build errors introduced after converting to FGET and FSET.
7568 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7569 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7570 (w32_judge_scroll_bars): Change to use FSET.
7571 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7572
f99bac93
DA
75732012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7574
7575 Fix replacement typo.
7576 * window.c (replace_window): Set root_window instead of
7577 selected_window. This fixes a total window subsystem
7578 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7579
8c2a0f2d
GM
75802012-08-06 Glenn Morris <rgm@gnu.org>
7581
7582 * lisp.mk (lisp): Add language/persian.elc.
7583
edd74c35
DA
75842012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7585
7586 Separate read and write access to Lisp_Object slots of struct frame.
7587 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7588 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7589 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7590 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7591 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7592
8671676c
AS
75932012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7594
7595 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7596
663e2b3f
DA
75972012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7598
7599 Generalize common compile-time constants.
7600 * lisp.h (header_size, bool_header_size, word_size): Now here.
7601 (struct Lisp_Vector): Add comment.
7602 (struct Lisp_Bool_Vector): Move up to define handy constants.
7603 (VECSIZE, PSEUDOVECSIZE): Simplify.
7604 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7605 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7606 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7607 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7608 * xfont.c, xmenu.c: Use word_size where appropriate.
7609
d32e47af
LM
76102012-08-05 Lawrence Mitchell <wence@gmx.li>
7611
7612 * search.c (Freplace_match): Treat \? in the replacement text
7613 literally (Bug#8161).
7614
e5d9c0d1
CY
76152012-08-05 Chong Yidong <cyd@gnu.org>
7616
7617 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
7618 * frame.c (Vdelete_frame_functions):
7619 * emacs.c (Vkill_emacs_hook): Doc fix.
7620
8da0576b
EZ
76212012-08-04 Eli Zaretskii <eliz@gnu.org>
7622
7623 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
7624 --with-x-toolkit=no builds.
7625 Reported by Carsten Mattner <carstenmattner@gmail.com>.
7626
02676e5d
CY
76272012-08-04 Chong Yidong <cyd@gnu.org>
7628
7629 * syntax.c (Fmodify_syntax_entry): Doc fix.
7630
97147da9
EZ
76312012-08-04 Eli Zaretskii <eliz@gnu.org>
7632
76151e2c
EZ
7633 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
7634 * w32.c (init_environment): Change the default values of many
7635 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
7636 them into environment when they were not already defined.
7637 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 7638 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
7639 (check_windows_init_file): Now external, not static.
7640 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
7641 called when Vload_path is already set up.
7642
7643 * w32.h (check_windows_init_file): Add prototype.
7644
7645 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
7646 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
7647 compatibility with Posix platforms.
7648 (main): Move the call to check_windows_init_file to here from
7649 w32.c.
7650 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
7651 any, in the DEFALT argument into the root of the Emacs build or
7652 installation tree, as appropriate.
7653
7654 * callproc.c (init_callproc_1): Call decode_env_path instead of
7655 doing its equivalent by hand.
7656 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
7657 the code that sets Vexec_path run on MS-Windows.
7658
7659 * lread.c (init_lread): Add comments to #ifdef's.
7660
97147da9
EZ
7661 * msdos.c (dos_set_window_size, IT_update_begin)
7662 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
7663 instead of direct references.
7664
185ee146
PE
76652012-08-04 Paul Eggert <eggert@cs.ucla.edu>
7666
7667 Export DEFAULT_REHASH_* to GDB.
7668 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
7669 Now constants, not macros.
7670
8834c57a
PE
76712012-08-03 Paul Eggert <eggert@cs.ucla.edu>
7672
98c6f1e3
PE
7673 Remove unnecessary casts involving pointers.
7674 These casts are no longer needed now that we assume C89 or later,
7675 since they involve casting to or from void *.
7676 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
7677 (make_pure_float, make_pure_vector):
7678 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
7679 * macros.c (Fstart_kbd_macro):
7680 * menu.c (find_and_return_menu_selection):
7681 * minibuf.c (read_minibuf_noninteractive):
7682 * sysdep.c (closedir):
7683 * xdisp.c (x_produce_glyphs):
7684 * xfaces.c (compare_fonts_by_sort_order):
7685 * xfns.c (x_real_positions, select_visual):
7686 * xselect.c (x_stop_queuing_selection_requests)
7687 (x_get_window_property, x_get_window_property_as_lisp_data):
7688 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
7689 Remove unnecessary pointer casts.
7690 * alloc.c (record_xmalloc): New function.
7691 * lisp.h (record_xmalloc): New decl.
7692 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
7693 more like a function. This is because the pointer cast is not
7694 needed. All uses changed.
7695 * print.c (print_string, print_error_message): Avoid length recalc.
7696
8834c57a
PE
7697 Improve fix for macroexp crash with debugging (Bug#12118).
7698 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
7699 ARRAY_MARK_FLAG when checking subscripts, because ASET is
7700 not supposed to be invoked from the garbage collector.
7701 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
7702 (gc_aset): New function, which is like ASET but can be
7703 used in the garbage collector.
7704 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7705 (set_hash_index): Use it instead of ASET.
7706
6dad7178
EZ
77072012-08-03 Eli Zaretskii <eliz@gnu.org>
7708
7709 Support symlinks on latest versions of MS-Windows.
7710 * w32.c: Include winioctl.h and aclapi.h.
7711 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
7712 (revert_to_self): Forward declarations of static functions.
7713 <static BOOL g_b_init_get_security_info>:
7714 <g_b_init_create_symbolic_link>: New static flags.
7715 (globals_of_w32): Initialize them to zero.
7716 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
7717 (map_w32_filename): Improve commentary. Simplify switch.
7718 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
7719 headers (most versions of MinGW w32api don't).
7720 (get_security_info, create_symbolic_link)
7721 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
7722 New functions.
7723 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
7724 in the argument file name.
7725 (sys_access): Call unc_volume_file_attributes only if
7726 GetFileAttributes fails with network-related error codes.
7727 (sys_rename): Diagnose renaming of a symlink when the user doesn't
7728 have the required privileges.
14ae4239 7729 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
7730 get_file_security_desc.
7731 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
7732 with addition of handling of symlinks and support for 'lstat'.
7733 If possible, get file's attributes and security information by
6dad7178
EZ
7734 handle, not by name. Produce S_IFLNK bit for symlinks, when
7735 called from 'lstat'.
7736 (stat, lstat): New functions, call 'stat_worker'.
7737 (symlink, readlink, careadlinkat): Rewritten to create and resolve
7738 symlinks when the underlying filesystem supports them.
7739
f162bcc3
PE
77402012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7741
79ea6c20
PE
7742 Fix macroexp crash on Windows with debugging (Bug#12118).
7743 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
7744 checking subscripts; problem introduced with the recent
7745 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
7746 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
7747 since it's used in non-static inline functions now.
7748
c0ce93fd
PE
7749 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
7750 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 7751
f162bcc3
PE
7752 Use C99-style 'extern inline' if available.
7753 * buffer.h (BUFFER_INLINE):
7754 * category.h (CATEGORY_INLINE):
7755 * character.h (CHARACTER_INLINE):
7756 * charset.h (CHARSET_INLINE):
7757 * composite.h (COMPOSITE_INLINE):
7758 * dispextern.h (DISPEXTERN_INLINE):
7759 * lisp.h (LISP_INLINE):
7760 * systime.h (SYSTIME_INLINE):
7761 New macro, replacing 'static inline' in this header.
7762 * buffer.h, category.h, character.h, charset.h, composite.h:
7763 * dispextern.h, lisp.h, systime.h:
7764 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7765 * alloc.c (LISP_INLINE):
7766 * buffer.c (BUFFER_INLINE):
7767 * category.c (CATEGORY_INLINE):
7768 * character.c (CHARACTER_INLINE):
7769 * charset.c (CHARSET_INLINE):
7770 * composite.c (COMPOSITE_INLINE):
7771 * dispnew.c (DISPEXTERN_INLINE):
7772 * sysdep.c (SYSTIME_INLINE):
7773 Define to EXTERN_INLINE, so that the corresponding functions
7774 are compiled into code.
7775 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
7776 (INLINE_HEADER_END): New macros.
7777 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
7778 since it's used in non-static inline functions now.
a8333d03 7779 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 7780
837b365b
GM
77812012-08-02 Glenn Morris <rgm@gnu.org>
7782
d66b744d
GM
7783 * s/: Remove empty directory.
7784
837b365b
GM
7785 * s/ms-w32.h: Move to ../nt/inc.
7786 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
7787 Update for new ms-w32.h location.
7788
13294f95
PE
77892012-08-02 Paul Eggert <eggert@cs.ucla.edu>
7790
7791 Port to Solaris 8.
7792 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
7793
90df0db3
GM
77942012-08-02 Glenn Morris <rgm@gnu.org>
7795
7796 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
7797 hard-coding the path separator.
7798
4939150c
PE
77992012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7800
7801 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
7802 This how ASET and AREF are supposed to work, and makes
7803 it easier to think about future improvements. See
7804 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
7805 * charset.h (set_charset_attr): New function.
7806 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
7807 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
7808 (aref_addr): New function. All uses of &AREF(...) changed.
7809 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
7810 (set_hash_index): New functions. All lvalue-style uses of
7811 HASH_KEY etc. changed.
7812 * keyboard.c (set_prop): New function. All lvalue-style uses
7813 of PROP changed.
7814
947b2afd
AA
78152012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
7816
7817 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
7818 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 7819 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
7820 * nsfns.m (ns_set_name_as_filename): Likewise.
7821 * nsmenu.m (ns_update_menubar): Likewise.
7822 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
7823
4f5d0325
EZ
78242012-08-01 Eli Zaretskii <eliz@gnu.org>
7825
2008beae
EZ
7826 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
7827 Adapt to latest changes in field names of the corresponding Lisp
288479f6 7828 objects.
2008beae 7829
4f5d0325
EZ
7830 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
7831
fe3cc771
GM
78322012-08-01 Glenn Morris <rgm@gnu.org>
7833
7834 * s/msdos.h: Remove file.
7835 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
7836 * Makefile.in (S_FILE): Remove.
7837 (config_h): Remove S_FILE.
7838
c90acc54
JB
78392012-08-01 Juanma Barranquero <lekktu@gmail.com>
7840
7841 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
7842 Remove; moved to nt/config.nt.
7843
d8a05828
DA
78442012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7845
7846 Use INTERNAL_FIELD for conses and overlays.
7847 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
7848 Remove obsolete comment.
7849 (MVAR): New macro.
7850 (struct Lisp_Overlay): Use INTERNAL_FIELD.
7851 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
7852
8271d590
DA
78532012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7854
7855 Use INTERNAL_FIELD for symbols.
7856 * lisp.h (SVAR): New macro. Adjust users.
7857 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
7858 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
7859
3193acd2
DA
78602012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7861
7862 Use INTERNAL_FIELD for processes.
7863 * process.h (PVAR): New macro. Adjust style.
7864 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
7865 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
7866
3a45383a
DA
78672012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
7868
7869 Use INTERNAL_FIELD for windows.
7870 * window.h (WVAR): New macro.
7871 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
7872 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7873 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7874 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
7875 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
7876 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7877
c1dbc63c
PE
78782012-08-01 Paul Eggert <eggert@cs.ucla.edu>
7879
7880 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
7881
5c0c0e8a
GM
78822012-08-01 Glenn Morris <rgm@gnu.org>
7883
7884 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
7885 Move to configure.ac.
7886
552a99b4
JB
78872012-08-01 Juanma Barranquero <lekktu@gmail.com>
7888
7889 * makefile.w32-in (CONFIG_H): Update dependencies.
7890 (CONF_POST_H): New macro.
7891
7892 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
7893
8d8e2dfe
GM
78942012-07-31 Glenn Morris <rgm@gnu.org>
7895
bc96620a
GM
7896 * Makefile.in (S_FILE): No longer set by configure.
7897
476b1b2d
GM
7898 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
7899 is available.
7900 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
7901
b2c7a106
GM
7902 * process.h (NULL_DEVICE):
7903 * emacs.c (SEPCHAR):
7904 * editfns.c (USER_FULL_NAME): Let configure set them.
7905
d53d062a
GM
7906 * s/README, s/template.h: Remove files.
7907
4515017f
GM
7908 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
7909
8d8e2dfe
GM
7910 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
7911 Move to configure.ac.
7912
5b20b3cc
EZ
79132012-07-31 Eli Zaretskii <eliz@gnu.org>
7914
1e0afd9a
EZ
7915 * .gdbinit (xframe): Adapt to introduction of FVAR and the
7916 resulting renaming of 'struct frame' members.
7917
5b20b3cc
EZ
7918 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
7919
7920 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
7921 after introduction of FVAR.
7922
f1310128
JD
79232012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7924
79e721e0
JD
7925 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
7926
7927 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
7928 instead of compositeToPoint.
7929 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
7930
8d7c7eed 7931 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 7932
e34f7f79
DA
79332012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7934
7935 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
7936 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 7937 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
7938 (BVAR): Change to use INTERNAL_FIELD.
7939 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
7940 (KVAR): Change to use INTERNAL_FIELD.
7941 * frame.h (FVAR): New macro.
7942 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
7943 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
7944 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
7945 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
7946 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
7947
c09bfb2f
DA
79482012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
7949
7950 Miscellaneous fixes for non-default X toolkits.
7951 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
7952 * xterm.c (x_frame_of_widget): Remove redundant prototype.
7953 Move under #ifdef USE_LUCID.
7954 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
7955 definition and usage to avoid warnings.
7956
14c114ae
JD
79572012-07-31 Jan Djärv <jan.h.d@swipnet.se>
7958
7959 * nsterm.m (openFiles): Fix previous checkin.
7960
3bd21e82
PE
79612012-07-31 Paul Eggert <eggert@cs.ucla.edu>
7962
7963 * indent.c (compute_motion): Remove unused local.
7964
c1529ded
GM
79652012-07-31 Glenn Morris <rgm@gnu.org>
7966
400d5621
GM
7967 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
7968
268e2432
GM
7969 * conf_post.h [USG5_4]:
7970 Move remaining contents of s/usg5-4-common.h here.
7971 * s/usg5-4-common.h: Remove file.
7972
7552f3ee
GM
7973 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
7974 * s/irix6-5.h: Remove file.
7975
6a381852
GM
7976 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
7977 * s/darwin.h: Remove file.
7978
c1529ded
GM
7979 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
7980 * s/hpux10-20.h: Remove file, which is now empty.
7981
b429a4ee
GM
79822012-07-30 Glenn Morris <rgm@gnu.org>
7983
7984 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
7985 * Makefile.in (config_h): Add conf_post.h.
7986 * makefile.w32-in (CONFIG_H): Add conf_post.h.
7987
adff3182
JD
79882012-07-30 Jan Djärv <jan.h.d@swipnet.se>
7989
7990 * nsterm.m (ns_do_open_file): New variable.
b9031d69 7991 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
7992 (openFile, openTempFile, openFileWithoutUI, openFiles):
7993 Open files only if ns_do_open_file.
adff3182 7994
c32af1e4
PE
79952012-07-30 Paul Eggert <eggert@cs.ucla.edu>
7996
7393bcbb
PE
7997 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
7998 This no-op macro hasn't been needed for many years.
7999 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8000
c32af1e4
PE
8001 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8002 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8003 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8004 gdb_make_enums_visible.
8005 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8006 (DIRECTORY_SEP): Now a constant, not a macro.
8007
302fc036
EZ
80082012-07-30 Eli Zaretskii <eliz@gnu.org>
8009
8010 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8011 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8012
8013 * w32term.c <w32_keyboard_codepage>: Renamed from
8014 keyboard_codepage and now external. All users changed.
8015
8016 * w32term.h: Add declaration of w32_keyboard_codepage.
8017
8018 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8019 the codepage to translate keys to Unicode. If this argument is
8020 -1, use the value returned by GetConsoleCP. All callers changed.
8021
88fb40b4
PE
80222012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8023
0aee6912
PE
8024 Update .PHONY listings in makefiles.
8025 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8026 bootstrap-clean, distclean, maintainer-clean, versioclean,
8027 extraclean, frc.
8028
88fb40b4
PE
8029 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8030 This is a bit clearer. Fix some commentary typos.
8031
0a763bd1
GM
80322012-07-30 Glenn Morris <rgm@gnu.org>
8033
32bac6d6
GM
8034 * s/netbsd.h: Let configure include signal.h if needed.
8035 Remove file, which is now empty.
8036
b65e7c46
GM
8037 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8038 Let configure set them.
8039 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8040 No more need to undefine.
0a763bd1 8041
169304bd
AS
80422012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8043
8044 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8045 non-single-byte char when adding meta modifier. (Bug#12090)
8046
6cd7a139
DA
80472012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8048
8049 Convert safe_call to use variable number of arguments.
8050 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8051 (safe_call2): Fix comment.
8052 * lisp.h (safe_call): Adjust prototype.
8053 * coding.c (encode_coding_object): Change to use safe_call2.
8054 * xfaces.c (merge_face_heights): Change to use safe_call1.
8055
d34d6ffc
GM
80562012-07-30 Glenn Morris <rgm@gnu.org>
8057
7b8a48e4 8058 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 8059 does that unconditionally. Remove file, which is now empty.
7b8a48e4 8060
d34d6ffc
GM
8061 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8062 Remove empty files.
8063
03a660a6
PE
80642012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 Export to GDB most of lisp.h's remaining object-like macros.
8067 * lisp.h (min, max): Move earlier, because they're used earlier now.
8068 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8069 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8070 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8071 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8072 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8073 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8074 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8075 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8076 Now constants, for GDB. They need not be macros.
8077 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8078 Now constants, for GDB, as well as macros, for static initializers.
8079 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8080 Move to after the definition of struct Lisp_Char_Table,
8081 since the former now needs that type defined.
8082 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8083 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8084 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8085 New enums, for gdb_make_enums_visible.
8086 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 8087 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
8088 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8089 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8090 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8091 enum maxargs, enum MAX_ALLOCA.
8092 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8093 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8094 no longer needed, now that they are done in lisp.h.
8095
e499d0ee
DA
80962012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8097
8098 Cleanup string bytes checking.
8099 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8100 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8101 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8102 (check_sblock, compact_small_strings): Simplify.
8103
d5040d2d
PE
81042012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8105
8106 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8107 These macros are confusing and no longer need to be defined, as
8108 the enum values now suffice. All uses replaced with definiens.
8109 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8110
7f259ae6
JB
81112012-07-29 Juanma Barranquero <lekktu@gmail.com>
8112
8113 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8114 ($(BLD)/w32console.$(O)): Update dependencies.
8115
7e63e0c3
DA
81162012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8117
8118 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8119 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8120 time. Adjust users.
8121 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8122
ffd817eb
JD
81232012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8124
8125 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8126 setting sitelisp (Bug#12010).
8127
417a7a0e
EZ
81282012-07-29 Eli Zaretskii <eliz@gnu.org>
8129
14ae4239 8130 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
8131
8132 * w32heap.c (cache_system_info):
8133 * w32.c (sys_rename):
8134 * w32proc.c (find_child_console, sys_kill): All users changed.
8135
387d4d92
PE
81362012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8137
8138 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8139
55a6cca6
EZ
81402012-07-29 Eli Zaretskii <eliz@gnu.org>
8141
8142 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8143
dbcf001c
DA
81442012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8145
8146 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
8147 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8148 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 8149
e2688e4a
DA
81502012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8151
8152 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8153 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8154 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8155 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8156 (replace_range, replace_range_2, del_range_2): Change to eassert.
8157 * marker.c (byte_char_debug_check): Adjust style.
8158
b46a6a83
PE
81592012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8160
8161 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8162 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8163 long-ago-commented-out code that talks about "WIN32".
8164 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8165 All uses changed.
8166
e32a5799
PE
81672012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8168
8169 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8170 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8171 Simplify by using alignof.
8172 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8173 * lisp.h: Include <stdalign.h>.
8174 (GCALIGNMENT): New macro and constant.
8175 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8176 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8177 (stdalign): New macro, if not already defined.
8178
df81cd29
EZ
81792012-07-28 Eli Zaretskii <eliz@gnu.org>
8180
01bd1b0d
EZ
8181 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8182 * w32inevt.c: Include w32inevt.h.
8183 (w32_read_console_input): New inline function, calls either
8184 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8185 w32_console_unicode_input.
8186 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8187 (w32_kbd_patch_key, key_event): Use the codepage returned by
8188 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8189 (key_event): use uChar.UnicodeChar only if
8190 w32_console_unicode_input is non-zero.
8191
8192 * w32console.c: Include w32heap.h.
8193 <w32_console_unicode_input>: New global variable.
8194 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8195 family of Windows, zero otherwise.
8196
8197 * w32inevt.h: Declare w32_console_unicode_input.
8198
df81cd29
EZ
8199 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8200 --without-x. (Bug#11742)
8201
c20fdd9e
PE
82022012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 Adjust GDB to reflect pvec_type changes (Bug#12036).
8205 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
8206 2012-07-04 changes to pseudovector representation.
8207 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 8208
32770973 82092012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
8210
8211 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8212 bus address.
8213 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8214
3438fe21
EZ
82152012-07-27 Eli Zaretskii <eliz@gnu.org>
8216
bcfbc9de
EZ
8217 * alloc.c (listn): Fix the order the arguments are consed onto the
8218 list.
8219
3438fe21
EZ
8220 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8221 enumeration constants, as PURE and HEAP are too general, and clash
8222 with other headers and sources, such as gmalloc.c and the
8223 MS-Windows system headers. All users changed.
8224
eeaea515
DA
82252012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8226
8227 Revert last save_excursion_save and save_excursion_restore changes.
8228 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8229 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8230
073c88c2
DA
82312012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8232
8233 Fix recently-introduced typos in Windows port.
8234 Reported by Martin Rudalics <rudalics@gmx.at>.
8235 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 8236 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 8237
4706125e
PE
82382012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8239
8240 Improve GDB symbol export (Bug#12036).
8241 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8242 arms of an 'if', not using conditional expressions; otherwise GDB
8243 complains about the types in the unevaluated arm when the argument
8244 is an integer literal.
8245 (xgetint): Simplify expression.
8246 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8247 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8248 Zaretskii in <http://bugs.gnu.org/12036#13>.
8249 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8250 needed now that we have gdb_make_enums_visible.
8251 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8252 (enum enum_USE_LSB_TAG):
8253 New enum types, packaging up enums that need to be exported to GDB.
8254
694b6c97
DA
82552012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8256
8257 Utility function to make a list from specified amount of objects.
8258 * lisp.h (enum constype): New datatype.
8259 (listn): New prototype.
8260 * alloc.c (listn): New function.
8261 (Fmemory_use_count, syms_of_alloc): Use it.
8262 * buffer.c (syms_of_buffer): Likewise.
8263 * callint.c (syms_of_callint): Likewise.
8264 * charset.c (define_charset_internal): Likewise.
8265 * coding.c (syms_of_coding): Likewise.
8266 * keymap.c (syms_of_keymap): Likewise.
8267 * search.c (syms_of_search): Likewise.
8268 * syntax.c (syms_of_syntax): Likewise.
8269 * w32.c (init_environment): Likewise.
8270 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8271 * xdisp.c (syms_of_xdisp): Likewise.
8272 * xfns.c (syms_of_xfns): Likewise.
8273
6195f384
DA
82742012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8275
8276 Fast save_excursion_save and save_excursion_restore.
8277 * lisp.h (struct Lisp_Excursion): New data type.
8278 (PVEC_EXCURSION): New pseudovector type.
8279 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8280 to deal with it. Adjust comments.
8281 (init_marker, attach_marker): New prototype.
8282 (unchain_marker): Adjust prototype.
8283 * marker.c (attach_marker): Change to global.
8284 (init_marker): New function.
8285 * alloc.c (Fmake_marker, build_marker): Use it.
8286 (build_marker): More easserts.
8287 (mark_object): Handle struct Lisp_Excursion.
8288 * editfns.c (save_excursion_save, save_excursion_restore):
8289 Reimplement to use struct Lisp_Excursion. Add comments.
8290
5eceb8fb
PE
82912012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8292
8293 Fix export of symbols to GDB (Bug#12036).
8294 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8295 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8296 emacs.c, as this is a more-suitable home. Had this been done earlier
8297 the fix for 12036 would have avoided some of the problems noted in
8298 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8299 would have been more obvious.
562157c8
PE
8300 * emacs.c: Do not include <verify.h>; no longer needed.
8301 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8302 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8303 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8304 Remove; now done in lisp.h.
8305 * lisp.h (PUBLISH_TO_GDB): New macro.
8306 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8307 (DATA_SEG_BITS): Use it.
8308 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8309 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8310 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8311 not be usable in #if. This simplifies things.
8312
d6749401
JB
83132012-07-26 Juanma Barranquero <lekktu@gmail.com>
8314
8315 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8316
1781b9e9
PE
83172012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8318
d89518db 8319 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8320 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8321 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8322 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8323 Adjust to changes in lisp.h and emacs.c, by using
8324 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8325 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8326 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8327 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8328 instead of gdb_valbits.
8329 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8330 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8331 instead of gdb_array_mark_flag.
8332 (xboolvector): Get size from $->size, not $->header.size.
8333 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8334 (xreload, hook-run, hookpost-run): Remove.
8335 * emacs.c: Include <verify.h>.
8336 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8337 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8338 Remove.
8339 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8340 (gdb_USE_LSB_TAG): New enum constants.
8341 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8342 Also define these as enum constants, so they're visible to GDB.
8343 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8344 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8345 as constants, so they're visible to GDB.
8346 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8347 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8348 Now enum constants, not macros, so they're visible to GDB.
8349 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8350 more convenient now. All uses changed.
8351 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8352 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8353
3628596a
DA
83542012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8355
8356 Explicitly free restriction data that are not needed anymore.
8357 * editfns.c (save_restriction_restore): Free restriction data.
8358
7abaf5cc
SM
83592012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8360
8361 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8362 add argument, tune behavior, and adjust all callers.
8363
71f88e00
PE
83642012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8365
8366 Use typedef for EMACS_INT, EMACS_UINT.
8367 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8368 than macros. This simplifies debugging in the usual case, since
8369 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8370 and it allows expressions involving EMACS_INT casts.
8371 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8372
57ec3034
JD
83732012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8374
8375 * nsterm.m (ns_read_socket): Return early if there is a modal
8376 window (Bug#12043).
8377
8137e7b3
MR
83782012-07-25 Martin Rudalics <rudalics@gmx.at>
8379
8380 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8381 that FOCUS-FRAME can be omitted.
8382
04e9897c
DA
83832012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8384
8385 Adjust buffer text indirection counters at the end of Fkill_buffer.
8386 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8387 buffer is definitely dead. This should really fix an issue reported
8388 by Christoph Scholtes again. (Bug#12007).
8389 (init_buffer_once): Initialize indirection counters of
8390 buffer_defaults and buffer_local_symbols (for sanity and safety).
8391
8a0484e1
EZ
83922012-07-24 Eli Zaretskii <eliz@gnu.org>
8393
8394 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8395 and continuation glyphs on tooltip frames, leave them at zero.
8396 Avoids continued lines in tooltips. (Bug#11832)
8397
fa691a83
DA
83982012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8399
8400 Simplify copy_overlay.
04e9897c 8401 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
8402 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8403
436bc8e0
EZ
84042012-07-23 Eli Zaretskii <eliz@gnu.org>
8405
8406 * print.c (print_object): Don't crash when a frame's name is nil
8407 or invalid. (Bug#12025)
8408
8409 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8410 it signals an error when a tooltip frame is being created.
8411
d7a7fda3
DA
84122012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8413
8414 Cleanup miscellaneous objects allocation and initialization.
8415 * alloc.c (allocate_misc): Change to static. Add argument to
8416 specify the subtype. Adjust comment and users.
8417 (build_overlay): New function.
8418 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8419 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8420 (allocate_misc): Remove prototype.
8421 (build_overlay): Add prototype.
8422
84232012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
8424
8425 Swap buffer text indirection counters in Fbuffer_swap_text.
8426 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8427 This avoids crash reported by Christoph Scholtes at
8428 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8429
9d7fa573
JD
84302012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8431
8432 * nsmenu.m (Popdown_data): New struct.
8433 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8434 free Popdown_data.
8435 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8436 (initWithContentRect): Make imgView and contentView non-static
8437 and autorelease them. Also autorelease img and matrix (Bug#12005).
8438 (dealloc): Remove (Bug#12005).
8439
0dd6d66d
DA
84402012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8441
8442 Adjust consing_since_gc when objects are explicitly freed.
8443 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8444 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8445 (free_cons, free_misc): Subtract object size from consing_since_gc.
8446
d36d71df
DA
84472012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8448
8449 Simplify and cleanup markers positioning code.
8450 * marker.c (attach_marker): More useful eassert.
8451 (live_buffer, set_marker_internal): New function.
8452 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8453 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8454
fb9ea40f
PE
84552012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8456
8457 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8458 as it's limited by the amount of memory, not by INT_MAX.
8459
2d5c5f7d
EZ
84602012-07-21 Eli Zaretskii <eliz@gnu.org>
8461
07fb592e
EZ
8462 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8463 in special-event-map. See the discussion at
8464 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8465 for the reasons.
8466
37a9eac8 8467 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
8468 info.dwItemData. Fixes crashes on 64-bit Windows.
8469 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 8470
c4328746
JD
84712012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8472
fc0c31f8 8473 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 8474 (conversationIdentifier): Return value is NSInteger.
784051c4 8475 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 8476
6e5d1c12
CY
84772012-07-21 Chong Yidong <cyd@gnu.org>
8478
8479 * window.c (decode_any_window): Signal an error if the window is
8480 on a dead frame (Bug#11984).
8481
9928463d
DA
84822012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8483
8484 Add indirection counting to speed up Fkill_buffer.
8485 * buffer.h (struct buffer): New member.
8486 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8487 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8488 base buffer indirection counter.
8489 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8490 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8491 through buffer list if indirection counter is 0.
8492
f8643a6b
DA
84932012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8494
8495 Extend the value returned by Fgarbage_collect with heap statistics.
8496 * alloc.c (Qheap): New symbol.
8497 (syms_of_alloc): DEFSYM it.
8498 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8499 (Fmemory_free): Remove.
8500 (syms_of_alloc): Don't defsubr it.
8501 * buffer.c (Fcompact_buffer): Remove.
8502 (syms_of_buffer): Don't defsubr it.
8503
dac616ff
DA
85042012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8505
8506 Make maybe_gc inline.
8507 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8508 * lisp.h (consing_since_gc, gc_relative_threshold)
8509 (memory_full_cons_threshold): Revert declaration.
8510 (maybe_gc): Remove prototype, define as inline.
8511 * alloc.c: Remove old commented-out code.
8512 (consing_since_gc, gc_relative_threshold)
8513 (memory_full_cons_threshold): Revert to global.
8514 (maybe_gc): Remove.
8515
d7ea76b4
DA
85162012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8517
8518 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8519 * lisp.h (build_unibyte_string): New function.
8520 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8521 * sysdep.c, w32fns.c, xfns.c: Use it.
8522 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8523 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8524 Adjust users accordingly.
8525 * font.h (font_open_by_name): Adjust prototype.
8526
765e61e3
DA
85272012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8528
8529 Cleanup calls to Fgarbage_collect.
8530 * lisp.h (maybe_gc): New prototype.
8531 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8532 Remove declarations.
8533 * alloc.c (maybe_gc): New function.
8534 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8535 Make them static.
8536 * bytecode.c (MAYBE_GC): Use maybe_gc.
8537 * eval.c (eval_sub, Ffuncall): Likewise.
8538 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8539 to avoid dependency from auto-save feature.
8540
52b852c7
PE
85412012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8542
8543 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8544 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8545 'for_each_per_buffer_object_at'.
8546 All uses changed. It's better to use upper-case for macros that
8547 cannot be implemented as functions, to give the reader a clue
8548 that they're special.
8549
5db81e33
SM
85502012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8551
8552 * alloc.c (Fgarbage_collect): Tweak docstring.
8553
5b835e1d
DA
85542012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8555
8556 Tweak the value returned from Fgarbage_collect again.
8557 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8558 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8559 Adjust documentation.
8560 (total_vector_bytes): Rename to total_vector_slots, adjust
8561 accounting.
8562 (total_free_vector_bytes): Rename to total_free_vector_slots,
8563 adjust accounting.
8564 (Qstring_bytes, Qvector_slots): New symbols.
8565 (syms_of_alloc): DEFSYM them.
8566
9cd47b72
DA
85672012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8568
8569 Buffer compaction primitive which may be used from Lisp.
8570 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8571 (syms_of_buffer): Register Fcompact_buffer.
8572 * alloc.c (Fgarbage_collect): Use compact_buffer.
8573 * buffer.h (compact_buffer): New prototype.
8574 (struct buffer_text): New member.
8575
d17337e5
DA
85762012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8577
8578 New macro to iterate over all buffers, miscellaneous cleanups.
8579 * lisp.h (all_buffers): Remove declaration.
8580 * buffer.h (all_buffers): Add declaration, with comment.
8581 (for_each_buffer): New macro.
8582 * alloc.c (Fgarbage_collect, mark_object): Use it.
8583 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8584 (init_buffer): Likewise.
8585 * data.c (Fset_default): Likewise.
8586 * coding.c (code_conversion_restore): Remove redundant check
8587 for dead buffer.
8588 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8589
60cfd278
AS
85902012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8591
8592 Fix bug that created negative-length intervals.
8593 * intervals.c (merge_interval_right, merge_interval_left):
8594 Do not zero out this interval if it is absorbed by its children,
8595 as this interval's total length doesn't change in that case. See
8596 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8597
d06714cb
PE
85982012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8599
83713154
PE
8600 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8601 when invoking (make-bool-vector N t) and N is a positive
8602 multiple of 8 -- the last 8 bits were mistakenly cleared.
8603
d06714cb
PE
8604 Remove some struct layout assumptions in bool vectors.
8605 * alloc.c (bool_header_size): New constant.
8606 (header_size, word_size): Move earlier, as they're now used earlier.
8607 Use 'word_size' in a few more places, where it's appropriate.
8608 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8609 padding before the data member of a bool vector.
8610 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8611 than doing the check by hand with an abort ().
8612
464d5a5e
SM
86132012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8614
5fbc0409
SM
8615 * eval.c (Fdefvar): Don't check constants since we only set the var if
8616 it's not yet defined anyway (bug#11904).
8617
464d5a5e
SM
8618 * lisp.h (last_undo_boundary): Declare new var.
8619 * keyboard.c (command_loop_1): Set it.
8620 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
8621 were auto-added by the command loop (bug#11774).
8622
8dc2e44a
AS
86232012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8624
8625 * w32font.c (Qsymbol): Remove local definition.
8626 (syms_of_w32font): Don't DEFSYM it.
8627
169925ec
DA
86282012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8629
8630 Fix sweep_vectors to handle large bool vectors correctly.
8631 * alloc.c (sweep_vectors): Account total_vector_bytes for
8632 bool vectors larger than VBLOCK_BYTES_MAX.
8633
5fbfb018
CY
86342012-07-18 Chong Yidong <cyd@gnu.org>
8635
8636 * frame.c (x_set_frame_parameters): Revert bogus change introduced
8637 in 2012-05-25 commit by Paul Eggert (Bug#11738).
8638
3ab6e069
DA
86392012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
8640
8641 Return more descriptive data from Fgarbage_collect.
8642 Suggested by Stefan Monnier in
8643 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
8644 * alloc.c (bounded_number): New function.
8645 (total_buffers, total_vectors): New variable.
8646 (total_string_size): Rename to total_string_bytes, adjust users.
8647 (total_vector_size): Rename to total_vector_bytes, adjust users.
8648 (sweep_vectors): Account total_vectors and total_vector_bytes.
8649 (Fgarbage_collect): New return value. Adjust documentation.
8650 (gc_sweep): Account total_buffers.
8651 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
8652 (VECTOR_SIZE): Remove.
8653 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
8654 (Qinterval, Qmisc): New symbols.
8655 (syms_of_data): Initialize them.
8656 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
8657 (Qcons, Qbuffer): New declarations.
8658
6d02fe5b
PE
86592012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8660
8661 * alloc.c (Fmemory_free): Account for memory-free's own storage.
8662 Round up, not down. Improve doc.
8663
b7ffe040
DA
86642012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8665
8666 Restore old code in allocate_string_data to avoid Faset breakage.
8667 Reported by Julien Danjou <julien@danjou.info> in
8668 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
8669 * alloc.c (allocate_string_data): Restore old code with minor
8670 adjustments, fix comment to explain this subtle issue.
8671
4dc7c8d5
SM
86722012-07-17 Eli Zaretskii <eliz@gnu.org>
8673
8674 Remove FILE_SYSTEM_CASE.
8675 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
8676
8677 * fileio.c (FILE_SYSTEM_CASE): Don't define.
8678 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
8679 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
8680 call-process-region passes it through expand-file-name.
8681
8682 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
8683
86842012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8685
8686 Fix crash when creating indirect buffer (Bug#11917)
8687 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
8688 Don't handle unbound variables specially if non-zero.
8689 (Fbuffer_local_variables): Pass zero.
8690 (clone_per_buffer_values): Pass non-zero.
8691
86922012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8693
8694 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
8695 to make the loop interruptible.
8696
86972012-07-17 Andreas Schwab <schwab@linux-m68k.org>
8698
8699 * gnutls.c (emacs_gnutls_handshake): Only retry if
8700 GNUTLS_E_INTERRUPTED.
8701
cce7fefc
DA
87022012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8703
8704 Cleanup and convert miscellaneous checks to eassert.
8705 * alloc.c (mark_interval): Fix comment, partially rephrase
8706 old comment from intervals.h (see below).
8707 * intervals.c (find_interval, adjust_intervals_for_insertion)
8708 (delete_interval, adjust_intervals_for_deletion)
8709 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
8710 Convert to eassert.
8711 (adjust_intervals_for_insertion, make_new_interval):
8712 Remove obsolete and unused code.
8713 * intervals.h (struct interval): Remove obsolete comment.
8714 * textprotp.c (erase_properties): Remove unused code.
8715 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
8716 (Fremove_list_of_text_properties): Convert to eassert.
8717
9ea10cc3
CY
87182012-07-17 Chong Yidong <cyd@gnu.org>
8719
8720 * editfns.c (Finsert_char): Doc fix.
8721
3900d5de
DA
87222012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8723
8724 Fix previous change to make Fmemory_free always accurate.
8725 * alloc.c (make_interval): Update total_free_intervals.
8726 (make_float): Likewise for total_free_floats.
8727 (free_cons, Fcons): Likewise for total_free_conses.
8728 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
8729 Likewise for total_free_vector_bytes.
8730 (Fmake_symbol): Likewise for total_free_symbols.
8731 (bytes_free): Remove.
8732
7098646f
DA
87332012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8734
8735 Simple free memory accounting feature.
8736 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
8737 (sweep_vectors): Accumulate size of free vectors.
8738 (Fgarbage_collect): Setup bytes_free.
8739 (Fmemory_free): New function.
8740 (syms_of_alloc): Register it.
8741
22657b40
DA
87422012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
8743
8744 Cleanup overlays checking.
8745 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
8746 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
8747 eassert and OVERLAYP.
8748 (sort_overlays): Change to use OVERLAYP.
8749
ddfc8813
RK
87502012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
8751
8752 * editfns.c (Finsert_char): Make it interactive, and make the
8753 second arg optional. Copy interactive spec and docstring from
8754 ucs-insert.
8755
7c26cf3c
PE
87562012-07-17 Paul Eggert <eggert@cs.ucla.edu>
8757
8758 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
8759 Unlike the other wrapped functions, fabs has an unspecified
8760 effect on errno.
8761
5d127af9
JD
87622012-07-16 Jan Djärv <jan.h.d@swipnet.se>
8763
8764 * nsterm.m (keyDown): Interpret flags without left/right bits
8765 as the left key (Bug#11670).
8766
6a0dd1d7
DA
87672012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 Remove empty and useless init functions.
8770 * lisp.h (init_character_once, init_fns, init_image)
8771 (init_filelock, init_sound): Remove prototype.
8772 * character.c (init_character_once): Remove.
8773 * filelock.c (init_filelock): Likewise.
8774 * fns.c (init_fns): Likewise.
8775 * image.c (init_image): Likewise.
8776 * sound.c (init_sound): Likewise.
8777 * emacs.c (main): Adjust accordingly.
8778
7a6136fd
DA
87792012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
8780
8781 * gtkutil.h: Tiny cleanups.
8782 (use_old_gtk_file_dialog): Remove useless declaration.
8783 (xg_uses_old_file_dialog): Add suggested const attribute.
8784
ce811ad9
EZ
87852012-07-15 Eli Zaretskii <eliz@gnu.org>
8786
8787 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
8788 (bidi_paragraph_init): Use it to limit search forward for a strong
8789 directional character in abnormally large paragraphs full of
8790 neutral or weak characters. (Bug#11943)
8791
c9adfeaa
SF
87922012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
8793
8794 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
8795 the toolbar (Bug#9451).
8796 (xg_make_tool_item): Give the widget event box a transparent
8797 background.
8798
fff62aa9
DA
87992012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8800
8801 Cleanup basic allocation variables and functions.
8802 * alloc.c (ignore_warnings, init_intervals, init_float)
8803 (init_cons, init_symbol, init_marker): Remove.
8804 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
8805 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
8806 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
8807 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
8808 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
8809 (staticidx, init_alloc_once, init_strings, free_ablock):
8810 Remove redundant initialization.
8811 * fns.c (init_weak_hash_tables): Remove.
8812 * lisp.h (init_weak_hash_tables): Remove prototype.
8813
9730daca
DA
88142012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
8815
8816 Use zero_vector where appropriate.
8817 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
8818 accordingly.
8819 * lisp.h (zero_vector): New declaration.
8820 * font.c (null_vector): Remove.
8821 (syms_of_font): Remove initialization and staticpro.
8822 (font_list_entities, font_find_for_lface): Change to use zero_vector.
8823 * keymap.c (Faccessible_keymaps): Likewise.
8824
2e2d2a13
LL
88252012-07-15 Leo Liu <sdl.web@gmail.com>
8826
8827 * fringe.c: Fix typo in comments.
8828
cd276f6e
LL
88292012-07-14 Leo Liu <sdl.web@gmail.com>
8830
8831 * fringe.c: Add a new bitmap exclamation-mark.
8832
5a1131d9
EZ
88332012-07-14 Eli Zaretskii <eliz@gnu.org>
8834
8835 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
8836
8837 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
8838 (HAVE_MENUS): Don't define, defined by editing config.in with
8839 msdos/sed2v2.inp.
8840 (GMALLOC_INHIBIT_VALLOC): Don't define.
8841 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
8842
22e983b7
JB
88432012-07-14 Juanma Barranquero <lekktu@gmail.com>
8844
8845 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
8846
5b3f250f
GM
88472012-07-14 Glenn Morris <rgm@gnu.org>
8848
8849 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
8850 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
8851 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
8852
33d63ff4
GM
88532012-07-13 Glenn Morris <rgm@gnu.org>
8854
5b633342
GM
8855 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
8856
33d63ff4
GM
8857 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
8858 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
8859
b55b9f85
JD
88602012-07-13 Jan Djärv <jan.h.d@swipnet.se>
8861
0dc8cf50
JD
8862 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
8863 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
8864 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
8865 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
8866 where appropriate.
8867 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
8868 as boolean expression.
8869 (x_set_window_size): Remove unused variable toolbar.
8870 (ns_get_color_default, ns_mod_to_lisp): Remove.
8871 (ns_mouse_position): Remove unused variables xchar and ychar.
8872 (ns_compute_glyph_string_overhangs): Remove unused variable face.
8873 (ns_set_vertical_scroll_bar): Remove unused variable count.
8874 (ns_delete_terminal): Remove unused variable i.
8875 (ns_term_init): Remove unused variables r, g and b.
8876 (mouseDown): Remove unused variable window.
8877 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
8878 (initFrameFromEmacs): Remove unused variable vbextra.
8879 (mouseEntered): Remove unused variables p and dpyinfo.
8880 (mouseExited): Remove unused variables p and r.
8881 (ns_define_frame_cursor, ns_clear_frame_area)
8882 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
8883 (menuDown): Assign [sender tag] to variable and cast the variable.
8884
8885 * nsterm.h (menuDown): Add id as type to argument sender.
8886 (ns_display_info_for_name): Add Lisp_Object argument.
8887 (ns_term_init): Add Lisp_Object argument.
8888 (ns_map_event_to_object): Add void argument.
8889 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
8890 prototype with arguments and only declare if __OBJC__.
8891 (nxatoms_of_nsselect): Add void argument.
8892 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
8893 (ns_alloc_autorelease_pool): Add void argument.
8894 (ns_release_autorelease_pool): Add void* argument.
8895 (ns_get_defaults_value): Add const char* argument.
8896
8897 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
8898 (initFromContents): Use SSDATA where appropriate.
8899 (ns_update_menubar): Add braces to ambigous if-else.
8900 (initWithTitle): Put () around assignment in if statement.
8901 (ns_menu_show): Remove unused variables window and keymap.
8902 (update_frame_tool_bar): Remove unused variable selected_p.
8903 (initWithContentRect): Remove unused variable this_cmd_name.
8904
8905 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
8906 appropriate.
8907 (setXBMColor): Remove unused variable len.
8908 (setPixmapData): Put () around assignment in loop statement.
8909
8910 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
8911 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
8912 where appropriate.
8913 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
8914 around assignment in loop statement.
8915 (nsfont_open): Remove unused variable i.
8916 (nsfont_open): Remove unused variable len.
8917 (nsfont_draw): Remove unused variable cs.
8918
8919 * nsfns.m (x_set_icon_name, ns_set_name_internal)
8920 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
8921 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
8922 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
8923 (Fns_font_name, Fns_perform_service)
8924 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
8925 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
8926 (ns_set_name): Remove unused variable view.
8927 (x_set_menu_bar_lines): Remove unused variable olines.
8928 (x_set_tool_bar_lines): Remove unused variable root_window.
8929 (Fns_list_colors): Put () around assignment in while statement.
8930 (Fns_perform_service): Remove unused variable len.
8931 (Fns_display_usable_bounds): Remove unused variable top.
8932 (syms_of_nsfns): Remove unused variable i.
8933
b55b9f85
JD
8934 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
8935 memcpy (Bug#11907).
8936
ed9265fc 89372012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
8938
8939 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
8940 and free it with DestroyExceptionInfo (Bug#11558).
8941
ef099b57
JB
89422012-07-13 Juanma Barranquero <lekktu@gmail.com>
8943
8944 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
8945 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
8946 Set here, not in nt/config.nt.
8947
ea814a5d
EZ
89482012-07-13 Eli Zaretskii <eliz@gnu.org>
8949
8950 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
8951 cursor overflow into the last glyph on display line when the right
8952 fringe is off. (Bug#11832)
8953
1a952767
PE
89542012-07-13 Paul Eggert <eggert@cs.ucla.edu>
8955
8956 * xdisp.c (produce_special_glyphs): Now static.
8957 * dispextern.h (produce_special_glyphs): Remove decl.
8958
983188fd
GM
89592012-07-13 Glenn Morris <rgm@gnu.org>
8960
8d7c7eed 8961 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
8962 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
8963
983188fd
GM
8964 * s/usg5-4-common.h (USG, USG5):
8965 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
8966 * s/sol2-6.h (SOLARIS2):
8967 * s/irix6-5.h (IRIX6_5):
8968 * s/hpux10-20.h (USG, USG5, HPUX):
8969 * s/gnu-linux.h (USG, GNU_LINUX):
8970 * s/freebsd.h (BSD_SYSTEM):
8971 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
8972 * s/cygwin.h (CYGWIN):
8973 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
8974 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
8975
d1e68667 89762012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
8977
8978 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 8979
6de0e799
GM
89802012-07-13 Glenn Morris <rgm@gnu.org>
8981
739ae010
GM
8982 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
8983
dbee5793
GM
8984 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
8985
6de0e799
GM
8986 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
8987 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
8988
b82da769
GM
89892012-07-12 Glenn Morris <rgm@gnu.org>
8990
4fae5a7a 8991 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
8992
8993 * process.c (init_process_emacs): Rename from init_process.
8994 The old name is also the name of a Mach system call.
8995 * lisp.h, emacs.c: Update for this name change.
8996 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
8997 longer needed.
8998
5a979817
EZ
89992012-07-12 Eli Zaretskii <eliz@gnu.org>
9000
9001 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9002 memmove call that removes glyphs covered by the left truncation
9003 glyph. Improve commentary.
9004 (display_line): Fix display of continuation glyphs on GUI frames
9005 when the right fringe is turned off and variable-size fonts are
9006 used in the window. Move the code that appends a stretch glyph to
9007 produce_special_glyphs, so that it could be used for truncation
9008 and continuation glyphs alike.
9009 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9010 glyph of a suitably computed width, to align the special glyphs at
9011 the window margin. Code moved from display_line. (Bug#11832)
9012
3e91a053
GM
90132012-07-12 Glenn Morris <rgm@gnu.org>
9014
ba9e4b84
GM
9015 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9016
9017 * s/gnu-linux.h, s/hpux10-20.h:
9018 Do not unconditionally define HAVE_XRMSETDATABASE.
9019
3e91a053
GM
9020 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9021
b300b1f4
PE
90222012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9023
9024 Fix typos that broke OS X build.
9025 Reported by Randal L. Schwartz in
9026 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9027 * nsterm.m (ns_timeout): Add missing local decl.
9028 (ns_get_color): snprintf -> sprintf, to fix typo.
9029
6e777848
GM
90302012-07-12 Glenn Morris <rgm@gnu.org>
9031
3f922c37
GM
9032 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9033 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9034 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9035 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9036
0ab7b23a
GM
9037 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9038 Move PTY_OPEN to configure.
9039
6e777848
GM
9040 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9041 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9042 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9043
4a7edc24
DA
90442012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9045
9046 Use empty_unibyte_string where applicable.
9047 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9048 * lread.c (read1): Likewise.
9049 * xsettings.c (syms_of_xsettings): Likewise.
9050
308aab79
GM
90512012-07-12 Glenn Morris <rgm@gnu.org>
9052
42bd1719
GM
9053 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9054 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
9055 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9056 * s/hpux10-20.h (RUN_TIME_REMAP):
9057 * s/bsd-common.h (TABDLY): Move to configure.
9058
9059 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9060
9061 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9062
ea0bbd17 9063 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 9064 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
9065
9066 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 9067
308aab79
GM
9068 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9069 * s/template.h: Move NARROWPROTO to configure.
9070
ee1cf5cf
GM
90712012-07-11 Glenn Morris <rgm@gnu.org>
9072
30fe9bf4
GM
9073 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9074 unused since 2011-01-17 change to systty.h.
9075
ee1cf5cf
GM
9076 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9077 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9078 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9079
63e47e07
PE
90802012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9083
c43fb4c3
GM
90842012-07-11 Glenn Morris <rgm@gnu.org>
9085
9086 * s/darwin.h, s/gnu-linux.h, s/template.h:
9087 Move INTERRUPT_INPUT to configure.
9088
e8df9267
DA
90892012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9090
9091 Minor adjustments to interning code.
9092 * lisp.h (intern, intern_c_string): Redefine as static inline
9093 wrappers for intern_1 and intern_c_string_1, respectively.
9094 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
9095 * lread.c (intern_1, intern_c_string_1, oblookup):
9096 Simplify Vobarray checking.
e8df9267
DA
9097 * font.c (font_intern_prop): Likewise. Adjust comment.
9098 * w32font.c (intern_font_name): Likewise.
9099
34348bd4
AS
91002012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9101
d96a1e0c
AS
9102 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9103
34348bd4
AS
9104 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9105 of Fcar/Fcdr if possible.
9106 * font.c (check_otf_features): Likewise.
9107 * fontset.c (Fnew_fontset): Likewise.
9108 * gnutls.c (Fgnutls_boot): Likewise.
9109 * minibuf.c (read_minibuf): Likewise.
9110 * msdos.c (IT_set_frame_parameters): Likewise.
9111 * xmenu.c (Fx_popup_dialog): Likewise.
9112 * w32menu.c (Fx_popup_dialog): Likewise.
9113
c8add24e
GM
91142012-07-11 Glenn Morris <rgm@gnu.org>
9115
4b575b3c
GM
9116 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9117 since nothing has defined it on these platforms.
9118
09f4e3b0
GM
9119 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9120 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9121
172bedef
GM
9122 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9123 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9124 Move CLASH_DETECTION to configure.
9125
249685df
GM
9126 * s/gnu.h: Remove file, which is now empty.
9127
c8add24e
GM
9128 * s/gnu.h, s/gnu-linux.h:
9129 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9130
b41253a3
JW
91312012-07-11 John Wiegley <johnw@newartisans.com>
9132
9133 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9134 function attribute, so we only use it if it exists in the
9135 compiler.
9136
d923b542
DA
91372012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9138
9139 Avoid call to strlen in fast_c_string_match_ignore_case.
9140 * search.c (fast_c_string_match_ignore_case): Change to use
9141 length argument. Adjust users accordingly.
9142 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9143
5ebbef1d
PE
91442012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9145
bb352260
PE
9146 Assume mkdir, rmdir.
9147 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9148 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9149
57054ddd
PE
9150 Assume rename.
9151 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9152
b747d3f7
PE
9153 Assume perror.
9154 * s/hpux10-20.h (HAVE_PERROR): Remove.
9155 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9156 Remove dummy definition, as this problem was obsolete long ago.
9157
5ebbef1d
PE
9158 Assume strerror.
9159 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9160
984e7f30
DA
91612012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9162
9163 Avoid calls to strlen in font processing functions.
9164 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
9165 (font_open_by_name): Change to use length argument.
9166 Adjust users accordingly.
d923b542
DA
9167 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9168 Adjust prototypes.
9169 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9170 Change to return ptrdiff_t.
984e7f30
DA
9171 (xfont_list_pattern, xfont_match): Use length returned by
9172 xfont_decode_coding_xlfd.
9173 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9174
20e94fdd
GM
91752012-07-11 Glenn Morris <rgm@gnu.org>
9176
9d596af3
GM
9177 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9178 Move DONT_REOPEN_PTY to configure.
9179
20e94fdd
GM
9180 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9181 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9182
e99a530f
PE
91832012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9184
22ffb973
PE
9185 Remove "#define unix" that is no longer needed (Bug#11905).
9186 * s/aix4-2.h (unix): Remove; no longer needed.
9187
e9a9ae03
PE
9188 EMACS_TIME simplification (Bug#11875).
9189 This replaces macros (which typically do not work in GDB)
9190 with functions, typedefs and enums, making the code easier to debug.
9191 The functional style also makes code easier to read and maintain.
9192 * systime.h: Include <sys/time.h> on all hosts, not just if
9193 WINDOWSNT, since 'struct timeval' is needed in general.
9194 (EMACS_TIME): Now a typedef, not a macro.
9195 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9196 not macros.
9197 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9198 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9199 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9200 (EMACS_TIME_LE): Now functions, not macros.
9201 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9202 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9203 which are not functions. All uses rewritten to use:
9204 (make_emacs_time): New function.
9205 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9206 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9207 not functions. All uses rewritten to use the following, respectively:
9208 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9209 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 9210 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
9211 * fileio.c (Fcopy_file):
9212 * xterm.c (XTflash): Get the current time closer to when it's used.
9213 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9214
ffacb126
PE
9215 * bytecode.c (targets): Suppress -Woverride-init warnings.
9216
e99a530f
PE
9217 Simplify by avoiding confusing use of strncpy etc.
9218 * doc.c (Fsnarf_documentation):
9219 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9220 * frame.c (Fmake_terminal_frame):
9221 * gtkutil.c (get_utf8_string):
9222 * lread.c (openp):
9223 * nsmenu.m (ns_update_menubar):
9224 * regex.c (regerror):
9225 Prefer memcpy to strncpy and strncat when either will do.
9226 * fileio.c (Fsubstitute_in_file_name):
9227 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9228 (menu_separator_name_p):
9229 * nsmenu.m (ns_update_menubar):
9230 Prefer memcmp to strncmp when either will do.
9231 * nsterm.m: Include <ftoastr.h>.
9232 (ns_get_color):
9233 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9234 Prefer snprintf to strncpy.
9235 * nsterm.m (ns_term_init):
9236 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9237 * nsterm.m (ns_term_init):
9238 Avoid the need for strncpy, by using build_string or
9239 make_unibyte_string directly. Use dtoastr, not snprintf.
9240 * process.c (Fmake_network_process): Diagnose service names that
9241 are too long, rather than silently truncating them or creating
9242 non-null-terminated names.
9243 (Fnetwork_interface_info): Likewise, for interface names.
9244 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9245 Prefer sprintf to strncat.
9246 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9247 Prefer vsnprintf to vsprintf + strncpy.
9248
c59592b3
GM
92492012-07-10 Glenn Morris <rgm@gnu.org>
9250
9251 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9252 Clarify fallback case.
9253
7d7bbefd
DA
92542012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9255
9256 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9257 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9258 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 9259 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
9260 where argument type is known to be a Lisp_Cons.
9261
3a4c8000
TT
92622012-07-10 Tom Tromey <tromey@redhat.com>
9263
9264 * bytecode.c (BYTE_CODE_THREADED): New macro.
9265 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9266 (enum byte_code_op): New type.
9267 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9268 (exec_byte_code): Use them. Use token threading when applicable.
9269
2a0213a6
DA
92702012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9271
9272 Optimize pure C strings initialization.
9273 * lisp.h (make_pure_string): Fix prototype.
9274 (build_pure_c_string): New function, defined as static inline. This
9275 provides a better opportunity to optimize away calls to strlen when
9276 the function is called with compile-time constant argument.
9277 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9278 argument, adjust users accordingly. Use build_pure_c_string where
9279 appropriate.
9280 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9281 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9282 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9283
cb1caeaf
DA
92842012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9285
9286 Avoid calls to strlen in miscellaneous functions.
9287 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9288 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9289 * lread.c (openp): Likewise.
9290
c293e30c
DA
92912012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9292
9293 Avoid calls to strlen in path processing functions.
9294 * fileio.c (file_name_as_directory): Add comment. Change to add
9295 srclen argument and return the length of result. Adjust users
9296 accordingly.
9297 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9298 swap 1st and 2nd arguments to obey the common convention.
9299 Adjust users accordingly.
c293e30c
DA
9300 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9301
9e059e3f
GM
93022012-07-10 Glenn Morris <rgm@gnu.org>
9303
d02eb359
GM
9304 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9305 Move PENDING_OUTPUT_COUNT definition to configure.
9306
882cf227
GM
9307 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9308 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9309 * s/gnu.h (DATA_START): Move definitions to configure.
9310
af6e839f
GM
9311 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9312 We include usg5-4-common.h, which defines them both.
9313
40289a12
GM
9314 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9315 O_RDONLY already includes it).
9316
9e059e3f
GM
9317 Stop ns builds setting the EMACSLOADPATH environment variable.
9318 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9319 Now it does not set EMACSLOADPATH, just returns the load-path string.
9320 * nsterm.h: Update accordingly.
9321 * lread.c [HAVE_NS]: Include nsterm.h.
9322 (init_lread) [HAVE_NS]: Use ns_load_path.
9323 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9324
7c4e8ec0
GM
93252012-07-09 Glenn Morris <rgm@gnu.org>
9326
d4f600ff
GM
9327 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9328 since the included bsd-common.h does so.
9329
cbb31951
GM
9330 Stop ns builds setting the EMACSPATH environment variable.
9331 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9332 (ns_init_paths): Do not set EMACSPATH.
9333 * nsterm.h (ns_exec_path): Add it.
9334 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9335 Use ns_exec_path.
9336
7c4e8ec0
GM
9337 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9338
26bccfae
PE
93392012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9340
a0bee46f
PE
9341 * process.c (wait_reading_process_output): 'waitchannels' was unset
9342 when read_kbd || !NILP (wait_for_cell); fix this.
9343
5994c183
PE
9344 Add GCC-style 'const' attribute to functions that can use it.
9345 * character.h (char_resolve_modifier_mask):
9346 * keyboard.h (make_ctrl_char):
9347 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9348 (init_character_once, next_almost_prime, init_fns, init_image)
9349 (flush_pending_output, init_sound):
9350 * mem-limits.h (start_of_data):
9351 * menu.h (finish_menu_items):
9352 Add ATTRIBUTE_CONST.
9353 * emacs.c (DEFINE_DUMMY_FUNCTION):
9354 Declare the dummy function with ATTRIBUTE_CONST.
9355 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9356 Add decls with ATTRIBUTE_CONST.
9357
26bccfae
PE
9358 Minor improvements to make_formatted_string.
9359 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9360 where int is good enough, as vsprintf returns an int.
9361 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9362
a8290ec3
DA
93632012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9364
9365 Use make_formatted_string to avoid double length calculation.
9366 * lisp.h (make_formatted_string): New prototype.
9367 * alloc.c (make_formatted_string): New function.
9368 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 9369 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
9370 * editfns.c (Fcurrent_time_zone): Likewise.
9371 * filelock.c (get_boot_time): Likewise.
9372 * frame.c (make_terminal_frame, set_term_frame_name)
9373 (x_report_frame_params): Likewise.
9374 * image.c (gs_load): Likewise.
9375 * minibuf.c (get_minibuffer): Likewise.
9376 * msdos.c (dos_set_window_size): Likewise.
9377 * process.c (make_process): Likewise.
9378 * xdisp.c (ensure_echo_area_buffers): Likewise.
9379 * xsettings.c (apply_xft_settings): Likewise.
9380
d01ba2f1
GM
93812012-07-09 Glenn Morris <rgm@gnu.org>
9382
9383 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9384 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9385 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9386 * nsterm.h (ns_etc_directory): Add it.
9387 * callproc.c [HAVE_NS]: Include nsterm.h.
9388 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9389
f1f924b6
DA
93902012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9391
9392 Move marker debugging code under MARKER_DEBUG.
9393 * marker.c (MARKER_DEBUG): Move marker debugging code under
9394 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9395 for bootstrap with --enable-checking (~3x slowdown reported
9396 by Juanma Barranquero <lekktu@gmail.com>).
9397 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9398
ab531b66
PE
93992012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9400
9401 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9402 See <http://bugs.gnu.org/11825#29>.
9403
c4b3bc8a
EZ
94042012-07-08 Eli Zaretskii <eliz@gnu.org>
9405
9406 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9407 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
9408 (display_line): Add commentary about displaying truncation glyphs
9409 on GUI frames.
9410 (produce_special_glyphs): Move here from term.c.
9411
9412 * term.c (produce_special_glyphs): Move to xdisp.c.
9413
9414 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9415 section.
c4b3bc8a 9416
b676b881
AS
94172012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9418
f17c5273
AS
9419 * xdisp.c (display_line): Avoid warning about implicit declaration
9420 of FRAME_FONT.
9421
298819b9
AS
9422 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9423
b676b881
AS
9424 * lisp.h: Remove empty conditional.
9425
6045c4fd
PE
94262012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9427
b3350bf9
PE
9428 * lread.c (load_path_check): Now static.
9429
6045c4fd
PE
9430 Fix some minor --with-ns problems found by static checking.
9431 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9432 (x_set_font) [!HAVE_X_WINDOWS]:
9433 * image.c (xpm_load_image) [HAVE_NS]:
9434 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9435 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9436 Remove unused local.
9437 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9438 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9439 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9440 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9441 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9442 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9443 Fix pointer signedness problem.
9444 * xfaces.c (FRAME_X_FONT_TABLE):
9445 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9446
929e7845
GM
94472012-07-07 Glenn Morris <rgm@gnu.org>
9448
9449 * lread.c (load_path_check): New function, split from init_lread.
9450 (init_lread): Reorganize. Motivation:
9451 If EMACSLOADPATH is set, check/warn about that rather than the
9452 defaults, which we are not going to use. Hence we can remove
9453 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9454 Don't warn if site-lisp directories are missing.
9455 If not installed, start from a blank load-path, since
9456 PATH_LOADSEARCH refers to the eventual installation directories.
9457
58dd0aa4
EZ
94582012-07-07 Eli Zaretskii <eliz@gnu.org>
9459
9460 Support truncation and continuation glyphs on GUI frames, when
9461 fringes are disabled. (Bug#11832)
9462 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
9463 continuation glyphs even if on GUI frames.
9464 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
9465 or both, are absent.
9466 (start_display, move_it_in_display_line_to): Handle the case of a
9467 GUI frame without a fringe to display continuation or truncation
9468 glyphs.
9469 (insert_left_trunc_glyphs): Support GUI frames: make sure
9470 truncation glyphs overwrite enough glyphs from the current line to
9471 have sufficient space in pixels.
9472 (display_line): Support truncation and continuation glyphs on GUI
9473 frames. If some spare pixels are left on the line after inserting
9474 the truncation glyphs, fill that space with a stretch glyph of a
9475 suitably computed width.
9476
9477 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9478 produce_glyphs, to support GUI sessions.
9479
31571fd7
PE
94802012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9481
5a16b9bc
PE
9482 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9483
f3047c75
PE
9484 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9485
31571fd7
PE
9486 Do not require float-time's arg to fit in time_t (Bug#11825).
9487 This works better on hosts where time_t is unsigned, and where
9488 float-time is applied to the (negative) difference between two times.
9489 * editfns.c (decode_time_components): Last arg is now double *,
9490 not int *, and means to store all the result as a double, without
9491 worrying about whether the seconds part fits in time_t.
9492 All callers changed.
9493 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9494 All callers changed.
9495 (Ffloat_time): Do not fail merely because the specified time falls
9496 outside of time_t range.
9497
4516fbef
GM
94982012-07-07 Glenn Morris <rgm@gnu.org>
9499
9500 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9501 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9502 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9503
07adc2c6
JB
95042012-07-07 Juanma Barranquero <lekktu@gmail.com>
9505
9506 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9507 Update dependencies.
9508
9509 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9510
fd573f31
PE
95112012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9512
fee5959d
PE
9513 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9514 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9515 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9516 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9517 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9518 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9519
fd573f31
PE
9520 * xfont.c (compare_font_names): Redo to omit the need for casts.
9521
ddadbc0e
AS
95222012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9523
fca8d6b6
AS
9524 * xfns.c (Fx_change_window_property): Doc fix.
9525 * w32fns.c (Fx_change_window_property): Doc fix.
9526
ddadbc0e
AS
9527 * w32fns.c (Fx_window_property): Accept the same arguments as the
9528 X Windows version. Doc fix.
9529 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9530
ed9265fc 95312012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
9532 Eli Zaretskii <eliz@gnu.org>
9533
9534 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9535 Windows-specific code from nt/config.nt moved here.
9536 Obsolete settings removed.
9537
216ee680
PE
95382012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9539
9540 * process.c: Avoid unnecessary calls to gettime.
9541 (wait_reading_process_output): Don't get the time of day
9542 when gobbling data immediately and not waiting, as there's no need
9543 for it in that case. This removes a FIXME.
9544
bdd091e4
JD
95452012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9546
9547 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9548 is defined (Bug#11768).
9549
9d44f8ce
DA
95502012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9551
9552 Fix marker debugging code.
9553 * marker.c (byte_char_debug_check): Do not perform the check
9554 if buffer is not multibyte.
090bd7cb
JB
9555 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9556 Call byte_char_debug_check with correct arguments.
9d44f8ce 9557
90fc4786
DA
95582012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
9561 * marker.c (byte_char_debug_check, count_markers):
9562 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
9563 (byte_debug_flag): Remove.
9564 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9565 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9566
7b7ae965
DA
95672012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9568
4e57b342
DA
9569 Avoid code repetition in marker-related functions.
9570 * marker.c (attach_marker): New function.
9571 (Fset_marker, set_marker_restricted, set_marker_both)
9572 (set_marker_restricted_both): Use it.
9573 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9574 Consistently rename charno to charpos.
9575 (marker_position): Add eassert.
9576 (marker_byte_position): Convert to eassert.
9577
95782012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9579
9580 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9581 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9582 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9583
657924ff
DA
95842012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9585
9586 Introduce fast path for the widely used marker operation.
9587 * alloc.c (build_marker): New function.
9588 * lisp.h (build_marker): New prototype.
9589 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9590 * composite.c (autocmp_chars): Likewise.
9591 * editfns.c (buildmark): Remove.
9592 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9593 (save_restriction_save): Use build_marker.
9594 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9595 * window.c (save_window_save): Likewise.
9596
041a49a6
DA
95972012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9598
9599 Do not use Fdelete_overlay in delete_all_overlays
9600 to avoid redundant calls to unchain_overlay.
9601 * buffer.c (drop_overlay): New function.
9602 (delete_all_overlays, Fdelete_overlay): Use it.
9603 * minibuf.c (get_minibuffer): Fix comment.
9604
7dca65a4
PE
96052012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 Port to OpenBSD 5.1 amd64.
9608 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9609 This is needed for OpenBSD, and should be harmless on all BSD systems.
9610 Also, include <sys/sysctl.h>, as it should be available on all
9611 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9612 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9613 use p_pid member, not kp_proc.pid.
9614
8eb876e2
GM
96152012-07-06 Glenn Morris <rgm@gnu.org>
9616
9617 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
9618
38182d90
PE
96192012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9620
9621 More xmalloc and related cleanup.
9622 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
9623 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
9624 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
9625 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
9626 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
9627 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
9628 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
9629 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
9630 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
9631 * xterm.c:
9632 Omit needless casts involving void * pointers and allocation.
9633 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
9634 as the former is more robust if P's type is changed.
9635 Prefer xzalloc to xmalloc + memset 0.
9636 Simplify malloc-or-realloc to realloc.
9637 Don't worry about xmalloc returning a null pointer.
9638 Prefer xstrdup to xmalloc + strcpy.
9639 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
9640 growing it.
9641 * keyboard.c (apply_modifiers_uncached): Prefer local array to
9642 alloca of a constant.
9643
6dd5a677
EZ
96442012-07-05 Eli Zaretskii <eliz@gnu.org>
9645
9646 * xdisp.c (display_line): Fix horizontal pixel coordinates when
9647 hscroll is larger than the line width. Fixes long and futile
9648 looping inside extend_face_to_end_of_line (on a TTY) producing
9649 glyphs that are not needed and thrown away.
9650
6b312f0f
DA
96512012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9652
9653 * marker.c (set_marker_restricted_both): Simplify by using
9654 clip_to_bounds.
9655
f520ef9b
PE
96562012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 * editfns.c (region_limit): Simplify by using clip_to_bounds.
9659
383b7c95
JD
96602012-07-05 Jan Djärv <jan.h.d@swipnet.se>
9661
9662 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
9663 not defined (Bug#11768).
9664 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
9665 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
9666 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
9667 followed by gtk_box_set_homogeneous (Bug#11768).
9668 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
9669 (update_theme_scrollbar_width, xg_create_scroll_bar):
9670 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
9671 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
9672 (is_box_type): New function (Bug#11768).
9673 (xg_tool_item_stale_p): Call is_box_type.
5293d758 9674 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
9675 with default display (Bug#11768).
9676
d6e7bf45
EZ
96772012-07-05 Eli Zaretskii <eliz@gnu.org>
9678
9679 * xdisp.c (window_hscroll_limited): New function.
9680 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
9681 coordinates when window's hscroll is set to insanely large
9682 values. (Bug#11857)
9683
431391ec
JB
96842012-07-05 Juanma Barranquero <lekktu@gmail.com>
9685
9686 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
9687 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
9688
23f86fce
DA
96892012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
9690
9691 Cleanup xmalloc.
9692 * lisp.h (xzalloc): New prototype. Omit needless casts.
9693 * alloc.c (xzalloc): New function. Omit needless casts.
9694 * charset.c: Omit needless casts. Convert all calls to
9695 xmalloc with following memset to xzalloc.
9696 * dispnew.c: Likewise.
9697 * fringe.c: Likewise.
9698 * image.c: Likewise.
9699 * sound.c: Likewise.
9700 * term.c: Likewise.
9701 * w32fns.c: Likewise.
9702 * w32font.c: Likewise.
9703 * w32term.c: Likewise.
9704 * xfaces.c: Likewise.
9705 * xfns.c: Likewise.
9706 * xterm.c: Likewise.
9707 * atimer.c: Omit needless casts.
9708 * buffer.c: Likewise.
9709 * callproc.c: Likewise.
9710 * ccl.c: Likewise.
9711 * coding.c: Likewise.
9712 * composite.c: Likewise.
9713 * doc.c: Likewise.
9714 * doprnt.c: Likewise.
9715 * editfns.c: Likewise.
9716 * emacs.c: Likewise.
9717 * eval.c: Likewise.
9718 * filelock.c: Likewise.
9719 * fns.c: Likewise.
9720 * gtkutil.c: Likewise.
9721 * keyboard.c: Likewise.
9722 * lisp.h: Likewise.
9723 * lread.c: Likewise.
9724 * minibuf.c: Likewise.
9725 * msdos.c: Likewise.
9726 * print.c: Likewise.
9727 * process.c: Likewise.
9728 * region-cache.c: Likewise.
9729 * search.c: Likewise.
9730 * sysdep.c: Likewise.
9731 * termcap.c: Likewise.
9732 * terminal.c: Likewise.
9733 * tparam.c: Likewise.
9734 * w16select.c: Likewise.
9735 * w32.c: Likewise.
9736 * w32reg.c: Likewise.
9737 * w32select.c: Likewise.
9738 * w32uniscribe.c: Likewise.
9739 * widget.c: Likewise.
9740 * xdisp.c: Likewise.
9741 * xmenu.c: Likewise.
9742 * xrdb.c: Likewise.
9743 * xselect.c: Likewise.
9744
0497dc44
PE
97452012-07-05 Paul Eggert <eggert@cs.ucla.edu>
9746
9747 * fileio.c (time_error_value): Check the right error number.
9748 Problem reported by Troels Nielsen in
9749 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
9750
356e7178
PE
97512012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9752
4e71fd89
PE
9753 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
9754 This should be fixed in a better way; see Eli Zaretskii in
9755 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
9756 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
9757
f0941253
PE
9758 * fileio.c (time_error_value): Rename from special_mtime.
9759 The old name's problems were noted by Eli Zaretskii in
9760 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
9761
065c9eb4
PE
9762 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
9763 This variable's comment says Emacs needs at least one GDB-visible
9764 symbol of type enum pvec_type, to work around GDB problems.
9765 The symbol's value doesn't matter.
9766
356e7178
PE
9767 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
9768 that causes compilation to fail on pre-C99 compilers.
9769
ed9265fc 97702012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
9771
9772 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
9773 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
9774
3884d954
DA
97752012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9776
d209e2fb 9777 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
9778 headers for buffer_defaults and buffer_local_symbols.
9779 Reported by Juanma Barranquero <lekktu@gmail.com>.
9780
ee28be33
SM
97812012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
9782
9783 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
9784 * lisp.h (enum pvec_type): Use fewer bits.
9785 (PSEUDOVECTOR_SIZE_BITS): New constant.
9786 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
9787 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
9788 change in pvec_type.
9789 (PSEUDOVECTOR_TYPEP): New macro.
9790 (TYPED_PSEUDOVECTORP): Use it.
9791 * fns.c (internal_equal): Adapt code to extract pvectype.
9792 * emacs.c (gdb_pvec_type): Update type.
9793 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
9794 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
9795 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
9796 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
9797 (sweep_vectors): Use it. Use local var `total_bytes' instead of
9798 abusing vector->header.next.nbytes.
9799 (live_vector_p): Use PVEC_TYPE.
9800 (mark_object): Adapt code to extract pvectype. Use switch.
9801
c7f2cd7f
PE
98022012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9803
9804 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
9805 Tighten new eassert a bit.
9806
8ce70ed2
DA
98072012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9808
9809 Fix compilation with --enable-gcc-warnings and -O1
9810 optimization level.
9811 * doprnt.c (doprnt): Change type of tem to int, initialize
9812 to avoid compiler warning. Add eassert.
9813 * search.c (simple_search): Initialize match_byte to avoid
9814 compiler warning. Add eassert.
9815
dea7f1e5
PE
98162012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9817
24a212eb
PE
9818 Avoid weird behavior with large horizontal scrolls.
9819 Without this change, for example, large hscroll values would
9820 mess up Emacs's display on Fedora 15 x86, presumably due to
9821 overflows in int calculations in the display code.
9822 Also, if buffers had long lines, Emacs would freeze.
9823 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
9824 (set_window_hscroll): New function, containing the old guts of
9825 Fset_window_hscroll. Return the clipped value.
9826 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
9827 This avoids the need to check against PTRDIFF_MAX.
9828
dea7f1e5
PE
9829 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
9830
76046526
DA
98312012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
9832
9833 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
9834
39adff0d
PE
98352012-07-04 Paul Eggert <eggert@cs.ucla.edu>
9836
63807d47
PE
9837 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
9838 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
9839 since GCC 4.4.6 issues a bogus warning for them.
9840
39adff0d
PE
9841 Fix bugs in file timestamp newness comparisons.
9842 * fileio.c (Ffile_newer_than_file_p):
9843 * lread.c (Fload): Use full timestamp resolution of files,
9844 not just the 1-second resolution, so that files that are only
9845 slightly newer still count as newer.
9846 * fileio.c (Ffile_newer_than_file_p): Don't assume file
9847 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
9848
dbeed9a6
PE
98492012-07-03 Paul Eggert <eggert@cs.ucla.edu>
9850
9851 * fileio.c: Improve handling of file time marker. (Bug#11852)
9852 (special_mtime): New function.
9853 (Finsert_file_contents, Fverify_visited_file_modtime):
9854 Use it to set special mtime values consistently.
9855
636334d6
AS
98562012-07-03 Andreas Schwab <schwab@linux-m68k.org>
9857
9858 * fileio.c (Finsert_file_contents): Properly handle st_mtime
9859 marker for non-existing file. (Bug#11852)
9860
e2017fe2
GM
98612012-07-03 Glenn Morris <rgm@gnu.org>
9862
9863 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
9864 and did not make it into globals.h).
9865
404dbd37
TT
98662012-07-03 Tom Tromey <tromey@redhat.com>
9867
9868 * window.c (Fset_window_margins, Fset_window_fringes)
9869 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
9870 * textprop.c (Fprevious_property_change): No longer static.
9871 * syntax.c (Fsyntax_table_p): No longer static.
9872 * process.c (Fget_process, Fprocess_datagram_address): No longer
9873 static.
9874 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
9875 * keyboard.c (Fcommand_execute): No longer static.
9876 Remove EXFUN.
9877 * insdel.c (Fcombine_after_change_execute): No longer static.
9878 * image.c (Finit_image_library): No longer static.
9879 * fileio.c (Fmake_symbolic_link): No longer static.
9880 * eval.c (Ffetch_bytecode): No longer static.
9881 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
9882 * doc.c (Fdocumentation_property, Fsnarf_documentation):
9883 No longer static.
404dbd37
TT
9884 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
9885 static.
9886 * dired.c (Ffile_attributes): No longer static.
9887 * composite.c (Fcomposition_get_gstring): No longer static.
9888 * callproc.c (Fgetenv_internal): No longer static.
9889
9890 * ccl.h: Remove EXFUNs.
9891 * buffer.h: Remove EXFUNs.
9892 * dispextern.h: Remove EXFUNs.
9893 * intervals.h: Remove EXFUNs.
9894 * fontset.h: Remove EXFUN.
9895 * font.h: Remove EXFUNs.
9896 * dosfns.c (system_process_attributes): Remove EXFUN.
9897 * keymap.h: Remove EXFUNs.
9898 * lisp.h: Remove EXFUNs.
9899 * w32term.h: Remove EXFUNs.
9900 * window.h: Remove EXFUNs.
9901 * xsettings.h: Remove EXFUN.
9902 * xterm.h: Remove EXFUN.
9903
8e4fd1e1
GM
99042012-07-03 Glenn Morris <rgm@gnu.org>
9905
9906 * lisp.h (Frandom): Make it visible to C.
9907 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
9908 buffer for invisible buffers. (Bug#1229)
9909
ca95b3eb
DA
99102012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9911
9912 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
9913 values which aren't power of 2.
14ae4239 9914 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 9915 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
9916 accordingly.
9917
7555c33f
SM
99182012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
9919
9920 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
9921
9922 * alloc.c (mark_object): Revert part of last patch to use `switch'.
9923
d12e8f5a
DA
99242012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9925
9926 * alloc.c (allocate_vector_block): Remove redundant
9927 calls to mallopt if DOUG_LEA_MALLOC is defined.
9928 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
9929 avoid calls to mallopt if zero_vector is returned.
9930
296094c3
DA
99312012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9932
9933 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
9934 is enabled, avoid dereferencing NULL current_sblock if
9935 running undumped.
9936
36429c89
DA
99372012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
9938
9939 Cleanup basic buffer management.
9940 * buffer.h (struct buffer): Change layout to use generic vector
9941 marking code. Fix some comments. Change type of 'clip_changed'
9942 to bitfield. Remove unused #ifndef old.
9943 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
9944 (GET_OVERLAYS_AT): Fix indentation.
9945 (for_each_per_buffer_object_at): New macro.
9946 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
9947 (Fbuffer_local_variables): Use it.
9948 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
9949 * alloc.c (allocate_buffer): Adjust to match new layout of
9950 struct buffer. Fix comment.
9951 (mark_overlay): New function.
9952 (mark_buffer): Use it. Use mark_vectorlike to mark normal
9953 Lisp area of struct buffer.
9954 (mark_object): Use it. Adjust marking of misc objects
9955 and related comments.
9956
3b3e4cac
PE
99572012-07-02 Paul Eggert <eggert@cs.ucla.edu>
9958
9959 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
9960 wrapper that is not needed because the wrapped code is a no-op (zero
9961 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
9962 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
9963
cf5c0175
DA
99642012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
9965
9966 * alloc.c (mark_buffer): Simplify. Remove prototype.
9967 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 9968 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
9969 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
9970 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 9971
ca26824c
GM
99722012-06-30 Glenn Morris <rgm@gnu.org>
9973
2e4c5312
GM
9974 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
9975
ca26824c
GM
9976 * epaths.in (PATH_SITELOADSEARCH): New.
9977 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
9978 This is rather than relying on --enable-locallisppath elements
9979 having "site-lisp" in their names. (Bug#10208#25, 11658)
9980
0d23c240
EZ
99812012-06-30 Eli Zaretskii <eliz@gnu.org>
9982
c9240d7a
EZ
9983 * w32proc.c (sys_select): Accept and ignore one more argument.
9984
9985 * w32.c (emacs_gnutls_pull): Call select with one more argument.
9986
0d23c240 9987 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 9988 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
9989
9990 * sysdep.c: Don't include dos.h and dosfns.h.
9991
9992 * process.c (sys_select):
9993 * msdos.c (sys_select): Accept one more argument and ignore it.
9994
9995 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
9996 adapt data types and code to that.
9997
9998 * dosfns.c:
9999 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10000 which clashes with the gnulib function of the same name.
10001
af5a5a98
AS
100022012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10003
c5e4379c
AS
10004 * font.c (font_style_to_value, font_style_symbolic)
10005 (font_prop_validate_style): Add type checks for values in
10006 font_style_table.
10007
af5a5a98
AS
10008 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10009 argument.
10010 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10011 uses.
10012
8d38f461
EZ
100132012-06-29 Eli Zaretskii <eliz@gnu.org>
10014
2e5a6631
EZ
10015 * xdisp.c (try_window_id): Undo last change.
10016
8d38f461
EZ
10017 * w32.c (getwd): Adjust commentary about startup_dir.
10018 (init_environment): Always call sys_access, even in non-MSVC
10019 builds. Don't chdir to the directory of the Emacs executable.
10020 This undoes code from 1997 which was justified by the need to
10021 "avoid conflicts when removing and renaming directories". But its
10022 downside was that every relative file name was being interpreted
10023 relative to the directory of the Emacs executable, which can never
10024 be TRT. In particular, it broke sys_access when called with
10025 relative file names.
10026 (sys_access): Map GetLastError to errno.
10027
2af3565e
DA
100282012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10029
10030 * window.h (struct window): Change type of 'fringes_outside_margins'
10031 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 10032 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
10033 Adjust comment.
10034 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10035 to ptrdiff_t.
10036
c8d3a25c 100372012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 10038
c8d3a25c
GM
10039 * gnutls.c (emacs_gnutls_handshake):
10040 Add QUIT to make the loop interruptible.
57570cd3 10041
c8d3a25c 100422012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 10043
c8d3a25c
GM
10044 * charset.c (init_charset): Make lack of etc/charsets fatal.
10045
3e984ee8
DA
100462012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10047
10048 * editfns.c (region_limit): Fix type mismatch.
10049
ef884f23
DA
100502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10051
10052 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10053 undefined. Convert from xassert to eassert.
10054 * nsmenu.m: Convert from xassert to eassert.
10055 * nsterm.m: Likewise.
10056
7d7e0027
SM
100572012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10058
10059 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10060
aa754e6a
PE
100612012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10062
10063 Avoid integer overflow on scroll-left and scroll-right.
10064 * window.c (HSCROLL_MAX): New macro.
10065 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10066 overflow when requested scroll falls outside ptrdiff_t range.
10067
80b00b08
DA
100682012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10069
10070 * window.h (struct window): Change type of 'hscroll',
10071 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10072 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10073 Adjust users accordingly.
10074 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10075 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10076 from EMACS_INT to ptrdiff_t.
10077 (make_window): Omit redundant initialization.
10078
62b2bcf6
JB
100792012-06-28 Juanma Barranquero <lekktu@gmail.com>
10080
10081 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10082
45942c7d
DA
100832012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10084
10085 * window.h (struct window): Change type of 'use_time' and
10086 'sequence_number' from Lisp_Object to int.
10087 * frame.c (make_frame): Adjust users accordingly.
10088 * print.c (print_object): Likewise.
10089 * window.c (select_window, Fwindow_use_time, make_parent_window)
10090 (make_window): Likewise.
10091
e509cfa6
DA
100922012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10093
10094 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10095 enabled with --enable-checking=[all,glyphs] configure option.
10096 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10097 adjust comments accordingly.
10098 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10099 undefined, adjust comments accordingly.
10100 * image.c: Likewise.
10101 * scroll.c: Likewise.
10102 * w32fns.c: Likewise.
10103 * w32term.c: Likewise.
10104 * xdisp.c: Likewise.
10105 * xfaces.c: Likewise.
10106 * xfns.c: Likewise.
10107 * xterm.c: Likewise.
10108
a54e2c05
DA
101092012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10110
10111 Generalize run-time debugging checks.
10112 * dispextern.h (XASSERTS): Remove.
10113 * fontset.c (xassert): Remove.
10114 Convert from xassert to eassert.
10115 * alloc.c: Convert from xassert to eassert.
10116 * bidi.c: Likewise.
10117 * dispnew.c: Likewise.
10118 * fns.c: Likewise.
10119 * fringe.c: Likewise.
10120 * ftfont.c: Likewise.
10121 * gtkutil.c: Likewise.
10122 * image.c: Likewise.
10123 * keyboard.c: Likewise.
10124 * menu.c: Likewise.
10125 * process.c: Likewise.
10126 * scroll.c: Likewise.
10127 * sound.c: Likewise.
10128 * term.c: Likewise.
10129 * w32console.c: Likewise.
10130 * w32fns.c: Likewise.
10131 * w32term.c: Likewise.
10132 * window.c: Likewise.
10133 * xdisp.c: Likewise.
10134 * xfaces.c: Likewise.
10135 * xfns.c: Likewise.
10136 * xselect.c: Likewise.
10137 * xterm.c: Likewise.
10138
1ec4b7b2
SM
101392012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10140
10141 * fns.c (maybe_resize_hash_table): Output message when growing the
10142 purify-hashtable.
10143
2014308a
DA
101442012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10145
10146 * alloc.c (allocate_string_data): Remove dead code.
10147 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10148 avoid GCC warning about unused macro.
10149
246155eb
DA
101502012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10151
10152 * alloc.c (allocate_string): Omit intervals initialization.
10153 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10154 as in make_pure_string and make_pure_c_string.
10155
43184b7b
DA
101562012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10157
d209e2fb 10158 * alloc.c (allocate_string): Fix last change.
43184b7b 10159
3fe6dd74
DA
101602012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10161
d209e2fb 10162 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
10163 to memset, add explicit initialization where appropriate.
10164
1ba6038a
GM
101652012-06-27 Glenn Morris <rgm@gnu.org>
10166
10167 * lisp.mk (lisp): Remove paths.elc.
10168
c89926a5
CY
101692012-06-27 Chong Yidong <cyd@gnu.org>
10170
10171 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10172
ed6b3510
JW
101732012-06-26 John Wiegley <johnw@newartisans.com>
10174
1ec4b7b2 10175 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
10176 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10177
ed6b3510
JW
10178 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10179 when building with Clang.
10180
8edd4a2b
SM
101812012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10182
10183 * eval.c (Fapply): Allow calling it with a single argument.
10184
f6f62d1b
EZ
101852012-06-26 Eli Zaretskii <eliz@gnu.org>
10186
10187 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10188 _stricmp and _strnicmp.
10189 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10190
62efea5e
DA
101912012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10192
10193 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10194 allocated window.
10195 (allocate_process): Likewise for new process.
8edd4a2b 10196 (allocate_terminal): Change to use offsetof.
62efea5e
DA
10197 (allocate_frame): Likewise.
10198 * frame.c (make_frame): Omit redundant initialization.
10199 * window.c (make_parent_window): Use memset.
10200 (make_window): Omit redundant initialization.
10201 * process.c (make_process): Omit redundant initialization.
10202 * terminal.c (create_terminal): Likewise.
10203
42997f4d
DA
102042012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10205
10206 * term.c (delete_tty): Remove redundant call to memset.
10207
1130ecfc
DA
102082012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10209
10210 * alloc.c: Remove build_string.
10211 * lisp.h: Define build_string as static inline. This provides
10212 a better opportunity to optimize away calls to strlen when the
10213 function is called with compile-time constant argument.
10214 * image.c (imagemagick_error): Convert to build_string.
10215 * w32proc.c (sys_spawnve): Likewise.
10216 * xterm.c (x_term_init): Likewise.
10217
cf38a720
PE
102182012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10219
99027bdd
PE
10220 Use sprintf return value instead of invoking strlen on result.
10221 In the old days this wasn't portable, since some sprintf
10222 implementations returned char *. But they died out years ago and
10223 Emacs already assumes sprintf returns int.
10224 Similarly for float_to_string.
10225 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10226 * ccl.c (ccl_driver):
10227 * character.c (string_escape_byte8):
10228 * data.c (Fnumber_to_string):
10229 * doprnt.c (doprnt):
10230 * print.c (print_object):
10231 * xdisp.c (message_dolog):
10232 * xfns.c (syms_of_xfns):
10233 Use sprintf or float_to_string result to avoid need to call strlen.
10234 * data.c (Fnumber_to_string):
10235 Use make_unibyte_string, since the string must be ASCII.
10236 * lisp.h, print.c (float_to_string): Now returns int length.
10237 * term.c (produce_glyphless_glyph):
10238 Use sprintf result rather than recomputing it.
10239
cf38a720
PE
10240 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10241 * Makefile.in (ALL_CFLAGS):
10242 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10243 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10244
3511c784
DA
102452012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10246
0a08eb21 10247 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
10248 strcasecmp if available.
10249 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10250
fb7da12e
AS
102512012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10252
10253 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10254 Avoid comma operator.
10255 * menu.c (push_submenu_start, push_submenu_end)
10256 (push_left_right_boundary, push_menu_pane): Likewise.
10257 * msdos.c (dos_rawgetc): Likewise.
10258
afa2ffd8
DA
102592012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10260
10261 * xfns.c (xic_create_fontsetname): Remove redundant calls
10262 to memset.
10263
b3b4476b
PE
102642012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10265
4495ff38
PE
10266 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10267 sprintf already null-terminates its output.
10268
b3b4476b
PE
10269 * xfns.c (x_window): Remove redundant cast.
10270
b00876c9
DA
102712012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10272
10273 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10274 `const char *' to `char *' to avoid compiler warning.
10275
d188e26b
PE
102762012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10277
885d1d74
PE
10278 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10279 instead of truncating it to 63 (admittedly a generous limit).
10280
d188e26b
PE
10281 * process.c: Fix spelling and caps in comments.
10282
e2f560b1
DN
102832012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10284
e86db54b 10285 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10286 * sysdep.c (setpgrp): Remove definition, not used in this file.
10287
7583a3a1
JB
102882012-06-24 Juanma Barranquero <lekktu@gmail.com>
10289
10290 * makefile.w32-in: Update dependencies.
10291
696056c2
EZ
102922012-06-24 Eli Zaretskii <eliz@gnu.org>
10293
10294 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10295 (SYSTIME_H): Add nt/inc/sys/time.h.
10296
10297 * systime.h [WINDOWSNT]: Include sys/time.h.
10298
10299 * s/ms-w32.h (struct timespec): Definition moved from
10300 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10301
845ca893
PE
103022012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10303
10304 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10305 * buffer.h (buffer_slot_type_mismatch):
10306 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10307 * eval.c (unwind_to_catch):
10308 * image.c (my_png_error, my_error_exit):
10309 * keyboard.c (quit_throw_to_read_char, user_error)
10310 (Fexit_recursive_edit, Fabort_recursive_edit):
10311 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10312 (wrong_type_argument, buffer_overflow, __executable_start)
10313 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10314 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10315 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10316 (fatal):
10317 (child_setup) [!DOS_NT]:
10318 * lread.c (end_of_file_error, invalid_syntax):
10319 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10320 * puresize.h (pure_write_error):
10321 * search.c (matcher_overflow):
10322 * sound.c (sound_perror, alsa_sound_perror):
10323 * sysdep.c, syssignal.h (croak):
10324 * term.c (maybe_fatal, vfatal):
10325 * textprop.c (text_read_only):
10326 * undo.c (user_error):
10327 * unexmacosx.c (unexec_error):
10328 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10329 Use _Noreturn rather than NO_RETURN.
10330 No need for separate decl merely because of _Noreturn.
10331 * sound.c (sound_warning, parse_sound):
10332 Remove unnecessary forward decls.
10333
f1dd8073
PE
103342012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10335
10336 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10337 * lisp.h (WAIT_READING_MAX): New macro.
10338 * dispnew.c (Fsleep_for, sit_for):
10339 * keyboard.c (kbd_buffer_get_event):
10340 * process.c (Faccept_process_output):
10341 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10342 This improves on the previous patch, which introduced a bug
10343 when time_t is unsigned and as wide as intmax_t.
10344 See <http://bugs.gnu.org/9000#51>.
10345
b82c1755
EZ
103462012-06-23 Eli Zaretskii <eliz@gnu.org>
10347
10348 * dispnew.c (sit_for, Fsleep_for):
10349 * keyboard.c (kbd_buffer_get_event):
10350 * process.c (Faccept_process_output): Avoid compiler warnings when
10351 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10352
ca300656
JB
103532012-06-23 Juanma Barranquero <lekktu@gmail.com>
10354
049ec95b
JB
10355 * makefile.w32-in: Update dependencies.
10356
ca300656
JB
10357 * w32.c (ltime): Add return type and declare static.
10358 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10359
db7b8d06
PE
103602012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10361
10362 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10363 Privately reported by Herbert J. Skuhra.
10364 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10365 All uses changed.
10366 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10367 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10368
0bd8297f
EZ
103692012-06-23 Eli Zaretskii <eliz@gnu.org>
10370
96512555
EZ
10371 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10372 last argument of make_unibyte_string.
10373
0bd8297f
EZ
10374 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10375 language ID in the event parameters.
10376
10377 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10378 event.code, not the obscure "character set ID".
10379
63def6b6
CY
103802012-06-23 Chong Yidong <cyd@gnu.org>
10381
10382 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10383
e8a02204
EZ
103842012-06-23 Eli Zaretskii <eliz@gnu.org>
10385
388cdec0
EZ
10386 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10387 * w32.c (fdutimens): New function.
10388
10389 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10390
10391 * s/ms-w32.h (pselect): Redirect to sys_select.
10392
10393 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10394
e8a02204
EZ
10395 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10396 in the logic of incrementing and decrementing the value of
10397 use_relocatable_buffers.
10398
d054f3fb
PE
103992012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10400
10401 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10402 Privately reported by Herbert J. Skuhra.
10403 [__FreeBSD__]: Remove "*/" typo after "#include".
10404 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10405 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10406 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10407 Don't assume EMACS_TIME and struct timeval are the same type.
10408
d35af63c
PE
104092012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10410
10411 Support higher-resolution time stamps (Bug#9000).
10412 The time stamps are only nanosecond-resolution at the C level,
10413 since that's the best that any real-world system supports now.
10414 But they are picosecond-resolution at the Lisp level, as that's
10415 easy, and leaves room for future OS improvements.
10416
10417 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10418 (LIBES): Use it.
10419
10420 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10421 Don't get current time unless it's needed.
10422
10423 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10424 now provides it if it's absent.
10425 (start_atimer): Port to higher-res time stamps.
10426 Check for time stamp overflow. Don't get current time more
10427 often than is needed.
10428
10429 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10430 Include systime.h, not time.h.
10431 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10432
10433 * dired.c: Include stat-time.h.
10434 (Ffile-attributes): File times now have higher resolution.
10435
10436 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10437 (struct image): Timestamp now has higher resolution.
10438
10439 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10440 has at least microseconds now. All uses removed.
10441 (update_frame, update_single_window, update_window, update_frame_1)
10442 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 10443 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
10444
10445 * editfns.c (time_overflow): Now extern.
10446 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10447 (float-time, Fformat_time_string, Fcurrent_time_string)
10448 (Fcurrent_time_zone): Accept and generate higher-resolution
10449 time stamps.
10450 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10451 (decode_time_components, lisp_seconds_argument): New functions.
10452 (make_time): Now static.
10453 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10454 Report an error if the time is invalid, rather than having the caller
10455 do that.
10456
10457 * fileio.c: Include <stat-time.h>
10458 (Fcopy_file): Copy higher-resolution time stamps.
10459 Prefer to set the time stamp via a file descriptor if that works.
10460 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10461 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10462 (Fvisited_file_modtime, Fset_visited_file_modtime):
10463 Support higher-resolution time stamps.
10464
10465 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10466
10467 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10468
10469 * image.c (prepare_image_for_display, clear_image_cache)
10470 (lookup_image): Port to higer-resolution time stamps.
10471
10472 * keyboard.c (start_polling, bind_polling_period):
10473 Check for time stamp overflow.
10474 (read_char, kbd_buffer_get_event, timer_start_idle)
10475 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10476 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10477 Port to higher-resolution time stamps. Do not assume time_t is signed.
10478 (decode_timer): New function. Timers are now vectors of length 9,
10479 not 8, to accommodate the picosecond component.
10480 (timer_check_2): Use it.
10481
10482 * nsterm.m (select_timeout, timeval_subtract): Remove.
10483 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10484 as they're a bit more accurate and handle overflow better.
10485 (ns_select): Change prototype to be compatible with pselect.
10486 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10487 * nsterm.h (ns_select): Adjust prototype.
10488
10489 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10490 us-resolution time stamps.
10491 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10492
10493 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10494
10495 * lisp.h (time_overflow): New decl.
10496 (wait_reading_process_output): First arg is now intmax_t, not int,
10497 to accommodate larger waits.
10498
10499 * process.h (struct Lisp_Process.read_output_delay):
10500 Now counts nanoseconds, not microseconds.
10501 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10502 EMACS_HAS_USECS.
10503 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10504 (wait_reading_process_output):
10505 Port to ns-resolution time stamps.
10506 (Faccept_process_output, wait_reading_process_output):
10507 Check for time stamp overflow. Do not assume time_t is signed.
10508 (select_wrapper): Remove; we now use pselect.
10509 (Fprocess_attributes): Now generates ns-resolution time stamps.
10510
10511 * sysdep.c: Include utimens.h. Don't include utime.h
10512 or worry about struct utimbuf; gnulib does that for us now.
10513 (gettimeofday): Remove; gnulib provides a substitute.
10514 (make_timeval): New function.
10515 (set_file_times): Now sets ns-resolution time stamps.
10516 New arg FD; all uses changed.
10517 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10518 (system_process_attributes):
10519 Now returns ns-resolution time stamp. All uses changed.
10520 Check for time stamp overflow.
10521
10522 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10523 provides a substitute now.
10524
10525 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10526 since it guarantees struct timespec.
10527 (EMACS_TIME): Now struct timespec, so that we can support
10528 ns-resolution time stamps.
10529 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10530 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10531 (EMACS_USECS): Remove.
10532 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10533 so multiply the arg by 1000 before storing it.
10534 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10535 New macros.
10536 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10537 Port to ns-resolution time stamps.
10538 (EMACS_TIME_NEG_P): Remove; replaced by....
10539 (EMACS_TIME_SIGN): New macro.
10540 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10541 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10542 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10543 (make_timeval, make_lisp_time, decode_time_components): New decls.
10544 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10545 that it mishandled time_t overflow. You can't compare by subtracting!
10546 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10547 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10548
10549 * term.c: Include <sys/time.h>.
10550 (timeval_to_Time): New function, for proper overflow wraparound.
10551 (term_mouse_position, term_mouse_click): Use it.
10552
10553 * undo.c (record_first_change): Support higher-resolution time stamps
10554 in the undo buffer.
10555 (Fprimitive_undo): Use them when restoring time stamps.
10556
10557 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10558 (w32_get_internal_run_time):
10559 Port to higher-resolution Emacs time stamps.
10560 (ltime): Now accepts single 64-bit integer, as that's more convenient
10561 for callers.
10562
10563 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10564
10565 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10566 for compatibility with pselect. Support ns-resolution time stamps.
10567
10568 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10569
10570 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10571 Check for time stamp overflow, and support ns-resolution time stamps.
10572
10573 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10574 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10575 (timeval_subtract): Remove; no longer needed.
10576 (XTflash, XTring_bell, x_wait_for_event):
10577 Port to ns-resolution time stamps. Don't assume time_t is signed.
10578
b6a92dfe
CY
105792012-06-22 Chong Yidong <cyd@gnu.org>
10580
10581 * xdisp.c (x_consider_frame_title): Revert last change.
10582
d251c37c
EZ
105832012-06-22 Eli Zaretskii <eliz@gnu.org>
10584
10585 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10586 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10587 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10588 staticidx goes up to 1597 out of 1600 = 0x640.)
10589
f10deafb
PE
105902012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10591
10592 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10593 Otherwise, the umask might be mistakenly 0 while handling input signals.
10594
ec6de1e2
SM
105952012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10596
10597 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10598
28be1ada
DA
105992012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10600
10601 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10602 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10603 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10604 access to `contents' member of Lisp_Vector objects with AREF and ASET
10605 where appropriate.
10606
c6bf3022
CY
106072012-06-19 Chong Yidong <cyd@gnu.org>
10608
10609 * frame.c (delete_frame): When selecting a frame on a different
10610 text terminal, do not alter the terminal's top-frame.
10611
10612 * xdisp.c (format_mode_line_unwind_data): Record the target
10613 frame's selected window and its terminal's top-frame.
10614 (unwind_format_mode_line): Restore them.
10615 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10616 Callers changed.
10617 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
10618 since tty frames can be explicitly named.
10619 (prepare_menu_bars): Likewise.
10620
10621 * term.c (Ftty_top_frame): New function.
10622
defd4196
PE
106232012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10624
10625 Port byte-code-meter to modern targets.
10626 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
10627 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 10628 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
10629 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
10630 (METER_1, METER_2): Simplify.
10631
1053a871
SM
106322012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10633
10634 * data.c (Fdefalias): Return `symbol' (bug#11686).
10635
b7e8d081
MR
106362012-06-18 Martin Rudalics <rudalics@gmx.at>
10637
10638 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
10639 gets killed during executing of this function (Bug#11665).
10640 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
10641 (Vkill_buffer_query_functions): In doc-string say that functions
10642 run by this hook should not change the current buffer.
10643
7ea2b339
PE
106442012-06-18 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 Fix recently-introduced process.c problems found by static checking.
10647 * process.c (write_queue_push, write_queue_pop, send_process):
10648 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
10649 (write_queue_pop): Fix pointer signedness problem.
10650 (send_process): Remove unused local.
10651
96a313a1
CY
106522012-06-17 Chong Yidong <cyd@gnu.org>
10653
10654 * xdisp.c (redisplay_internal): No need to redisplay terminal
10655 frames that are not on top.
10656
20ca2e94
TN
106572012-06-17 Troels Nielsen <bn.troels@gmail.com>
10658
10659 * process.c (make_process): Initialize write_queue.
10660 (write_queue_push, write_queue_pop): New functions.
10661 (send_process): Use them to maintain correct ordering of process
10662 writes (Bug#10815).
10663
9a900ca9
PE
106642012-06-17 Paul Eggert <eggert@cs.ucla.edu>
10665
310fbfa8
PE
10666 * lisp.h (eassert): Assume C89 or later.
10667 This removes the need for CHECK.
10668 (CHECK): Remove. Its comments about always evaluating its
10669 argument were confusing, as 'eassert' typically does not evaluate
10670 its argument.
10671
27bb1ca4
PE
10672 * coding.c (produce_chars): Use ptrdiff_t, not int.
10673
9a900ca9
PE
10674 * xterm.c (x_draw_underwave): Check for integer overflow.
10675 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
10676
41b7f8bc 106772012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
10678
10679 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
10680 referenced (Bug#11583).
10681
9b0e3eba
AA
106822012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
10683
10684 Implement wave-style variant of underlining.
10685 * dispextern.h (face_underline_type): New enum.
10686 (face): Add field for underline type.
10687 * nsterm.m (ns_draw_underwave): New function.
10688 (ns_draw_text_decoration): Use it.
10689 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
10690 New functions.
10691 (x_draw_glyph_string): Use them.
10692 * xfaces.c (Qline, Qwave): New Lisp objects.
10693 (check_lface_attrs, merge_face_ref)
1053a871
SM
10694 (Finternal_set_lisp_face_attribute, realize_x_face):
10695 Handle wave-style underline face attributes.
9b0e3eba
AA
10696 * xterm.c (x_draw_underwave): New function.
10697 (x_draw_glyph_string): Use it.
10698
0fb52f11
JB
106992012-06-16 Juanma Barranquero <lekktu@gmail.com>
10700
10701 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
10702 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
10703 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
10704 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
10705 ($(BLD)/w32select.$(O)): Update dependencies.
10706
e5560ff7
AS
107072012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10708
10709 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
10710 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
10711 * character.c (_fetch_multibyte_char_p): Remove.
10712 * alloc.c: Include "character.h" before "buffer.h".
10713 * bidi.c: Likewise.
10714 * buffer.c: Likewise.
10715 * bytecode.c: Likewise.
10716 * callint.c: Likewise.
10717 * callproc.c: Likewise.
10718 * casefiddle.c: Likewise.
10719 * casetab.c: Likewise.
10720 * category.c: Likewise.
10721 * cmds.c: Likewise.
10722 * coding.c: Likewise.
10723 * composite.c: Likewise.
10724 * dired.c: Likewise.
10725 * dispnew.c: Likewise.
10726 * doc.c: Likewise.
10727 * dosfns.c: Likewise.
10728 * editfns.c: Likewise.
10729 * emacs.c: Likewise.
10730 * fileio.c: Likewise.
10731 * filelock.c: Likewise.
10732 * font.c: Likewise.
10733 * fontset.c: Likewise.
10734 * fringe.c: Likewise.
10735 * indent.c: Likewise.
10736 * insdel.c: Likewise.
10737 * intervals.c: Likewise.
10738 * keyboard.c: Likewise.
10739 * keymap.c: Likewise.
10740 * lread.c: Likewise.
10741 * macros.c: Likewise.
10742 * marker.c: Likewise.
10743 * minibuf.c: Likewise.
10744 * nsfns.m: Likewise.
10745 * nsmenu.m: Likewise.
10746 * print.c: Likewise.
10747 * process.c: Likewise.
10748 * regex.c: Likewise.
10749 * region-cache.c: Likewise.
10750 * search.c: Likewise.
10751 * syntax.c: Likewise.
10752 * term.c: Likewise.
10753 * textprop.c: Likewise.
10754 * undo.c: Likewise.
10755 * unexsol.c: Likewise.
10756 * w16select.c: Likewise.
10757 * w32fns.c: Likewise.
10758 * w32menu.c: Likewise.
10759 * window.c: Likewise.
10760 * xdisp.c: Likewise.
10761 * xfns.c: Likewise.
10762 * xmenu.c: Likewise.
10763 * xml.c: Likewise.
10764 * xselect.c: Likewise.
10765
2f07e6af
EZ
107662012-06-16 Eli Zaretskii <eliz@gnu.org>
10767
1053a871
SM
10768 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
10769 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 10770 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
10771 row.
10772 (handle_face_prop): Use chunk-relative overlay string index when
10773 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
10774 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
10775 the rightmost. (Bug#11720)
2f07e6af 10776
29b83cec
AS
107772012-06-16 Andreas Schwab <schwab@linux-m68k.org>
10778
10779 * category.h (CHAR_HAS_CATEGORY): Define as inline.
10780 (CATEGORY_MEMBER): Enforce 1/0 value.
10781 * category.c (_temp_category_set): Remove.
10782
4c5501e9
EZ
107832012-06-16 Eli Zaretskii <eliz@gnu.org>
10784
10785 * window.c (Fdelete_other_windows_internal)
10786 (Fdelete_window_internal): Don't access frame's mouse highlight
10787 info of the initial frame. (Bug#11677)
10788
2b570124
PE
107892012-06-14 Paul Eggert <eggert@cs.ucla.edu>
10790
e93864f9
PE
10791 * .gdbinit (xgetint): Fix recently-introduced paren typo.
10792 Assume USE_2_TAGS_FOR_INTS.
10793 (xreload): Adjust $tagmask width to match recent lisp.h change.
10794
2b570124
PE
10795 Simplify lisp.h in minor ways that should not affect code.
10796 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
10797 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
10798 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
10799 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
10800 (INTTYPEBITS): New macro, for clarity.
10801 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
10802 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
10803 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
10804 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
10805 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
10806
81755f69
JB
108072012-06-13 Juanma Barranquero <lekktu@gmail.com>
10808
10809 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
10810
16192a57
GM
108112012-06-13 Glenn Morris <rgm@gnu.org>
10812
10813 * s/bsd-common.h (BSD4_3):
10814 * s/usg5-4-common.h (USG5_4): No longer define; unused.
10815
646b5f55
AS
108162012-06-13 Andreas Schwab <schwab@linux-m68k.org>
10817
10818 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
10819 instead of union.
10820 (XLI, XIL): Define.
1053a871
SM
10821 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
10822 Use them.
10823 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 10824 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 10825 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
10826 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
10827 * frame.c (delete_frame): Remove outdated comment.
10828 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
10829 USE_LISP_UNION_TYPE.
10830 (Fw32_unregister_hot_key): Likewise.
10831 (Fw32_toggle_lock_key): Likewise.
10832 * w32menu.c (add_menu_item): Likewise.
10833 (w32_menu_display_help): Use XIL instead of checking
10834 USE_LISP_UNION_TYPE.
10835 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
10836 (init_heap): Likewise.
10837 * w32term.c (w32_read_socket): Update comment.
10838
1d3823c9
GM
108392012-06-13 Glenn Morris <rgm@gnu.org>
10840
c62ff706
GM
10841 * s/usg5-4-common.h, src/s/unixware.h:
10842 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
10843
1d3823c9
GM
10844 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
10845
bfe3e0a2
PE
108462012-06-13 Paul Eggert <eggert@cs.ucla.edu>
10847
10848 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
10849 * alloc.c (make_number) [!defined make_number]:
10850 Remove, as lisp.h always defines this now.
10851 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
10852 (roundup_size): Verify that it is a power of 2.
10853 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
10854 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
10855 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
10856 -DUSE_LSB_TAG=0, to override the automatically-selected default.
10857 USE_LSB_TAG now is always defined to be either 0 or 1.
10858 All uses changed.
10859 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
10860 code works fine either way, and efficiency is not a concern here,
10861 as the union type is for debugging, not for production.
10862 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
10863 Use an inline function on all platforms when using the union type,
10864 since this is simpler and 'static inline' can be used portably
10865 within Emacs now.
10866 (LISP_INITIALLY_ZERO): New macro.
10867 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
10868 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
10869
45fa9c0f
GM
108702012-06-12 Glenn Morris <rgm@gnu.org>
10871
b4492cba
GM
10872 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
10873
10874 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 10875
45fa9c0f
GM
10876 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
10877 Move BROKEN_SIGIO to configure.
10878
10879 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
10880 Move NO_TERMIO to configure.
10881
0e25d334
CY
108822012-06-12 Chong Yidong <cyd@gnu.org>
10883
10884 * image.c (imagemagick_load_image): Use MagickFlattenImage if
10885 MagickMergeImageLayers is undefined. Use pixel pusher loop if
10886 MagickExportImagePixels is undefined.
10887
43682bb6
PE
108882012-06-12 Paul Eggert <eggert@cs.ucla.edu>
10889
10890 * image.c (imagemagick_load_image): Remove unused label.
10891
a9be7d2b
GM
108922012-06-11 Glenn Morris <rgm@gnu.org>
10893
10894 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10895 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
10896 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
10897 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
10898
3017f87f
SM
108992012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
10900
10901 * alloc.c (make_byte_code): New function.
10902 (Fmake_byte_code): Use it. Don't purify here.
10903 * lread.c (read1): Use it as well to avoid extra allocation.
10904
1b9b4cf4
CY
109052012-06-11 Chong Yidong <cyd@gnu.org>
10906
10907 * image.c (imagemagick_load_image): Implement transparency.
10908
95988fcf
AS
109092012-06-10 Andreas Schwab <schwab@linux-m68k.org>
10910
10911 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
10912 account for preceding backslashes. (Bug#11663)
10913
cd4eb164
CY
109142012-06-09 Chong Yidong <cyd@gnu.org>
10915
10916 * term.c: Support italics in capable terminals (Bug#9652).
10917 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
10918 (turn_on_face): Output using TS_enter_italic_mode if available.
10919 Don't handle unused blinking and alt-charset cases.
10920 (turn_off_face): Handle italic case; discard unused tty_blinking_p
10921 and tty_alt_charset_p cases.
10922 (tty_capable_p, init_tty): Support italics.
10923
10924 * termchar.h (struct tty_display_info): Add field for italics.
10925 Remove unused blink field.
10926
10927 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
10928 Handle slant.
10929
10930 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
10931 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
10932 tty_alt_charset_p. Add tty_italic_p.
10933
ff88beb8
MA
109342012-06-09 Michael Albinus <michael.albinus@gmx.de>
10935
10936 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
10937 dbus_type_is_basic if available.
10938 (xd_extract_signed, xd_extract_unsigned): Rename from
10939 extract_signed and extract_unsigned, respectively. Adapt callers.
10940
44286096
CY
109412012-06-09 Chong Yidong <cyd@gnu.org>
10942
1682701f
CY
10943 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
10944
44286096
CY
10945 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
10946 case (Bug#9752).
10947
d86feb17
PE
109482012-06-08 Paul Eggert <eggert@cs.ucla.edu>
10949
10950 * xdisp.c (vmessage): Treat frame message as multibyte.
10951 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
10952 would generate the diagnostic "Making \302\247 buffer-local while
10953 let-bound!".
10954
d5c20fe8
EZ
109552012-06-08 Eli Zaretskii <eliz@gnu.org>
10956
10957 * dispnew.c (showing_window_margins_p): Undo last change, which
10958 was done due to an inadvertent commit.
10959 (adjust_frame_glyphs_for_frame_redisplay): Do call
10960 showing_window_margins_p.
10961
513749ee
SM
109622012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
10963
10964 * eval.c (Fmake_var_non_special): New primitive.
10965 (syms_of_eval): Defsubr it.
10966 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
10967
d4a8f5c1
JB
109682012-06-08 Juanma Barranquero <lekktu@gmail.com>
10969
10970 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
10971 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
10972
8bbbc977
EZ
109732012-06-08 Eli Zaretskii <eliz@gnu.org>
10974
10975 * alloc.c (allocate_vectorlike): Fix last change.
10976
f3372c87
DA
109772012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
10978
10979 Block-based vector allocation of small vectors.
10980 * lisp.h (struct vectorlike_header): New field `nbytes',
10981 adjust comment accordingly.
10982 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 10983 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
10984 mark_maybe_pointer, valid_lisp_object_p) accordingly.
10985 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
10986 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
10987 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
10988 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
10989 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
10990 (roundup_size): New constant.
10991 (struct vector_block): New data type.
10992 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 10993 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
10994 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
10995 (sweep_vectors): New functions.
10996 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 10997 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
10998 or equal to VBLOCK_BYTES_MAX.
10999 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11000 (init_alloc_once): Add call to init_vectors.
11001
4f18a4ed
SM
110022012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11003
11004 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11005
86f158bc
PE
110062012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11007
11008 * doprnt.c (doprnt): Truncate multibyte char correctly.
11009 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11010 would mishandle a string argument "Xc" if X was a multibyte
11011 character of length 2: it would truncate after X's first byte
11012 rather than including all of X.
11013
c5cfcbe0
CY
110142012-06-06 Chong Yidong <cyd@gnu.org>
11015
11016 * buffer.c (word_wrap): Doc fix.
11017
c05cf390
PE
110182012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11019
11020 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11021
0c3461de
GM
110222012-06-03 Glenn Morris <rgm@gnu.org>
11023
11024 * xdisp.c (tool-bar-style): Doc fix.
11025
c71232db
UM
110262012-06-03 Ulrich Müller <ulm@gentoo.org>
11027
11028 * Makefile.in (PAXCTL): Define.
11029 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11030 binary via PaX flags if the paxctl utility is available.
11031 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11032 Restore PaX flags to their default. (Bug#11398)
11033
383f7350
CY
110342012-06-03 Chong Yidong <cyd@gnu.org>
11035
11036 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11037 buffer (Bug#11226).
11038
5f2c76c6
CY
110392012-06-03 Chong Yidong <cyd@gnu.org>
11040
11041 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11042 (note_mode_line_or_margin_highlight): If there is no help echo,
11043 use mode-line-default-help-echo. Handle the case where the mouse
11044 position is past the end of the mode line string.
11045
11046 * buffer.c (buffer_local_value_1): New function, split from
11047 Fbuffer_local_value; can return Qunbound.
11048 (Fbuffer_local_value): Use it.
11049 (Vmode_line_format): Docstring tweaks.
11050
773d47f6
PE
110512012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11052
11053 * sysdep.c (system_process_attributes): Improve comment.
11054
f2d6a3df
SM
110552012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11056
11057 * keyboard.c: Export real-this-command to Elisp.
11058 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11059 and DEFVAR it. Update all users.
11060
63810350
PE
110612012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11062
7bd5c1f4
PE
11063 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11064
63810350
PE
11065 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11066 Convert pctcpu and pctmem to Lisp float properly.
11067 Let the compiler fold better, as 100.0/0x8000 is exact.
11068
a2821611
AS
110692012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11070
11071 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11072 cons_block.
11073
5fceba1d
PE
110742012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11075
11076 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11077
c98ff5dd
DA
110782012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11079
11080 For a 'struct window', replace some Lisp_Object fields to
11081 bitfields where appropriate, remove unused fields.
11082 * window.h (struct window): Remove unused 'last_mark_x' and
11083 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 11084 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
11085 Change type of 'force_start', 'optional_new_start',
11086 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 11087 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 11088
ca34e0be
PE
110892012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 Pacify gcc -Wdouble-precision when using Xaw.
11092 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11093 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11094 Use 'float' consistently, rather than 'float' in most places
11095 and 'double' in a couple of places.
11096
efc00ab1 110972012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
11098
11099 * xdisp.c (handle_stop): Detect whether we have overlay strings
11100 loaded by testing it->current.overlay_string_index to be
11101 non-negative, instead of checking whether n_overlay_strings is
11102 positive. (Bug#11587)
11103
efc00ab1 111042012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
11105
11106 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11107
11108 * doc.c (Fsubstitute_command_keys): Doc fix.
11109
efc00ab1 111102012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
11111
11112 * search.c (search_buffer): Remove calls to
11113 r_alloc_inhibit_buffer_relocation, as it is now called by
11114 maybe_unify_char, which was the cause of relocation of buffer text
11115 in bug#11519.
11116
efc00ab1 111172012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
11118
11119 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11120 for the duration of call to load_charset, to avoid problems with
11121 callers of maybe_unify_char that access buffer text through C
11122 pointers.
11123
11124 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11125 decrement the inhibition flag, instead of just setting or
11126 resetting it.
11127
ba93a187
PE
111282012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11129
11130 Remove obsolete '#define static' cruft.
11131 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11132 This #undef was "temporary" in 2000; it is no longer needed
11133 now that '#define static' has gone away.
11134 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11135 (gray_bitmap_bits): Remove; no longer needed.
11136 All uses replaced with definiens.
11137 * xterm.c: Include "bitmaps/gray.xbm".
11138
9e4bf381
PE
111392012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11140
11141 Clean up __executable_start, monstartup when --enable-profiling.
11142 The following changes affect the code only when profiling.
11143 * dispnew.c (__executable_start): Rename from safe_bcopy.
11144 Define only on platforms that need it.
11145 * emacs.c: Include <sys/gmon.h> when profiling.
11146 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11147 (__executable_start): Remove decl, since lisp.h does it now.
11148 (safe_bcopy): Remove decl; no longer has that name.
11149 (main): Coalesce #if into single bit of code, for simplicity.
11150 Cast pointers to uintptr_t, since standard libraries want integers
11151 and not pointers.
11152 * lisp.h (__executable_start): New decl.
11153
32d72c2f
GM
111542012-05-31 Glenn Morris <rgm@gnu.org>
11155
11156 * image.c (Fimagemagick_types): Doc fix.
11157
baac5bc7
JM
111582012-05-30 Jim Meyering <meyering@redhat.com>
11159
11160 * callproc.c (Fcall_process_region): Include directory component
11161 in mkstemp error message (Bug#11586).
11162
72cb32cf
PE
111632012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11164
11165 * alloc.c, lisp.h (make_pure_vector): Now static.
11166
61b108cc
SM
111672012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11168
11169 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11170 Move to byte-run.el.
11171 (Fautoload): Do the hash-doc more carefully.
11172 * data.c (Fdefalias): Purify definition, except for keymaps.
11173 (Qdefun): Move from eval.c.
11174 * lisp.h (Qdefun): Remove.
11175 * lread.c (read1): Tiny simplification.
11176
471fe23d
TN
111772012-05-29 Troels Nielsen <bn.troels@gmail.com>
11178
934f3f58 11179 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
11180 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11181 Bug#9642, but explicitly check that the buffer the overlay would
11182 be moved to is live and rearrange lines to make sure that errors
11183 will not put the overlay in an inconsistent state.
11184 (Fdelete_overlay): Cosmetics.
11185
85d0efd1
EZ
111862012-05-28 Eli Zaretskii <eliz@gnu.org>
11187
11188 * w32term.c (my_bring_window_to_top): New function.
11189 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
11190 could be different from the original one.
11191 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
11192 (Bug#11513)
11193
11194 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11195 by calling BringWindowToTop.
11196
11197 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11198 (WM_EMACS_END): Increase by one.
11199
da92a98c
PE
112002012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11201
11202 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11203 This avoids undefined behavior that might cause the eassert
11204 to not catch an out-of-range value.
11205
74d1f848
JB
112062012-05-28 Juanma Barranquero <lekktu@gmail.com>
11207
11208 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11209 Update dependencies.
11210
9e1a06fc
EZ
112112012-05-27 Eli Zaretskii <eliz@gnu.org>
11212
11213 * bidi.c (bidi_mirror_char): Fix last change.
11214
f3dd7312
AS
112152012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11216
11217 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11218 when referring to sectname field in printf format.
11219
81899c91
PE
112202012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11221
57b81a9f
PE
11222 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11223 Only r_alloc_inhibit_buffer_relocation needed to be added;
11224 the others were already declared.
11225
81899c91
PE
11226 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11227 before checking whether it's out of range. Put the check inside
11228 eassert. See
11229 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11230
33017faf 112312012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
11232
11233 * callproc.c (Fcall_process): Restore a line that was accidentally
11234 commented out in the 2011-02-13 change (bug#11547).
11235
33017faf 112362012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
11237
11238 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11239 defined on ralloc.c.
11240
11241 * buffer.c [REL_ALLOC]: Remove prototypes of
11242 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11243 they are now on lisp.h.
11244
11245 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11246
11247 * search.c (search_buffer): Use it to inhibit relocation of buffer
11248 text while re_search_2 is doing its job, because re_search_2 is
11249 passed C pointers to buffer text. (Bug#11519)
11250
23415acf
EZ
11251 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11252 Update value to 24.
11253
44e27368
EZ
11254 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11255 state after an additional call to move_it_in_display_line_to, keep
11256 the values of it->max_ascent and it->max_descent found for the
11257 entire line.
11258 (pos_visible_p): Revert the comparison against bottom_y to what it
11259 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11260 (Bug#11464)
11261
c1892f11
PE
112622012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11263
11264 Fix coding-related core dumps with gcc -ftrapv.
11265 The code was computing A - B, where A and B are pointers, and B is
11266 random garbage. This can lead to core dumps on platforms that
11267 have special pointer registers, and it also leads to core dumps on
11268 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11269 A - B only when B is initialized properly.
11270 * coding.c (coding_set_source, coding_set_destination): Return void.
11271 (coding_change_source, coding_change_destinations): New functions,
11272 with the old behaviors of coding_set_source and coding_set_destination.
11273 All callers that need an offset changed to use these new functions.
11274
eb7afdad
GM
112752012-05-26 Glenn Morris <rgm@gnu.org>
11276
11277 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11278
f12fdf02
EZ
112792012-05-26 Eli Zaretskii <eliz@gnu.org>
11280
53a63be6 11281 Extend mouse support on W32 text-mode console.
61b108cc
SM
11282 * xdisp.c (draw_row_with_mouse_face):
11283 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11284
eb3f6f01 11285 * w32console.c: Include window.h.
61b108cc
SM
11286 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11287 New functions.
eb3f6f01
EZ
11288 (initialize_w32_display): Initialize mouse-highlight data.
11289
53a63be6
EZ
11290 * w32inevt.c: Include termchar.h and window.h.
11291 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11292 moves, call note_mouse_highlight. If help_echo changed, call
11293 gen_help_event to produce help-echo message in the echo area.
11294 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11295 highlight info.
11296
4cfd81f6
PE
112972012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11298
11299 * lread.c (read1): Simplify slightly to avoid an overflow warning
11300 with GCC 4.7.0 on x86-64.
11301
4446092a
EZ
113022012-05-26 Eli Zaretskii <eliz@gnu.org>
11303
11304 * bidi.c (bidi_mirror_char): Revert last change: an int is
11305 definitely wide enough here.
11306
42b2a986 113072012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11308
42b2a986 11309 Fix integer width and related bugs (Bug#9874).
eb106a49 11310 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11311 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11312 (string_bytes, check_sblock, allocate_string_data):
11313 (compact_small_strings, Fmake_bool_vector, make_string)
11314 (make_unibyte_string, make_multibyte_string)
11315 (make_string_from_bytes, make_specified_string)
11316 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11317 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11318 (mark_vectorlike):
11319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11320 (allocate_pseudovector):
11321 Use int, not EMACS_INT, where int is wide enough.
11322 (inhibit_garbage_collection, Fgarbage_collect):
11323 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11324 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11325 int might not be wide enough.
11326 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11327 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11328 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11329 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11330 (bidi_level_of_next_char, bidi_move_to_visually_next):
11331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11332 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11333 (Fkill_buffer, Fset_buffer_major_mode)
11334 (advance_to_char_boundary, Fbuffer_swap_text)
11335 (Fset_buffer_multibyte, overlays_at, overlays_in)
11336 (overlay_touches_p, struct sortvec, record_overlay_string)
11337 (overlay_strings, recenter_overlay_lists)
11338 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11339 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11340 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11341 (Foverlay_recenter, last_overlay_modification_hooks_used)
11342 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11344 (validate_region): Omit unnecessary test for b <= e,
11345 since that's guaranteed by the previous test.
d311d28c
PE
11346 (adjust_overlays_for_delete): Avoid pos + length overflow.
11347 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11348 (report_overlay_modification):
11349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11350 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11351 Omit pointer cast, which isn't needed anyway, and doesn't work
11352 after the EMACS_INT -> ptrdiff_t change.
02481186 11353 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11354 * buffer.h: Adjust decls to match defn changes elsewhere.
11355 (struct buffer_text, struct buffer):
11356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11357 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
11358 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11359 not int, to avoid needless 32-bit limit on 64-bit hosts.
11360 (exec_byte_code): Use tighter memory-full test, one that checks
11361 for alloca overflow. Don't compute the address of the object just
11362 before an array, as that's not portable. Use EMACS_INT, not
11363 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
11364 * callint.c (Fcall_interactively):
11365 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11366 * callproc.c (call_process_kill, Fcall_process):
11367 Don't assume pid_t fits into an Emacs fixnum.
11368 (call_process_cleanup, Fcall_process, child_setup):
11369 Don't assume pid_t fits into int.
11370 (call_process_cleanup, Fcall_process, delete_temp_file)
11371 (Fcall_process_region):
11372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11373 (Fcall_process): Simplify handling of volatile integers.
11374 Use int, not EMACS_INT, where int will do.
11375 * casefiddle.c (casify_object, casify_region, operate_on_word)
11376 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11378 (casify_object): Avoid integer overflow when overallocating buffer.
11379 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 11380 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
11381 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11382 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11383 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11384 integers are now checked earlier. All uses replaced with XINT.
11385 (ccl_driver):
11386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11387 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
11388 (ccl_driver, Fregister_code_conversion_map):
11389 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
11390 (resolve_symbol_ccl_program): Check that vector header is in range.
11391 Always copy the vector, so that we can check its contents reliably
11392 now rather than having to recheck each instruction as it's being
11393 executed. Check that vector words fit in 'int'.
11394 (ccl_get_compiled_code, Fregister_ccl_program)
11395 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11396 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11397 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11398 contents are in range.
11399 (Fccl_execute_on_string): Check that status is in range.
11400 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11401 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11402 Accept and return EMACS_INT, not int, because callers can pass values
11403 out of 'int' range.
11404 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11405 (multibyte_chars_in_text, parse_str_as_multibyte)
11406 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11407 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11408 (string_escape_byte8, Fget_byte):
11409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 11410 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
11411 avoid mishandling large integers.
11412 * character.h: Adjust decls to match defn changes elsewhere.
11413 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11414 (Ffind_charset_region):
11415 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11416 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11417 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 11418 Don't assume fixnum fits in int.
d311d28c
PE
11419 (load_charset_map_from_vector, Fmap_charset_chars):
11420 Remove now-unnecessary CHECK_NATNUMs.
11421 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
11422 Don't rely on undefined behavior with signed left shift overflow.
11423 Don't assume unsigned int fits into fixnum, or that fixnum fits
11424 into unsigned int. Don't require max_code to be a valid fixnum;
11425 that's not true for gb10830 4-byte on a 32-bit host. Allow
11426 invalid_code to be a cons, for the same reason. Require code_offset
11427 to be a character. Avoid int overflow if max_char is close
11428 to INT_MAX.
11429 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11430 this is intended anyway and avoids some undefined behavior.
11431 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11432 INDEX_TO_CODE_POINT, as that's what it expects.
11433 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
11434 * charset.h (DECODE_CHAR): Return int, not unsigned;
11435 this is what was intended anyway, and it avoids undefined behavior.
11436 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11437 integer-overflow issues.
11438 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11439 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11440 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
11441 * chartab.c (Fmake_char_table, Fset_char_table_range)
11442 (uniprop_get_decoder, uniprop_get_encoder):
11443 Don't assume fixnum fits in int.
11444 * cmds.c (move_point): New function, that does the gist of
11445 Fforward_char and Fbackward_char, but does so while checking
11446 for integer overflow more accurately.
c96e5d6a 11447 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
11448 (Fforward_line, Fend_of_line, internal_self_insert)
11449 (internal_self_insert):
11450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11451 Fix a FIXME, by checking for integer overflow when calculating
11452 target_clm and actual_clm.
11453 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 11454 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
11455 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11456 (coding_alloc_by_making_gap, alloc_destination)
11457 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11458 (encode_coding_utf_16, detect_coding_emacs_mule)
11459 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11460 (detect_coding_iso_2022, decode_coding_iso_2022)
11461 (encode_invocation_designation, encode_designation_at_bol)
11462 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11463 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11464 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11465 (encode_coding_ccl, encode_coding_raw_text)
11466 (detect_coding_charset, decode_coding_charset)
11467 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11468 (produce_composition, produce_charset, produce_annotation)
11469 (decode_coding, handle_composition_annotation)
11470 (handle_charset_annotation, consume_chars, decode_coding_gap)
11471 (decode_coding_object, encode_coding_object, detect_coding_system)
11472 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11473 (code_convert_region, code_convert_string)
8f50130c
PE
11474 (Fdefine_coding_system_internal)
11475 (coding_set_source, coding_set_destination):
d311d28c
PE
11476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11477 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11478 (Fdefine_coding_system_internal):
11479 Don't assume fixnums fit in int.
11480 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 11481 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
11482 (Funencodable_char_position, Fcheck_coding_systems_region)
11483 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 11484 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 11485 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 11486 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 11487 Don't access memory outside of the args array.
d311d28c 11488 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
11489 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11490 result of ENCODE_CHAR.
d311d28c
PE
11491 * coding.h: Adjust decls to match defn changes elsewhere.
11492 (struct coding_system):
11493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11494 * composite.c (get_composition_id, find_composition)
11495 (run_composition_function, update_compositions)
11496 (compose_text, composition_gstring_put_cache)
11497 (composition_gstring_p, composition_gstring_width)
11498 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11499 (composition_compute_stop_pos, composition_reseat_it)
11500 (composition_update_it, struct position_record)
11501 (find_automatic_composition, composition_adjust_point)
11502 (Fcomposition_get_gstring, Ffind_composition_internal):
11503 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11504 (update_compositions):
11505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11506 * composite.h: Adjust decls to match defn changes elsewhere.
11507 (struct composition):
11508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11509 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11510 Do not attempt to compute the address of the object just before a
11511 buffer; this is not portable.
11512 (Faref, Faset):
11513 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11514 (Faset): Use int, not EMACS_INT, where int is wide enough.
11515 (Fstring_to_number): Don't assume fixnums fit in int.
11516 (Frem): Don't assume arg is nonnegative.
11517 * dbusbind.c (xd_append_arg): Check for integers out of range.
11518 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 11519 (extract_signed, extract_unsigned): New functions.
243e0530
PE
11520 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11521 (xd_get_connection_references): Return ptrdiff_t, not int.
11522 All uses changed.
11523 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11524 (xd_read_message_1):
11525 Use int, not unsigned, where the dbus API uses int.
11526 (Fdbus_message_internal): Don't overflow mtype.
11527 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
11528 * dired.c (directory_files_internal, file_name_completion, scmp)
11529 (file_name_completion_stat):
11530 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11531 (file_name_completion): Don't overflow matchcount.
11532 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11533 * dispextern.h: Adjust decls to match defn changes elsewhere.
11534 (struct text_pos, struct glyph, struct bidi_saved_info)
11535 (struct bidi_string_data, struct bidi_it, struct composition_it)
11536 (struct it):
11537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11538 (struct display_pos, struct composition_it, struct it):
11539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11540 * dispnew.c (increment_matrix_positions)
11541 (increment_row_positions, mode_line_string)
11542 (marginal_area_string):
11543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 11544 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
11545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11546 (duration_to_sec_usec): New function, to check for overflow better.
11547 (Fsleep_for, sit_for): Use it.
11548 * doc.c (get_doc_string, store_function_docstring):
11549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11550 (get_doc_string, Fsnarf_documentation):
11551 Use int, not EMACS_INT, where int is wide enough.
11552 (get_doc_string):
11553 Use SAFE_ALLOCA, not alloca.
11554 Check for overflow when converting EMACS_INT to off_t.
11555 * doprnt.c (doprnt):
11556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11557 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11558 Don't assume uid_t fits into fixnum.
11559 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11560 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11561 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11562 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11563 (general_insert_function)
11564 (Finsert_char, make_buffer_string, make_buffer_string_both)
11565 (update_buffer_properties, Fbuffer_substring)
11566 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11567 (Fsubst_char_in_region, check_translation)
11568 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11569 (transpose_markers, Ftranspose_regions):
11570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11571 (clip_to_bounds): Move to lisp.h as an inline function).
11572 (Fconstrain_to_field): Don't assume integers are nonnegative.
11573 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11574 (Fsubst_char_in_region, Fsave_restriction):
11575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11576 (Femacs_pid): Don't assume pid_t fits into fixnum.
11577 (lo_time): Use int, not EMACS_INT, when int suffices.
11578 (lisp_time_argument): Check for usec out of range.
11579 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11580 (Fuser_login_name, Fuser_full_name): Signal an error
11581 if a uid argument is out of range, rather than relying on
11582 undefined behavior.
c8d5c857
PE
11583 (Fformat_time_string): Remove now-unnecessary check.
11584 lisp_time_argument checks for out-of-range usec now.
243e0530 11585 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11586 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11587 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11588 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11589 (init_cmdargs, Fdump_emacs):
11590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11591 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11592 the bottom (typically) 32 bits of the fixnum.
11593 * eval.c (specpdl_size, call_debugger):
11594 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11595 (when_entered_debugger, Fbacktrace_debug):
11596 Don't assume fixnum can fit in int.
11597 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11598 the object just before a buffer; this is not portable.
11599 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11600 (grow_specpdl, unbind_to):
11601 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11602 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11603 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11604 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11605 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11606 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11608 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11609 (a_write, e_write):
11610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11611 (Fcopy_file, non_regular_nbytes, read_non_regular)
11612 (Finsert_file_contents):
11613 Use int, not EMACS_INT, where int is wide enough.
11614 (READ_BUF_SIZE): Verify that it fits in int.
11615 (Finsert_file_contents): Check that counts are in proper range,
11616 rather than assuming fixnums fit into ptrdiff_t etc.
11617 Don't assume fixnums fit into int.
125b3835 11618 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
11619 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
11620 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
11621 (string_char_to_byte, string_byte_to_char)
11622 (string_make_multibyte, string_to_multibyte)
11623 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
11624 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
11625 (substring_both, Fdelete, internal_equal, Ffillarray)
11626 (Fclear_string, mapcar1)
11627 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
11628 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
11629 (larger_vector, make_hash_table, maybe_resize_hash_table)
11630 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
11631 (Fmaphash, secure_hash):
11632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11633 (concat): Check for string index and length overflow.
11634 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
11635 (Frequire):
11636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11637 (larger_vector): New API (vec, incr_min, size_max) replaces old
11638 one (vec, new_size, init). This catches size overflow.
11639 INIT was removed because it was always Qnil.
11640 All callers changed.
11641 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
11642 the upper bound on a hash table index size.
11643 (make_hash_table, maybe_resize_hash_table): Use it.
11644 (secure_hash): Computer start_byte and end_byte only after
11645 they're known to be in ptrdiff_t range.
11646 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
11647 (Ffont_get_glyphs, Ffont_at):
11648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11649 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
11650 (Flist_fonts, Fopen_font):
11651 Don't assume fixnum can fit in int.
11652 (check_gstring): Don't assume index can fit in int.
11653 (font_match_p): Check that fixnum is a character, not a nonnegative
11654 fixnum, since the later code needs to stuff it into an int.
11655 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
11656 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
11657 conversion overflow issues.
11658 (Fopen_font): Check for integer out of range.
11659 (Ffont_get_glyphs): Don't assume index can fit in int.
11660 * font.h: Adjust decls to match defn changes elsewhere.
11661 * fontset.c (reorder_font_vector): Redo score calculation to avoid
11662 integer overflow.
11663 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
11664 printmax_t, where ptrdiff_t is wide enough.
11665 (Finternal_char_font):
11666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11667 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
11668 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
11669 (Fset_frame_position, x_set_frame_parameters)
11670 (x_set_line_spacing, x_set_border_width)
11671 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
11672 Check that fixnums are in proper range for system types.
11673 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
11674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11675 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
11676 Use SAFE_ALLOCA_LISP, not alloca.
11677 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
11678 intptr_t is wide enough.
11679 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
11680 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
11681 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
11682 Check for fixnum out of range.
11683 * ftfont.c (ftfont_list): Don't assume index fits in int.
11684 Check that fixnums are in proper range for system types.
11685 (ftfont_shape_by_flt):
11686 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
11687 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
11688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11689 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
11690 Check that fixnums are in proper range for system types.
11691 * gnutls.h: Adjust decls to match defn changes elsewhere.
11692 * gtkutil.c (xg_dialog_run):
11693 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11694 (update_frame_tool_bar):
11695 Check that fixnums are in proper range for system types.
11696 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 11697 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
11698 * indent.c (last_known_column, last_known_column_point):
11699 (current_column_bol_cache):
11700 (skip_invisible, current_column, check_display_width):
11701 (check_display_width, scan_for_column, current_column_1)
11702 (Findent_to, Fcurrent_indentation, position_indentation)
11703 (indented_beyond_p, Fmove_to_column, compute_motion):
11704 (Fcompute_motion, Fvertical_motion):
11705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11706 (last_known_column_modified): Use EMACS_INT, not int.
11707 (check_display_width):
11708 (Fcompute_motion):
11709 Check that fixnums and floats are in proper range for system types.
11710 (compute_motion): Don't assume index or fixnum fits in int.
11711 (compute_motion, Fcompute_motion):
11712 Use int, not EMACS_INT, when it is wide enough.
11713 (vmotion): Omit local var start_hpos that is always 0; that way
11714 we don't need to worry about overflow in expressions involving it.
11715 * indent.h: Adjust decls to match defn changes elsewhere.
11716 (struct position):
11717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11718 Use int, not EMACS_INT, where int is wide enough.
11719 Remove unused members ovstring_chars_done and tab_offset;
11720 all uses removed.
11721 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
11722 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
11723 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
11724 (make_gap, copy_text, insert, insert_and_inherit)
11725 (insert_before_markers, insert_before_markers_and_inherit)
11726 (insert_1, count_combining_before, count_combining_after)
11727 (insert_1_both, insert_from_string)
11728 (insert_from_string_before_markers, insert_from_string_1)
11729 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
11730 (adjust_after_replace, adjust_after_insert, replace_range)
11731 (replace_range_2, del_range, del_range_1, del_range_byte)
11732 (del_range_both, del_range_2, modify_region)
11733 (prepare_to_modify_buffer, signal_before_change)
11734 (signal_after_change, Fcombine_after_change_execute):
11735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11736 * intervals.c (traverse_intervals, rotate_right, rotate_left)
11737 (balance_an_interval, split_interval_right, split_interval_left)
11738 (find_interval, next_interval, update_interval)
11739 (adjust_intervals_for_insertion, delete_node, delete_interval)
11740 (interval_deletion_adjustment, adjust_intervals_for_deletion)
11741 (static_offset_intervals, offset_intervals)
11742 (merge_interval_right, merge_interval_left, make_new_interval)
11743 (graft_intervals_into_buffer, temp_set_point_both)
11744 (temp_set_point, set_point, adjust_for_invis_intang)
11745 (set_point_both, move_if_not_intangible, get_property_and_range)
11746 (get_local_map, copy_intervals, copy_intervals_to_string)
11747 (compare_string_intervals, set_intervals_multibyte_1):
11748 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11749 * intervals.h: Adjust decls to match defn changes elsewhere.
11750 (struct interval):
11751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11752 * keyboard.c (this_command_key_count, this_single_command_key_start)
11753 (before_command_key_count, before_command_echo_length, echo_now)
11754 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
11755 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
11756 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
11757 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
11758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11759 (last_non_minibuf_size, last_point_position, echo_truncate)
11760 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
11761 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
11762 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
11763 (stuff_buffered_input):
11764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11765 (last_auto_save, command_loop_1, read_char):
11766 Use EMACS_INT, not int, to avoid integer overflow.
11767 (record_char): Avoid overflow in total_keys computation.
11768 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
11769 * keyboard.h: Adjust decls to match defn changes elsewhere.
11770 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
11771 (Fkey_description, Fdescribe_vector, Flookup_key):
11772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11773 (click_position): New function, to check that positions are in range.
11774 (Fcurrent_active_maps):
11775 (describe_command):
11776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11777 (Faccessible_keymaps, Fkey_description):
11778 (preferred_sequence_p):
11779 Don't assume fixnum can fit into int.
11780 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
11781 Check for integer overflow in size calculations.
11782 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
11783 avoid mishandling large integers.
11784 * lisp.h: Adjust decls to match defn changes elsewhere.
11785 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
11786 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
11787 (struct Lisp_Marker):
11788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11789 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
11790 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
11791 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
11792 All callers changed.
11793 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
11794 Assume the arg has valid form, since it always does.
11795 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
11796 unsigned integer system type.
11797 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
11798 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
11799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11800 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
11801 (duration_to_sec_usec): New decl.
11802 * lread.c (read_from_string_index, read_from_string_index_byte)
11803 (read_from_string_limit, readchar, unreadchar, openp)
11804 (read_internal_start, read1, oblookup):
11805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11806 (Fload, readevalloop, Feval_buffer, Feval_region):
11807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11808 (openp): Check for out-of-range argument to 'access'.
11809 (read1): Use int, not EMACS_INT, where int is wide enough.
11810 Don't assume fixnum fits into int.
6efdadfd 11811 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
11812 (read_filtered_event): Use duration_to_sec_usec
11813 to do proper overflow checking on durations.
d311d28c
PE
11814 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
11815 in size calculation.
11816 (Fexecute_kbd_macro):
11817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11818 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
11819 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
11820 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
11821 (set_marker_both, set_marker_restricted_both, marker_position)
11822 (marker_byte_position, Fbuffer_has_markers_at):
11823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11824 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 11825 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
11826 It now merely ensures that the menu is large enough, without
11827 necessarily growing it, as this avoids some integer overflow issues.
11828 All callers changed.
11829 (keymap_panes, parse_single_submenu, Fx_popup_menu):
11830 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11831 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
11832 Use SAFE_ALLOCA_LISP, not alloca.
11833 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
11834 to EMACS_INT. Check that fixnums are in proper range for system types.
11835 * minibuf.c (minibuf_prompt_width, string_to_object)
11836 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
11837 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
11838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11839 (get_minibuffer, read_minibuf_unwind):
11840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11841 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
11842 this simplifies overflow checking. All callers changed.
11843 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
11844 (Ftest_completion):
11845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11846 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
11847 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
11848 Check that fixnums are in proper range for system types.
11849 (Fx_create_frame, Fx_show_tip):
11850 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11851 * nsfont.m (ns_findfonts, nsfont_list_family):
11852 Don't assume fixnum fits in long.
11853 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
11854 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11855 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
11856 wide enough.
17fdb222 11857 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
11858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11859 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
11860 (PRINTDECLARE, PRINTPREPARE):
11861 (strout, print_string):
11862 (print, print_preprocess, print_check_string_charset_prop)
11863 (print_object):
11864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11865 (PRINTDECLARE):
11866 (temp_output_buffer_setup, Fprin1_to_string, print_object):
11867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11868 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 11869 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 11870 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
11871 (print_error_message): Use SAFE_ALLOCA, not alloca.
11872 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
11873 (print_depth, new_backquote_output, print_number_index):
11874 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
11875 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
11876 (Fset_process_window_size, Fformat_network_address)
11877 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 11878 (sigchld_handler):
d311d28c 11879 Check that fixnums are in proper range for system types.
d44287d4 11880 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
11881 Check for process-ids out of pid_t range rather than relying on
11882 undefined behavior.
e4d81efc 11883 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
11884 (Fformat_network_address, read_process_output, send_process)
11885 (Fprocess_send_region, status_notify):
11886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11887 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
11888 (wait_reading_process_output, read_process_output, exec_sentinel):
11889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11890 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
11891 (Faccept_process_output): Use duration_to_sec_usec to do proper
11892 overflow checking on durations.
dde14581
PE
11893 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
11894 Don't assume pid_t fits in int.
02481186
PE
11895 * process.h (struct Lisp_Process): Members tick and update_tick
11896 are now of type EMACS_INT, not int.
b62b53e8
PE
11897 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
11898 configured --with-wide-int.
d311d28c
PE
11899 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
11900 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
11901 * search.c (looking_at_1, string_match_1):
11902 (fast_string_match, fast_c_string_match_ignore_case)
11903 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
11904 (scan_newline, find_before_next_newline, search_command)
11905 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
11906 (set_search_regs, wordify):
11907 (Freplace_match):
11908 (Fmatch_data):
11909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11910 (string_match_1, search_buffer, set_search_regs):
11911 (Fmatch_data):
11912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11913 (wordify): Check for overflow in size calculation.
11914 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
11915 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
11916 Check that fixnums are in proper range for system types.
11917 * sound.c (struct sound_device)
11918 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
11919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11920 (Fplay_sound_internal):
11921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 11922 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
11923 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
11924 (Fparse_partial_sexp):
11925 Don't assume fixnums can fit in int.
11926 (struct lisp_parse_state, find_start_pos, find_start_value)
11927 (find_start_value_byte, find_start_begv)
11928 (update_syntax_table, char_quoted, dec_bytepos)
11929 (find_defun_start, prev_char_comend_first, back_comment):
11930 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
11931 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
11932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11933 (Finternal_describe_syntax_value): Check that match_lisp is a
11934 character, not an integer, since the code stuffs it into int.
11935 (scan_words, scan_sexps_forward):
11936 Check that fixnums are in proper range for system types.
11937 (Fforward_word):
11938 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11939 (scan_sexps_forward):
11940 Use CHARACTERP, not INTEGERP, since the value must fit into int.
11941 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
11942 * syntax.h: Adjust decls to match defn changes elsewhere.
11943 (struct gl_state_s):
11944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
11945 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
11946 MOST_POSITIVE_FIXNUM.
d311d28c
PE
11947 * sysdep.c (wait_for_termination_1, wait_for_termination)
11948 (interruptible_wait_for_termination, mkdir):
11949 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
11950 (emacs_read, emacs_write):
11951 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
11952 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
11953 and double all fit in int.
d311d28c
PE
11954 * term.c (set_tty_color_mode):
11955 Check that fixnums are in proper range for system types.
11956 * termhooks.h (struct input_event):
11957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11958 * textprop.c (validate_interval_range, interval_of)
11959 (Fadd_text_properties, set_text_properties_1)
11960 (Fremove_text_properties, Fremove_list_of_text_properties)
11961 (Ftext_property_any, Ftext_property_not_all)
11962 (copy_text_properties, text_property_list, extend_property_ranges)
11963 (verify_interval_modification):
11964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11965 (Fnext_single_char_property_change)
11966 (Fprevious_single_char_property_change):
11967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
11968 (copy_text_properties):
11969 Check for integer overflow in index calculation.
d311d28c
PE
11970 * undo.c (last_boundary_position, record_point, record_insert)
11971 (record_delete, record_marker_adjustment, record_change)
11972 (record_property_change):
11973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11974 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
11975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11976 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
11977 (Fx_hide_tip, Fx_file_dialog):
11978 * w32menu.c (set_frame_menubar):
11979 Use ptrdiff_t, not int, for consistency with rest of code.
11980 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
11981 (select_window, Fdelete_other_windows_internal)
11982 (window_scroll_pixel_based, window_scroll_line_based)
11983 (Frecenter, Fset_window_configuration):
11984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11985 (Fset_window_hscroll, run_window_configuration_change_hook)
11986 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 11987 (Fscroll_other_window, Frecenter):
d311d28c
PE
11988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11989 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
11990 Don't assume fixnum fits in int.
11991 (Fset_window_scroll_bars):
11992 Check that fixnums are in proper range for system types.
11993 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
11994 (string_pos, c_string_pos, number_of_chars, init_iterator)
11995 (in_ellipses_for_invisible_text_p, init_from_display_pos)
11996 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
11997 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
11998 (face_before_or_after_it_pos, handle_invisible_prop)
11999 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
12000 (display_prop_intangible_p, string_buffer_position_lim)
12001 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12002 (get_overlay_strings_1, get_overlay_strings)
12003 (iterate_out_of_display_property, forward_to_next_line_start)
12004 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12005 (get_next_display_element, set_iterator_to_next)
12006 (get_visually_first_element, compute_stop_pos_backwards)
12007 (handle_stop_backwards, next_element_from_buffer)
12008 (move_it_in_display_line_to, move_it_in_display_line)
12009 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12010 (add_to_log, message_dolog, message_log_check_duplicate)
12011 (message2, message2_nolog, message3, message3_nolog
12012 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12013 (current_message_1, truncate_echo_area, truncate_message_1)
12014 (set_message, set_message_1, store_mode_line_noprop)
12015 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12016 (text_outside_line_unchanged_p, check_point_in_composition)
12017 (reconsider_clip_changes)
12018 (redisplay_internal, set_cursor_from_row, try_scrolling)
12019 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12020 (redisplay_window, find_last_unchanged_at_beg_row)
12021 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12022 (trailing_whitespace_p, find_row_edges, display_line)
12023 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12024 (display_mode_element, store_mode_line_string)
12025 (pint2str, pint2hrstr, decode_mode_spec)
12026 (display_count_lines, display_string, draw_glyphs)
12027 (x_produce_glyphs, x_insert_glyphs)
12028 (rows_from_pos_range, mouse_face_from_buffer_pos)
12029 (fast_find_string_pos, mouse_face_from_string_pos)
12030 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12032 (safe_call, init_from_display_pos, handle_fontified_prop)
12033 (handle_single_display_spec, load_overlay_strings)
12034 (with_echo_area_buffer, setup_echo_area_for_printing)
12035 (display_echo_area, echo_area_display)
12036 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12037 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
12038 (redisplay_window, dump_glyph_row, display_mode_line)
12039 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 12040 (handle_display_spec, display_prop_string_p):
d311d28c
PE
12041 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12042 (handle_single_display_spec, build_desired_tool_bar_string)
12043 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12044 (get_specified_cursor_type):
12045 Check that fixnums are in proper range for system types.
12046 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12047 (Flookup_image_map):
12048 Don't assume fixnums fit in int.
12049 (compare_overlay_entries):
12050 Avoid mishandling comparisons due to subtraction overflow.
12051 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12052 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12053 (handle_tool_bar_click):
12054 Use int, not unsigned, since we prefer signed and the signedness
12055 doesn't matter here.
12056 (get_next_display_element, next_element_from_display_vector):
12057 Use int, not EMACS_INT, when int is wide enough.
12058 (start_hourglass): Use duration_to_sec_usec to do proper
12059 overflow checking on durations.
12060 * xfaces.c (Fbitmap_spec_p):
12061 Check that fixnums are in proper range for system types.
12062 (compare_fonts_by_sort_order):
12063 Avoid mishandling comparisons due to subtraction overflow.
12064 (Fx_family_fonts, realize_basic_faces):
12065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12066 (Fx_family_fonts):
12067 Don't assume fixnum fits in int.
12068 Use SAFE_ALLOCA_LISP, not alloca.
12069 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12070 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12071 (face_at_buffer_position, face_for_overlay_string)
12072 (face_at_string_position):
12073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12074 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12075 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12076 (Fx_show_tip):
12077 Check that fixnums are in proper range for system types.
12078 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12079 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12080 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12081 (Fx_change_window_property): Don't assume fixnums fit in int.
12082 * xfont.c (xfont_chars_supported):
12083 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12084 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12085 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12086 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12087 * xml.c (parse_region):
12088 * xrdb.c (magic_file_p):
12089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12090 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12091 (x_get_local_selection, x_reply_selection_request)
12092 (x_handle_selection_request, wait_for_property_change):
12093 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12094 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12095 short is wide enough.
12096 (x_send_client_event): Don't assume fixnum fits in int.
12097 * xterm.c (x_x_to_emacs_modifiers):
12098 Don't assume EMACS_INT overflows nicely into int.
12099 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12100 may come from Lisp.
12101 (handle_one_xevent): NATNUMP can eval its arg twice.
12102 (x_connection_closed):
12103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12104 * xterm.h: Adjust decls to match defn changes elsewhere.
12105 (struct scroll_bar): Use struct vectorlike_header
12106 rather than rolling our own approximation.
12107 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12108
c6574eb5
GM
121092012-05-25 Glenn Morris <rgm@gnu.org>
12110
12111 * lisp.mk (lisp): Update for more files being compiled now.
12112
e8d32c7e
SM
121132012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12114
48def666
SM
12115 * lread.c: Remove `read_pure' which makes no difference.
12116 (read_pure): Remove var.
12117 (unreadpure): Remove function.
12118 (readevalloop): Don't call read_list with -1 flag.
12119 (read1, read_vector): Don't test read_pure any more.
12120 (read_list): Simplify.
12121
e8d32c7e
SM
12122 * fileio.c, character.h: Minor style tweaks.
12123
4b2addb7
DA
121242012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12125
12126 * window.h (clip_changed): Remove useless declaration.
12127
584461b2
JB
121282012-05-22 Juanma Barranquero <lekktu@gmail.com>
12129
12130 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12131 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12132
34374650
PE
121332012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12134
12135 Remove src/m/*.
12136 This directory predates autoconf and is no longer needed nowadays.
12137 Move its few remaining bits of functionality to where they're needed.
12138 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12139 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12140 * m/template.h: Remove.
12141 * Makefile.in (M_FILE): Remove. All uses removed.
12142 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12143 * lisp.h (USE_LSB_TAG):
12144 * mem-limits.h (EXCEEDS_LISP_PTR):
12145 Use VAL_MAX, not VALBITS, in #if.
12146 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12147 (EMACS_UINT): Define unconditionally now.
12148 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12149 (BITS_PER_EMACS_INT): New constants, replacing
12150 what used to be in config.h, but not useful in #if.
12151 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12152 define them any more.
12153 (VAL_MAX): New macro.
12154 (VALMASK): Use it.
12155 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12156 BITS_PER_EMACS_INT, in #if.
12157 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12158 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12159 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12160 * s/ms-w32.h (DATA_START):
12161 Move here from removed file m/intel386.h.
12162 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12163 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12164
261cb4bb
PE
121652012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12166
12167 Assume C89 or later.
12168 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12169 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12170 (xrealloc):
12171 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12172 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12173 * textprop.c, tparam.c (NULL): Remove.
12174 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12175 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12176 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12177 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12178 * xterm.c (input_signal_count): Assume volatile works.
12179
ff23cd9f
KB
121802012-05-21 Ken Brown <kbrown@cornell.edu>
12181
12182 * xgselect.c (xg_select): Fix first argument in call to 'select'
12183 (bug#11508).
12184
1b170bc6
KB
121852012-05-20 Ken Brown <kbrown@cornell.edu>
12186
12187 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 12188 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 12189
b2f4d39f
KB
121902012-05-19 Ken Brown <kbrown@cornell.edu>
12191
12192 * xfns.c (x_in_use): Remove `static' qualifier.
12193 * xterm.h (x_in_use): Declare.
12194 * xgselect.c: Include xterm.h.
12195 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12196 and `display_arg' (bug#9754).
12197
003fdae2
PE
121982012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12199
9232a6d9
PE
12200 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12201
003fdae2
PE
12202 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12203 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12204
784b56e2
EZ
122052012-05-18 Eli Zaretskii <eliz@gnu.org>
12206
12207 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12208
12209 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 12210 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
12211
12212 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12213 reference to image_cache->refcount.
12214 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12215
a0a79cde
JL
122162012-05-17 Juri Linkov <juri@jurta.org>
12217
12218 * search.c (Fword_search_regexp, Fword_search_backward)
12219 (Fword_search_forward, Fword_search_backward_lax)
12220 (Fword_search_forward_lax): Move functions to isearch.el
12221 (bug#10145, bug#11381).
12222
b0572523
PE
122232012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12224
12225 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12226
9660f5fc
SM
122272012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12228
12229 * lread.c (init_obarray): Declare Qt and Qnil as special.
12230
4374de83
GM
122312012-05-14 Glenn Morris <rgm@gnu.org>
12232
12233 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 12234 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 12235
dc44c39a
PE
122362012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12237
078c97cb
PE
12238 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12239
dc44c39a
PE
12240 * unexaix.c: Port to more-recent AIX compilers.
12241 (report_error, report_error_1, make_hdr, copy_sym)
12242 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12243 Make arguments const char *, not char *, to avoid violations of C
12244 standard and to fix some AIX warnings reported by Gilles Pion.
12245
e18afed7 122462012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
12247
12248 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12249 already have overlays loaded.
12250 (handle_single_display_spec): Before returning without displaying
12251 fringe bitmap, synchronize the bidi iterator with the main display
12252 iterator, by calling iterate_out_of_display_property.
12253 (iterate_out_of_display_property): Detect buffer iteration by
12254 testing that it->string is a Lisp string.
12255 (get_next_display_element): When the current object is exhausted,
12256 and there's something on it->stack, call set_iterator_to_next to
12257 proceed with what's on the stack, instead of returning zero.
12258 (set_iterator_to_next): If called at the end of a Lisp string,
12259 proceed to consider_string_end without incrementing string
12260 position. Don't increment display vector index past the end of
12261 the display vector. (Bug#11417)
c8fb9dc6
EZ
12262 (pos_visible_p): Don't report a position visible when move_it_to
12263 stopped at the last line of window, which happens to be scanned
12264 backwards by the bidi iteration. (Bug#11464)
ac268e67 12265
e18afed7 122662012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
12267
12268 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12269 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
12270 are on a TTY, and thus unable to display on the fringes.
12271 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
12272 so we need to signal to the caller that this is a "replacing"
12273 display spec. This fixes display when the spec is invalid or we
12274 are on a TTY.
12275
e18afed7 122762012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
12277
12278 * unexaix.c (make_hdr): Fix typo in prototype.
12279 This bug broke the build on AIX. Problem reported by Gilles Pion.
12280
9d0a235a
MA
122812012-05-14 Michael Albinus <michael.albinus@gmx.de>
12282
12283 * keyboard.c (kbd_buffer_get_event): Read special events also in
12284 batch mode. (Bug#11415)
12285
9e6b06ed
GM
122862012-05-12 Glenn Morris <rgm@gnu.org>
12287
12288 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12289
c1a1d7a3
EZ
122902012-05-12 Eli Zaretskii <eliz@gnu.org>
12291
12292 * lisp.mk (lisp): Add newcomment.elc.
12293
3fe7cdc8
GM
122942012-05-12 Glenn Morris <rgm@gnu.org>
12295
12296 * Makefile.in (MKDIR_P): New, set by configure.
12297 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12298
53f7d2c0
PE
122992012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12300
12301 Remove unused function hourglass_started.
12302 * dispextern.h (hourglass_started):
12303 * w32fns.c (hourglass_started):
12304 * xdisp.c (hourglass_started): Remove.
12305
75aafb17
JB
123062012-05-10 Juanma Barranquero <lekktu@gmail.com>
12307
12308 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12309 Update dependencies.
12310
12959e8e
PE
123112012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12312
97107e2e
PE
12313 * xgselect.c (xg_select): Put maxfds+1 into a var.
12314 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12315
12959e8e
PE
12316 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12317
836d29b3
DA
123182012-05-10 Dave Abrahams <dave@boostpro.com>
12319
12320 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12321 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12322
5cb67954
MA
123232012-05-09 Michael Albinus <michael.albinus@gmx.de>
12324
12325 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12326 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12327 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12328 Initialize xd_registered_buses.
12329
3478ec45
PE
123302012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12331
b263a6b0
PE
12332 Untag more efficiently if USE_LSB_TAG.
12333 This is based on a proposal by YAMAMOTO Mitsuharu in
12334 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12335 For an admittedly artificial (nth 8000 longlist) benchmark on
12336 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12337 Emacs's overall text size by 1%.
12338 * lisp.h (XUNTAG): New macro.
12339 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12340 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12341 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12342 * eval.c (Fautoload):
12343 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12344 * frame.h (XFRAME): Use XUNTAG.
12345
3478ec45
PE
12346 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12347 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12348 Remove unportable assumptions about print widths of types like
12349 dbus_uint32_t.
12350 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12351 intptr_t when converting between pointer and integer, to avoid GCC
12352 warnings about wrong width.
12353
666b903b 123542012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12355
12356 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12357 stack for each reader_thread, instead of defaulting to 8MB
12358 determined by the linker. This avoids failures in creating
12359 subprocesses on Windows 7, see the discussion in this thread:
12360 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12361
b120cc17
JC
123622012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12363
12364 Fix up display of the *Minibuf-0* buffer in the mini window.
12365 * keyboard.c (read_char): Don't clear the echo area if there's no
12366 message to clear.
12367 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 12368 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 12369
9a4b36f8
MA
123702012-05-07 Michael Albinus <michael.albinus@gmx.de>
12371
12372 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12373 batch mode.
12374
e5f9458f
CY
123752012-05-06 Chong Yidong <cyd@gnu.org>
12376
12377 * lisp.mk (lisp): Update.
12378
eceeb5fc 123792012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
12380
12381 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12382
71873e2b
SM
123832012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12384
12385 * data.c (PUT_ERROR): New macro.
12386 (syms_of_data): Use it. Add new error type `user-error'.
12387 * undo.c (user_error): New function.
12388 (Fprimitive_undo): Use it.
12389 * print.c (print_error_message): Adjust print style for `user-error'.
12390 * keyboard.c (user_error): New function.
12391 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12392
ab0fa4e4
PE
123932012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12394
12395 Do not limit current-time-string to years 1000..9999.
12396 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12397 (Fcurrent_time_string): Support any year that is supported by the
12398 underlying localtime representation. Don't use asctime, as it
12399 has undefined behavior for years outside the range -999..9999.
12400
7ed806a7
PE
124012012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12402
12403 Fix race conditions involving setenv, gmtime, localtime, asctime.
12404 Without this fix, interrupts could mess up code that uses these
12405 nonreentrant functions, since setting TZ invalidates existing
12406 tm_zone or tzname values, and since most of these functions return
12407 pointers to static storage.
12408 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12409 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12410 Grow the critical sections to include not just invoking
12411 localtime/gmtime, but also accessing these functions' results
12412 including their tm_zone values if any, and any related TZ setting.
12413 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
12414 so that the struct tm is saved in the critical section.
12415 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
12416 motivated by the fact that memory allocation needs to be outside
12417 the critical section.
12418
0c16dfed
DA
124192012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12420
12421 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12422 with RESET_INTERVAL.
12423
12424 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12425 Remove duplicated buffer name initialization.
12426
3f83ace8
JM
124272012-05-02 Jim Meyering <jim@meyering.net>
12428
12429 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12430
c7b8541e
JM
12431 * xfns.c (x_window): Use xstrdup (Bug#11375).
12432
90207a15 124332012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
12434
12435 * xdisp.c (pos_visible_p): If already at a newline from the
12436 display string before the 'while' loop, don't walk back the glyphs
12437 from it3.glyph_row. Solves assertion violation when the display
12438 string begins with a newline (egg.el). (Bug#11367)
12439
b593d6a9
AH
124402012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12441
12442 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12443 Move to simple.el.
12444
4737362e
GM
124452012-05-01 Glenn Morris <rgm@gnu.org>
12446
99cf43f9
GM
12447 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12448 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12449 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12450 All were removed before 23.1.
12451
9311dcff
GM
12452 * dispnew.c: Remove HAVE_LIBNCURSES test;
12453 it is always true on relevant platforms.
12454
4d5c6349
GM
12455 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12456 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12457
4737362e
GM
12458 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12459
74dd3a6b
AS
124602012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12461
12462 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12463 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12464 Remove.
12465
13c379ee
PE
124662012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12467
12468 Do not avoid creating empty evaporating overlays (Bug#9642).
12469 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12470 That is, do not delete an evaporating overlay if it becomes
12471 empty after its bounds are adjusted to fit within its buffer.
12472 This fix caused other problems, and I'm reverting it until we get
12473 to the bottom of them.
12474
a8e7d6d7 124752012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
12476
12477 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12478
a8e7d6d7 124792012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
12480
12481 * xdisp.c (pos_visible_p): If the window start position is beyond
12482 ZV, start the display from buffer beginning. Prevents assertion
12483 violation in init_iterator when the minibuffer window is scrolled
12484 via the scroll bar.
12485
12486 * window.c (window_scroll_pixel_based): Likewise.
12487
a8e7d6d7 124882012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
12489
12490 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12491
a8e7d6d7 124922012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
12493
12494 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12495 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12496
a8e7d6d7 124972012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 12498
b593d6a9
AH
12499 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12500 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 12501
1c6900d9
EZ
125022012-04-26 Eli Zaretskii <eliz@gnu.org>
12503
4c3fa1d9
EZ
12504 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12505 display element, check also the underlying string or buffer
12506 character. (Bug#11341)
12507
1c6900d9
EZ
12508 * w32menu.c: Include w32heap.h.
12509 (add_menu_item): If the call to AppendMenuW (via
12510 unicode_append_menu) fails, disable Unicode menus only if we are
12511 running on Windows 9X/Me.
12512
42bf8205
AS
125132012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12514
12515 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12516 (xgetint): Add missing shift for LSB tags.
12517
b1bac16e
MR
125182012-04-24 Martin Rudalics <rudalics@gmx.at>
12519
12520 * keyboard.c (read_char): Don't wipe echo area for select window
12521 events: These might get delayed via `mouse-autoselect-window'
12522 (Bug#11304).
12523
d69621cc
JB
125242012-04-24 Juanma Barranquero <lekktu@gmail.com>
12525
12526 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12527 manipulation of :loaded-from data.
12528
02fd101b
JB
125292012-04-23 Juanma Barranquero <lekktu@gmail.com>
12530
12531 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12532 now a cons (bug#11311).
12533
888bec30
PE
125342012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12535
89a438bd
PE
12536 Do not create empty overlays with the evaporate property (Bug#9642).
12537 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12538 if it becomes empty after its bounds are adjusted to fit within
12539 its buffer. Without this fix, in a nonempty buffer (let ((o
12540 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12541 yields an empty overlay that has the evaporate property, which is
12542 not supposed to happen.
12543
1068fe4d
PE
12544 Fix minor GTK3 problems found by static checking.
12545 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12546 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12547 (struct _EmacsFixedClass, emacs_fixed_get_type):
12548 Move decls here from emacsgtkfixed.h, since they needn't be public.
12549 (emacs_fixed_get_type): Now static.
12550 (emacs_fixed_class_init): Omit unused local.
12551 (emacs_fixed_child_type): Remove; unused.
12552 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12553 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12554 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12555 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12556 (EMACS_FIXED_GET_CLASS): Remove; unused.
12557 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12558
888bec30
PE
12559 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12560 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12561
de85e130
PE
125622012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12563
d0baac98 12564 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12565 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12566 (__malloc_size_t, __malloc_ptrdiff_t):
12567 Remove. All uses removed, replaced by the definiens if needed,
12568 since we can assume C89 or better now.
12569 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12570 (protect_malloc_state, align, get_contiguous_space)
12571 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12572 (malloc_atfork_handler_child, malloc_enable_thread)
12573 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12574 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12575 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12576 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12577 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12578 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12579 Define using prototypes, not old style.
12580 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12581 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12582 (align): Don't assume that signed integer overflow wraps around.
12583 Omit unused local var.
12584 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12585 (_free_internal_nolock, memalign, mallochook, reallochook):
12586 Omit no-longer-needed casts.
12587 (valloc): Use getpagesize, not __getpagesize.
12588 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12589 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12590
de85e130
PE
12591 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12592
dcbf5805
MA
125932012-04-22 Michael Albinus <michael.albinus@gmx.de>
12594
12595 Move functions from C to Lisp. Make non-blocking method calls
12596 the default. Implement further D-Bus standard interfaces.
12597
12598 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12599 (QCdbus_request_name_allow_replacement)
12600 (QCdbus_request_name_replace_existing)
12601 (QCdbus_request_name_do_not_queue)
12602 (QCdbus_request_name_reply_primary_owner)
12603 (QCdbus_request_name_reply_in_queue)
12604 (QCdbus_request_name_reply_exists)
12605 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12606 (QCdbus_registered_serial, QCdbus_registered_method)
12607 (QCdbus_registered_signal): New Lisp objects.
12608 (XD_DEBUG_MESSAGE): Use sizeof.
12609 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12610 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12611 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12612 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12613 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12614 (xd_signature, xd_append_arg): Allow float for integer types.
12615 (xd_get_connection_references): New function.
b593d6a9
AH
12616 (xd_get_connection_address): Rename from xd_initialize.
12617 Return cached address.
dcbf5805
MA
12618 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
12619 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
12620 level.
12621 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 12622 Return number of refcounts.
dcbf5805
MA
12623 (Fdbus_get_unique_name): Make stronger parameter check.
12624 (Fdbus_message_internal): New defun.
12625 (Fdbus_call_method, Fdbus_call_method_asynchronously)
12626 (Fdbus_method_return_internal, Fdbus_method_error_internal)
12627 (Fdbus_send_signal, Fdbus_register_service)
12628 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
12629 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
12630 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
12631 (Vdbus_compiled_version, Vdbus_runtime_version)
12632 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
12633 (Vdbus_message_type_method_return, Vdbus_message_type_error)
12634 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
12635 (Vdbus_registered_buses, Vdbus_registered_objects_table):
12636 Adapt docstring.
dcbf5805 12637
52828e02
PE
126382012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12639
da05bc4c
PE
12640 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
12641 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
12642 Do not assume ptrdiff_t is the same width as 'int'.
12643
52828e02
PE
12644 * alloc.c: Handle unusual debugging option combinations.
12645 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
12646 since the two debugging options are incompatible.
12647 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
12648 is defined.
12649 (mem_init, mem_insert, mem_insert_fixup):
12650 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
12651 (NEED_MEM_INSERT): Remove; no longer needed.
12652
f01769f9
LL
126532012-04-22 Leo Liu <sdl.web@gmail.com>
12654
12655 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
12656
5790543d
PE
126572012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12658
12659 * sysdep.c [__FreeBSD__]: Minor cleanups.
12660 (list_system_processes, system_process_attributes) [__FreeBSD__]:
12661 Use Emacs indenting style more consistently. Avoid some casts.
12662 Use 'double' consistently rather than mixing 'float' and 'double'.
12663
b91b7e4d
EW
126642012-04-21 Eduard Wiebe <usenet@pusto.de>
12665
b593d6a9
AH
12666 * sysdep.c (list_system_processes, system_process_attributes):
12667 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 12668
6114eb15
AS
126692012-04-21 Andreas Schwab <schwab@linux-m68k.org>
12670
12671 * lisp.mk (lisp): Update.
12672
2f38dff7
PE
126732012-04-20 Paul Eggert <eggert@cs.ucla.edu>
12674
12675 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
12676 It is never used otherwise.
12677
4ae29f89
SM
126782012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
12679
12680 * print.c (print_preprocess): Only check print_depth if print-circle
12681 is nil.
12682 (print_object): Check for cycles even when print-circle is nil and
12683 print-gensym is t, but only check print_depth if print-circle is nil.
12684
f30d612a
CY
126852012-04-20 Chong Yidong <cyd@gnu.org>
12686
12687 * process.c (wait_reading_process_output): If EIO occurs on a pty,
12688 set the status to "failed" and ensure that sentinel is run.
12689
c07a4c0b 126902012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
12691
12692 * process.c (Fset_process_inherit_coding_system_flag)
12693 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 12694 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 12695
c07a4c0b 126962012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
12697
12698 * xdisp.c (string_buffer_position_lim): Limit starting position to
12699 BEGV.
12700 (set_cursor_from_row): If called for a mode-line or header-line
12701 row, return zero immediately.
12702 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
12703 farther than the first row after the header line, if any.
12704 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
12705 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
12706
c07a4c0b 127072012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12708
4ae29f89
SM
12709 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
12710 (bug#11238).
ad3a2b41 12711
c07a4c0b 127122012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 127132012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
12714
12715 configure: new option --enable-gcc-warnings (Bug#11207)
12716 * Makefile.in (C_WARNINGS_SWITCH): Remove.
12717 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
12718 (ALL_CFLAGS): Use new macros rather than old.
12719 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
12720 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
12721 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
12722 -Wunused-result, -Wunused-variable. This should go away once
12723 the Emacs and Gnulib regex code is merged.
12724 (xmalloc, xrealloc): Now static.
12725
aba027e8
PE
127262012-04-17 Paul Eggert <eggert@cs.ucla.edu>
12727
12728 * dired.c (Fsystem_groups): Remove unused local.
12729
e5a36063
GM
127302012-04-17 Glenn Morris <rgm@gnu.org>
12731
12732 * dired.c (Fsystem_users): Doc fix.
12733
316411f0
DA
127342012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
12735
12736 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
12737 (syms_of_dired): Add them.
12738
9426aba4
PE
127392012-04-16 Paul Eggert <eggert@cs.ucla.edu>
12740
b62a57be
PE
12741 Fix minor alloc.c problems found by static checking.
12742 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
12743 New extern decls, to avoid calling undeclared functions.
12744 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
12745 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
12746 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
12747 (NEED_MEM_INSERT): New macro.
12748 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 12749 Remove one incorrect comment and fix another.
b62a57be 12750
3539f31f
PE
12751 Fix minor ralloc.c problems found by static checking.
12752 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12753 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
12754 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
12755 (r_alloc_sbrk): Now static.
12756
a041960a
PE
12757 Improve ralloc.c interface checking.
12758 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
12759 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
12760 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
12761 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
12762 [REL_ALLOC]: ... to here, to check interface.
12763 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
12764 Remove decls. This fixes an "It stinks!".
12765
9426aba4
PE
12766 * alloc.c (which_symbols): Fix alignment issue / type clash.
12767
d55c12ed
AS
127682012-04-15 Andreas Schwab <schwab@linux-m68k.org>
12769
12770 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
12771 (struct Lisp_Misc_Any): Likewise.
12772 (struct Lisp_Free): Likewise.
12773 * alloc.c (union aligned_Lisp_Symbol): Define.
12774 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
12775 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
12776 (union aligned_Lisp_Misc): Define.
12777 (MARKER_BLOCK_SIZE, struct marker_block): Use union
12778 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 12779 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 12780
b948ce8b
PE
127812012-04-14 Paul Eggert <eggert@cs.ucla.edu>
12782
12783 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
12784 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
12785 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
12786 * s/netbsd.h, s/sol2-6.h:
12787 Remove definition of GC_MARK_STACK, since the default now works.
12788 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
12789 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
12790 no longer the default.
12791 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
12792
35dc09a1 127932012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 12794
35dc09a1
GM
12795 * lread.c (lisp_file_lexically_bound_p):
12796 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 12797
35dc09a1
GM
127982012-04-14 Eli Zaretskii <eliz@gnu.org>
12799
12800 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
12801 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
12802
128032012-04-14 Jan Djärv <jan.h.d@swipnet.se>
12804
12805 * nsterm.m (constrainFrameRect): Always constrain when there is only
12806 one screen (Bug#10962).
12807
bcd86815
KB
128082012-04-13 Ken Brown <kbrown@cornell.edu>
12809
12810 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
12811
c25df26e
RT
128122012-04-13 Reuben Thomas <rrt@sc3d.org>
12813
12814 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
12815
0fc59f1e
DC
128162012-04-11 Daniel Colascione <dancol@dancol.org>
12817
12818 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
12819 against is gone. It's better to use vfork now so that when Cygwin
12820 gains a new, working vfork, we use it automatically (bug#10398).
12821
de8c03dc
SM
128222012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12823
12824 * window.c (save_window_save): Obey window-point-insertion-type.
12825
2f097256
GM
128262012-04-11 Glenn Morris <rgm@gnu.org>
12827
12828 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
12829
453b951e
SM
128302012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
12831
12832 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
12833
75f1671a 128342012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
12835
12836 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
12837 (force_quit_count): New var.
12838 (handle_interrupt): Use it.
12839
2a8ce227
JB
128402012-04-10 Juanma Barranquero <lekktu@gmail.com>
12841
12842 * w32.c (w32_delayed_load): Record the full path of the library
12843 being loaded (bug#10424).
12844
935396c0
GM
128452012-04-09 Glenn Morris <rgm@gnu.org>
12846
05920a43
GM
12847 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
12848 not just in the obarray, before snarfing them. (Bug#11036)
12849
935396c0
GM
12850 * Makefile.in ($(leimdir)/leim-list.el):
12851 Pass EMACS rather than BUILT_EMACS.
12852
a18ecafa
TZ
128532012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
12854
12855 * process.c (make_process):
12856 * process.h: Add integer `gnutls_handshakes_tried' member to
12857 process struct.
12858
6bbef4e5
JC
12859 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
12860 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
12861
12862 * gnutls.c (gnutls_log_function2i): Convenience log function.
12863 (emacs_gnutls_read): Use new log functions,
12864 `gnutls_handshakes_tried' process member, and
12865 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
12866 attempts per process (connection).
12867
b4d3bc10
CY
128682012-04-09 Chong Yidong <cyd@gnu.org>
12869
12870 * eval.c (Fuser_variable_p, user_variable_p_eh)
12871 (lisp_indirect_variable): Functions deleted.
12872 (Fdefvar): Caller changed.
12873
12874 * callint.c (Finteractive, Fcall_interactively):
12875 * minibuf.c (Fread_variable): Callers changed.
12876
70f4d973
EZ
128772012-04-09 Eli Zaretskii <eliz@gnu.org>
12878
12879 * xdisp.c (set_cursor_from_row): If the display string appears in
12880 the buffer at position that is closer to point than the position
12881 after the display string, display the cursor on the first glyph of
12882 the display string. Fixes cursor display when a 'display' text
12883 property immediately follows invisible text. (Bug#11094)
12884
cb3c2e3e
PE
128852012-04-09 Paul Eggert <eggert@cs.ucla.edu>
12886
12887 composite.c: use 'double' consistently
12888 * composite.c (get_composition_id): Use 'double' consistently
12889 instead of converting 'float' to 'double' and vice versa; this is
12890 easier to understand and avoids a GCC warning.
12891
fd06db5d
GM
128922012-04-09 Glenn Morris <rgm@gnu.org>
12893
50fe702a
GM
12894 * Makefile.in: Generate leim-list with bootstrap-emacs, in
12895 preparation for dumping it with emacs. (Bug#4789)
12896 (leimdir): New variable.
12897 ($(leimdir)/leim-list.el): New rule.
12898 (emacs$(EXEEXT)): Depend on leim-list.el.
12899
fd06db5d
GM
12900 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
12901 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
12902 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
12903
55c131ee
AS
129042012-04-08 Andreas Schwab <schwab@linux-m68k.org>
12905
12906 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
12907 proper alignment.
12908
9209588f
JB
129092012-04-07 Juanma Barranquero <lekktu@gmail.com>
12910
12911 * xml.c (init_libxml2_functions) [WINDOWSNT]:
12912 Remove unused local variable.
12913
e3fb2efb
PE
129142012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12915
12916 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
12917 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
12918 (mark_memory): Mark Lisp_Objects only if pointers might hide in
12919 objects, as mark_maybe_pointer will catch them otherwise.
12920 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
12921 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
12922
b5385551
PE
129232012-04-07 Paul Eggert <eggert@cs.ucla.edu>
12924
12925 Fix typo that broke non-Windows builds.
12926 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
12927
9078ead6
EZ
129282012-04-07 Eli Zaretskii <eliz@gnu.org>
12929
12930 Support building on MS-Windows with libxml2.
12931
12932 * makefile.w32-in (OBJ2): Add xml.$(O).
12933 (GLOBAL_SOURCES): Add xml.c.
12934 ($(BLD)/xml.$(O)): New dependency list.
12935
12936 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
12937 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
12938 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
12939 [!WINDOWSNT]: New macros.
12940 (init_libxml2_functions, libxml2_loaded_p): New functions.
12941 (parse_region): Call fn_xmlCheckVersion instead of using the macro
12942 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
12943 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
12944 Calls xmlCleanupParser only if libxml2 was loaded (or statically
12945 linked in).
6bbef4e5
JC
12946 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
12947 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
12948 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
12949
12950 * emacs.c: Don't include libxml/parser.h.
12951 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
12952 xmlCleanupParser directly.
12953
12954 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
12955
3811fdf3
EZ
129562012-04-07 Eli Zaretskii <eliz@gnu.org>
12957
12958 * indent.c (Fvertical_motion): If there is a display string at
12959 point, use it.vpos to compute how many lines to backtrack after
12960 move_it_to point. (Bug#11133)
12961
2f8e16b2
EZ
129622012-04-06 Eli Zaretskii <eliz@gnu.org>
12963
12964 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
12965 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
12966 about subtle differences between FETCH_CHAR* and STRING_CHAR*
12967 macros related to unification of CJK characters. For the details,
12968 see the discussion following the message here:
12969 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
12970
3d439cd1
CY
129712012-04-04 Chong Yidong <cyd@gnu.org>
12972
12973 * keyboard.c (Vdelayed_warnings_list): Doc fix.
12974
8bc53d00
EZ
129752012-04-01 Eli Zaretskii <eliz@gnu.org>
12976
12977 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
12978 instead of alloca. (Bug#11138)
12979
3b0512a3
AS
129802012-04-01 Andreas Schwab <schwab@linux-m68k.org>
12981
12982 * w32menu.c (is_simple_dialog): Properly check lisp types.
12983 (Bug#11141)
12984
8427ddd2
EZ
129852012-03-31 Eli Zaretskii <eliz@gnu.org>
12986
979022ef
EZ
12987 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
12988 position we get to after a call to move_it_to fails the
12989 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
12990 only if we wind up in a string from display property. (Bug#11063)
12991
a6b1c7cc
EZ
12992 * window.c (Fdelete_other_windows_internal): Invalidate the row
12993 and column information about mouse highlight, so that redisplay
12994 restores it after reallocating the glyph matrices. (Bug#7464)
12995
8427ddd2
EZ
12996 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
12997 string comes from a `display' text property, use the buffer
12998 position of that property as if we actually saw that position in
12999 the row's glyphs.
697ba24b
EZ
13000 (move_it_by_lines): Remove the assertion that
13001 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13002 violated when there's a before-string at the beginning of a line.
13003 (Bug#11063)
8427ddd2 13004
65a0a738
EZ
130052012-03-30 Eli Zaretskii <eliz@gnu.org>
13006
13007 * xdisp.c (append_space_for_newline): If the default face was
13008 remapped, use the remapped face for the appended newline.
13009 (extend_face_to_end_of_line): Use the remapped default face for
13010 extending the face to the end of the line.
13011 (display_line): Call extend_face_to_end_of_line when the default
13012 face was remapped. (Bug#11068)
13013
581355cc
EZ
130142012-03-29 Eli Zaretskii <eliz@gnu.org>
13015
13016 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13017
e8fc049f
SM
130182012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13019
13020 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13021
4fb9a543
GM
130222012-03-27 Glenn Morris <rgm@gnu.org>
13023
13024 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13025 Doc fixes.
13026
679910f1
KH
130272012-03-26 Kenichi Handa <handa@m17n.org>
13028
13029 * dispextern.h (struct glyph): Fix previous change. Change the
13030 bit length of glyphless.ch to 25 (Bug#11082).
13031
90d49b7f
CY
130322012-03-26 Chong Yidong <cyd@gnu.org>
13033
13034 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13035 (command_loop_1): Use it; inhibit selection update for
13036 handle-select-window too (Bug#8996).
13037
f514f6f0
FP
130382012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13039
e8fc049f 13040 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 13041
bf43fa51
KH
130422012-03-25 Kenichi Handa <handa@m17n.org>
13043
13044 * dispextern.h (struct glyph): Change the bit length of
13045 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13046
8a0c01dd
EZ
130472012-03-24 Eli Zaretskii <eliz@gnu.org>
13048
13049 * s/ms-w32.h (tzname): Include time.h before redirecting to
13050 _tzname. Fixes the MSVC build. (Bug#9960)
13051
7d1c3a76
AS
130522012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13053
8ed79523
AS
13054 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13055 characters.
13056
7d1c3a76
AS
13057 * xterm.c (XTread_socket): Only modify handling_signal if
13058 !SYNC_INPUT. (Bug#11080)
13059
e99a9b8b
EZ
130602012-03-23 Eli Zaretskii <eliz@gnu.org>
13061
13062 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13063 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13064 when fetching a multibyte character consumes more bytes than
13065 CHAR_BYTES returns, due to unification of CJK characters in
13066 string_char. (Bug#11073)
13067
5063c0e1
TN
130682012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13069
13070 * process.c (wait_reading_process_output): Handle pty disconnect
13071 by refraining from sending oneself a SIGCHLD (bug#10933).
13072
9f851fbd
CY
130732012-03-22 Chong Yidong <cyd@gnu.org>
13074
13075 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13076
5063c0e1 13077 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
13078 Mark string as coming from a prefix property.
13079 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13080 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13081
fb5b8aca
CY
130822012-03-21 Chong Yidong <cyd@gnu.org>
13083
13084 * xfaces.c (Vface_remapping_alist): Doc fix.
13085
62356a1b
EZ
130862012-03-20 Eli Zaretskii <eliz@gnu.org>
13087
13088 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
13089 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13090 Doc fixes.
62356a1b 13091
025de85b
CY
130922012-03-20 Chong Yidong <cyd@gnu.org>
13093
13094 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13095 to reflect default non-nil value of redisplay-dont-pause.
13096
4827f94e
KH
130972012-03-19 Kenichi Handa <handa@m17n.org>
13098
13099 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13100 it fit in a valid range (Bug#11003).
13101
e50a24a2
EZ
131022012-03-18 Eli Zaretskii <eliz@gnu.org>
13103
13104 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13105 that is not from display property, accept the row as a "cursor
13106 row" if one of the string's character has a non-nil `cursor'
13107 property. Fixes cursor positioning when there are newlines in
13108 overlay strings, e.g. in icomplete.el. (Bug#11035)
13109
9af5ed87
PE
131102012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13111
13112 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13113
d1f55f16
CY
131142012-03-12 Chong Yidong <cyd@gnu.org>
13115
13116 * eval.c (inhibit_lisp_code): Rename from
13117 inhibit_window_configuration_change_hook; move from window.c.
13118
13119 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13120 * window.c (run_window_configuration_change_hook)
13121 (syms_of_window): Callers changed.
13122
66c5eebd
CY
131232012-03-11 Chong Yidong <cyd@gnu.org>
13124
413df973
CY
13125 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13126
66c5eebd
CY
13127 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13128
1de11f56
CY
131292012-03-10 Chong Yidong <cyd@gnu.org>
13130
13131 * frame.c (other_visible_frames): Don't assume the selected frame
13132 is visible (Bug#10955).
13133
cae07000
SM
131342012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13135
13136 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13137
89c94350
JD
131382012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13139
13140 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13141 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13142 zero (Bug#10954).
13143
999dd333
GM
131442012-03-03 Glenn Morris <rgm@gnu.org>
13145
01a6dcc8 13146 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 13147
de0100f2
EZ
131482012-03-02 Eli Zaretskii <eliz@gnu.org>
13149
13150 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13151 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
13152 (redisplay_window, next_element_from_string): Fix typos in
13153 comments.
3e441275
EZ
13154 (redisplay_window): Pass to move_it_vertically the margin in
13155 pixels, not in screen lines.
de0100f2 13156
96a72ee9
GM
131572012-03-02 Glenn Morris <rgm@gnu.org>
13158
13159 * buffer.c (buffer-list-update-hook): Doc fix.
13160
312508d7
EZ
131612012-02-29 Eli Zaretskii <eliz@gnu.org>
13162
13163 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13164 push_it before setting up the iterator for the first overlay
13165 string, even if we have an empty string loaded.
13166 (next_overlay_string): If there's an empty string on the iterator
13167 stack, pop the stack. (Bug#10903)
13168
27f3c637
PE
131692012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13170
13171 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13172 Suggested by Stefan Monnier in
13173 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13174 * alloc.c (widen_to_Lisp_Object): New static function.
13175 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13176 and widening them to Lisp_Objects. This would work even if
13177 USE_LSB_TAG is defined and wide integers are used, which might
13178 happen in a future version of Emacs.
13179
3c9dfce6
CY
131802012-02-25 Chong Yidong <cyd@gnu.org>
13181
fa74b241
CY
13182 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13183 Doc fix.
13184
3c9dfce6
CY
13185 * xselect.c (Fx_selection_exists_p): Doc fix.
13186 (x_clipboard_manager_save_all): Print an informative message
13187 before saving to clipboard manager.
13188
9486df08
CY
131892012-02-24 Chong Yidong <cyd@gnu.org>
13190
13191 * keyboard.c (process_special_events): Handle all X selection
13192 requests in kbd_buffer, not just the next one (Bug#8869).
13193
f01d3321
CY
131942012-02-23 Chong Yidong <cyd@gnu.org>
13195
13196 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13197 call when setting menu-bar-lines and tool-bar-lines parameters.
13198 (unwind_create_frame_1): New helper function.
13199
13200 * window.c (inhibit_window_configuration_change_hook): New var.
13201 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 13202 (syms_of_window): Initialize it.
f01d3321 13203
86b847b6
CY
132042012-02-22 Chong Yidong <cyd@gnu.org>
13205
13206 * xterm.c (x_draw_image_relief): Add missing type check for
13207 Vtool_bar_button_margin (Bug#10743).
13208
a59225b1
CY
132092012-02-21 Chong Yidong <cyd@gnu.org>
13210
13211 * fileio.c (Vfile_name_handler_alist): Doc fix.
13212
13213 * buffer.c (Fget_file_buffer): Protect against invalid file
13214 handler return value.
13215
310f5bd4
PE
132162012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13217
cb3a28cc
PE
13218 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13219 when computing $valmask.
13220
310f5bd4
PE
13221 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13222 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13223 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13224 It's useless in that case, and it can cause problems on hosts
13225 that allocate halves of EMACS_INT values separately.
13226 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13227 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13228 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13229 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13230 it avoids undefined behavior on hosts where shifting right by more
13231 than the word width has undefined behavior.
13232
2375c96a
CY
132332012-02-19 Chong Yidong <cyd@gnu.org>
13234
13235 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13236 (Funhandled_file_name_directory, Ffile_name_as_directory)
13237 (Fdirectory_file_name, Fexpand_file_name)
13238 (Fsubstitute_in_file_name): Protect against invalid file handler
13239 return values (Bug#10845).
13240
3eb49e71
EZ
132412012-02-18 Eli Zaretskii <eliz@gnu.org>
13242
13243 * .gdbinit (pitx): Fix incorrect references to fields of the
13244 iterator stack.
13245
7b926f3f
CY
132462012-02-17 Chong Yidong <cyd@gnu.org>
13247
13248 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13249
11273115
PE
132502012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13251
13252 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13253 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13254
c3a70e2b
CY
132552012-02-15 Chong Yidong <cyd@gnu.org>
13256
13257 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13258 marked as special. Also, starting docstrings with * is obsolete.
13259
0ca43699
AS
132602012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13261
13262 * gnutls.c (emacs_gnutls_write): Fix last change.
13263
2e8f3c56
LI
132642012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13265
13266 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13267 send_process.
13268
af70074f
SM
132692012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13270
13271 * keymap.c (Fsingle_key_description): Handle char ranges.
13272
95986d52
CY
132732012-02-12 Chong Yidong <cyd@gnu.org>
13274
afd83bd1
CY
13275 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13276 as that creates a dangerous corner case.
13277
95986d52
CY
13278 * window.c (Fdelete_window_internal): Invalidate the mouse
13279 highlight (Bug#9904).
13280
bd7da63e
GM
132812012-02-12 Glenn Morris <rgm@gnu.org>
13282
13283 * xselect.c (Fx_own_selection_internal)
13284 (Fx_get_selection_internal, Fx_disown_selection_internal)
13285 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13286 * nsselect.m (Fx_own_selection_internal)
13287 (Fx_disown_selection_internal, Fx_selection_exists_p)
13288 (Fx_selection_owner_p, Fx_get_selection_internal):
13289 Sync docs and argument specs with the xselect.c versions.
13290
77abcbc2
LI
132912012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13292
13293 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13294
90b671e2
EZ
132952012-02-11 Eli Zaretskii <eliz@gnu.org>
13296
1c0ca0b7
EZ
13297 * w32select.c (Fx_selection_exists_p): Sync doc string and
13298 argument list with xselect.c. (Bug#10783)
13299
13300 * w16select.c (Fx_selection_exists_p): Sync doc string and
13301 argument list with xselect.c. (Bug#10783)
90b671e2 13302
49241268
GM
133032012-02-10 Glenn Morris <rgm@gnu.org>
13304
13305 * fns.c (Fsecure_hash): Doc fix.
13306
f998bbe7 133072012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13308
13309 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13310
0992bd9c
CY
133112012-02-07 Chong Yidong <cyd@gnu.org>
13312
13313 * buffer.c (Fbuffer_local_variables)
13314 (buffer_lisp_local_variables): Handle unbound vars correctly;
13315 don't let Qunbound leak into Lisp.
13316
af008560
GM
133172012-02-07 Glenn Morris <rgm@gnu.org>
13318
dd605cc4
GM
13319 * image.c (Fimagemagick_types): Doc fix.
13320
af008560
GM
13321 * image.c (imagemagick-render-type): Change it from a lisp object
13322 to an integer. Move the doc here from the lisp manual.
13323 Treat all values not equal to 0 the same.
13324
1449fa1d
CY
133252012-02-06 Chong Yidong <cyd@gnu.org>
13326
13327 * doc.c (store_function_docstring): Avoid applying docstring of
13328 alias to base function (Bug#2603).
13329
3723ec07
AS
133302012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13331
13332 * .gdbinit (pp1, pv1): Remove redundant defines.
13333 (pr): Use pp.
13334
79c1cc1e
CY
133352012-02-04 Chong Yidong <cyd@gnu.org>
13336
13337 * nsterm.m: Declare a global (Bug#10694).
13338
d7f29f8e
EZ
133392012-02-04 Eli Zaretskii <eliz@gnu.org>
13340
cae07000
SM
13341 * w32.c (get_emacs_configuration_options):
13342 Include --enable-checking, if specified, in the return value.
d7f29f8e 13343
3b95a6f9
MR
133442012-02-04 Martin Rudalics <rudalics@gmx.at>
13345
13346 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13347 after rounding frame sizes. (Bug#9723)
13348
d6fa96a6
EZ
133492012-02-04 Eli Zaretskii <eliz@gnu.org>
13350
13351 * keyboard.c (adjust_point_for_property): Don't position point
13352 before BEGV. (Bug#10696)
13353
df0b2940
PE
133542012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13355
13356 Handle overflow when computing char display width (Bug#9496).
13357 * character.c (char_width): Return EMACS_INT, not int.
13358 (char_width, c_string_width): Check for overflow when
13359 computing the width; this is possible now that individual
13360 characters can have unbounded width. Problem introduced
13361 by merge from Emacs 23 on 2012-01-19.
13362
6bee44d6
MA
133632012-02-02 Michael Albinus <michael.albinus@gmx.de>
13364
13365 * dbusbind.c (Fdbus_register_method): Mention the return value
13366 :ignore in the docstring.
13367
44f92739
GM
133682012-02-02 Glenn Morris <rgm@gnu.org>
13369
1b9f60cc
GM
13370 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13371
44f92739
GM
13372 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13373 Unconditionally set to t. (Bug#10673)
13374 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13375 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13376 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13377
c5d3843c
KH
133782012-02-02 Kenichi Handa <handa@m17n.org>
13379
13380 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13381 0, do not call append_composite_glyph.
13382
159462d4 133832012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
13384
13385 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13386 NULL (Bug#6988).
13387 (x_produce_glyphs): If the component of a composition is a null
13388 string, set it->pixel_width to 1 to avoid zero-width glyph.
13389
78cef877
EZ
133902012-02-01 Eli Zaretskii <eliz@gnu.org>
13391
13392 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13393 first 2 arguments are identical. This makes inserting large
13394 output from a subprocess an order of magnitude faster on
13395 MS-Windows, where all sbrk'ed memory is always contiguous.
13396
97897668
GM
133972012-01-31 Glenn Morris <rgm@gnu.org>
13398
13399 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 13400 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
13401 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13402
31fd3586
GM
134032012-01-29 Glenn Morris <rgm@gnu.org>
13404
13405 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13406
0e24a8b2
CY
134072012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13408
13409 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13410
cc0adcb0
CY
134112012-01-28 Chong Yidong <cyd@gnu.org>
13412
13413 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13414
acc28cb9
CY
134152012-01-26 Chong Yidong <cyd@gnu.org>
13416
9c69cfb7
CY
13417 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13418
acc28cb9
CY
13419 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13420 repeat counts (Bug#10507).
13421
48da7392
GM
134222012-01-26 Glenn Morris <rgm@gnu.org>
13423
13424 * lread.c (syms_of_lread): Doc fix.
13425
14af5f7f
CY
134262012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13427
13428 * coding.c (encode_designation_at_bol): Change return value to
13429 EMACS_INT.
13430
0b21c100
CY
134312012-01-25 Chong Yidong <cyd@gnu.org>
13432
13433 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13434
3c2907f7
CY
134352012-01-21 Chong Yidong <cyd@gnu.org>
13436
13437 * floatfns.c (Fcopysign): Make the second argument non-optional,
13438 since nil is not allowed anyway.
13439
959ad23f
AS
134402012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13441
13442 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13443 (send_process): Likewise.
13444
34a02f46
MR
134452012-01-19 Martin Rudalics <rudalics@gmx.at>
13446
13447 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
13448 (Vwindow_persistent_parameters): Do not use Qstate.
13449 Rewrite doc-strings.
34a02f46 13450
1259009a 134512012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
13452
13453 * character.c (char_width): New function.
70d4fdf6
GM
13454 (Fchar_width, c_string_width, lisp_string_width):
13455 Use char_width (Bug#9496).
25ed9e61 13456
6a6ee00d
MR
134572012-01-16 Martin Rudalics <rudalics@gmx.at>
13458
13459 * window.c (Vwindow_persistent_parameters): New variable.
13460 (Fset_window_configuration, save_window_save): Handle persistent
13461 window parameters.
13462
c85efaf7
EZ
134632012-01-14 Eli Zaretskii <eliz@gnu.org>
13464
13465 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13466 thrashing the stack of the thread. (Bug#9087)
13467
5944709e
PE
134682012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13469
13470 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13471
e71f5d99
EZ
134722012-01-11 Eli Zaretskii <eliz@gnu.org>
13473
13474 * xdisp.c (rows_from_pos_range): Handle the case where the
13475 highlight ends on a newline. (Bug#10464)
13476 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13477 he end column for display of highlight that ends on a newline
13478 before a R2L line.
13479
ce316182
GM
134802012-01-11 Glenn Morris <rgm@gnu.org>
13481
13482 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13483 from load-path also when installation-directory is nil. (Bug#10208)
13484
5b43da69
GM
134852012-01-10 Glenn Morris <rgm@gnu.org>
13486
74cc8ff9
GM
13487 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13488
7d8d6e4e
GM
13489 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13490 Update template values to be closer to their typical values these days.
5b43da69 13491
a0db8d43
EZ
134922012-01-09 Eli Zaretskii <eliz@gnu.org>
13493
13494 * xdisp.c (rows_from_pos_range): Accept additional argument
13495 DISP_STRING, and accept any glyph in a row whose object is that
13496 string as eligible for mouse highlight. Fixes mouse highlight of
13497 display strings from overlays. (Bug#10464)
13498
9a0115ab 134992012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 13500
b9110d6a 13501 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
13502 * fileio.c (auto_saving_dir_umask): New static var.
13503 (Fmake_directory_internal): Use it.
13504 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13505 creating the directory. The old code temporarily assigns
13506 too-generous permissions to the directory.
13507 (do_auto_save_eh): Clear it.
b9110d6a 13508 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
13509 that the var is always cleared.
13510
6c1bd3f3
EZ
135112012-01-07 Eli Zaretskii <eliz@gnu.org>
13512
13513 * search.c (scan_buffer): Pass character positions to
13514 know_region_cache, not byte positions. (Bug#6540)
13515
069d2b50
L
135162012-01-07 LynX <_LynX@bk.ru> (tiny change)
13517
13518 * w32.c (sys_rename): Report EXDEV when rename of a directory
13519 fails because the target is on another logical disk. (Bug#10284)
13520
75bf0d33
DB
135212012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13522
13523 * xterm.c (x_embed_request_focus): New function.
13524
13525 * xterm.h: Add prototype.
13526
13527 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13528
1c6e5a32
GM
135292012-01-05 Glenn Morris <rgm@gnu.org>
13530
13531 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13532
651e947e
EZ
135332012-01-01 Eli Zaretskii <eliz@gnu.org>
13534
13535 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13536 Load gnutls_transport_set_lowat only if GnuTLS version is below
13537 2.11.1.
13538 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13539 GnuTLS versions below 2.11.1.
13540
3778cdd8
AL
135412011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13542
13543 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13544 to the doc string advising against its use for altering the way
13545 windows are scrolled.
13546
0e5317f7
KH
135472011-12-28 Kenichi Handa <handa@m17n.org>
13548
13549 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13550 coding-system ASCII compatible only when it does not produce BOM
13551 on encoding (Bug#10383).
13552
93d5ca1f
JD
135532011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13554
13555 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13556 can scroll.
13557 (create_and_show_popup_menu): Always use menu_position_func for
13558 Gtk3 (Bug#10361).
13559
ca22b785
AS
135602011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13561
13562 * callint.c (Fcall_interactively): Don't truncate prompt string.
13563
d048e1e6
EZ
135642011-12-23 Eli Zaretskii <eliz@gnu.org>
13565
13566 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13567 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13568 resumed from there (after widening). (Bug#10360)
d048e1e6 13569
5ccaba1f
JD
135702011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13571
13572 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13573
204ee57f
JD
135742011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13575
b81d40f0
JB
13576 * nsterm.m (x_free_frame_resources):
13577 Release f->output_data.ns->miniimage.
204ee57f
JD
13578 (ns_index_color): Fix indentation. Do not retain
13579 color_table->colors[i].
13580
13581 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13582 before returning.
13583
13584 * nsfns.m (x_set_background_color): Assign return value from
13585 ns_index_color to face-background instead of NSColor*.
13586 (ns_implicitly_set_icon_type): Fix indentation.
13587 Change assignment in for loop to comparison.
13588
13589 * emacs.c (ns_pool): New variable.
13590 (main): Assign ns_pool.
13591 (Fkill_emacs): Call ns_release_autorelease_pool.
13592
13593 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13594 autorelease fdesc, release fdAttrs and tdict.
13595 (ns_get_covering_families): Release charset.
13596 (ns_findfonts): Release NSFontDescriptor created with new.
13597 (ns_uni_to_glyphs): Fix indentation.
13598 (setString): Release attrStr before assigning new value.
13599
c803b2b7
JD
136002011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13601
678f4426
JD
13602 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13603 and NS_IMPL_COCOA.
13604 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13605 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13606
cd394be1 136072011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13608
5fecd5fc
JD
13609 * nsterm.m (ns_term_init): Subscribe for notifications
13610 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13611 to method trackingNotification in EmacsMenu.
13612
13613 * nsmenu.m (trackingMenu): New variable.
3771cb17 13614 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13615 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 13616 from Aquamacs (Bug#7030).
678f4426
JD
13617
136182011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 13619
c803b2b7
JD
13620 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
13621 (symbol_to_nsstring): Fix indentation.
13622 (ns_symbol_to_pb): New function.
cae07000
SM
13623 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
13624 (Fns_rotate_cut_buffers_internal): Remove.
13625 (Fns_store_selection_internal): Rename from
c803b2b7
JD
13626 Fns_store_cut_buffer_internal.
13627 (ns_get_foreign_selection, Fx_own_selection_internal)
13628 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
13629 (Fns_get_selection_internal, Fns_store_selection_internal):
13630 Use ns_symbol_to_pb and check if return value is nil.
13631 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
13632 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
13633 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
13634 renamed to Sns_store_selection_internal.
13635 (ns_handle_selection_request): Move code to Fx_own_selection_internal
13636 and remove this function.
13637 (ns_handle_selection_clear): Remove, never used.
13638 (Fx_own_selection_internal): Move code from ns_handle_selection_request
13639 here.
13640
e1b01a3a
KB
136412011-12-17 Ken Brown <kbrown@cornell.edu>
13642
13643 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
13644 GID is unknown (Bug#10257).
13645
2adb6e85
PE
136462011-12-17 Paul Eggert <eggert@cs.ucla.edu>
13647
13648 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
13649 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
13650 which caused a build failure on GNU/Linux IA-64. This problem was
13651 introduced by my 2011-10-07 patch.
13652
d1d7b339
JL
136532011-12-15 Juri Linkov <juri@jurta.org>
13654
13655 * image.c (imagemagick_error): New function. (Bug#10112)
13656 (imagemagick_load_image): Comment out `MagickSetResolution' call.
13657 Use `imagemagick_error' where ImageMagick functions return
13658 `MagickFalse'.
13659 (Fimagemagick_types): Add `Fnreverse' to return the list in the
13660 proper order.
13661
100d5755
KH
136622011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13663
13664 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
13665 fill background (Bug#8992).
13666
454592a6
MR
136672011-12-13 Martin Rudalics <rudalics@gmx.at>
13668
13669 * window.c (Vwindow_combination_resize)
13670 (Vwindow_combination_limit): Use t instead of non-nil in
13671 doc-strings.
61d4b438
MR
13672 (Vrecenter_redisplay): Add first sentence of doc-string on
13673 separate line.
53524d93 13674 (Frecenter): Fix doc-string typo.
454592a6 13675
3633e3aa
KH
136762011-12-11 Kenichi Handa <handa@m17n.org>
13677
13678 * coding.c (Funencodable_char_position): Pay attention to the
13679 buffer text relocation (Bug#9389).
13680
7b9d523a 136812011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 13682
7b9d523a
JD
13683 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
13684 gtk_init (Bug#10100).
13685
b73189c6
EZ
136862011-12-10 Eli Zaretskii <eliz@gnu.org>
13687
13688 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
13689 IT->string is nil. (Bug#10263)
13690
f7dfe5d6
JD
136912011-12-10 Jan Djärv <jan.h.d@swipnet.se>
13692
83faebb4
JD
13693 * nsterm.h (x_free_frame_resources): Declare.
13694
f7dfe5d6
JD
13695 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
13696 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
13697
13698 * nsterm.h (ns_get_defaults_value): Declare.
13699
13700 * nsterm.m (ns_default): Call ns_get_defaults_value.
13701
7cd4e72c
EZ
137022011-12-09 Eli Zaretskii <eliz@gnu.org>
13703
13704 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
13705 (Bug#10170)
13706
b34d7317
YM
137072011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13708
13709 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
13710 that where the value of an _OBJC_* symbol points to is in the .bss
13711 section (Bug#10240).
13712
76470ad1
KH
137132011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13714
13715 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 13716 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 13717
745fff94
KH
137182011-12-08 Kenichi Handa <handa@m17n.org>
13719
13720 * ftfont.c (get_adstyle_property): Fix previous change
13721 (Bug#10233).
13722
6e44397c
JB
137232011-12-07 Juanma Barranquero <lekktu@gmail.com>
13724
13725 * w32.c (init_environment): If no_site_lisp, remove site-lisp
13726 dirs from the default value of EMACSLOADPATH (bug#10208).
13727
7efa6272
GM
137282011-12-07 Glenn Morris <rgm@gnu.org>
13729
13730 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
13731 installation and source directories as well. (Bug#10208)
13732
f6fc4d87
CY
137332011-12-06 Chong Yidong <cyd@gnu.org>
13734
13735 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
13736
2bf26180
GM
137372011-12-06 Glenn Morris <rgm@gnu.org>
13738
13739 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
13740 as an error, not just -1. (Bug#10217)
13741
3a6ad4f0
CY
137422011-12-05 Chong Yidong <cyd@gnu.org>
13743
13744 * keyboard.c (process_special_events): New function.
13745 (swallow_events, Finput_pending_p): Use it (Bug#10195).
13746
75a3b399
PE
137472011-12-05 Paul Eggert <eggert@cs.ucla.edu>
13748
13749 * coding.c (encode_designation_at_bol): Don't use uninitialized
13750 local variable (Bug#9318).
13751
c3c9e25e
KH
137522011-12-05 Kenichi Handa <handa@m17n.org>
13753
13754 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
13755 return Qnil (Bug#8046, Bug#10193).
13756
5eb05ea3
KH
137572011-12-05 Kenichi Handa <handa@m17n.org>
13758
13759 * coding.c (encode_designation_at_bol): New args charbuf_end and
13760 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
13761 (coding_set_source): Return how many bytes coding->source was
13762 relocated.
13763 (coding_set_destination): Return how many bytes
13764 coding->destination was relocated.
13765 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 13766 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
13767
137682011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
13769
13770 * coding.c (CODING_CHAR_CHARSET_P): New macro.
13771 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
13772 macro (Bug#9318).
13773
137742011-12-05 Andreas Schwab <schwab@linux-m68k.org>
13775
13776 The following changes are to fix Bug#9318.
13777
a79703f5 13778 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
13779 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
13780 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 13781 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 13782
7dbda6df
JB
137832011-12-05 Juanma Barranquero <lekktu@gmail.com>
13784
13785 * lisp.h (process_quit_flag): Fix external declaration.
13786
6d5eb5b0
SM
137872011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
13788
13789 Don't macro-inline non-performance-critical code.
13790 * eval.c (process_quit_flag): New function.
13791 * lisp.h (QUIT): Use it.
13792
a0c3fad0
JD
137932011-12-04 Jan Djärv <jan.h.d@swipnet.se>
13794
13795 * nsfns.m (get_geometry_from_preferences): New function.
13796 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
13797
6c07aac2
AS
137982011-12-04 Andreas Schwab <schwab@linux-m68k.org>
13799
13800 * emacs.c (Qkill_emacs): Define.
13801 (syms_of_emacs): Initialize it.
13802 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
13803 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
13804 (quit_throw_to_read_char): Add parameter `from_signal'.
13805 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
13806 * lisp.h (QUIT): Call Fkill_emacs if requested.
13807
c052ead4
JD
138082011-12-03 Jan Djärv <jan.h.d@swipnet.se>
13809
13810 * widget.c (update_wm_hints): Return if wmshell is null.
13811 (widget_update_wm_size_hints): New function.
13812
13813 * widget.h (widget_update_wm_size_hints): Declare.
13814
13815 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
13816 widget_update_wm_size_hints (Bug#10104).
13817
9e49252b
EZ
138182011-12-03 Eli Zaretskii <eliz@gnu.org>
13819
13820 * xdisp.c (handle_invisible_prop): If the invisible text ends just
13821 before a newline, prepare the bidi iterator for consuming the
13822 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 13823 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 13824
02b16839
JL
138252011-12-02 Juri Linkov <juri@jurta.org>
13826
13827 * search.c (Fword_search_regexp): New Lisp function created from
13828 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
13829 (Fword_search_backward, Fword_search_forward)
13830 (Fword_search_backward_lax, Fword_search_forward_lax):
13831 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
13832 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
13833
0068070e
SM
138342011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
13835
13836 * fileio.c (Finsert_file_contents): Move after-change-function call
13837 to before the "handled:" label, since all "goto handled" appear in
13838 cases where the *-change-functions have already been properly called
13839 (bug#10117).
13840
3360a3fc
AS
138412011-12-01 Andreas Schwab <schwab@linux-m68k.org>
13842
13843 * keyboard.c (interrupt_signal): Don't call kill-emacs when
13844 waiting for input. (Bug#10169)
13845
73d6c093
EZ
138462011-11-30 Eli Zaretskii <eliz@gnu.org>
13847
13848 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
13849 verifies glyph row's hash code--we have just reallocated the
13850 glyphs, so their contents can be complete garbage. (Bug#10164)
13851
febe6bea
JB
138522011-11-30 Juanma Barranquero <lekktu@gmail.com>
13853
13854 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
13855
801a4313
EZ
138562011-11-30 Eli Zaretskii <eliz@gnu.org>
13857
13858 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
13859 attributes are tested _before_ calling verify_row_hash, to protect
13860 against GCC re-ordering of the tests. (Bug#10164)
13861
2b56b87e
JD
138622011-11-29 Jan Djärv <jan.h.d@swipnet.se>
13863
13864 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
13865
13866 * xterm.c (handle_one_xevent): Only set async_visible and friends
13867 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 13868 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
13869 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
13870
dbf31225
PE
138712011-11-28 Paul Eggert <eggert@cs.ucla.edu>
13872
13873 Remove GCPRO-related macros that exist only to avoid shadowing locals.
13874 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
13875 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
13876 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13877 All uses changed to use GCPRO1 etc.
13878 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
13879 Revert to old implementation (i.e., before 2011-03-11).
13880
1305621b
YM
138812011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13882
13883 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
13884 of scroll runs so as to avoid assigning disabled bogus rows and
13885 unnecessary graphics copy operations.
13886
8c9afb46
EZ
138872011-11-27 Eli Zaretskii <eliz@gnu.org>
13888
13889 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
13890 (snprintf) [_MSC_VER]: Redirect to _snprintf.
13891 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
13892 (malloc, free, realloc, calloc): Redirect to e_* only when
13893 compiling Emacs.
13894
13895 * lisp.h (GCTYPEBITS): Move before first use.
13896 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
13897 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
13898 this macro definition.
13899
13900 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
13901 _MSC_VER.
13902
54e9e3bf
JD
139032011-11-27 Jan Djärv <jan.h.d@swipnet.se>
13904
6d5eb5b0
SM
13905 * gtkutil.c (xg_create_frame_widgets):
13906 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
13907 present with Gtk+ 2.0.
13908
83aca1cb
PE
139092011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13910
13911 * fileio.c (Finsert_file_contents): Undo previous change; see
13912 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
13913
5b76caa4
PE
139142011-11-26 Paul Eggert <eggert@cs.ucla.edu>
13915
13916 Rename locals to avoid shadowing.
13917 * fileio.c (Finsert_file_contents):
13918 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
13919 * process.c (wait_reading_process_output):
13920 Rename inner 'proc' to 'p' to avoid shadowing.
13921 Indent for consistency with usual Emacs style.
13922
8c535114
EZ
139232011-11-25 Eli Zaretskii <eliz@gnu.org>
13924
13925 * xdisp.c (redisplay_window): If cursor row is not fully visible
13926 after recentering, and scroll-conservatively is set to a large
13927 number, scroll window by a few more lines to make the cursor fully
13928 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
13929 (start_display): Don't move to the next line if the display should
13930 start at a newline that is part of a display vector or an overlay
13931 string. (Bug#10119)
8c535114 13932
fa4fdb5c
JL
139332011-11-24 Juri Linkov <juri@jurta.org>
13934
13935 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
13936 after the `MagickPingImage' call. (Bug#10112)
13937
90ec88df
CY
139382011-11-23 Chong Yidong <cyd@gnu.org>
13939
13940 * window.c (Fcoordinates_in_window_p): Accept only live windows.
13941
56e2e794
MR
139422011-11-23 Martin Rudalics <rudalics@gmx.at>
13943
13944 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
13945 making another buffer current. (Bug#10114)
13946
b6e64c41
GM
139472011-11-23 Glenn Morris <rgm@gnu.org>
13948
13949 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
13950
6b21de18
CY
139512011-11-23 Chong Yidong <cyd@gnu.org>
13952
13953 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
13954 using it (Bug#5984).
13955
b12cd789
EZ
139562011-11-22 Eli Zaretskii <eliz@gnu.org>
13957
13958 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
13959 and header-lines, as they don't have one computed for them.
13960 (Bug#10098)
13961
13962 * .gdbinit (prow): Make displayed values more self-explaining.
13963 Add row's hash code.
13964
261b6fd4
LMI
139652011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
13966
13967 * process.c (wait_reading_process_output): Fix asynchrounous
13968 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 13969 (wait_reading_process_output): Add comment and URL.
261b6fd4 13970
e7cfd277
JD
139712011-11-21 Jan Djärv <jan.h.d@swipnet.se>
13972
13973 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
13974
a9b9b7f5
CY
139752011-11-21 Chong Yidong <cyd@gnu.org>
13976
13977 * window.c (Fnext_window, Fprevious_window): Doc fix.
13978
b0d15b4f
SM
139792011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13980
13981 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
13982
fe7a3057
JB
139832011-11-20 Juanma Barranquero <lekktu@gmail.com>
13984
13985 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
13986
d2999b1a
MR
139872011-11-20 Martin Rudalics <rudalics@gmx.at>
13988
13989 * window.c (Fset_window_combination_limit): Rename argument
13990 STATUS to LIMIT.
13991 (Vwindow_combination_limit): Remove "status" from doc-string.
13992
d5ff9cd0
AS
139932011-11-20 Andreas Schwab <schwab@linux-m68k.org>
13994
13995 * m/ibms390.h: Remove.
13996 * m/ibms390x.h: Don't include "ibms390.h".
13997
a5bb9bd3
SM
139982011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
13999
14000 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14001 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14002
cd1181db
JB
140032011-11-20 Juanma Barranquero <lekktu@gmail.com>
14004
14005 * casetab.c (Fset_case_table):
14006 * charset.c (Fcharset_after): Fix typos.
14007
615a3b8d 140082011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 14009
17e845af
PE
14010 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14011 Otherwise, valgrind does not work on some platforms.
14012 Problem reported by Andreas Schwab in
6a0bf43d
PE
14013 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14014 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14015 is set, removing the need for VIRT_ADDRESS_VARIES.
14016 (PURE_P): Use a more-efficient implementation that needs just one
14017 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14018 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14019 to 4 (xorl, subq, cmpq, setbe).
14020 * alloc.c (pure): Always extern now, since that's the
14021 VIRT_ADDR_VARIES behavior.
14022 (PURE_POINTER_P): Use a single comparison, not two, for
14023 consistency with the new puresize.h.
14024 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14025 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14026 Remove VIRT_ADDR_VARIES no longer needed.
14027
f8fe6f96
EZ
140282011-11-19 Eli Zaretskii <eliz@gnu.org>
14029
14030 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14031 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14032 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14033 behave as if the cursor position were at the window margin.
14034
14035 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14036 and the cursor position is out of bounds, behave as if the cursor
14037 position were at the window margin. (Bug#10075)
14038
df05a53c
CY
140392011-11-18 Chong Yidong <cyd@gnu.org>
14040
14041 * window.c (Fwindow_combination_limit): Make first argument
14042 non-optional, since it is meaningless for live windows like the
14043 selected window.
61ccba97 14044
2071918e
DA
140452011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14046
14047 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14048
b50a28de
SM
140492011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14050
14051 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14052 (graft_intervals_into_buffer): Simplify.
14053
015137db
EZ
140542011-11-18 Eli Zaretskii <eliz@gnu.org>
14055
14056 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14057 hash values of the two rows.
14058 (copy_row_except_pointers): Preserve the used[] arrays and the
14059 hash values of the two rows. (Bug#10035)
68c95424 14060 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
14061
14062 * xdisp.c (row_hash): New function, body extracted from
14063 compute_line_metrics.
14064 (compute_line_metrics): Call row_hash, instead of computing the
14065 hash code inline.
14066
14067 * dispnew.c (verify_row_hash): Call row_hash for computing the
14068 hash code of a row, instead of duplicating code from xdisp.c.
14069
14070 * dispextern.h (row_hash): Add prototype.
14071
a2addb04
TH
140722011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14073
14074 * frame.c (delete_frame): Don't delete the terminal when the last
14075 X frame is closed if emacs is built with GTK toolkit.
14076
df85d315
JB
140772011-11-17 Juanma Barranquero <lekktu@gmail.com>
14078
14079 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14080
a0c2d0ae
MR
140812011-11-17 Martin Rudalics <rudalics@gmx.at>
14082
14083 * window.c (Vwindow_splits): Rename to
14084 Vwindow_combination_resize. Suggested by Juri Linkov.
14085 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14086 of Vwindow_splits.
14087
58179cce
JB
140882011-11-16 Juanma Barranquero <lekktu@gmail.com>
14089
7877f373
JB
14090 * nsfns.m (Fns_font_name):
14091 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 14092
b6f67890
MR
140932011-11-16 Martin Rudalics <rudalics@gmx.at>
14094
14095 * window.h (window): Rename slot "nest" to "combination_limit".
14096 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14097 (Fset_window_nest): Rename to Fset_window_combination_limit.
14098 (Vwindow_nest): Rename to Vwindow_combination_limit.
14099 (recombine_windows, make_parent_window, make_window)
14100 (Fsplit_window_internal, saved_window)
14101 (Fset_window_configuration, save_window_save): Rename all
14102 occurrences of window_nest to window_combination_limit.
14103
c7015153
JB
141042011-11-15 Juanma Barranquero <lekktu@gmail.com>
14105
14106 * image.c (imagemagick_load_image): Fix typo.
14107
322ad6ec
EZ
141082011-11-14 Eli Zaretskii <eliz@gnu.org>
14109
14110 * xdisp.c (display_line): Move the call to
14111 highlight_trailing_whitespace before the call to
14112 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
14113 faces of all the glyphs to compute ROW's hash value.
14114 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 14115
f067b8ec
JB
141162011-11-14 Juanma Barranquero <lekktu@gmail.com>
14117
14118 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14119 just return (bug#10044).
14120
1e5b2111
EZ
141212011-11-12 Eli Zaretskii <eliz@gnu.org>
14122
7ef3cbd5
EZ
14123 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14124 with user-defined heap size. Bump the default size of the temacs
14125 heap to 27MB, to avoid memory warning when running temacs.
14126 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14127
1e5b2111
EZ
14128 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14129 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
14130 (verify_row_hash) [XASSERTS]: New function.
14131 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14132 that the hash value of glyph rows is correct.
1e5b2111 14133
89d61221
MR
141342011-11-12 Martin Rudalics <rudalics@gmx.at>
14135
14136 * window.h (window): Remove splits slot.
14137 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14138 (Fdelete_other_windows_internal, make_parent_window)
14139 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14140 (Fset_window_configuration, save_window_save): Don't deal with
14141 split status of windows.
14142 (saved_window): Remove splits slot.
14143 (Vwindow_splits): Rewrite doc-string.
14144
97f18cc8
JD
141452011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14146
14147 * xfns.c (unwind_create_frame):
14148 * nsfns.m (unwind_create_frame):
14149 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14150 Vframe_list (Bug#9999).
14151
22a648b4
DA
141522011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14153
0b381c7e 14154 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 14155
659afede
KH
141562011-11-11 Kenichi Handa <handa@m17n.org>
14157
14158 * callproc.c (Fcall_process): Set the member dst_multibyte of
14159 process_coding.
14160
9ac0394b
KH
141612011-11-11 Johan Bockgård <bojohan@gnu.org>
14162
14163 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14164 avoid a crash (bug#9496).
14165
2fbdc249
CY
141662011-11-09 Chong Yidong <cyd@gnu.org>
14167
14168 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14169 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14170
ac6b1f81
PE
141712011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14172
14173 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14174
09db192c
PE
141752011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14176
14177 Avoid some portability problems by eschewing 'extern inline' functions.
14178 The trivial performance wins aren't worth the portability hassles; see
14179 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14180 et seq.
14181 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14182 (window_box_width, window_box_left, window_box_left_offset)
14183 (window_box_right, window_box_right_offset): Undo previous change,
14184 by removing the "extern"s.
14185 * intervals.c (adjust_intervals_for_insertion)
14186 (adjust_intervals_for_deletion): Undo previous change,
14187 making these static again.
14188 (offset_intervals, temp_set_point_both, temp_set_point)
14189 (copy_intervals_to_string): No longer inline.
14190 * xdisp.c (window_text_bottom_y, window_box_width)
14191 (window_box_height, window_box_left_offset)
14192 (window_box_right_offset, window_box_left, window_box_right)
14193 (window_box): No longer inline.
14194
105216ed
CY
141952011-11-08 Chong Yidong <cyd@gnu.org>
14196
14197 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
14198 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14199 Signal an error if not a live window.
105216ed
CY
14200 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14201 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14202
ae9e237f
JB
142032011-11-07 Juanma Barranquero <lekktu@gmail.com>
14204
14205 * lisp.h (syms_of_abbrev): Remove declaration.
14206 Reported by CHENG Gao <chenggao@royau.me>.
14207
c7aa8333
EZ
142082011-11-07 Eli Zaretskii <eliz@gnu.org>
14209
14210 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14211 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14212 of temacs in GUI mode.
14213
be7f5545
MR
142142011-11-07 Martin Rudalics <rudalics@gmx.at>
14215
14216 * window.h: Declare delete_all_child_windows instead of
14217 delete_all_subwindows.
14218 * window.c (Fwindow_nest, Fset_window_nest)
14219 (Fset_window_new_total, Fset_window_new_normal)
14220 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14221 (delete_all_subwindows): Rename to delete_all_child_windows.
14222 (Fdelete_other_windows_internal, Fset_window_configuration):
14223 Call delete_all_child_windows instead of delete_all_subwindows.
14224 * frame.c (delete_frame): Call delete_all_child_windows instead
14225 of delete_all_subwindows.
14226
ca78dc43
PE
142272011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14228
14229 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14230 This is also needed for porting to any host where GC_MARK_STACK is
14231 not GC_MAKE_GCPROS_NOOPS.
14232 (which_symbols): Use it.
14233
a0241d01
KH
142342011-11-07 Kenichi Handa <handa@m17n.org>
14235
14236 * coding.c (coding_set_destination): Check coding->src_pos only
14237 when coding->src_object is a buffer (bug#9910).
14238
14239 * process.c (send_process): Set the member src_multibyte of coding
14240 to 0 (bug#9911) when sending a unibyte text.
14241
14242 * callproc.c (Fcall_process): Set the member src_multibyte of
14243 process_coding to 0 (bug#9912).
14244
a64bfdfa 142452011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
14246
14247 * xmenu.c (cleanup_widget_value_tree): New function.
14248 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14249 calling free_menubar_widget_value_tree directly (Bug#9830).
14250
cb41b32a
PE
142512011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14252
14253 Fix some portability problems with 'inline'.
14254 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14255 (window_box_width, window_box_left, window_box_left_offset)
14256 (window_box_right, window_box_right_offset): Declare extern.
14257 Otherwise, these inline functions do not conform to C99 and
14258 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14259 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14260 * intervals.c (adjust_intervals_for_insertion)
14261 (adjust_intervals_for_deletion): Now extern, because otherwise the
14262 extern inline functions 'offset_intervals' couldn't refer to it.
14263 (static_offset_intervals): Remove.
14264 (offset_intervals): Rewrite using the old contents of
14265 static_offset_intervals. The old version didn't conform to C99
14266 because an extern inline function contained a reference to an
14267 identifier with static linkage.
14268
b7041366
AS
142692011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14270
14271 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14272 GC.
14273
88a37c4d
EZ
142742011-11-06 Eli Zaretskii <eliz@gnu.org>
14275
14276 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14277 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14278 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14279 return Qleft_to_right.
14280
49745b39
CY
142812011-11-06 Chong Yidong <cyd@gnu.org>
14282
14283 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14284 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14285 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14286 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14287 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14288 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14289 (Fwindow_vscroll): Doc fix.
14290 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14291 argument, since it makes no sense to pass a live window and for
14292 consistency with window-child.
14293
1f05cd82
CS
142942011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14295
14296 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14297 support MSVC.
14298
22610910
JR
142992011-11-05 Jason Rumney <jasonr@gnu.org>
14300
14301 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14302 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14303 fonts (Bug#6029).
14304 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14305 bitwise arithmetic preventing use of unicode-sip and non-truetype
14306 opentype fonts.
14307
a06776b2
EZ
143082011-11-05 Eli Zaretskii <eliz@gnu.org>
14309
3ad924ba
EZ
14310 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14311 "emacs"-only part.
14312
a06776b2
EZ
14313 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14314 initialization code to keep similarity to xfns.c after changes
14315 from 2011-11-05.
14316
c9e7db78
JD
143172011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14318
a97f8f3f
JD
14319 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14320 (unwind_create_frame): New function (Bug#9943).
14321 (Fx_create_frame): Restructure code to be more similar to the one in
14322 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14323 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14324 Move terminal->reference_count++ just before making the frame official
14325 (Bug#9943).
14326
14327 * nsterm.m (x_free_frame_resources): New function.
14328 (x_destroy_window): Move code to x_free_frame_resources.
14329
c9e7db78 14330 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14331 (Fx_create_frame, x_create_tip_frame):
14332 Move terminal->reference_count++ just before making the frame
75f1671a 14333 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14334 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14335
a6fc3b5c
EZ
143362011-11-05 Eli Zaretskii <eliz@gnu.org>
14337
14338 Support MSVC build with newer versions of Visual Studio.
14339 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14340 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14341 nt/gmake.defs.
14342
14343 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14344 which are not supported by MSVC.
14345 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14346 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14347 bitfields.
14348 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14349 types in bitfields.
14350 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14351
14352 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14353
58179cce 143542011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14355
14356 Support MSVC build with newer versions of Visual Studio.
14357 * w32.c: Don't include w32api.h for MSVC.
14358 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14359
14360 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14361 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14362 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14363 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14364 e_* cousins.
14365 (alloca) [_MSC_VER]: Define to _alloca.
14366
14367 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14368
14369 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14370
a58c13ed
EZ
143712011-11-04 Eli Zaretskii <eliz@gnu.org>
14372
14373 * xdisp.c (note_mouse_highlight): If either of
14374 previous/next-single-property-change returns nil, treat that as
14375 the beginning or the end of the buffer. (Bug#9955)
14376
fe0b6370
JD
143772011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14378
a58c13ed 14379 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
14380 label is not null (Bug#9951).
14381 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14382 may be NULL.
14383
89bd5ee1
EZ
143842011-11-04 Eli Zaretskii <eliz@gnu.org>
14385
14386 * window.c (Fwindow_body_size): Mention in the doc string that the
14387 return value is in frame's canonical units. (Bug#9949)
14388
84c3edb9
EZ
143892011-11-03 Eli Zaretskii <eliz@gnu.org>
14390
4e2fb5c7
EZ
14391 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14392
84c3edb9 14393 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 14394 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 14395 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 14396
bc17a887
EZ
143972011-11-01 Eli Zaretskii <eliz@gnu.org>
14398
14399 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14400 Don't stop backward scan on the continuation glyph, even though
14401 its CHARPOS is positive.
6d5eb5b0
SM
14402 (mouse_face_from_buffer_pos, note_mouse_highlight):
14403 Rename cover_string to disp_string.
bc17a887 14404
4ee88440
MR
144052011-11-01 Martin Rudalics <rudalics@gmx.at>
14406
14407 * window.c (temp_output_buffer_show): Don't use
14408 Vtemp_buffer_show_specifiers.
14409 (Vtemp_buffer_show_specifiers): Remove unused variable.
14410
c2ff3c02
EZ
144112011-10-30 Eli Zaretskii <eliz@gnu.org>
14412
14413 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14414 past the beginning of the current glyph matrix.
14415
58179cce 144162011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
14417
14418 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14419 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14420 HAVE_GTK3 (Bug#9869).
b77a6a7f 14421
3b574623
JD
14422 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14423 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14424
b77a6a7f
JD
14425 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14426
14427 * xterm.c: Declare x_handle_net_wm_state to return int.
14428 (handle_one_xevent): Check if we are iconified but don't have
14429 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14430 (get_current_wm_state): Return non-zero if not hidden,
14431 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14432 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14433 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14434 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14435
196e41e4
PE
144362011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14437
14438 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14439 so that this new function doesn't get optimized away by a
14440 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14441
021f2e1a
AS
144422011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14443
14444 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14445
8b058d44
EZ
144462011-10-29 Eli Zaretskii <eliz@gnu.org>
14447
14448 Fix the `xbytecode' command.
14449 * .gdbinit (xprintbytestr): New command.
b50a28de 14450 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
14451 (xbytecode): Print the byte-code string as well.
14452
4452fb80
EZ
144532011-10-29 Kim Storm <storm@cua.dk>
14454
8b058d44
EZ
14455 * alloc.c (which_symbols): New function.
14456
21b72067
AS
144572011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14458
14459 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14460 line. (Bug#9903)
14461
83ed7b5c
GM
144622011-10-29 Glenn Morris <rgm@gnu.org>
14463
14464 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14465 Not clear what it was for, and it causes various bugs. (Bug#9839)
14466
5a7a728b
EZ
144672011-10-28 Eli Zaretskii <eliz@gnu.org>
14468
14469 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14470 possible random value that matches one of those tested as
14471 condition to clear the mouse face.
14472
d3d0842f
CY
144732011-10-28 Chong Yidong <cyd@gnu.org>
14474
14475 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14476
31b39d13
DN
144772011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14478
14479 * window.c (make_window): Initialize phys_cursor_on_p.
14480
9aba6043
SM
144812011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14482
14483 * lisp.h (struct Lisp_Symbol): Update comments.
14484
c20992f4
JB
144852011-10-28 Juanma Barranquero <lekktu@gmail.com>
14486
14487 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14488
db4f02f2
EZ
144892011-10-28 Eli Zaretskii <eliz@gnu.org>
14490
14491 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14492 <oslsachem@gmail.com> for helping to debug this.
14493
14494 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14495 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14496 (g_b_init_get_glyph_outline_w): New static variables.
14497 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14498 (GetGlyphOutlineW_Proc): New typedefs.
14499 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
14500 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14501 New functions.
14502 (w32font_open_internal, compute_metrics):
14503 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
14504 instead of calling the "wide" APIs directly.
14505
14506 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14507
14508 * w32.h (syms_of_w32font): Add prototype.
14509
87e68db4
JB
145102011-10-27 Juanma Barranquero <lekktu@gmail.com>
14511
14512 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14513 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14514 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14515 (Fmove_to_window_line): Doc fix.
14516
435c1d67
CY
145172011-10-27 Chong Yidong <cyd@gnu.org>
14518
14519 * process.c (make_process): Set gnutls_state to NULL.
14520
14521 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14522 non-NULL, regardless of GNUTLS_INITSTAGE.
14523 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14524 an error. Set process slots as soon as we allocate them.
14525
14526 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14527
9c6c6f49
CY
145282011-10-27 Chong Yidong <cyd@gnu.org>
14529
9aba6043
SM
14530 * gnutls.c (emacs_gnutls_deinit): New function.
14531 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
14532 (Fgnutls_deinit, Fgnutls_boot): Use it.
14533
14534 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14535 (deactivate_process): Call emacs_gnutls_deinit.
14536
657d08d3
JB
145372011-10-27 Juanma Barranquero <lekktu@gmail.com>
14538
14539 * image.c (x_create_x_image_and_pixmap):
14540 * w32.c (sys_rename, w32_delayed_load):
14541 * w32font.c (fill_in_logfont):
14542 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14543
5430d399
JB
145442011-10-26 Juanma Barranquero <lekktu@gmail.com>
14545
14546 * w32fns.c (w32_default_color_map): New function,
14547 extracted from Fw32_default_color_map.
a7ef684b 14548 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 14549
fe0055fa
PE
145502011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14551
14552 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14553
e6346438
SM
145542011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14555
14556 * keyboard.c (test_undefined): New function (bug#9751).
14557 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14558
e112cc37
ET
145592011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14560
14561 * sysdep.c (init_sys_modes): Fix the check for the controlling
14562 terminal (Bug#6649).
14563
7b5d6677
EZ
145642011-10-20 Eli Zaretskii <eliz@gnu.org>
14565
14566 * dispextern.h (struct bidi_it): New member next_en_type.
14567
14568 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14569 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14570 current character, check also for next_en_type being WEAK_EN.
14571 (bidi_resolve_weak): Don't enter the expensive loop if the current
14572 position is before next_en_pos. Record the bidi type of the first
14573 non-ET, non-BN character we find, in addition to its position.
14574 (bidi_level_of_next_char): Invalidate next_en_type when
14575 next_en_pos is over-stepped.
14576
7da0b018
PE
145772011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14578
14579 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14580 * editfns.c: Rewrite current-time-zone so that it invokes
14581 the equivalent of (format-time-string "%Z") to get the time zone name.
14582 This fixes a bug when the time zone name contains characters that
14583 need converting from the system time locale to Emacs internal format.
14584 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14585 that patch fixed format-time-string to do the conversion, but
14586 I forgot to fix current-time-zone.
14587 (format_time_string): New function, containing most of
14588 what Fformat_time_string used to contain.
14589 (Fformat_time_string): Rewrite in terms of format_time_string.
14590 This doesn't change this function's behavior.
14591 (current-time-zone): Rewrite to use format_time_string.
14592 This fixes the bug reported by Michael Schierl in
14593 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14594 Jason Rumney's 2007-06-07 change worked around this bug, but
14595 didn't fix it.
14596 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14597
8547b010
EZ
145982011-10-19 Eli Zaretskii <eliz@gnu.org>
14599
14600 * xdisp.c (start_display): If the character at POS is displayed
14601 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14602 (try_window_reusing_current_matrix): If a line ends in a display
14603 vector or the next line starts in a display vector, continue
14604 redrawing the window even though the character position of
14605 start_row was reached.
8547b010
EZ
14606 (Bug#9771, part 2)
14607
4e948d15
CY
146082011-10-18 Chong Yidong <cyd@gnu.org>
14609
14610 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14611 with nobreak-char-display too.
14612
4787455f
EZ
146132011-10-18 Eli Zaretskii <eliz@gnu.org>
14614
14615 Fix part 3 of bug#9771.
14616 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
14617 (bidi_resolve_neutral): Don't enter the expensive loop looking for
14618 non-neutral characters if the current character is a paragraph
14619 separator (a.k.a. Newline). This avoids running the same
14620 expensive loop twice, once when we consume the preceding newline
14621 and the other time when the line actually needs to be displayed.
14622 Avoid the loop when we see neutrals on the base embedding level
14623 following a character whose directionality is the same as the
14624 paragraph's. This avoids running the expensive loop when a line
14625 ends in a long sequence of neutrals, like control characters.
14626 Add assertion against STRONG_AL type. Slightly rearrange code
14627 that determines the type of a neutral given the first non-neutral
14628 that follows it.
14629 (bidi_level_of_next_char): Set next_en_pos to zero when
14630 invalidating its info.
14631
2c91f553
EZ
146322011-10-17 Eli Zaretskii <eliz@gnu.org>
14633
14634 * xdisp.c (push_display_prop): Determine whether to record string
14635 or buffer position by IT->string, not by IT->method. Allow
14636 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
14637 (move_it_vertically_backward): Don't look for character position
14638 immediately after the newline when in a continuation line.
14639 (Bug#9771, part 1)
2c91f553 14640
c7b08b0d
MR
146412011-10-15 Martin Rudalics <rudalics@gmx.at>
14642
14643 * window.c (coordinates_in_window): Rewrite and delabelize
14644 vertical border check. (Bug#5357) (Bug#9618)
14645
6b02f655
SM
146462011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
14647
14648 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
14649 errors in XSetWindowBorder (bug#9310).
14650
81d40c92
DA
146512011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
14652
14653 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
14654 avoid crash when xmalloc overrun checking is enabled.
14655
d4172c3b
EZ
146562011-10-13 Eli Zaretskii <eliz@gnu.org>
14657
14658 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
14659 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
14660 cursor motion with <left> and <right> arrow keys.
14661
14662 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
14663 some callers set that themselves.
14664
b00eea75
EZ
146652011-10-12 Eli Zaretskii <eliz@gnu.org>
14666
14667 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
14668 display string and the previous row comes from the same string and
14669 is empty. (Bug#9739) (Bug#9738)
14670
8fe012c4
SM
146712011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
14672
14673 * doc.c (get_doc_string): Encode file name (bug#9735).
14674
0074aef2
EZ
146752011-10-12 Eli Zaretskii <eliz@gnu.org>
14676
79beb178
EZ
14677 * bidi.c (bidi_level_of_next_char):
14678 * xdisp.c (get_visually_first_element): Remove old incorrect
14679 comments regarding the Unicode Line Separator character.
14680
0074aef2
EZ
14681 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
14682
6e4b3fbe
DA
146832011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
14684
14685 * alloc.c (Fgc_status): Do not access beyond zombies array
14686 boundary if nzombies > MAX_ZOMBIES.
14687 * alloc.c (dump_zombies): Add missing format specifier.
14688
0324f3af
PE
146892011-10-12 Paul Eggert <eggert@cs.ucla.edu>
14690
b5525cac
PE
14691 * xdisp.c (set_cursor_from_row): Simplify conditionals,
14692 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
14693
0324f3af
PE
14694 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
14695 Some packages use them to denote characters with modifiers.
14696
e9b5f888
AS
146972011-10-11 Andreas Schwab <schwab@linux-m68k.org>
14698
14699 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
14700 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
14701 matching a pp-number. Rename parameter var to var1.
14702
127827c0
SM
147032011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
14704
14705 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
14706
c8fd3bd0
GM
147072011-10-08 Glenn Morris <rgm@gnu.org>
14708
14709 * callint.c (Fcall_interactively): Give a more explicit error for the
14710 'c' case with a non-character input. (Bug#8479)
14711
352ec8ff
EZ
147122011-10-08 Eli Zaretskii <eliz@gnu.org>
14713
03669ccb
EZ
14714 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
14715 lines.
7061c986
EZ
14716 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
14717 lines that are hscrolled on the left.
03669ccb 14718
352ec8ff
EZ
14719 * dispnew.c (buffer_posn_from_coords): Account for a possible
14720 presence of header-line. (Bug#4426)
14721
a66cfb1c
SM
147222011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
14723
6b02f655
SM
14724 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
14725 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 14726
7c5ee88e
PE
147272011-10-07 Paul Eggert <eggert@cs.ucla.edu>
14728
14729 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
14730 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
14731 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
14732 this makes Emacs dump core during garbage collection on rare
14733 occasions. sizeof is obviously inferior to offsetof here, so
14734 stick with offsetof.
14735 (GC_POINTER_ALIGNMENT): New macro.
14736 (mark_memory): Omit 3rd (offset) arg; caller changed.
14737 Don't assume EMACS_INT alignment is the same as pointer alignment.
14738
df1bbe5b
SM
147392011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
14740
14741 * keyboard.c (read_key_sequence_remapped): New var.
14742 (read_key_sequence): Compute remapping in the right buffer.
14743 (command_loop_1): Use read_key_sequence's remapping directly.
14744
51553db6
SM
147452011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
14746
32c1fffd
SM
14747 * dired.c (file_name_completion): Don't expand file name.
14748 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
14749 before checking file name handler.
14750
51553db6
SM
14751 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
14752 they've been requested explicitly (bug#9591).
14753
b6bd1599 147542011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
14755
14756 * keymap.c (Fsingle_key_description): Use make_specified_string
14757 instead of build_string to build string from push_key_description.
14758 (Bug#5193)
14759
f701dc2a
PE
147602011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14761
4222c55d
PE
14762 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
14763 This fixes a Y2038 bug on 64-bit hosts.
14764 * buffer.c (reset_buffer):
14765 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
14766 (Fclear_buffer_auto_save_failure):
14767 Use 0, not -1, to represent an unset failure time, since time_t
14768 might not be signed.
14769
f701dc2a
PE
14770 Remove dependency on glibc malloc internals.
14771 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14772 Move back here from lisp.h, but with their new implementations.
14773 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14774 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
14775 * charset.c (charset_table_init): New static var.
14776 (syms_of_charset): Use it instead of xmalloc. This removes a
14777 dependency on glibc malloc internals. See Eli Zaretskii's comment in
14778 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
14779 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14780 Move back to alloc.c.
14781 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14782 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
14783
9ceebf39
JD
147842011-09-30 Jan Djärv <jan.h.d@swipnet.se>
14785
14786 * nsterm.m (windowDidResize): Call x_set_window_size only when
14787 ns_in_resize is true. Otherwise set pixelwidth/height and
14788 call change_frame_size (Bug#9628).
14789
cb993c58
PE
147902011-09-30 Paul Eggert <eggert@cs.ucla.edu>
14791
3930c88b
PE
14792 Port --enable-checking=all to Fedora 14 x86-64.
14793 * charset.c (syms_of_charset): Also account for glibc malloc's
14794 internal overhead when calculating the initial malloc maximum.
14795
cb993c58
PE
14796 Port --enable-checking=all to Fedora 14 x86.
14797 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14798 Move to lisp.h.
14799 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
14800 (overrun_check_realloc, overrun_check_free):
14801 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
14802 That way, xmalloc returns a properly-aligned pointer even if
14803 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
14804 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
14805 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
14806 into account when calculating the initial malloc maximum.
14807 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
14808 Move here from alloc.c, so that charset.c can use it too.
14809 Properly align; the old code wasn't right for common 32-bit hosts
14810 when configured with --enable-checking=all.
14811 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
14812 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
14813
31bed486
EZ
148142011-09-29 Eli Zaretskii <eliz@gnu.org>
14815
04c70788 14816 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
14817 use EDOM.
14818
fbcaa2f3
EZ
148192011-09-28 Eli Zaretskii <eliz@gnu.org>
14820
14821 * xdisp.c (compute_display_string_end): If there's no display
14822 string at CHARPOS, return -1.
14823
14824 * bidi.c (bidi_fetch_char): When compute_display_string_end
14825 returns a negative value, treat the character as a normal
14826 character not covered by a display string. (Bug#9624)
14827
a239d4e9
JB
148282011-09-28 Juanma Barranquero <lekktu@gmail.com>
14829
14830 * lread.c (Fread_from_string): Fix typo in docstring.
14831
88652fd5
EZ
148322011-09-27 Eli Zaretskii <eliz@gnu.org>
14833
14834 * xdisp.c (handle_invisible_prop): If invisible text ends on a
14835 newline, reseat the iterator instead of bidi-iterating there one
14836 character at a time. (Bug#9610)
32c1fffd
SM
14837 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
14838 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 14839
ed497dd4
AS
148402011-09-27 Andreas Schwab <schwab@linux-m68k.org>
14841
14842 * lread.c (readevalloop): Use correct code for NBSP.
14843 (read1): Likewise. (Bug#9608)
14844
b2bf61aa
MA
148452011-09-25 Michael Albinus <michael.albinus@gmx.de>
14846
14847 * dbusbind.c (Fdbus_register_signal): When service is not
14848 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
14849
32bbb17c
GM
148502011-09-25 Glenn Morris <rgm@gnu.org>
14851
14852 * buffer.c (truncate-lines): Doc fix.
14853
94e0933e
CY
148542011-09-24 Chong Yidong <cyd@stupidchicken.com>
14855
14856 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
14857 (Fset_window_next_buffers): Doc fix.
14858
cddde921
GM
148592011-09-24 Glenn Morris <rgm@gnu.org>
14860
14861 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
14862
1260aef1
PE
148632011-09-24 Paul Eggert <eggert@cs.ucla.edu>
14864
25b4bfa0
PE
14865 Fix minor problems found by static checking.
14866 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
14867 * indent.c (Fvertical_motion): Fix == vs = typo.
14868
e3cbd34b
EZ
148692011-09-24 Eli Zaretskii <eliz@gnu.org>
14870
a66cfb1c
SM
14871 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
14872 Default value is now t. Doc fix.
6bf7006f 14873
e3cbd34b 14874 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 14875 logic when moving up, not only when moving down. Fix the
e3cbd34b 14876 confusing name and values of the it_overshoot_expected variable;
32c1fffd 14877 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
14878
14879 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
14880 CHARPOS is covered by a display string which includes newlines.
14881 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
14882 is covered by a display string with embedded newlines.
14883
a3de0cbd
MA
148842011-09-24 Michael Albinus <michael.albinus@gmx.de>
14885
14886 * dbusbind.c (Fdbus_register_signal): Add match rule to
14887 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
14888 (Fdbus_register_method, Vdbus_registered_objects_table):
14889 Fix docstring.
a3de0cbd 14890
b260039d
JM
148912011-09-24 Jim Meyering <meyering@redhat.com>
14892
32c1fffd 14893 do not ignore write error for any output size
b260039d
JM
14894 The previous change was incomplete.
14895 While it makes emacs --batch detect the vast majority of stdout
14896 write failures, errors were still ignored whenever the output size is
14897 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
14898 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
14899 && echo FAIL: ignored write error
14900 FAIL: ignored write error
14901 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
14902 && echo FAIL: ignored write error
14903 FAIL: ignored write error
14904 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
14905
8eca8a7c
AS
149062011-09-23 Andreas Schwab <schwab@linux-m68k.org>
14907
14908 * emacs.c (Fkill_emacs): In noninteractive mode exit
14909 non-successfully if a write error occurred on stdout. (Bug#9574)
14910
3341db62
EZ
149112011-09-21 Eli Zaretskii <eliz@gnu.org>
14912
14913 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
14914 the xassert test.
14915
14916 * dispextern.h (struct it): Update the comment documenting what
14917 can it->OBJECT be.
14918
8c203dbf
EZ
149192011-09-20 Eli Zaretskii <eliz@gnu.org>
14920
14921 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
14922 a display string, extend search for cursor position to end of row.
14923 (find_row_edges): If the row ends in a newline from a display
14924 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
14925 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
14926 (Fcurrent_bidi_paragraph_direction): Fix search for previous
14927 non-empty line. Fixes confusing cursor motion with arrow keys at
14928 the beginning of a line that starts with whitespace.
8c203dbf 14929
a4824228
LMI
149302011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14931
14932 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
14933 (bug#9493).
14934
33ed493b
CY
149352011-09-18 Chong Yidong <cyd@stupidchicken.com>
14936
14937 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
14938 boolean (Bug#9154).
14939
56cd55c8
EZ
149402011-09-18 Eli Zaretskii <eliz@gnu.org>
14941
14942 * xdisp.c (display_line): Record maximum and minimum buffer
14943 positions even if no glyphs were produced (e.g., by a zero-width
14944 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
14945 buffer positions that will be removed from the glyph row because
14946 they don't fit.
c02dcedf
EZ
14947 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
14948 column is beyond frame width: don't subtract 1 "pixel" when
14949 computing width of the stretch.
3e62b7e0
EZ
14950 (reseat_at_next_visible_line_start): Undo the change made on
14951 2011-09-17 that saved paragraph information and restored it after
14952 the call to `reseat'. (Bug#9545)
56cd55c8 14953
5ed99d36 149542011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
14955
14956 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
14957 and turn window cursor on if cleared (Bug#9415).
14958
5ed99d36 149592011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
14960
14961 * search.c (boyer_moore): Take unibyte characters from pattern
14962 literally. (Bug#9458)
14963
9bade7b2
EZ
149642011-09-18 Eli Zaretskii <eliz@gnu.org>
14965
14966 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
14967
e5e9d610
PE
149682011-09-18 Paul Eggert <eggert@cs.ucla.edu>
14969
87e4427a
PE
14970 Fix minor problem found by static checking.
14971 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
14972 initialized, to pacify gcc -Wuninitialized.
14973
e5e9d610
PE
14974 * fileio.c: Report proper errno when syscall falls.
14975 (Finsert_file_contents): Save and restore errno,
14976 so that report_file_error outputs the correct diagnostic.
14977 (Fwrite_region) [CLASH_DETECTION]: Likewise.
14978
a1674f0b
EZ
149792011-09-18 Eli Zaretskii <eliz@gnu.org>
14980
14981 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
14982
fbfb6dd4
EZ
149832011-09-17 Eli Zaretskii <eliz@gnu.org>
14984
14985 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
14986 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
14987
bb187662
EZ
149882011-09-17 Eli Zaretskii <eliz@gnu.org>
14989
1137e8b8 14990 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 14991 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
14992
14993 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
14994 (bidi_find_paragraph_start): Search back for paragraph beginning
14995 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
14996 (bidi_move_to_visually_next): Only trigger paragraph-related
14997 computations when the last character is a newline or at EOB, not
14998 just any NEUTRAL_B. (Bug#9470)
14999
bb187662
EZ
15000 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15001 truncated lines if point is covered by a display string. (Bug#9524)
15002
2e621251
PE
150032011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15004
15005 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15006 (cons_to_x_long): New function.
15007 (lisp_data_to_selection_data): Use it. Correct the test for
15008 short-versus-long data; it was negated. Break out of vector
15009 loop, for efficiency, when a long datum is discovered.
15010
91a15bc6
SM
150112011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15012
15013 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15014
b41c3a35
EZ
150152011-09-16 Eli Zaretskii <eliz@gnu.org>
15016
15017 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15018 GCC PR/17406) by declaring this function with external scope.
15019
7812ba2d
PE
150202011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15021
15022 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15023 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15024
cf7edc2a
AS
150252011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15026
15027 * editfns.c (Fformat): Correctly handle text properties on "%%".
15028
bd01620e
EZ
150292011-09-15 Eli Zaretskii <eliz@gnu.org>
15030
15031 * xterm.c (x_draw_composite_glyph_string_foreground):
15032 * w32term.c (x_draw_composite_glyph_string_foreground):
15033 * term.c (encode_terminal_code):
15034 * composite.c (composition_update_it, get_composition_id):
15035 * xdisp.c (get_next_display_element)
15036 (fill_composite_glyph_string): Add comments about special meaning
15037 of TAB characters in a composition.
15038
a02719a3
PE
150392011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15040
15041 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
15042 This occurs when processing a multibyte format.
15043 Problem reported by Wolfgang Jenker.
a02719a3 15044
72589a3c
JB
150452011-09-15 Johan Bockgård <bojohan@gnu.org>
15046
15047 * xdisp.c (try_cursor_movement): Only check for exact match if
15048 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15049
1c14176c
PE
150502011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15051
15052 Remove unused external symbols.
15053 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15054 * xdisp.c (calc_pixel_width_or_height): Now static.
15055 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15056 * indent.c (check_display_width):
15057 * w32term.c: Fix comment to match code.
15058 * xterm.c, xterm.h (x_catching_errors): Remove.
15059
d2eea5b5
PE
150602011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15061
15062 * xselect.c: Use signed conversions more consistently (Bug#9498).
15063 (selection_data_to_lisp_data): Assume incoming selection data are
15064 signed integers, not unsigned. This is to be consistent with
15065 outgoing selection data, which was modified to use signed integers
15066 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15067 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15068 expects long, not unsigned long.
15069
46888499
EZ
150702011-09-14 Eli Zaretskii <eliz@gnu.org>
15071
15072 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15073 computation of loop end. Reported by Johan Bockgård
15074 <bojohan@gnu.org>.
15075
ef8ef9fb
CY
150762011-09-13 Chong Yidong <cyd@stupidchicken.com>
15077
15078 * frame.c (Fother_visible_frames_p): Function deleted.
15079
fa819fed
EZ
150802011-09-12 Eli Zaretskii <eliz@gnu.org>
15081
15082 * indent.c (compute_motion): Process display vector front to back
15083 rather than the other way around. (Bug#2496)
15084
2ba8e008
SM
150852011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15086
15087 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15088
20f53c69
CY
150892011-09-11 Chong Yidong <cyd@stupidchicken.com>
15090
15091 * minibuf.c (Fread_from_minibuffer): Doc fix.
15092
d562d7a4
EZ
150932011-09-11 Eli Zaretskii <eliz@gnu.org>
15094
15095 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15096 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15097
1c4d7f3d
LMI
150982011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15099
15100 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15101 value for non-existent files.
15102
b885bf36
EZ
151032011-09-11 Eli Zaretskii <eliz@gnu.org>
15104
15105 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15106 set its "size" to -1. This will set the modtime_size field of
15107 the corresponding buffer to -1, which is what
15108 verify-visited-file-modtime expects for files that do not exist.
15109 (Bug#9139)
15110
6612f0bf
PE
151112011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15112
15113 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15114 here ...
15115 * lisp.h: ... from here. push_key_description is no longer
15116 defined in keyboard.c, so its declaration should not be in
15117 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15118 logically belongs with push_key_description.
15119
dfb3f755
PE
151202011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15121
15122 * buffer.h: Include <sys/types.h> instead of <time.h>.
15123 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15124 Problem reported by Herbert J. Skuhra.
15125
3134906c
LMI
151262011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15127
15128 * xml.c (parse_region): Make the parsing work for
15129 non-comment-starting XML files again (bug#9144).
15130
8d903f4e
AS
151312011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15132
15133 * image.c (gif_load): Fix calculation of bottom and right corner.
15134 (Bug#9468)
15135
80ad64f4
EZ
151362011-09-10 Eli Zaretskii <eliz@gnu.org>
15137
15138 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15139 redisplay in small windows.
15140
208a048d
EZ
151412011-09-09 Eli Zaretskii <eliz@gnu.org>
15142
15143 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15144
9b1c252e
MR
151452011-09-08 Martin Rudalics <rudalics@gmx.at>
15146
15147 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15148 Operate on live windows only.
15149
2949f33b
JB
151502011-09-08 Juanma Barranquero <lekktu@gmail.com>
15151
15152 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15153
e08dcafd
EZ
151542011-09-07 Eli Zaretskii <eliz@gnu.org>
15155
15156 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15157 only under bidi iteration.
15158
115b96bd
JD
151592011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15160
15161 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15162
c8199d0f
PE
151632011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15164
15165 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15166 Without this fix, the command to link temacs failed due to an
15167 undefined symbol __builtin_isnan. This is because
15168 /usr/include/iso/math_c99.h #defines isnan(x) to
15169 __builtin_isnan(x), but the bundled gcc, which identifies itself
15170 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15171 a __builtin_isnan.
15172 * floatfns.c (isnan): #undef, and then #define to a clone of
15173 what's in data.c.
15174 (Fisnan): Always define, since it's always available now.
15175 (syms_of_floatfns): Always define isnan at the Lisp level.
15176
e39b275c 151772011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
15178
15179 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15180
b2db44d9 151812011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 15182
f4af5137 15183 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
15184 The previous code assumed that file offsets (off_t values) fit in
15185 EMACS_INT variables, which is not true on typical 32-bit hosts.
15186 The code messed up by falsely reporting buffer overflow in cases
15187 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15188 when "big" contains more than 2**29 bytes, even though this
15189 inserts just one byte and does not overflow the buffer.
15190 (Finsert_file_contents): Store file offsets as off_t
15191 values, not as EMACS_INT values. Check for overflow when
15192 converting between EMACS_INT and off_t. When checking for
15193 buffer overflow or for overlap, take the offsets into account.
15194 Don't use EMACS_INT for small values where int suffices.
15195 When checking for overlap, fix a typo: ZV was used where
15196 ZV_BYTE was intended.
15197 (Fwrite_region): Don't assume off_t fits into 'long'.
15198 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15199
ecfc0a49
MA
152002011-09-05 Michael Albinus <michael.albinus@gmx.de>
15201
15202 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15203
6511acf2 152042011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 15205
0999621a 15206 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
15207
15208 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 15209 (esprintf, exprintf, evxprintf): New functions.
62f19c19 15210 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 15211 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
15212 (modify_event_symbol): Do not assume that the length of
15213 name_alist_or_stem is safe to alloca and fits in int.
15214 (Fexecute_extended_command): Likewise for function name and binding.
15215 (Frecursion_depth): Wrap around reliably on integer overflow.
15216 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15217 since some callers pass EMACS_INT values.
15218 (Fsingle_key_description): Don't crash if symbol name contains more
15219 than MAX_ALLOCA bytes.
15220 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15221 (get_minibuffer): Arg is now EMACS_INT, not int.
15222 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 15223 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
15224 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15225
2be7d702
PE
15226 * dbusbind.c (signature_cat): New function.
15227 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
15228 Do not overrun buffer; instead, report string overflow.
15229
9d1df220
PE
15230 * dispnew.c (add_window_display_history): Don't overrun buffer.
15231 Truncate instead; this is OK since it's just a log.
15232
33ef5c64
PE
15233 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15234 even if the time zone offset is outlandishly large.
15235 Don't mishandle offset == INT_MIN.
15236
66c6fdd5
PE
15237 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15238 when creating daemon; the previous buffer-overflow check was incorrect.
15239
d749b01b
PE
15240 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15241 which has the guts of the old verror function.
15242
b5cd1905
PE
15243 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15244 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15245
6e1a67fb
PE
15246 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15247 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 15248 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 15249 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
15250 length of string rather than counting it via multiple sprintfs;
15251 that's simpler and more reliable.
c21721cc
PE
15252 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15253 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15254 sprintf, in case result does not fit in int.
15255
c57b67fc
PE
15256 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15257 (fontset_from_font): Print it.
15258
8a401434
PE
15259 * frame.c (tty_frame_count): Now printmax_t, not int.
15260 (make_terminal_frame, set_term_frame_name): Print it.
15261 (x_report_frame_params): In X, window IDs are unsigned long,
15262 not signed long, so print them as unsigned.
15263 (validate_x_resource_name): Check for implausibly long names,
15264 and don't assume name length fits in 'int'.
15265 (x_get_resource_string): Don't blindly alloca invocation name;
15266 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15267 not fit in int.
15268
6e1a67fb
PE
15269 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15270 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
15271 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15272
0df02bf3
PE
15273 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15274 Use esprintf, not sprintf, in case result does not fit in int.
15275
48e30793
PE
15276 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15277 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15278 it as a large positive number.
15279 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15280 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15281
a66ff6d8
PE
15282 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15283 in case result does not fit in int.
15284
aca216ff
PE
15285 * print.c (float_to_string): Detect width overflow more reliably.
15286 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15287 buffer overrun. Don't assume list length fits in 'int'. Treat
15288 print length of 0 as 0, not as infinity; to be consistent with other
15289 uses of print length in this function. Don't overflow print length
15290 index. Don't assume hash table size fits in 'long', or that
15291 vectorlike size fits in 'unsigned long'.
15292
31c286f7
PE
15293 * process.c (make_process): Use printmax_t, not int, to format
15294 process-name gensyms.
15295
55e5faa1
PE
15296 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15297
80f2e268
PE
15298 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15299 to avoid potential buffer overrun.
15300
670741ab
PE
15301 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15302 if X resource line is longer than 512 bytes.
15303
b7163a50
PE
15304 * xfns.c (x_window): Make sprintf buffer a bit bigger
15305 to avoid potential buffer overrun.
15306
ae58ff1f
PE
15307 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15308
c43c8a6a
PE
15309 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15310
3f8236f4
PE
153112011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15312
53e9fe90 15313 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15314 Without these, Emacs silently mishandles large integers sometimes.
15315 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15316 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15317
6511acf2
PE
15318 * xdisp.c (try_window_id): Check Emacs fixnum range before
15319 converting to 'int'.
806add1d 15320
6511acf2 15321 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15322 Check that an Emacs fixnum is in range before assigning it to 'int'.
15323 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15324 values converted from Emacs fixnums.
15325 (Frecenter): Don't wrap around a line count if it is out of 'int'
15326 range; instead, treat it as an extreme value.
15327 (Fset_window_configuration, compare_window_configurations):
15328 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15329
6511acf2
PE
15330 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15331 that can exceed INT_MAX. Check that EMACS_INT value is in range
15332 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15333 (match_limit): Don't assume that a fixnum can fit in 'int'.
15334
6511acf2 15335 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15336 exceed INT_MAX.
15337
6511acf2 15338 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15339 (Fvertical_motion): Don't wrap around LINES values that don't fit
15340 in 'int'. Instead, treat them as extreme values. This is good
15341 enough for windows, which can't have more than INT_MAX lines anyway.
15342
fcb901a7
LMI
153432011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15344
0f2f6b6d
LMI
15345 * Require libxml/parser.h to avoid compilation warning.
15346
fcb901a7
LMI
15347 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15348
15349 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15350 since this reportedly can destroy thread storage.
15351
6e20a0d4
CY
153522011-08-30 Chong Yidong <cyd@stupidchicken.com>
15353
15354 * syntax.c (find_defun_start): Update all cache variables if
15355 exiting early (Bug#9401).
15356
148ae00e
EZ
153572011-08-30 Eli Zaretskii <eliz@gnu.org>
15358
f6cfbd8f
EZ
15359 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15360
148ae00e
EZ
15361 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15362 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15363 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15364
15365 * term.c (tty_append_glyph): New function.
15366 (produce_stretch_glyph): Static function and its prototype deleted.
15367
a66cfb1c
SM
15368 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15369 Add prototypes.
148ae00e 15370
c4a07a4c
PE
153712011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15372
15373 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15374 when checking :margin (Bug#9390).
15375 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 15376 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
15377 so that the name doesn't mislead. All uses changed.
15378
6bc8cd65
JB
153792011-08-28 Johan Bockgård <bojohan@gnu.org>
15380
15381 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15382 set_tty_hooks.
15383
dca4927e
EZ
153842011-08-27 Eli Zaretskii <eliz@gnu.org>
15385
15386 * xdisp.c (move_it_to): Don't bail out early when reaching
15387 position beyond to_charpos, if we are scanning backwards.
15388 (move_it_vertically_backward): When DY == 0, make sure we get to
15389 the first character in the line after the newline.
15390
f2cad773
PE
153912011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15392
15393 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15394 (ccl_driver): Do not generate an out-of-range pointer.
15395 (Fccl_execute_on_string): Remove unnecessary check for
15396 integer overflow, noted by Stefan Monnier in
15397 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15398 Remove a FIXME that didn't need fixing.
15399 Simplify the newly-introduced buffer reallocation code.
15400
0cae2cdb
JB
154012011-08-27 Juanma Barranquero <lekktu@gmail.com>
15402
15403 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15404
5fc295a4 154052011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 15406
70c60eb2 15407 Integer and memory overflow issues (Bug#9196).
726e0ab1 15408
d31850da
PE
15409 * doc.c (get_doc_string): Rework so that
15410 get_doc_string_buffer_size is the actual buffer size, rather than
15411 being 1 less than the actual buffer size; this makes xpalloc more
15412 convenient.
15413
a69fbedb
PE
15414 * image.c (x_allocate_bitmap_record, cache_image):
15415 * xselect.c (Fx_register_dnd_atom):
15416 Simplify previous changes by using xpalloc.
15417
fe5c5d37
PE
15418 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15419 since either will do and ptrdiff_t is convenient with xpalloc.
15420
0065d054
PE
15421 * charset.c (charset_table_size)
15422 (struct charset_sort_data.priority): Now ptrdiff_t.
15423 (charset_compare): Don't overflow if priorities differ greatly.
15424 (Fsort_charsets): Don't assume list length fits in int.
15425 Check for size-calculation overflow when allocating sort data.
15426 (syms_of_charset): Allocate an initial charset table that is
15427 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15428
15429 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15430
15431 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15432 The actual value is always <= INT_MAX, and leaving it unsigned made
15433 overflow checking harder.
15434
15435 * dispextern.h (struct glyph_matrix.rows_allocated)
15436 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15437 with xpalloc. The values are still always <= INT_MAX.
15438
15439 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15440
15441 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15442 (SAFE_NALLOCA): New macro.
15443
15444 * region-cache.c (struct boundary.pos, find_cache_boundary)
15445 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15446 (set_cache_region, invalidate_region_cache)
15447 (revalidate_region_cache, know_region_cache, region_cache_forward)
15448 (region_cache_backward, pp_cache):
15449 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15450 so that ptrdiff_t * can be passed to xpalloc.
15451 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15452 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15453 (pp_cache): Don't assume cache_len fits in int.
15454 * region-cache.h: Adjust extern decls to match.
15455
15456 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15457 EMACS_INT, since either will do, for xpalloc.
15458
15459 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15460 (xnmalloc, xnrealloc, xpalloc): New functions.
15461
726e0ab1
PE
15462 * bidi.c (bidi_shelve_header_size): New constant.
15463 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15464 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15465
51f30bc5 15466 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
15467 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15468 (overlay_strings):
15469 Don't update size of array until after memory allocation succeeds,
15470 because xmalloc/xrealloc may not return.
0065d054
PE
15471 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15472 now that we have proper integer overflow checking.
15473 (record_overlay_string, overlay_strings): Catch overflows when
15474 calculating size of overlay_str_buf.
726e0ab1 15475
0065d054
PE
15476 * callproc.c (Fcall_process): Check for size overflow when
15477 calculating size of args2.
15478 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15479 Normally we prefer signed values, but sticking with ptrdiff_t would
15480 require adding more-complicated checks.
726e0ab1
PE
15481
15482 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15483 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15484 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 15485 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
15486
15487 * character.c (Fstring): Check for size-calculation overflow.
15488
15489 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15490 unnecessary integer overflow. Check for size overflow.
15491 (encode_coding_object): Don't update size until xmalloc succeeds.
15492
15493 * composite.c (get_composition_id): Check for overflow in glyph
15494 length calculations.
15495
15496 Integer and memory overflow fixes for display code.
15497 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15498 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15499 (scrolling_window): Check for overflow in size calculations.
15500 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15501 Don't assume glyph table len fits in int.
15502 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15503 (row_table_size): Now ptrdiff_t, not int.
15504 (scrolling_window): Avoid overflow in size calculations.
15505 Don't update size until allocation succeeds.
15506 * fns.c (concat): Check for overflow in size calculations.
15507 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15508 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15509 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15510
15511 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15512 (get_doc_string): Check for size calculation overflow.
15513 Don't update size until allocation succeeds.
15514 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15515 EMACS_INT, where ptrdiff_t will do.
15516 (Fsubstitute_command_keys): Check for string overflow.
15517
15518 * editfns.c (set_time_zone_rule): Don't assume environment length
15519 fits in int.
15520 (message_length): Now ptrdiff_t, not int.
15521 (Fmessage_box): Don't update size until allocation succeeds.
15522 Don't assume message length fits in int.
15523 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15524
0065d054
PE
15525 * emacs.c (main): Do not reallocate argv, since there is a null at
15526 the end that can be overwritten, and this way there's no need to
15527 worry about size-calculation overflow.
15528 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
15529
15530 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15531 alloc succeeds.
15532 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15533
15534 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15535 (x_set_scroll_bar_width, x_figure_window_size):
15536 Check for integer overflow.
15537 (x_set_alpha): Do not assume XINT fits in int.
15538
15539 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15540 This is for the members text_lines, text_cols, total_lines, total_cols,
15541 where the system imposes an 'int' limit.
15542
15543 * fringe.c (Fdefine_fringe_bitmap):
15544 Don't update size until alloc works.
15545
15546 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15547 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15548
15549 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15550 Check for size-calculation overflow.
15551 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15552 do, as we prefer signed integers.
15553 (id_to_widget.max_size, id_to_widget.used)
15554 (xg_store_widget_in_map, xg_remove_widget_from_map)
15555 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15556 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15557 Use and return ptrdiff_t, not int.
15558 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15559 * gtkutil.h: Change prototypes to match the above.
15560
15561 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15562 are duplicate now that they've been promoted to lisp.h.
15563 (x_allocate_bitmap_record, x_alloc_image_color)
15564 (make_image_cache, cache_image, xpm_load):
15565 Don't update size until alloc is done.
15566 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15567 (x_detect_edges):
3256efce 15568 Check for size calculation overflow.
726e0ab1
PE
15569 (ct_colors_allocated_max): New constant.
15570 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15571 overflow.
3256efce 15572
726e0ab1
PE
15573 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15574 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15575 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15576 Use ptrdiff_t, not int, to count maps.
15577 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15578 calculations. Don't update size until allocation succeeds.
15579 Redo calculations to avoid overflow.
726e0ab1
PE
15580 * keyboard.h: Change prototypes to match the above.
15581
15582 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15583 to count maps.
15584 (current_minor_maps): Check for size calculation overflow.
15585 * keymap.h: Change prototypes to match the above.
15586
15587 * lread.c (read1, init_obarray): Don't update size until alloc done.
15588
15589 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15590 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15591
726e0ab1
PE
15592 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15593 Now ptrdiff_t, not int.
15594 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15595 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15596
15597 * process.c (Fnetwork_interface_list): Check for overflow
15598 in size calculation.
15599
15600 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15601
15602 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15603 overflow. Don't bother calling xmalloc when xrealloc will do.
15604
15605 * search.c (Freplace_match): Check for size calculation overflow.
15606 (Fset_match_data): Don't assume list lengths fit in 'int'.
15607
15608 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15609 for command line length. Do not attempt to address one before the
15610 beginning of an array, as that's not portable.
15611
15612 * term.c (max_frame_lines): Remove; unused.
15613 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15614 not int.
15615 (encode_terminal_code, calculate_costs): Check for size
15616 calculation overflow.
15617 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
15618 table lengths and related sizes. Don't update size until alloc
15619 done. Redo calculations to avoid overflow.
15620 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
15621
15622 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
15623 subtracting pointers.
15624 (gobble_line): Check for overflow more carefully. Don't update size
15625 until alloc done.
15626
15627 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
15628 Don't update size until alloc done.
15629 Redo size calculations to avoid overflow.
15630 Check for size calculation overflow.
0065d054 15631 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
15632
15633 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
15634 Use ptrdiff_t, not int, for sizes.
15635 (store_mode_line_noprop_char): Don't update size until alloc done.
15636
0065d054
PE
15637 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
15638 Use ptrdiff_t, not int, for sizes.
15639 (Finternal_make_lisp_face, cache_face):
15640 Check for size calculation overflow.
15641 (cache_face): Treat size calculation overflows as if they were
15642 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
15643
15644 * xfns.c (x_encode_text, x_set_name_internal)
15645 (Fx_change_window_property): Use ptrdiff_t, not int, to count
15646 sizes, since they can exceed INT_MAX in size. Check for size
15647 calculation overflow.
15648
0065d054
PE
15649 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
15650 (xg_select): Check for size calculation overflow.
726e0ab1
PE
15651 Don't update size until alloc done.
15652
0065d054 15653 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 15654 as sprintf is limited to int lengths.
1d526e2f 15655
252c5ee1
PE
15656 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
15657 (X_LONG_MIN): New macros.
864d7ce7
PE
15658 Use them to make the following changes clearer.
15659 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
15660 This change doesn't affect the value now, but it may help remind
15661 future maintainers not to raise the value too much later.
15662 (SELECTION_QUANTUM): Remove, replacing with ...
15663 (selection_quantum): ... new function, which avoids overflow.
15664 All uses changed.
15665 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
15666 assumption that selection length fits in 'int'.
15667 (x_reply_selection_request, x_handle_selection_request)
15668 (x_get_window_property, receive_incremental_selection)
15669 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
15670 (lisp_data_to_selection_data, clean_local_selection_data):
15671 Use ptrdiff_t, not int, to record length of selection.
15672 (x_reply_selection_request, x_get_window_property)
15673 (receive_incremental_selection, x_property_data_to_lisp):
15674 Redo calculations to avoid overflow.
15675 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 15676 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
15677 something.
15678 (x_get_window_property, receive_incremental_selection)
15679 (lisp_data_to_selection_data, x_property_data_to_lisp):
15680 Check for size-calculation overflow.
15681 (x_get_window_property, receive_incremental_selection)
15682 (lisp_data_to_selection_data, Fx_register_dnd_atom):
15683 Don't store size until memory allocation succeeds.
15684 (x_get_window_property): Plug memory leak on memory exhaustion.
15685 Don't double-block input; malloc is safe here. Don't assume 2**34
15686 - 4 fits in unsigned long. Add an xassert to check
15687 XGetWindowProperty overflow. Be more careful about overflow
15688 calculations, and distinguish size from memory overflow better.
15689 (receive_incremental_selection): When tracing, don't assume
15690 unsigned int is less than INT_MAX.
15691 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
15692 harmful) conversions of unsigned short to int.
15693 (lisp_data_to_selection_data): Don't assume that integers
15694 in the range -65535 through -1 fit in an X unsigned short.
15695 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
15696 result parameters unless successful. Rely on cons_to_unsigned
15697 to report problems with elements; the old code wasn't right anyway.
15698 (x_check_property_data): Check for int overflow; we cannot use
15699 a wider type due to X limits.
15700 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
15701
726e0ab1 15702 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 15703
0065d054
PE
15704 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
15705 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
15706 (x_color_cells): Don't store size until memory allocation succeeds.
15707 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 15708 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
15709 (x_term_init): Don't assume length fits in int (sprintf is limited
15710 to int size).
bc18e09d 15711
ebfa62c0
PE
15712 Use ptrdiff_t for composition IDs.
15713 * character.c (lisp_string_width):
15714 * composite.c (composition_table_size, n_compositions)
15715 (get_composition_id, composition_gstring_from_id):
15716 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
15717 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
15718 * window.c (Frecenter):
15719 Use ptrdiff_t, not int, for composition IDs.
15720 * composite.c (get_composition_id): Check for integer overflow.
15721 * composite.h: Adjust prototypes to match the above changes.
15722
d3411f89
PE
15723 Use ptrdiff_t for hash table indexes.
15724 * category.c (hash_get_category_set):
15725 * ccl.c (ccl_driver):
15726 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
15727 * coding.c (coding_system_charset_list, detect_coding_system):
15728 * coding.h (struct coding_system.id):
15729 * composite.c (get_composition_id, gstring_lookup_cache):
15730 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
15731 * image.c (xpm_get_color_table_h):
15732 * lisp.h (hash_lookup, hash_put):
15733 * minibuf.c (Ftest_completion):
15734 Use ptrdiff_t for hash table indexes, not int (which is too
15735 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
15736 32-bit --with-wide-int hosts).
15737
e097a6fa
PE
15738 * charset.c (Fdefine_charset_internal): Check for integer overflow.
15739 Add a FIXME comment about memory leaks.
15740 (syms_of_charset): Don't assume xmalloc returns.
15741
5637687f
PE
15742 Don't assume that stated character widths fit in int.
15743 * character.c (Fchar_width, c_string_width, lisp_string_width):
15744 * character.h (CHAR_WIDTH):
15745 * indent.c (MULTIBYTE_BYTES_WIDTH):
15746 Use sanitize_char_width to avoid undefined and/or bad behavior
15747 with outlandish widths.
a66cfb1c 15748 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
15749 now that we have two such functions. All uses changed.
15750 (sanitize_char_width): New inline function.
15751
a2271ba2
PE
15752 Don't assume that tab-width fits in int.
15753 * character.h (sanitize_width): New inline function.
15754 (SANE_TAB_WIDTH): New macro.
15755 (ASCII_CHAR_WIDTH): Use it.
15756 * indent.c (sane_tab_width): Remove. All uses replaced by
15757 SANE_TAB_WIDTH (current_buffer).
15758 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
15759
18c52557
PE
15760 * fileio.c: Integer overflow issues with file modes.
15761 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
15762
caeeedc1
PE
15763 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
15764 Remove unreachable code.
15765 (read_hex, load_charset_map_from_file): Check for integer overflow.
15766
6df6ae42 15767 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
15768 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
15769 (x_send_scroll_bar_event): Likewise. Check that the size does not
15770 exceed limits imposed by XClientMessageEvent, as well as the usual
15771 ptrdiff_t and size_t limits.
15772
b13995db
PE
15773 * keyboard.c: Overflow, signedness and related fixes.
15774 (make_lispy_movement): Use same integer type in forward decl
15775 that is used in the definition.
15776 (read_key_sequence, keyremap_step):
15777 Change bufsize argument back to int, undoing my 2011-03-30 change.
15778 We prefer signed types, and int is wide enough here.
15779 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
15780 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
15781 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
15782 length, not size_t. Use ptrdiff_t for index, not int.
15783 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
15784 possibility of integer overflow.
15785
13464394
PE
15786 Overflow, signedness and related fixes for images.
15787
15788 * dispextern.h (struct it.stack[0].u.image.image_id)
15789 (struct_it.image_id, struct image.id, struct image_cache.size)
15790 (struct image_cache.used, struct image_cache.ref_count):
15791 * gtkutil.c (update_frame_tool_bar):
15792 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
15793 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
15794 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
15795 * nsmenu.m (update_frame_tool_bar):
15796 * xdisp.c (calc_pixel_width_or_height):
15797 * xfns.c (image_cache_refcount):
15798 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
15799 on typical 64-bit hosts.
15800
15801 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15802 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
15803 Omit unnecessary casts to int.
15804 (parse_image_spec): Check that integers fall into 'int' range
15805 when the callers expect that.
15806 (image_ascent): Redo ascent calculation to avoid int overflow.
15807 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
15808 (lookup_image): Remove unnecessary tests.
15809 (xbm_image_p): Locals are now of int, not EMACS_INT,
15810 since parse_image_check makes sure they fit into int.
15811 (png_load, gif_load, svg_load_image):
15812 Prefer int to unsigned where either will do.
15813 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
15814 old tiff_error_handler and tiff_warning_handler.
15815 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
15816 stack buffer overflows. It uses only the features of vsnprintf
15817 that are common to both POSIX and native Microsoft.
15818 (tiff_error_handler, tiff_warning_handler): Use it.
15819 (tiff_load, gif_load, imagemagick_load_image):
15820 Don't assume :index value fits in 'int'.
15821 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
15822 (imagemagick_load_image): Check that crop parameters fit into
15823 the integer types that MagickCropImage accepts. Don't assume
15824 Vimagemagick_render_type has a nonnegative value. Don't assume
15825 size_t fits in 'long'.
15826 (gs_load): Use printmax_t to print the widest integers possible.
15827 Check for integer overflow when computing image height and width.
15828
c11821d4
EZ
158292011-08-26 Eli Zaretskii <eliz@gnu.org>
15830
15831 * xdisp.c (redisplay_window): Don't force window start if point
15832 will be invisible in the resulting window. (Bug#9324)
15833
0c95fcf7
EZ
158342011-08-25 Eli Zaretskii <eliz@gnu.org>
15835
15836 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
15837 the display spec is of the form `(space ...)'.
15838 (handle_display_spec): Return the value returned by
15839 handle_single_display_spec, not just 1 or zero.
15840 (handle_single_display_spec): If the display spec is of the form
15841 `(space ...)', and specifies display in the text area, return 2
15842 rather than 1.
fee65a97 15843 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
15844 accurately, and prefer exact match for point under bidi.
15845 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
15846
15847 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
15848 into disp_prop; all users changed.
15849
15850 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
15851 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
15852 for the text covered by the display property.
15853
e4ed06f1
CY
158542011-08-25 Chong Yidong <cyd@stupidchicken.com>
15855
15856 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
15857 Change return value to nil.
15858 (Frecord_buffer): Delete unused function.
15859
f67cdd7f
EZ
158602011-08-24 Eli Zaretskii <eliz@gnu.org>
15861
5980d4c6
EZ
15862 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
15863 buffers, return left-to-right.
8610fe8b
EZ
15864 (set_cursor_from_row): Consider candidate row a win if its glyph
15865 represents a newline and point is on that newline. Fixes cursor
15866 positioning on the newline at EOL of R2L text within L2R
15867 paragraph, and vice versa.
15868 (try_cursor_movement): Check continued rows, in addition to
15869 continuation rows. Fixes unwarranted scroll when point enters a
15870 continued line of R2L text within an L2R paragraph, or vice versa.
15871 (cursor_row_p): Consider the case of point being equal to
15872 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
15873 from the end of a short line to the beginning of a continued line
15874 of R2L text within L2R paragraph.
15875 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
15876 composed characters.
5980d4c6 15877
f67cdd7f
EZ
15878 * bidi.c (bidi_check_type): Use xassert.
15879 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
15880 members.
15881
bca633fb
EZ
158822011-08-23 Eli Zaretskii <eliz@gnu.org>
15883
15884 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
15885 a character.
15886
4a5885a7
CY
158872011-08-23 Chong Yidong <cyd@stupidchicken.com>
15888
15889 * nsfont.m (ns_otf_to_script): Fix typo.
15890
0902a04e
KH
158912011-08-22 Kenichi Handa <handa@m17n.org>
15892
15893 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
15894 extra slot even if the purpose is char-code-property-table.
15895
1a2e6670
EZ
158962011-08-23 Eli Zaretskii <eliz@gnu.org>
15897
8ddde651
EZ
15898 * xdisp.c (redisplay_window): When computing centering_position,
15899 account for the height of the header line. (Bug#8874)
15900
425cc014
EZ
15901 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
15902 instead of CHAR_TO_BYTE. Fixes a crash when a completion
15903 candidate is selected by the mouse, and that candidate has a
15904 composed character under the mouse.
15905
1a2e6670
EZ
15906 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
15907 coordinates reported by pos-visible-in-window-p for a composed
15908 character in column zero.
15909
8b76d6f8
SM
159102011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
15911
15912 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
15913
dac347dd
EZ
159142011-08-22 Eli Zaretskii <eliz@gnu.org>
15915
15916 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
15917 consider it a hit if to_charpos is anywhere in the range of the
15918 composed buffer positions.
15919
e013fb34
CY
159202011-08-22 Chong Yidong <cyd@stupidchicken.com>
15921
15922 * image.c (gif_load): Don't assume that each subimage has the same
15923 dimensions as the base image. Handle disposal method that is
15924 "undefined" by the gif spec (Bug#9335).
15925
bd1ba3e8
CY
159262011-08-20 Chong Yidong <cyd@stupidchicken.com>
15927
15928 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 15929 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 15930
54a1215b
EZ
159312011-08-19 Eli Zaretskii <eliz@gnu.org>
15932
823564e5
EZ
15933 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
15934 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
15935 from an Org mode buffer to a Speedbar frame.
15936
54a1215b
EZ
15937 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
15938 a composition, take its buffer position from IT->cmp_it.charpos.
15939 Fixes cursor positioning at the beginning of a line that begins
15940 with a composed character.
15941
9778ebcc
EZ
159422011-08-18 Eli Zaretskii <eliz@gnu.org>
15943
0be6ee06
EZ
15944 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
15945 character bidirectional type, use STRONG_L instead. Fixes crashes
15946 in a buffer produced by `describe-categories'.
15947
9778ebcc
EZ
15948 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
15949 members before the level stack, so they would be saved and
15950 restored when copying iterator state. Fixes incorrect reordering
15951 around TABs covered by display properties.
15952
156bffbe
AS
159532011-08-18 Andreas Schwab <schwab@linux-m68k.org>
15954
6b02f655 15955 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 15956
72ad093b
CY
159572011-08-17 Chong Yidong <cyd@stupidchicken.com>
15958
15959 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
15960 (internal_condition_case_2, internal_condition_case_n):
15961 Remove unnecessary aborts (Bug#9081).
72ad093b 15962
35774242
EZ
159632011-08-17 Eli Zaretskii <eliz@gnu.org>
15964
15965 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
15966 has no `load' handler, try opening the file locally. (Bug#9311)
15967
db76dd85
KB
159682011-08-16 Ken Brown <kbrown@cornell.edu>
15969
15970 * gmalloc.c: Expand comment.
15971
b215eee5
EZ
159722011-08-16 Eli Zaretskii <eliz@gnu.org>
15973
15974 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
15975 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
15976
a4579d33
KB
159772011-08-16 Ken Brown <kbrown@cornell.edu>
15978
15979 Fix memory allocation problems in Cygwin build (Bug#9273).
15980
15981 * unexcw.c ( __malloc_initialized): Declare external variable.
15982 (fixup_executable): Force the dumped emacs to reinitialize malloc.
15983
8b76d6f8
SM
15984 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
15985 New variables.
a4579d33
KB
15986 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
15987 dumped emacs.
15988 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
15989 in the static heap.
15990 [CYGWIN] (special_realloc): New function.
15991 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
15992 requests to realloc storage in the static heap.
15993
3ebec551
PE
159942011-08-15 Paul Eggert <eggert@cs.ucla.edu>
15995
15996 * bidi.c (bidi_initialize): Remove unused local.
15997
9fd8be00
EZ
159982011-08-15 Eli Zaretskii <eliz@gnu.org>
15999
6b02f655
SM
16000 * bidimirror.h:
16001 * biditype.h: Remove file.
16002 * makefile.w32-in ($(BLD)/bidi.$(O)):
16003 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
16004
16005 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16006
16007 * chartab.c: Improve commentary for the uniprop_table API.
16008
32413314
EZ
16009 * bidi.c (bidi_paragraph_init): Support zero value of
16010 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
16011 (bidi_initialize): Use uniprop_table instead of including
16012 biditype.h and bidimirror.h.
32413314 16013
9fd8be00
EZ
16014 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16015 coordinates of the iterator when restoring from ppos_it.
16016 (Bug#9296)
16017
5cf2b69b
KH
160182011-08-14 Kenichi Handa <handa@m17n.org>
16019
16020 * process.c (create_process): Call setup_process_coding_systems
72ad093b 16021 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 16022
daf17d00
EZ
160232011-08-14 Eli Zaretskii <eliz@gnu.org>
16024
16025 * xdisp.c (move_it_in_display_line_to): Don't invoke
16026 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16027 ppos_it. Fixes vertical cursor motion when line beginning is
16028 covered by an image. (Bug#9296)
16029
08e3161a
JD
160302011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16031
16032 * nsterm.h (ns_run_ascript): Declare.
16033 (NSAPP_DATA2_RUNASSCRIPT): Define.
16034
16035 * nsfns.m (as_script, as_result, as_status): New static variables.
16036 (ns_run_ascript): New function.
5e617bc2 16037 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
16038 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16039 the event loop. Get status from as_status (Bug#7276).
16040
16041 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16042 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16043 the event loop (Bug#7276).
16044
a3720aa2
AS
160452011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16046
16047 * gnutls.c (QCgnutls_bootprop_priority)
16048 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16049 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16050 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16051 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16052 (QCgnutls_bootprop_verify_hostname_error)
16053 (QCgnutls_bootprop_callbacks_verify): Rename from
16054 Qgnutls_bootprop_..., all uses changed.
16055
16056 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16057 uses changed.
16058
0a0d27fb
PE
160592011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16060
19d5c50c
PE
16061 * xfaces.c (Qframe_set_background_mode): Now static.
16062 * dispextern.h (Qframe_set_background_mode): Remove decl.
16063
0a0d27fb
PE
16064 * process.c (Fnetwork_interface_info): Declare local only if needed.
16065
377538cb
JD
160662011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16067
16068 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16069 (Fnetwork_interface_list): Allocate in increments of bytes instead
16070 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16071 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16072 sockaddr.
16073 (struct ifflag_def): notrailers is smart on OSX.
16074 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16075 Get hardware address with getifaddrs if available.
16076
08fff70c
EZ
160772011-08-12 Eli Zaretskii <eliz@gnu.org>
16078
16079 * xdisp.c (iterate_out_of_display_property): xassert that
16080 IT->position is set to within IT->object's boundaries. Break from
16081 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
16082 when IT->position is set up wrongly due to some bug.
16083 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
16084 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16085 entry. Force push_it to save on the stack the current
16086 buffer/string position, to be restored by pop_it. Fix flags in
16087 the iterator structure wrt the object coming from a display
16088 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16089 properties. (Bug#9284)
16090
7be1c708 160912011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 16092
7be1c708
CY
16093 * fontset.c (fontset_get_font_group): Add proper type checks.
16094 (Bug#9172)
aac0c6e3 16095
7be1c708 160962011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 16097
7be1c708
CY
16098 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16099 and LC_VERSION_MIN_MACOSX.
16100 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16101 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 16102
97bb72a6
EZ
161032011-08-08 Eli Zaretskii <eliz@gnu.org>
16104
16105 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
16106 no-display-properties-and-no-overlays under bidi display.
16107 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 16108 properties and overlays.
97bb72a6 16109
d5617611
CY
161102011-08-08 Chong Yidong <cyd@stupidchicken.com>
16111
37e11a63
CY
16112 * editfns.c (Fset_time_zone_rule): Document relationship with the
16113 setenv function.
16114
d5617611
CY
16115 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16116 the font entity extracted from the cache (Bug#8109).
16117
58872834
CY
161182011-08-07 Chong Yidong <cyd@stupidchicken.com>
16119
16120 * composite.c (autocmp_chars): Don't reset point. That is done by
16121 restore_point_unwind (Bug#5984).
16122
75bfc667
JL
161232011-08-07 Juri Linkov <juri@jurta.org>
16124
16125 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16126 to show the arg `TIME' instead of `TIMEVAL'.
16127
d1410150
EZ
161282011-08-06 Eli Zaretskii <eliz@gnu.org>
16129
16130 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16131 display property strides EOL and includes a newline, as in
16132 longlines-mode. (Bug#9254)
75b771e4
EZ
16133 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16134 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
16135
16136 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16137 is non-zero, even if the data buffer is NULL. Fixes a crash in
16138 vertical-motion with longlines-mode. (Bug#9254)
16139
35928349
EZ
161402011-08-05 Eli Zaretskii <eliz@gnu.org>
16141
ec7cc85b
EZ
16142 * bidi.c <bidi_cache_total_alloc>: Now static.
16143 (bidi_initialize): Initialize bidi_cache_total_alloc.
16144
8b76d6f8 16145 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
16146 cache. (Bug#9221)
16147
16148 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16149 amount allocated this far in `bidi_cache_total_alloc'.
16150 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16151 non-zero, only free the data buffer without restoring the cache
16152 contents. All callers changed.
16153
16154 * dispextern.h (bidi_unshelve_cache): Update prototype.
16155
16156 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16157 (move_it_in_display_line, move_it_to)
16158 (move_it_vertically_backward, move_it_by_lines): Replace the call
16159 to xfree to an equivalent call to bidi_unshelve_cache.
16160 (move_it_in_display_line_to): Fix logic of returning
412b6358 16161 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 16162
e2e2423b
EZ
161632011-08-05 Eli Zaretskii <eliz@gnu.org>
16164
16165 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16166 came from a string character with a `cursor' property. (Bug#9229)
16167
ae9e757a
JD
161682011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16169
16170 * Makefile.in (LIB_PTHREAD): New variable.
16171 (LIBES): Add LIB_PTHREAD (Bug#9216).
16172
16173 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16174 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16175
213bd7f2
AS
161762011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16177
6b02f655 16178 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 16179
99aaf75f
JD
161802011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16181
16182 * xterm.c (x_find_topmost_parent): New function.
16183 (x_set_frame_alpha): Find topmost parent window with
16184 x_find_topmost_parent and set the property there also (bug#9181).
16185 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16186
c74e9d86
PE
161872011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16188
16189 * callproc.c (Fcall_process): Avoid vfork clobbering
16190 the local vars buffer, coding_systems, current_dir.
16191
640c8776
SM
161922011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16193
16194 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16195
f26d0e4c
PE
161962011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16197
8a10d76c
PE
16198 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16199 so that it is not optimized away.
16200
f26d0e4c
PE
16201 * xdisp.c (compute_display_string_pos): Remove unused local.
16202
55439c61
EZ
162032011-08-02 Eli Zaretskii <eliz@gnu.org>
16204
16205 Fix slow cursor motion and scrolling in large buffers with
16206 selective display, like Org Mode buffers. (Bug#9218)
16207
16208 * dispextern.h (struct bidi_it): New member disp_prop_p.
16209
16210 * xdisp.c: Remove one-slot cache of display string positions.
16211 (compute_display_string_pos): Accept an additional argument
5e617bc2 16212 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
16213 for a display string or property. If found, set DISP_PROP_P
16214 non-zero.
16215
16216 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
16217 DISP_PROP_P, and pass it to compute_display_string_pos.
16218 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
16219 non-zero. All callers of bidi_fetch_char changed.
16220
fb33fa43
SM
162212011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16222
16223 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16224
b099e063
DM
162252010-12-03 Don March <don@ohspite.net>
16226
16227 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16228 last character M-[char] is translated to ESC [char] (bug#7541).
16229
5cc7f7af
KH
162302011-08-02 Kenichi Handa <handa@m17n.org>
16231
d0fffa3f 16232 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
16233
16234 * chartab.c (uniprop_table): Make it non-static.
16235
525d5e6e
EZ
162362011-08-01 Eli Zaretskii <eliz@gnu.org>
16237
16238 * xdisp.c (forward_to_next_line_start): Accept additional argument
16239 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16240 on the newline.
16241 (reseat_at_next_visible_line_start): Use the bidi iterator state
16242 returned by forward_to_next_line_start to restore the state of
16243 it->bidi_it after backing up to previous newline. (Bug#9212)
16244
31011111
AS
162452011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16246
16247 * regex.c (re_comp): Protoize.
16248 (re_exec): Fix return type.
16249 (regexec): Fix type of `ret'. (Bug#9203)
16250
476371c4
PE
162512011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16252
e5d76069
PE
16253 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16254 This is needed if max-image-size is a floating-point number.
16255
9a79b20c
AS
162562011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16257
16258 * print.c (print_object): Print empty symbol as ##.
16259
16260 * lread.c (read1): Read ## as empty symbol.
16261
d8c2fa78
AA
162622011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16263
16264 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16265 setting frame foreground color (Bug#9175).
16266 (x_set_background_color): Likewise.
16267
ffe57a7a
AA
16268 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16269 contents (Bug#9176).
16270 (EmacsTooltip -init): Remove bezels and add shadows to
16271 tooltip windows.
16272
bf3492a5
AA
16273 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16274 or scroll bar (Bug#8470).
16275
d55e9c53
AA
16276 * nsfont.m (nsfont_open): Remove assignment to voffset and
16277 unnecessary vars hshink, expand, hd, full_height, min_height.
16278 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16279
16280 * nsterm.h (nsfont_info): Remove voffset field.
16281
d8c2fa78 162822011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
16283
16284 Implement strike-through and overline on NextStep (Bug#8863).
16285
16286 * nsfont.m (nsfont_open): Use underline position provided by font,
16287 instead of hard-coded value of 2.
16288 (nsfont_draw): Call ns_draw_text_decoration instead.
16289
16290 * nsterm.h: Add declaration for ns_draw_text_decoration.
16291
16292 * nsterm.m (ns_draw_text_decoration): New function for drawing
16293 underline, overline, and strike-through.
16294 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16295 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16296 accommodate underlining, etc.
4843aac3 16297
4cc60b9b
EZ
162982011-07-28 Eli Zaretskii <eliz@gnu.org>
16299
bc7ece87
EZ
16300 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16301 default.
4cc60b9b 16302
476371c4
PE
163032011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16304
66606eea
PE
16305 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16306 Without this fix, if a signal arrives just after memory fills up,
16307 'malloc' might be invoked reentrantly.
16308
476371c4
PE
16309 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16310 In other words, assume that every image size is allowed, on non-X
16311 hosts. This assumption is probably wrong, but it lets Emacs compile.
16312
f3fcc40d
AS
163132011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16314
16315 * regex.c (re_iswctype): Convert return values to boolean.
16316
350c992f
EZ
163172011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16318
16319 * xdisp.c (compute_display_string_pos): Don't use cached display
16320 string position if the buffer had its restriction changed.
16321 (Bug#9184)
16322
5266b4bb
PE
163232011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16324
16325 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16326
2573a837 163272011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16328
41f55ccd 16329 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16330
39e378da
PE
16331 * bidi.c: Integer size and overflow fixes.
16332 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16333 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16334 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16335 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16336 (bidi_find_other_level_edge):
16337 Use ptrdiff_t instead of EMACS_INT where either will do.
16338 This works better on 32-bit hosts configured --with-wide-int.
16339 (bidi_cache_ensure_space): Check for size-calculation overflow.
16340 Use % rather than repeated addition, for better worst-case speed.
16341 Don't set bidi_cache_size until after xrealloc returns, because it
16342 might not return.
16343 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16344 (bidi_cache_ensure_space): Also check that the bidi cache size
16345 does not exceed that of the largest Lisp string or buffer. See Eli
16346 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16347
5e927815
PE
16348 * alloc.c (__malloc_size_t): Remove.
16349 All uses replaced by size_t. See Andreas Schwab's note
16350 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16351
ca4aa935
PE
16352 * image.c: Improve checking for integer overflow.
16353 (check_image_size): Assume that f is nonnull, since
16354 it is always nonnull in practice. This is one less thing to
16355 worry about when checking for integer overflow later.
16356 (x_check_image_size): New function, which checks for integer
16357 overflow issues inside X.
16358 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16359 This removes the need for a memory_full check.
16360 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16361 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16362 (xbm_read_bitmap_data): Change locals back to 'int', since
16363 their values must fit in 'int'.
16364 (xpm_load_image, png_load, tiff_load):
16365 Invoke x_create_x_image_and_pixmap earlier,
16366 to avoid much needless work if the image is too large.
16367 (tiff_load): Treat overly large images as if
16368 x_create_x_image_and_pixmap failed, not as malloc failures.
16369 (gs_load): Use x_check_image_size.
16370
5f8f9cc2
PE
16371 * gtkutil.c: Omit integer casts.
16372 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16373 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16374
5adf60bc
PE
16375 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16376
c8907a93
PE
16377 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16378 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16379 would wrongly return t on a 64-bit host.
16380
e3c25c68
PE
16381 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16382 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16383 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16384 and therefore cause GCC to emit a bogus diagnostic in some cases.
16385
3f791afe
PE
16386 * image.c: Integer signedness and overflow and related fixes.
16387 This is not an exhaustive set of fixes, but it's time to
16388 record what I've got.
16389 (lookup_pixel_color, check_image_size): Remove redundant decls.
16390 (check_image_size): Don't assume that arbitrary EMACS_INT values
16391 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16392 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16393 (tiff_load, imagemagick_load_image):
16394 Check for overflow in size calculations.
16395 (x_create_x_image_and_pixmap): Remove unnecessary test for
16396 xmalloc returning NULL; that can't happen.
16397 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16398 (xpm_color_bucket): Use better integer hashing function.
16399 (xpm_cache_color): Don't possibly over-allocate memory.
16400 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16401 (gif_memory_source):
16402 Use ptrdiff_t, not int or size_t, to record sizes.
16403 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16404 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16405 either works, as we prefer signed integers.
16406 (tiff_read_from_memory, tiff_write_from_memory):
16407 Return tsize_t, not size_t, since that's what the TIFF API wants.
16408 (tiff_read_from_memory): Don't fail simply because the read would
16409 go past EOF; instead, return a short read.
16410 (tiff_load): Omit no-longer-needed casts.
16411 (Fimagemagick_types): Don't assume size fits into 'int'.
16412
3cc5a532
PE
16413 Improve hashing quality when configured --with-wide-int.
16414 * fns.c (hash_string): New function, taken from sxhash_string.
16415 Do not discard information about ASCII character case; this
16416 discarding is no longer needed.
16417 (sxhash-string): Use it. Change sig to match it. Caller changed.
16418 * lisp.h: Declare it.
16419 * lread.c (hash_string): Remove, since we now use fns.c's version.
16420 The fns.c version returns a wider integer if --with-wide-int is
16421 specified, so this should help the quality of the hashing a bit.
16422
b312a492
PE
16423 * emacs.c: Integer overflow minor fix.
16424 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16425 Define only if GNU_LINUX.
16426 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16427
dfd153ae
PE
16428 * dispnew.c: Integer signedness and overflow fixes.
16429 Remove unnecessary forward decls, that were a maintenance hassle.
16430 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16431 All uses changed.
16432 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16433 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16434 (prepare_desired_row, line_draw_cost):
16435 Use int, not unsigned, where either works.
16436 (save_current_matrix, restore_current_matrix):
16437 Use ptrdiff_t, not size_t, where either works.
16438 (init_display): Check for overflow more accurately, and without
16439 relying on undefined behavior.
16440
a81d11a3
PE
16441 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16442 Remove, replacing with the new symbols in lisp.h. All uses changed.
16443 * fileio.c (make_temp_name):
16444 * filelock.c (lock_file_1, lock_file):
16445 * xdisp.c (message_dolog):
16446 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16447 Use pMd etc. instead.
16448 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16449 replacing the pWIDE etc. symbols removed from editfns.c.
16450
3300e6fd
PE
16451 * keyboard.h (num_input_events): Now uintmax_t.
16452 This is (very slightly) less likely to mess up due to wraparound.
16453 All uses changed.
16454
fd05c7e9
PE
16455 * buffer.c: Integer signedness fixes.
16456 (alloc_buffer_text, enlarge_buffer_text):
16457 Use ptrdiff_t rather than size_t when either will do, as we prefer
16458 signed integers.
16459
903fe15d
PE
16460 * alloc.c: Integer signedness and overflow fixes.
16461 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16462 (__malloc_size_t): Default to size_t, not to int.
16463 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16464 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16465 Prefer ptrdiff_t to size_t when either would do, as we prefer
16466 signed integers.
16467 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16468 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16469 Now const. Initialize with values that are in range even if char
16470 is signed.
16471 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16472 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16473 These functions do the right thing with sizes > 2**32.
16474 (check_depth): Now ptrdiff_t, not int.
16475 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16476 Adjust to new way of storing sizes. Check for size overflow bugs
16477 in rest of code.
16478 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16479 slightly wrong anyway, as it missed one instance of
16480 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16481 (refill_memory_reserve): Omit needless cast to size_t.
16482 (mark_object_loop_halt): Mark as externally visible.
16483
ac82cc6a
PE
16484 * xselect.c: Integer signedness and overflow fixes.
16485 (Fx_register_dnd_atom, x_handle_dnd_message):
16486 Use ptrdiff_t, not size_t, since we prefer signed.
16487 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16488 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16489 x_dnd_atoms_size and x_dnd_atoms_length.
16490
c2d1e36d
PE
16491 * doprnt.c: Prefer signed to unsigned when either works.
16492 * eval.c (verror):
16493 * doprnt.c (doprnt):
16494 * lisp.h (doprnt):
16495 * xdisp.c (vmessage):
16496 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16497 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16498 prefer signed arithmetic to avoid comparison confusion.
16499 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16500 but is a bit tricky.
16501
0e926e56
PE
16502 Assume freestanding C89 headers, string.h, stdlib.h.
16503 * data.c, doprnt.c, floatfns.c, print.c:
16504 Include float.h unconditionally.
16505 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16506 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16507 * regex.c: Likewise for stddef.h, string.h.
16508 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16509 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16510 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16511 (STDC_HEADERS): Remove obsolete defines.
16512 * sysdep.c: Include limits.h unconditionally.
16513
9cfdb3ec
PE
16514 Assume support for memcmp, memcpy, memmove, memset.
16515 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16516 * regex.c (memcmp, memcpy):
16517 Remove; we assume C89 now.
16518
16519 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16520 (__malloc_safe_bcopy): Remove; no longer needed.
16521
cf950e6b 16522 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
16523 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16524 well either way, and we prefer signed to unsigned.
16525
dbf38e02
LMI
165262011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16527
16528 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16529 closes the connection while we're reading (bug#9182).
16530
d6f0886c 165312011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 16532
d6f0886c
JD
16533 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16534 are specified (Bug#9168).
24e0f6b1 16535
2eb1f9e6
PE
165362011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16537
16538 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16539 Found by GCC static checking and --with-wide-int on a 32-bit host.
16540
22381272 165412011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
16542
16543 * xdisp.c (compute_display_string_pos): Fix logic of caching
16544 previous display string position. Initialize cached_prev_pos to
16545 -1. Fixes slow-down at the beginning of a buffer.
16546
f25e39b4
EZ
165472011-07-24 Eli Zaretskii <eliz@gnu.org>
16548
16549 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16550 for attrs[LFACE_FONTSET_INDEX].
16551
04c4b52e
PE
165522011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16553
16554 * xml.c (parse_region): Remove unused local
16555 that was recently introduced.
16556
c1734fbd
EZ
165572011-07-23 Eli Zaretskii <eliz@gnu.org>
16558
be18c5a5
EZ
16559 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16560 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16561
c1734fbd
EZ
16562 * xdisp.c (move_it_in_display_line_to): Record the best matching
16563 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16564 exit if none of the characters scanned was an exact match.
16565 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16566 when exact match is impossible due to invisible text, and the
16567 lines are truncated.
16568
a258d627
JD
165692011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16570
16571 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16572 for OSX >= 10.7.
16573
b6d5a689
EZ
165742011-07-22 Eli Zaretskii <eliz@gnu.org>
16575
0f74f785
EZ
16576 Fix a significant slow-down of cursor motion with C-n, C-p,
16577 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16578 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16579 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16580 (next_element_from_buffer): Call compute_stop_pos_backwards to
16581 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16582 base_level_stop.
16583 (reseat): Don't look for prev_stop, as that could mean a very long
16584 run.
16585 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16586 <cached_disp_overlay_modiff>: Cache for last found display string
16587 position.
551918c1 16588 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16589 about the same buffer in the same area of character positions, and
16590 the buffer wasn't changed since the time the display string
16591 position was cached.
551918c1 16592
b2d0c91a
EZ
165932011-07-22 Eli Zaretskii <eliz@gnu.org>
16594
16595 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16596 is an integer, which is important for empty lines. (Bug#9149)
16597
043604ee
CY
165982011-07-22 Chong Yidong <cyd@stupidchicken.com>
16599
16600 * frame.c (Fmodify_frame_parameters): In tty case, update the
16601 default face if necessary (Bug#4238).
16602
da4adb04
CY
166032011-07-21 Chong Yidong <cyd@stupidchicken.com>
16604
16605 * editfns.c (Fstring_to_char): No need to explain what a character
16606 is in the docstring (Bug#6576).
16607
9abd0532
LMI
166082011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16609
16610 * xml.c (parse_region): Make sure we always return a tree.
16611
36881d16
HK
166122011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16613
16614 * xml.c (parse_region): If a document contains only comments,
16615 return that, too.
16616
1e98674d
LMI
166172011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16618
16619 * xml.c (make_dom): Return comments, too.
16620
590bd467
PE
166212011-07-19 Paul Eggert <eggert@cs.ucla.edu>
16622
16623 Port to OpenBSD.
16624 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
16625 and the surrounding thread.
16626 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
16627 rather than fgets, and retry after EINTR. Otherwise, 'emacs
16628 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
16629 timer goes off.
16630 * s/openbsd.h (BROKEN_SIGIO): Define.
16631 * unexelf.c (unexec) [__OpenBSD__]:
16632 Don't update the .mdebug section of the Alpha COFF symbol table.
16633
f41628b2
LMI
166342011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16635
16636 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
16637 (bug#8460).
16638
b59b67c5
PE
166392011-07-18 Paul Eggert <eggert@cs.ucla.edu>
16640
15e3a074
PE
16641 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
16642 This fixes some race conditions on the permissions of any newly
16643 created file.
16644
41bed37d
PE
16645 * alloc.c (valid_pointer_p): Use pipe, not open.
16646 This fixes some permissions issues when debugging.
16647
b59b67c5
PE
16648 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
16649 If fchown fails to set both uid and gid, try to set just gid,
16650 as that is sometimes allowed. Adjust the file's mode to eliminate
16651 setuid or setgid bits that are inappropriate if fchown fails.
16652
925a6be7
SM
166532011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16654
16655 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
16656 to compare Lisp_Objects.
16657 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
16658 global_gnutls_log_level, don't mistake it for a Lisp_Object.
16659 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
16660
52968808
AS
166612011-07-17 Andreas Schwab <schwab@linux-m68k.org>
16662
0a6a104b
AS
16663 * lread.c (read_integer): Unread even EOF character.
16664 (read1): Likewise. Properly record start position of symbol.
16665
52968808
AS
16666 * lread.c (read1): Read `#:' as empty uninterned symbol if no
16667 symbol character follows.
16668
9e381cdd
PE
166692011-07-17 Paul Eggert <eggert@cs.ucla.edu>
16670
16671 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
16672 This works around a problem with the previous change to Fcopy_file.
16673 Recent glibc declares fchown with __attribute__((warn_unused_result)),
16674 and without this change, GCC might complain about discarding
16675 fchown's return value.
16676
b5641435
JB
166772011-07-16 Juanma Barranquero <lekktu@gmail.com>
16678
16679 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
16680
a8031457
PE
166812011-07-16 Paul Eggert <eggert@cs.ucla.edu>
16682
16683 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
16684
dd889327
LMI
166852011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
16686
750c33f7
LMI
16687 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
16688 it's used from the C level.
16689
dd889327
LMI
16690 * process.c: Use the same condition for POLL_FOR_INPUT in both
16691 keyboard.c and process.c (bug#1858).
16692
87e86684
LM
166932011-07-09 Lawrence Mitchell <wence@gmx.li>
16694
16695 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
16696 (Fgnutls_boot): Use it.
16697
64348f40
AS
166982011-07-15 Andreas Schwab <schwab@linux-m68k.org>
16699
16700 * doc.c (Fsubstitute_command_keys): Revert last change.
16701
1d698799
LMI
167022011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
16703
f863868c
LMI
16704 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
16705 quotes the next character, and doesn't affect other longer
16706 sequences (bug#8935).
16707
1d698799
LMI
16708 * lread.c (syms_of_lread): Clarify that is isn't only
16709 `eval-buffer' and `eval-defun' that's affected by
16710 `lexical-binding' (bug#8460).
16711
aa4b6df6
EZ
167122011-07-15 Eli Zaretskii <eliz@gnu.org>
16713
16714 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 16715 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 16716
5d856da6
PE
167172011-07-14 Paul Eggert <eggert@cs.ucla.edu>
16718
ad6042bb
PE
16719 Fix minor problems found by static checking.
16720 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
16721 (elsz): Now a signed constant, not a size_t var. We prefer signed
16722 types to unsigned, to avoid integer comparison confusion. Without
16723 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
16724 "cannot optimize loop, the loop counter may overflow", a symptom
16725 of the confusion.
f00bbb22 16726 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
16727 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
16728
6468f31c
LMI
167292011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16730
49080b10
LMI
16731 * search.c (Fre_search_backward): Mention `case-fold-search' in
16732 all the re_search_* functions (bug#8138).
16733
6468f31c
LMI
16734 * keyboard.c (Fopen_dribble_file): Document when the file is
16735 closed (bug#8056).
16736
c965adc5
EZ
167372011-07-14 Eli Zaretskii <eliz@gnu.org>
16738
df9733bf
EZ
16739 * bidi.c (bidi_dump_cached_states): Fix format of displaying
16740 bidi_cache_idx.
16741
0bb23927
EZ
16742 Support bidi reordering of display and overlay strings.
16743 * xdisp.c (compute_display_string_pos)
16744 (compute_display_string_end): Accept additional argument STRING.
16745 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
16746 (reseat_to_string): Initialize bidi_it->string.s and
16747 bidi_it->string.schars.
16748 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
16749 NULL (avoids a crash in bidi_paragraph_init).
16750 Initialize itb.string.lstring.
0bb23927
EZ
16751 (init_iterator): Call bidi_init_it only of a valid
16752 buffer position was specified. Initialize paragraph_embedding to
16753 L2R.
16754 (reseat_to_string): Initialize the bidi iterator.
16755 (display_string): If we need to ignore text properties of
16756 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
16757 original value of -1 will not work with bidi.)
16758 (compute_display_string_pos): First arg is now struct
16759 `text_pos *'; all callers changed. Support display properties on
16760 Lisp strings.
16761 (compute_display_string_end): Support display properties on Lisp
16762 strings.
16763 (init_iterator, reseat_1, reseat_to_string): Initialize the
16764 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
16765 when iterating on a string not from display properties).
640c8776
SM
16766 (compute_display_string_pos, compute_display_string_end):
16767 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
16768 arrow keys.
16769 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
16770 base_level_stop; instead, set base_level_stop to BEGV.
16771 Fixes crashes in vertical-motion.
0bb23927
EZ
16772 (next_element_from_buffer): Improve commentary for when
16773 the iterator is before prev_stop.
16774 (init_iterator): Initialize bidi_p from the default value of
16775 bidi-display-reordering, not from buffer-local value. Use the
16776 buffer-local value only if initializing for buffer iteration.
16777 (handle_invisible_prop): Support invisible properties on strings
16778 that are being bidi-reordered.
16779 (set_iterator_to_next): Support bidi reordering of C strings and
16780 Lisp strings.
16781 (next_element_from_string): Support bidi reordering of Lisp
16782 strings.
16783 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
16784 (display_string): Support display of R2L glyph rows.
16785 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
16786 (init_iterator): Don't initialize it->bidi_p for strings
16787 here.
16788 (reseat_to_string): Initialize it->bidi_p for strings here.
16789 (next_element_from_string, next_element_from_c_string)
16790 (next_element_from_buffer): Add xassert's for correspondence
16791 between IT's object being iterated and it->bidi_it.string
16792 structure.
16793 (face_before_or_after_it_pos): Support bidi iteration.
16794 (next_element_from_c_string): Handle the case of the first string
16795 character that is not the first one in the visual order.
16796 (get_visually_first_element): New function, refactored from common
16797 parts of next_element_from_buffer, next_element_from_string, and
16798 next_element_from_c_string.
16799 (tool_bar_lines_needed, redisplay_tool_bar)
16800 (display_menu_bar): Force left-to-right direction. Add a FIXME
16801 comment for making that be controlled by a user option.
16802 (push_it, pop_it): Save and restore the state of the
16803 bidi iterator. Save and restore the bidi_p flag.
16804 (pop_it): Iterate out of display property for string iteration as
16805 well.
16806 (iterate_out_of_display_property): Support iteration over strings.
16807 (handle_single_display_spec): Set up it->bidi_it for iteration
16808 over a display string, and call bidi_init_it.
16809 (handle_single_display_spec, next_overlay_string)
16810 (get_overlay_strings_1, push_display_prop): Set up the bidi
16811 iterator for displaying display or overlay strings.
16812 (forward_to_next_line_start): Don't use the shortcut if
16813 bidi-iterating.
16814 (back_to_previous_visible_line_start): If handle_display_prop
16815 pushed the iterator stack, restore the internal state of the bidi
16816 iterator by calling bidi_pop_it same number of times.
16817 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
16818 and we are bidi-iterating, don't decrement the iterator position;
16819 instead, set the first_elt flag in the bidi iterator, to produce
16820 the same effect.
16821 (reseat_1): Remove redundant setting of string_from_display_prop_p.
16822 (push_display_prop): xassert that we are iterating a buffer.
16823 (push_it, pop_it): Save and restore paragraph_embedding member.
16824 (handle_single_display_spec, next_overlay_string)
16825 (get_overlay_strings_1, reseat_1, reseat_to_string)
16826 (push_display_prop): Set up the `unibyte' member of bidi_it.string
16827 correctly. Don't assume unibyte strings are not bidi-reordered.
16828 (compute_display_string_pos)
16829 (compute_display_string_end): Fix handling the case of C string.
16830 (push_it, pop_it): Save and restore from_disp_prop_p.
16831 (handle_single_display_spec, push_display_prop): Set the
16832 from_disp_prop_p flag.
16833 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
16834 (pop_it): Call iterate_out_of_display_property only if we are
16835 popping after iteration over a string that came from a display
16836 property. Fix a typo in popping stretch info. Add an assertion
16837 for verifying that the iterator position is in sync with the bidi
16838 iterator.
16839 (handle_single_display_spec, get_overlay_strings_1)
16840 (push_display_prop): Fix initialization of paragraph direction for
16841 string when that of the parent object is not yet determined.
16842 (reseat_1): Call bidi_init_it to resync the bidi
16843 iterator with IT's position. (Bug#7616)
16844 (find_row_edges): If ROW->start.pos gives position
16845 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
16846 (handle_stop, back_to_previous_visible_line_start, reseat_1):
16847 Reset the from_disp_prop_p flag.
16848 (SAVE_IT, RESTORE_IT): New macros.
16849 (pos_visible_p, face_before_or_after_it_pos)
16850 (back_to_previous_visible_line_start)
16851 (move_it_in_display_line_to, move_it_in_display_line)
16852 (move_it_to, move_it_vertically_backward, move_it_by_lines)
16853 (try_scrolling, redisplay_window, display_line): Use them when
16854 saving a temporary copy of the iterator and restoring it back.
16855 (back_to_previous_visible_line_start, reseat_1)
16856 (init_iterator): Empty the bidi cache "stack".
16857 (move_it_in_display_line_to): If iterator ended up at
16858 EOL, but we never saw any buffer positions smaller than
16859 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
16860 motion in bidi-reordered lines.
16861 (move_it_in_display_line_to): Record prev_method and prev_pos
16862 immediately before the call to set_iterator_to_next. Fixes cursor
16863 motion in bidi-reordered lines with stretch glyphs and strings
16864 displayed in margins. (Bug#8133) (Bug#8867)
16865 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
16866 TO_CHARPOS.
640c8776
SM
16867 (pos_visible_p): Support positions in bidi-reordered lines.
16868 Save and restore bidi cache.
0bb23927
EZ
16869
16870 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
16871 (bidi_paragraph_info): Delete unused struct.
16872 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
16873 (bidi_cache_start): New variable.
16874 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
16875 to zero.
16876 (bidi_cache_fetch_state, bidi_cache_search)
16877 (bidi_cache_find_level_change, bidi_cache_iterator_state)
16878 (bidi_cache_find, bidi_peek_at_next_level)
16879 (bidi_level_of_next_char, bidi_find_other_level_edge)
16880 (bidi_move_to_visually_next): Compare cache index with
16881 bidi_cache_start rather than with zero.
16882 (bidi_fetch_char): Accept new argument STRING; all callers
16883 changed. Support iteration over a string. Support strings with
16884 display properties. Support unibyte strings. Fix the type of
16885 `len' according to what STRING_CHAR_AND_LENGTH expects.
16886 (bidi_paragraph_init, bidi_resolve_explicit_1)
16887 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
16888 (bidi_level_of_next_char, bidi_move_to_visually_next):
16889 Support iteration over a string.
0bb23927
EZ
16890 (bidi_set_sor_type, bidi_resolve_explicit_1)
16891 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
16892 can now be zero (for strings); special values 0 and -1 were
16893 changed to -1 and -2, respectively.
16894 (bidi_char_at_pos): New function.
16895 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
16896 Call it instead of FETCH_MULTIBYTE_CHAR.
16897 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
16898 initialized to valid values.
16899 (bidi_init_it): Don't initialize charpos and bytepos with invalid
16900 values.
16901 (bidi_level_of_next_char): Allow the sentinel "position" to pass
16902 the test for valid cached positions. Fix the logic for looking up
16903 the sentinel state in the cache. GCPRO the Lisp string we are
16904 iterating.
16905 (bidi_push_it, bidi_pop_it): New functions.
16906 (bidi_initialize): Initialize the bidi cache start stack pointer.
16907 (bidi_cache_ensure_space): New function, refactored from part of
16908 bidi_cache_iterator_state. Don't assume the required size is just
16909 one BIDI_CACHE_CHUNK away.
16910 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
16911 (bidi_count_bytes, bidi_char_at_pos): New functions.
16912 (bidi_cache_search): Don't assume bidi_cache_last_idx is
16913 always valid if bidi_cache_idx is valid.
16914 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
16915 is valid if it's going to be used.
16916 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
16917 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
16918 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16919 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
16920 (bidi_find_other_level_edge, bidi_cache_start_stack):
16921 All variables related to cache indices are now EMACS_INT.
c965adc5 16922
0bb23927
EZ
16923 * dispextern.h (struct bidi_string_data): New structure.
16924 (struct bidi_it): New member `string'. Make flag members be 1-bit
16925 fields, and put them last in the struct.
640c8776
SM
16926 (compute_display_string_pos, compute_display_string_end):
16927 Update prototypes.
0bb23927
EZ
16928 (bidi_push_it, bidi_pop_it): Add prototypes.
16929 (struct iterator_stack_entry): New members bidi_p,
16930 paragraph_embedding, and from_disp_prop_p.
16931 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
16932 (bidi_shelve_cache, bidi_unshelve_cache):
16933 Declare prototypes.
0bb23927
EZ
16934
16935 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
16936 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
16937 and vector-like objects.
16938
16939 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
16940 cache around display iteration.
16941
16942 * window.c (Fwindow_end, window_scroll_pixel_based)
16943 (displayed_window_lines, Frecenter): Save and restore the bidi
16944 cache around display iteration.
16945
3bbd2265
LMI
169462011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
16947
16948 * editfns.c (Fdelete_region): Clarify the use of the named
16949 parameters (bug#6788).
16950
adc47434
MR
169512011-07-14 Martin Rudalics <rudalics@gmx.at>
16952
16953 * indent.c (Fvertical_motion): Set and restore w->pointm when
16954 saving and restoring the window's buffer (Bug#9006).
16955
837c31f8
LMI
169562011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
16957
16958 * editfns.c (Fstring_to_char): Clarify just what is returned
16959 (bug#6576). Text by Eli Zaretskii.
16960
ac389d0c
JB
169612011-07-13 Juanma Barranquero <lekktu@gmail.com>
16962
16963 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
16964
0be0ce47
EZ
169652011-07-13 Eli Zaretskii <eliz@gnu.org>
16966
16967 * buffer.c (mmap_find): Fix a typo.
16968
cd18e7e3
JB
169692011-07-13 Johan Bockgård <bojohan@gnu.org>
16970
16971 Fix execution of x selection hooks.
16972 * xselect.c (Qx_lost_selection_functions)
16973 (Qx_sent_selection_functions): New vars.
16974 (syms_of_xselect): DEFSYM them.
16975 (x_handle_selection_request): Pass Qx_sent_selection_functions
16976 rather than Vx_sent_selection_functions to Frun_hook_with_args.
16977 (x_handle_selection_clear,x_clear_frame_selections):
16978 Pass Qx_lost_selection_functions rather than
16979 Vx_lost_selection_functions to Frun_hook_with_args.
16980
47ea7f44
PE
169812011-07-13 Paul Eggert <eggert@cs.ucla.edu>
16982
ac389d0c 16983 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
16984 The old code sometimes used this field without initializing it.
16985
47ea7f44
PE
16986 * alloc.c (gc_sweep): Don't read past end of array.
16987 In theory, the old code could also have corrupted Emacs internals,
16988 though it'd be very unlikely.
16989
bc985c87
AS
169902011-07-12 Andreas Schwab <schwab@linux-m68k.org>
16991
16992 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 16993 argument. (Bug#4026)
bc985c87 16994
0cf34688
LMI
169952011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
16996
b3dadd76
LMI
16997 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
16998 key" (bug#4257).
16999
0cf34688
LMI
17000 * window.c (Fset_window_start): Doc fix (bug#4199).
17001 (Fset_window_hscroll): Ditto.
17002
270768cd
PE
170032011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17004
077e3dda 17005 Fix minor new problems caught by GCC 4.6.1.
270768cd 17006 * term.c (init_tty): Remove unused local.
490011a6 17007 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 17008 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 17009 not used otherwise.
270768cd 17010
b1f58454
CY
170112011-07-12 Chong Yidong <cyd@stupidchicken.com>
17012
17013 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17014
22b9578d
LMI
170152011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17016
6e70ab07
LMI
17017 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17018 are the mini-buffer and the echo area (bug#3320).
17019
22b9578d
LMI
17020 * term.c (init_tty): Remove support for supdup, c10 and perq
17021 terminals, which are no longer supported (bug#1482).
17022
8974cc9f
JB
170232011-07-10 Johan Bockgård <bojohan@gnu.org>
17024
17025 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17026
a560d974
JD
170272011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17028
17029 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17030 for non-popups (Bug#3642).
17031
1dae0f0a
AS
170322011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17033
268c2c36 17034 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 17035 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
17036 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17037 * cm.c (losecursor): Likewise.
1dae0f0a
AS
17038 * data.c (fmod): Likewise.
17039 * dispnew.c (swap_glyphs_in_rows): Likewise.
17040 * emacs.c (memory_warning_signal): Likewise.
17041 * floatfns.c (float_error): Likewise.
17042 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17043 (otf_open, font_otf_capability, generate_otf_features)
17044 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17045 Likewise.
17046 * image.c (pbm_read_file): Likewise.
17047 * indent.c (string_display_width): Likewise.
17048 * intervals.c (check_for_interval, search_for_interval)
17049 (inc_interval_count, count_intervals, root_interval)
17050 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17051 * lread.c (defalias): Likewise.
268c2c36 17052 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
17053 * regex.c (set_image_of_range_1, set_image_of_range)
17054 (regex_grow_registers): Likewise.
17055 * sysdep.c (strerror): Likewise.
17056 * termcap.c (valid_filename_p, tprint, main): Likewise.
17057 * tparam.c (main): Likewise.
17058 * unexhp9k800.c (run_time_remap, save_data_space)
17059 (update_file_ptrs, read_header, write_header, calculate_checksum)
17060 (copy_file, copy_rest, display_header): Likewise.
17061 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17062 Likewise.
17063 * xdisp.c (check_it): Likewise.
17064 * xfaces.c (register_color, unregister_color, unregister_colors):
17065 Likewise.
17066 * xfns.c (print_fontset_result): Likewise.
17067 * xrdb.c (member, fatal, main): Likewise.
17068
99033785
PE
170692011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17070
17071 Fix minor problems found by static checking (Bug#9031).
17072 * chartab.c (char_table_set_range, map_sub_char_table):
17073 Remove unused locals.
17074 (uniprop_table): Now static.
17075 * composite.c (_work_char): Remove unused static var.
17076
9cb2ac56
JB
170772011-07-09 Juanma Barranquero <lekktu@gmail.com>
17078
17079 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17080
f25661f0
JD
170812011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17082
17083 * gtkutil.c (qttip_cb): Remove code without function.
17084
8278c4fe
EZ
170852011-07-09 Eli Zaretskii <eliz@gnu.org>
17086
17087 * w32.c (pthread_sigmask): New stub.
17088
1692ae2d 170892011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 17090
8a6ebd58 17091 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
17092 sigprocmask is portable only for single-threaded applications, and
17093 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
17094 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17095 (LIBES): Use it.
17096 * callproc.c (Fcall_process):
17097 * process.c (create_process):
17098 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17099 Use pthread_sigmask, not sigprocmask.
123403e4 17100
1b854618
JD
171012011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17102
17103 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17104 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17105 wrong (Bug#8591).
17106
3fe4b549
JD
171072011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17108
0ce7e563
JD
17109 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17110 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17111 (xg_hide_tooltip): Fix comment.
17112
3fe4b549
JD
17113 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17114 in registerServicesMenuSendTypes.
17115 (validRequestorForSendType): Don't check ns_return_types.
17116
17117 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17118 ns_return_type.
17119
5df75e47
JR
171202011-07-08 Jason Rumney <jasonr@gnu.org>
17121
22610910
JR
17122 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17123 SH_SHOW for hidden windows (Bug#5482).
17124
5df75e47
JR
17125 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17126 frame struct members of non-existent frames (Bug#6284).
17127
699c10bd
JD
171282011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17129
4393663b
JD
17130 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17131 variable firstTime not needed on OSX >= 10.6.
17132 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17133 >= 10.5. Use setKnobProportion, setDoubleValue.
17134
17135 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17136 (MAC_OS_X_VERSION_10_5): Define if not defined.
17137 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17138 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17139 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17140
17141 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 17142 cString and lossyCString on OSX >= 10.4.
4393663b 17143
58179cce 17144 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
17145 sizeToFit on OSX >= 10.2.
17146
17147 * nsimage.m (allocInitFromFile): Don't use deprecated method
17148 bestRepresentationForDevice on OSX >= 10.6.
17149
17150 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17151 to avoid warning.
17152
17153 * emacs.c: Declare unexec_init_emacs_zone.
17154
a63e0781
JD
17155 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17156
699c10bd
JD
17157 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17158
17159 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17160 on svcsMenu (Bug#8842).
17161
17162 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17163 ns_return_types.
17164 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17165
17166 * nsterm.m (QUTF8_STRING): Declare.
17167 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17168 (validRequestorForSendType): Return type is (id).
17169 Change indexOfObjectIdenticalTo to indexOfObject.
17170 Check if we have local selection before returning self (Bug#8842).
17171 (writeSelectionToPasteboard): Put local selection into paste board
17172 if we have a local selection (Bug#8842).
17173 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17174
17175 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17176 (ns_get_local_selection): Declare.
17177
54e10184
LMI
171782011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17179
9888ff71
LMI
17180 * keymap.c (describe_map_tree): Don't insert a double newline at
17181 the end of the buffer (bug#1169) and return whether we inserted
17182 something.
17183
54e10184
LMI
17184 * callint.c (Fcall_interactively): Change "reading args" to
17185 "providing args" to try to clarify what it does (bug#1010).
17186
15fa4783
KH
171872011-07-07 Kenichi Handa <handa@m17n.org>
17188
17189 * composite.c (composition_compute_stop_pos): Ignore a static
17190 composition starting before CHARPOS (Bug#8915).
17191
17192 * xdisp.c (handle_composition_prop): Likewise.
17193
a8815b00
EZ
171942011-07-07 Eli Zaretskii <eliz@gnu.org>
17195
17196 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17197 (Bug#9015)
17198
ef7b981d 171992011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
17200
17201 * character.h (unicode_category_t): New enum type.
17202
17203 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17204 (Qchar_code_property_table): New variable.
17205 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17206 (UNIPROP_COMPRESSED_FORM_P): New macros.
17207 (char_table_ascii): Uncompress the compressed values.
17208 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17209 Uncompress the compressed values.
ac389d0c 17210 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
17211 (char_table_ref_and_range): Uncompress the compressed values.
17212 (sub_char_table_set): New arg is_uniprop. Callers changed.
17213 Uncompress the compressed values.
17214 (sub_char_table_set_range): Args changed. Callers changed.
17215 (char_table_set_range): Adjuted for the above change.
17216 (map_sub_char_table): Delete args default_val and parent. Add arg
17217 top. Give decoded values to a Lisp function.
640c8776 17218 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
17219 values to a Lisp function. Gcpro more variables.
17220 (uniprop_table_uncompress)
17221 (uniprop_decode_value_run_length): New functions.
17222 (uniprop_decoder, uniprop_decoder_count): New variables.
17223 (uniprop_get_decoder, uniprop_encode_value_character)
17224 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17225 New functions.
17226 (uniprop_encoder, uniprop_encoder_count): New variables.
17227 (uniprop_get_encoder, uniprop_table)
17228 (Funicode_property_table_internal, Fget_unicode_property_internal)
17229 (Fput_unicode_property_internal): New functions.
17230 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17231 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 17232 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
17233 char-code-property-alist.
17234
640c8776 17235 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
17236 Vunicode_category_table.
17237
640c8776 17238 * font.c (font_range): Adjust for the change of
c805dec0
KH
17239 Vunicode_category_table.
17240
76b397fb
DN
172412011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17242
17243 * m/iris4d.h: Remove file, move contents ...
17244 * s/irix6-5.h: ... here.
17245
22b4128e
PE
172462011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17247
17248 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
17249 * alloc.c (mark_buffer):
17250 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17251 (clone_per_buffer_values): Don't assume that
22b4128e
PE
17252 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17253 This isn't true in general, and it's particularly not true
17254 if Emacs is configured with --with-wide-int.
17255 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17256 New macros, used in the buffer.c change.
17257
869795d6
JD
172582011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17259
17260 * xsettings.c: Use both GConf and GSettings if both are available.
17261 (store_config_changed_event): Add comment.
17262 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17263 (store_tool_bar_style_changed): New functions.
5e617bc2 17264 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
17265 (struct xsettings): Move font inside HAVE_XFT.
17266 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 17267 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 17268 Move inside HAVE_XFT.
640c8776 17269 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
17270 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17271 also.
17272 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 17273 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 17274 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
17275 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17276 (parse_settings): Move check for font inside HAVE_XFT.
17277 (read_settings, apply_xft_settings): Add comment.
17278 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17279 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17280 call store_font_name_changed.
17281 (xft_settings_event): Add comment.
17282 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17283 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17284 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17285 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17286 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17287 (xsettings_get_system_font, xsettings_get_system_normal_font):
17288 Add comment.
869795d6 17289
d8ed26bd
PE
172902011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17291
17292 Random fixes. E.g., (random) never returned negative values.
17293 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17294 subseconds part to the entropy, as that's a bit more random.
17295 Prefer signed to unsigned, since the signedness doesn't matter and
17296 in general we prefer signed. When given a limit, use a
17297 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17298 latter isn't right if USE_2_TAGS_FOR_INTS.
17299 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17300 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17301
cabf1cac
SM
173022011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17303
17304 * textprop.c (text_property_stickiness):
17305 Obey Vtext_property_default_nonsticky.
17306 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17307 * w32fns.c (syms_of_w32fns):
17308 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17309
6e9b2be9
PE
173102011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17311
17312 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17313 This is more efficient than Ffile_directory_p and avoids a minor race.
17314
90186c68
LMI
173152011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17316
7c301272
LMI
17317 * buffer.c (Foverlay_put): Say what the return value is
17318 (bug#7835).
17319
c4f2d8d4
LMI
17320 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17321 is a directory before asking whether to use the file name
17322 (bug#7564).
ad637907
LMI
17323 (barf_or_query_if_file_exists): Make the "File is a directory"
17324 error be more correct.
c4f2d8d4 17325
90186c68
LMI
17326 * fns.c (Frequire): Remove the mention of the .gz files, since
17327 that's installation-specific, but keep the mention of
17328 `get-load-suffixes'.
17329
da64016e
PE
173302011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17331
17332 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17333 Report string overflow if the output is too long.
17334
7d47b580
JB
173352011-07-04 Juanma Barranquero <lekktu@gmail.com>
17336
a555cb87
JB
17337 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17338 (syms_of_gnutls): Remove duplicate DEFSYM for
17339 Qgnutls_bootprop_verify_hostname_error, an error for
17340 Qgnutls_bootprop_verify_error (which is no longer used).
17341
7d47b580
JB
17342 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17343 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17344 Also (re)move comments that are misplaced or no longer relevant.
17345
1e49bfab
LMI
173462011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17347
17348 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17349
1485f4c0
CY
173502011-07-03 Chong Yidong <cyd@stupidchicken.com>
17351
17352 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17353 and background color parameters if they have been changed.
17354
a9ab721e
LMI
173552011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17356
17357 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17358
cf7cff57
PE
173592011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17360
2e13213d
PE
17361 * xsettings.c (SYSTEM_FONT): Define only when used.
17362 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17363
cf7cff57
PE
17364 * keymap.c (access_keymap_1): Now static.
17365
7a8e04f7
CY
173662011-07-02 Chong Yidong <cyd@stupidchicken.com>
17367
17368 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17369 leave any prefix arg for the up event (Bug#1586).
17370
61352f62
LMI
173712011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17372
69bb1ef7
LMI
17373 * lread.c (syms_of_lread): Mention single symbols defined by
17374 `defvar' or `defconst' (bug#7154).
17375
61352f62 17376 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 17377 (Frequire): Mention get-load-suffixes.
61352f62 17378
28545e04
MR
173792011-07-02 Martin Rudalics <rudalics@gmx.at>
17380
17381 * window.h (window): Remove clone_number slot.
17382 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17383 Remove.
17384 (make_parent_window, make_window, saved_window)
17385 (Fset_window_configuration, save_window_save): Don't deal with
17386 clone numbers.
17387 * buffer.c (Qclone_number): Remove declaration.
17388 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17389
3349e122
SM
173902011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17391
17392 Add multiple inheritance to keymaps.
17393 * keymap.c (Fmake_composed_keymap): New function.
17394 (Fset_keymap_parent): Simplify.
17395 (fix_submap_inheritance): Remove.
17396 (access_keymap_1): New function extracted from access_keymap to handle
17397 embedded parents and handle lists of maps.
17398 (access_keymap): Use it.
17399 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17400 (Fcopy_keymap): Handle embedded parents.
17401 (Fcommand_remapping, define_as_prefix): Simplify.
17402 (Fkey_binding): Simplify.
17403 (syms_of_keymap): Move minibuffer-local-completion-map,
17404 minibuffer-local-filename-completion-map,
17405 minibuffer-local-must-match-map, and
17406 minibuffer-local-filename-must-match-map to Elisp.
17407 (syms_of_keymap): Defsubr make-composed-keymap.
17408 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17409 (parse_menu_item): Trivial simplification.
17410
3279eb87
GM
174112011-07-01 Glenn Morris <rgm@gnu.org>
17412
17413 * Makefile.in (SETTINGS_LIBS): Fix typo.
17414
39cb9e56 174152011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
17416
17417 * coding.c (Fencode_coding_string): Record the last coding system
17418 used, as the function doc string says (bug#8738).
17419
0949d2b6
JD
174202011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17421
17422 * xsettings.c (store_monospaced_changed): Take new font as arg and
17423 check for change against current_mono_font.
17424 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17425 (emacs_settings_constructor, emacs_settings_get_property)
17426 (emacs_settings_set_property, emacs_settings_class_init)
17427 (emacs_settings_init, gsettings_obj): Remove.
17428 (something_changedCB): New function for HAVE_GSETTINGS.
17429 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17430 with value as argument.
17431 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17432 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 17433 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
17434 "changed".
17435
17436 * xgselect.c: Add defined (HAVE_GSETTINGS).
17437 (xgselect_initialize): Ditto.
17438
17439 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17440 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17441 xg_select.
17442
bbc6b304
PE
174432011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17444
17445 * eval.c (struct backtrace): Simplify and port the data structure.
17446 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17447 signed bit field, as this assumption is not portable and it makes
17448 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17449 "char debug_on_exit : 1" as this is not portable either; instead,
17450 use the portable "unsigned int debug_on_exit : 1". Remove unused
17451 member evalargs. Remove obsolete comments about cc bombing out.
17452
9851bfc5
JD
174532011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17454
51bb811f 17455 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
17456 Let HAVE_GSETTINGS override HAVE_GCONF.
17457 (store_monospaced_changed): New function.
17458 (EMACS_SETTINGS): A new type derived from GObject to handle
17459 GSettings notifications.
17460 (emacs_settings_constructor, emacs_settings_get_property)
17461 (emacs_settings_set_property, emacs_settings_class_init):
17462 New functions.
17463 (gsettings_client, gsettings_obj): New variables.
17464 (GSETTINGS_SCHEMA): New define.
17465 (something_changedCB): Call store_monospaced_changed.
17466 (init_gsettings): New function.
17467 (xsettings_initialize): Call init_gsettings.
17468 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17469 to NULL.
17470
640c8776 17471 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
17472 GCONF_CFLAGS/LIBS.
17473
5386012d
MR
174742011-06-29 Martin Rudalics <rudalics@gmx.at>
17475
17476 * window.c (resize_root_window, grow_mini_window)
17477 (shrink_mini_window): Rename Qresize_root_window to
17478 Qwindow_resize_root_window and Qresize_root_window_vertically to
17479 Qwindow_resize_root_window_vertically.
17480
f13e0b08
PE
174812011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17482
17483 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17484
94515237
JB
174852011-06-27 Juanma Barranquero <lekktu@gmail.com>
17486
17487 * makefile.w32-in: Redesign dependencies so they reflect more
17488 clearly which files are directly included by each source file,
17489 and not through other includes.
17490
e43b6e43
MR
174912011-06-27 Martin Rudalics <rudalics@gmx.at>
17492
17493 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17494 (sort_overlays, overlay_strings): When an overlay's clone number
17495 matches the window's clone number process the overlay even if
17496 the overlay's window property doesn't match the current window.
17497
d68443dc
MR
17498 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17499 (Fwindow_hchild): Rename to Fwindow_left_child.
17500 (Fwindow_next): Rename to Fwindow_next_sibling.
17501 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
17502 (resize_window_check): Rename to window_resize_check.
17503 (resize_window_apply): Rename to window_resize_apply.
17504 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17505 (Fdelete_other_windows_internal, resize_frame_windows)
17506 (Fsplit_window_internal, Fdelete_window_internal)
17507 (grow_mini_window, shrink_mini_window)
17508 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 17509
c7e73be5
JD
175102011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17511
17512 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17513 (emacs_fixed_set_min_size): Remove.
17514 (emacs_fixed_new): Take frame as argument.
17515
17516 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17517 (_EmacsFixedPrivate): Remove minwidth/height.
17518 Add struct frame *f.
17519 (emacs_fixed_init): Initialize priv->f.
17520 (get_parent_class, emacs_fixed_set_min_size): Remove.
17521 (emacs_fixed_new): Set priv->f to argument.
17522 (emacs_fixed_get_preferred_width)
17523 (emacs_fixed_get_preferred_height): Use min_width/height from
17524 frames size_hint to set minimum and natural (Bug#8919).
17525 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17526 and use min_width/height from frames size_hint to set
17527 min_width/height (Bug#8919).
17528
17529 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
17530 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17531 Fix indentation.
c7e73be5 17532
cf99dcf8
EZ
175332011-06-26 Eli Zaretskii <eliz@gnu.org>
17534
17535 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17536 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17537 called at ZV.
17538
029529ac
CY
175392011-06-26 Chong Yidong <cyd@stupidchicken.com>
17540
17541 * process.c (wait_reading_process_output): Bypass select if
17542 waiting for a cell while ignoring keyboard input, and input is
17543 pending. Suggested by Jan Djärv (Bug#8869).
17544
7a7ef429
PE
175452011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17546
17547 Use gnulib's dup2 module instead of rolling our own.
17548 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17549
11fdef7d 175502011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
17551
17552 * dispnew.c (scrolling_window): Before scrolling, turn off a
17553 mouse-highlight in the window being scrolled.
17554
cd3520a4
JB
175552011-06-24 Juanma Barranquero <lekktu@gmail.com>
17556
17557 Move DEFSYM to lisp.h and use everywhere.
17558
17559 * character.h (DEFSYM): Move declaration...
17560 * lisp.h (DEFSYM): ...here.
17561
17562 * gnutls.c:
17563 * minibuf.c:
17564 * w32menu.c:
17565 * w32proc.c:
17566 * w32select.c: Don't include character.h.
17567
17568 * alloc.c (syms_of_alloc):
17569 * buffer.c (syms_of_buffer):
17570 * bytecode.c (syms_of_bytecode):
17571 * callint.c (syms_of_callint):
17572 * casefiddle.c (syms_of_casefiddle):
17573 * casetab.c (init_casetab_once):
17574 * category.c (init_category_once, syms_of_category):
17575 * ccl.c (syms_of_ccl):
17576 * cmds.c (syms_of_cmds):
17577 * composite.c (syms_of_composite):
17578 * dbusbind.c (syms_of_dbusbind):
17579 * dired.c (syms_of_dired):
17580 * dispnew.c (syms_of_display):
17581 * doc.c (syms_of_doc):
17582 * editfns.c (syms_of_editfns):
17583 * emacs.c (syms_of_emacs):
17584 * eval.c (syms_of_eval):
17585 * fileio.c (syms_of_fileio):
17586 * fns.c (syms_of_fns):
17587 * frame.c (syms_of_frame):
17588 * fringe.c (syms_of_fringe):
17589 * insdel.c (syms_of_insdel):
17590 * keymap.c (syms_of_keymap):
17591 * lread.c (init_obarray, syms_of_lread):
17592 * macros.c (syms_of_macros):
17593 * msdos.c (syms_of_msdos):
17594 * print.c (syms_of_print):
17595 * process.c (syms_of_process):
17596 * search.c (syms_of_search):
17597 * sound.c (syms_of_sound):
17598 * syntax.c (init_syntax_once, syms_of_syntax):
17599 * terminal.c (syms_of_terminal):
17600 * textprop.c (syms_of_textprop):
17601 * undo.c (syms_of_undo):
17602 * w32.c (globals_of_w32):
17603 * window.c (syms_of_window):
17604 * xdisp.c (syms_of_xdisp):
17605 * xfaces.c (syms_of_xfaces):
17606 * xfns.c (syms_of_xfns):
17607 * xmenu.c (syms_of_xmenu):
17608 * xsettings.c (syms_of_xsettings):
17609 * xterm.c (syms_of_xterm): Use DEFSYM.
17610
4228cf16
TZ
176112011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17612
cd3520a4 17613 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17614
7fcccf1e
PE
176152011-06-23 Paul Eggert <eggert@cs.ucla.edu>
17616
7efb4e0e
PE
17617 Integer and buffer overflow fixes (Bug#8873).
17618
ff5844ad
PE
17619 * print.c (printchar, strout): Check for string overflow.
17620 (PRINTPREPARE, printchar, strout):
17621 Don't set size unless allocation succeeds.
17622
90532f02
PE
17623 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
17624 for sizes. Check for string overflow more accurately.
17625 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
17626
6d84508d
PE
17627 * macros.c: Integer and buffer overflow fixes.
17628 * keyboard.h (struct keyboard.kbd_macro_bufsize):
17629 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
17630 Use ptrdiff_t, not int, for sizes.
17631 Don't increment bufsize until after realloc succeeds.
17632 Check for size-calculation overflow.
17633 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
17634
437b2cb4
PE
17635 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
17636
8b9ac8b4
PE
17637 * lread.c: Integer overflow fixes.
17638 (read_integer): Radix is now EMACS_INT, not int,
17639 to improve quality of diagnostics for out-of-range radices.
17640 Calculate buffer size correctly for out-of-range radices.
17641 (read1): Check for integer overflow in radices, and in
17642 read-circle numbers.
82cb60d3
PE
17643 (read_escape): Avoid int overflow.
17644 (Fload, openp, read_buffer_size, read1)
17645 (substitute_object_recurse, read_vector, read_list, map_obarray):
17646 Use ptrdiff_t, not int, for sizes.
17647 (read1): Use EMACS_INT, not int, for sizes.
20270765 17648 Check for size overflow.
8b9ac8b4 17649
7fcccf1e
PE
17650 * image.c (cache_image): Check for size arithmetic overflow.
17651
bfbbd7e7
PE
17652 * lread.c: Integer overflow issues.
17653 (saved_doc_string_size, saved_doc_string_length)
17654 (prev_saved_doc_string_size, prev_saved_doc_string_length):
17655 Now ptrdiff_t, not int.
17656 (read1): Don't assume doc string length fits in int. Check for
17657 out-of-range doc string lengths.
17658 (read_list): Don't assume file position fits in int.
39019e54 17659 (read_escape): Check for hex character overflow.
bfbbd7e7 17660
4e323265
LL
176612011-06-22 Leo Liu <sdl.web@gmail.com>
17662
17663 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
17664 Move to minibuffer.el.
17665
85fece3e
PE
176662011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17667
20b84ce9 17668 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
17669 The following patches are for when GLYPH_DEBUG && !XASSERT.
17670 * dispextern.h (trace_redisplay_p, dump_glyph_string):
17671 * dispnew.c (flush_stdout):
17672 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
17673 Mark as externally visible.
17674 * dispnew.c (check_window_matrix_pointers): Now static.
17675 * dispnew.c (window_to_frame_vpos):
17676 * xfns.c (unwind_create_frame):
17677 * xterm.c (x_check_font): Remove unused local.
17678 * scroll.c (CHECK_BOUNDS):
17679 * xfaces.c (cache_fache): Rename local to avoid shadowing.
17680 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
17681 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
17682 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
17683 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
17684 Now static.
17685 (debug_method_add): Use va_list and vsprintf rather than relying
17686 on undefined behavior with wrong number of arguments.
17687 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
17688 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
17689 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
17690 since we're not interested in debugging glyphs with old libraries.
17691 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
17692 GCC 4.6.0's static checking.
17693
0766b489
PE
176942011-06-22 Paul Eggert <eggert@cs.ucla.edu>
17695
31fd4b32
PE
17696 Integer overflow and signedness fixes (Bug#8873).
17697 A few related buffer overrun fixes, too.
17698
b79e8648
PE
17699 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
17700
0766b489
PE
17701 * dispextern.h (struct face.stipple):
17702 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
17703 (x_bitmap_mask, x_allocate_bitmap_record)
17704 (x_create_bitmap_from_data, x_create_bitmap_from_file)
17705 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
17706 (x_create_bitmap_from_xpm_data):
17707 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
17708 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
17709 (.bitmaps_last):
17710 * xfaces.c (load_pixmap):
17711 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
17712 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
17713 (.bitmaps_last, struct x_output.icon_bitmap):
17714 Use ptrdiff_t, not int, for bitmap indexes.
17715 (x_allocate_bitmap_record): Check for size overflow.
17716 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
17717
b081724f
PE
17718 Use ptrdiff_t, not int, for overlay counts.
17719 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
17720 * editfns.c (overlays_around, get_pos_property):
17721 * textprop.c (get_char_property_and_overlay):
17722 * xdisp.c (next_overlay_change, note_mouse_highlight):
17723 * xfaces.c (face_at_buffer_position):
21514da7
PE
17724 * buffer.c (OVERLAY_COUNT_MAX): New macro.
17725 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
17726 (Fnext_overlay_change, Fprevious_overlay_change)
17727 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 17728 Use ptrdiff_t, not int, for sizes.
21514da7 17729 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 17730
3de73e5e
PE
17731 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
17732
2606c57b
PE
17733 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
17734 (x_session_initialize): Do not assume string length fits in int.
17735
aaafe47a
PE
17736 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
17737 This is unlikely, but can occur if DPI is outlandish.
17738
2674ddc8 17739 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
17740 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
17741
28154962
PE
17742 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
17743 * xrdb.c (magic_file_p, search_magic_path):
17744 Omit last arg SUFFIX; it was always 0. All callers changed.
17745 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
17746
7de51af5
PE
17747 * xfont.c (xfont_match): Avoid need for strlen.
17748
25ed6cc3
PE
17749 * xfns.c: Don't assume strlen fits in int.
17750 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
17751
4eab31dd
PE
17752 * xdisp.c (message_log_check_duplicate): Return intmax_t,
17753 not unsigned long, as we prefer signed integers. All callers changed.
17754 Detect integer overflow in repeat count.
17755 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 17756 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 17757
171e2a58
PE
17758 * termcap.c: Don't assume sizes fit in int and never overflow.
17759 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
17760 (gobble_line): Check for size-calculation overflow.
17761
ad39faca 17762 * minibuf.c (Fread_buffer):
6e5bb2dc 17763 * lread.c (intern, intern_c_string):
74ca2eb3
PE
17764 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
17765 Don't assume string length fits in int.
17766
52c61c22 17767 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
17768 * gtkutil.c (style_changed_cb): Avoid need for strlen.
17769
b5b8c9e5
PE
17770 * font.c: Don't assume string length fits in int.
17771 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
17772 Use ptrdiff_t, not int.
ccd6111c
PE
17773 (font_intern_prop): Don't assume string length fits in int.
17774 Don't assume integer property fits in fixnum.
17775 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 17776
882f0d81 17777 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 17778 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
17779 Reformulate so as not to need the command string.
17780 Invoke gzip -cd rather than gunzip, as it's more portable.
17781 (lock_info_type, lock_file_1, lock_file):
17782 Don't assume pid_t and time_t fit in unsigned long.
17783 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
17784 (current_lock_owner): Prefer signed type for sizes.
17785 Use memcpy, not strncpy, where memcpy is what is really wanted.
17786 Don't assume (via atoi) that time_t and pid_t fit in int.
17787 Check for time_t and/or pid_t out of range, e.g., via a network share.
17788 Don't alloca where an auto var works fine.
17789
93f4cf88
PE
17790 * fileio.c: Fix some integer overflow issues.
17791 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
17792 Don't assume string length fits in int.
17793 (directory_file_name): Don't assume string length fits in long.
17794 (make_temp_name): Don't assume pid fits in int, or that its print
17795 length is less than 20.
17796
f3e92b69
PE
17797 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
17798
1bfdaf10
PE
17799 * coding.c (make_subsidiaries): Don't assume string length fits in int.
17800
35016e9a
PE
17801 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
17802
3d1e65a1
PE
17803 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
17804 We prefer signed integers, even for size calculations.
17805
0b963a93
PE
17806 * emacs.c: Don't assume string length fits in 'int'.
17807 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
17808 (main): Don't invoke strlen when not needed.
17809
573f4b54
PE
17810 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
17811 (XD_DEBUG_MESSAGE): Don't waste a byte.
17812
989f33ba
PE
17813 * callproc.c (getenv_internal_1, getenv_internal)
17814 (Fgetenv_internal):
965d34eb
PE
17815 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
17816
e4d29b33
PE
17817 * lread.c (invalid_syntax): Omit length argument.
17818 All uses changed. This doesn't fix a bug, but it simplifies the
17819 code away from its former Hollerith-constant appearance, and it's
17820 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 17821 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 17822
eb49b136
PE
17823 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
17824 This didn't break anything, but it didn't help either.
17825 It's confusing to put a bogus integer in a place where the actual
17826 value does not matter.
9f62aeb1 17827 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 17828 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 17829
15375a22
PE
17830 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
17831 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
17832 implementation.
b61cc01c
PE
17833 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
17834 We prefer signed types, and the value cannot exceed the EMACS_INT
17835 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
17836 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
17837 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
17838 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 17839
53b2623d
PE
17840 * indent.c (sane_tab_width): New function.
17841 (current_column, scan_for_column, Findent_to, position_indentation)
17842 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 17843 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 17844
51cab52b 17845 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 17846
f2ed8a70
PE
17847 * lisp.h (lint_assume): New macro.
17848 * composite.c (composition_gstring_put_cache):
17849 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
17850
abe80cc6
PE
17851 * editfns.c, insdel.c:
17852 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 17853
b02c740e
PE
17854 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
17855
ebc96716
PE
17856 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
17857
b4e50fa0 17858 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 17859 Use much-faster test for byte-length change.
311d5d7c 17860 Don't assume string byte-length fits in 'int'.
a4cf38e4 17861 Check that character arg fits in 'int'.
85461888 17862 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 17863
c0c1ee9f
PE
17864 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
17865
a498d7f4
PE
17866 * fns.c (concat): Catch string overflow earlier.
17867 Do not rely on integer wraparound.
17868
51cab52b
PE
17869 * dispextern.h (struct it.overlay_strings_charpos)
17870 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
17871 * xdisp.c (forward_to_next_line_start)
17872 (back_to_previous_visible_line_start)
17873 (reseat_at_next_visible_line_start, next_element_from_buffer):
17874 Don't arbitrarily truncate the value of 'selective' to int.
17875
76031fad
PE
17876 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
17877
5eb55db9
PE
17878 * composite.c: Don't truncate sizes to 'int'.
17879 (composition_gstring_p, composition_reseat_it)
17880 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
17881 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
17882 not EMACS_UINT, for indexes.
5eb55db9 17883
0703a717
PE
17884 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
17885
d6202519
PE
17886 * buffer.c: Include <verify.h>.
17887 (struct sortvec.priority, struct sortstr.priority):
8961a454 17888 Now EMACS_INT, not int.
c20998a7 17889 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
17890 (struct sortstr.size, record_overlay_string)
17891 (struct sortstrlist.size, struct sortlist.used):
17892 Don't truncate size to int.
17893 (record_overlay_string): Check for size-calculation overflow.
d6202519 17894 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 17895
d5a19415
JM
178962011-06-22 Jim Meyering <meyering@redhat.com>
17897
029529ac 17898 Don't leak an XBM-image-sized buffer
d5a19415
JM
17899 * image.c (xbm_load): Free the image buffer after using it.
17900
a9041e6c
PE
179012011-06-21 Paul Eggert <eggert@cs.ucla.edu>
17902
17903 Port to Sun C.
17904 * composite.c (find_automatic_composition): Omit needless 'return 0;'
17905 that Sun C diagnosed.
17906 * fns.c (secure_hash): Fix pointer signedness issue.
17907 * intervals.c (static_offset_intervals): New function.
17908 (offset_intervals): Use it.
17909
7f3f739f
LL
179102011-06-21 Leo Liu <sdl.web@gmail.com>
17911
17912 * deps.mk (fns.o):
17913 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
17914 sha512.h.
17915
17916 * fns.c (secure_hash): Rename from crypto_hash_function and change
17917 the first arg to accept symbols.
5b66d427 17918 (Fsecure_hash): New primitive.
7f3f739f
LL
17919 (syms_of_fns): New symbols.
17920
76147d94
DD
179212011-06-20 Deniz Dogan <deniz@dogan.se>
17922
17923 * process.c (Fset_process_buffer): Clarify return value in
17924 docstring.
17925
7d7d0045
CY
179262011-06-18 Chong Yidong <cyd@stupidchicken.com>
17927
17928 * dispnew.c (add_window_display_history): Use BVAR.
17929
17930 * xdisp.c (debug_method_add): Use BVAR.
17931 (check_window_end, dump_glyph_matrix, dump_glyph)
17932 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
17933
17934 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
17935 Likewise.
17936
17937 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
17938 check till after the cache is created in init_frame_faces.
17939
ff2bc410
SM
179402011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
17941
17942 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
17943
28177add
PE
179442011-06-16 Paul Eggert <eggert@cs.ucla.edu>
17945
dd3482fe
PE
17946 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
17947 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
17948 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
17949
393d71f3 17950 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
17951 * fileio.c (Finsert_file_contents):
17952 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
17953 Remove the old (too-loose) buffer overflow checks.
17954 They weren't needed, since make_gap checks for buffer overflow.
17955 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
17956 The old code merely checked for Emacs fixnum overflow, and relied
17957 on undefined (wraparound) behavior. The new code avoids undefined
17958 behavior, and also checks for ptrdiff_t and/or size_t overflow.
17959
2e6813b0 17960 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
17961 Tune. Don't use wider integers than needed. Don't use alloca.
17962 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 17963
599a9e4f
PE
17964 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
17965
99561444
PE
17966 * insdel.c, lisp.h (buffer_overflow): New function.
17967 (insert_from_buffer_1, replace_range, replace_range_2):
17968 * insdel.c (make_gap_larger):
17969 * editfns.c (Finsert_char):
17970 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
17971
28177add
PE
17972 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
17973
e69dafad
PE
179742011-06-15 Paul Eggert <eggert@cs.ucla.edu>
17975
4baa020d 17976 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 17977
b1c46f02
PE
17978 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
17979 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
17980
e69dafad
PE
17981 * fileio.c: Don't assume EMACS_INT fits in off_t.
17982 (emacs_lseek): New static function.
17983 (Finsert_file_contents, Fwrite_region): Use it.
17984 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
17985
566684ea
PE
17986 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
17987
e6966cd6
PE
17988 * fns.c: Don't overflow int when computing a list length.
17989 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
17990 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
17991 truncation on 64-bit hosts. Check for QUIT every
17992 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
17993 faster and is responsive enough.
17994 (Flength): Report an error instead of overflowing an integer.
17995 (Fsafe_length): Return a float if the value is not representable
17996 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 17997 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 17998 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 17999
dd0b0efb
PE
18000 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18001 (header_size, word_size): New constants.
18002 (allocate_vectorlike): Don't check size overflow here.
18003 (allocate_vector): Check it here instead, since this is the only
18004 caller of allocate_vectorlike that could cause overflow.
18005 Check that the new vector's length is representable as a fixnum.
18006
86fe5cfe
PE
18007 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18008 The previous code was bogus. For example, next_almost_prime (32)
18009 returned 39, which is undesirable as it is a multiple of 3; and
18010 next_almost_prime (24) returned 25, which is a multiple of 5 so
18011 why was the code bothering to check for multiples of 7?
18012
80e88859
PE
18013 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18014
4a2f0ad6
PE
18015 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18016
f66c7cf8
PE
18017 Variadic C functions now count arguments with ptrdiff_t.
18018 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18019 Back then I didn't know that the Emacs coding style prefers signed int.
18020 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
18021 were being counted with int, which may truncate counts on 64-bit
18022 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
18023 * lisp.h (struct Lisp_Subr.function.aMANY)
18024 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18025 Arg counts are now ptrdiff_t, not size_t.
18026 All variadic functions and their callers changed accordingly.
18027 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18028 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18029 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18030 * callint.c (Fcall_interactively): Check arg count for overflow,
18031 to avoid potential buffer overrun. Use signed char, not 'int',
18032 for 'varies' array, so that we needn't bother to check its size
18033 calculation for overflow.
18034 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18035 * eval.c (apply_lambda):
18036 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18037 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18038 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18039
a1759b76
PE
18040 * callint.c (Fcall_interactively): Don't use index var as event count.
18041
d96be9fc
PE
18042 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18043 * mem-limits.h (SIZE): Remove; no longer used.
18044
a690a978 18045 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 18046
578c21e6
PE
18047 Remove unnecessary casts.
18048 * xterm.c (x_term_init):
18049 * xfns.c (x_set_border_pixel):
18050 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18051 These aren't needed now that we assume ANSI C.
18052
96f53c6c
PE
18053 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18054 It's more likely to cause problems (due to unsigned overflow)
18055 than to cure them.
18056
83c77d31
PE
18057 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18058
ee2079f1
PE
18059 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18060
6da65536
PE
18061 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18062
7147c4a4
PE
18063 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18064
193e32d9
PE
18065 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18066
e5533da6
PE
18067 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18068
9910e595
PE
18069 GLYPH_CODE_FACE returns EMACS_INT, not int.
18070 * dispextern.h (merge_faces):
18071 * xfaces.c (merge_faces):
01103c44
PE
18072 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18073 Don't assume EMACS_INT fits in int.
9910e595 18074
2638320e
PE
18075 * character.h (CHAR_VALID_P): Remove unused parameter.
18076 * fontset.c, lisp.h, xdisp.c: All uses changed.
18077
045eb8d9
PE
18078 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18079
c1f134b5
PE
18080 * fns.c (concat): Minor tuning based on overflow analysis.
18081 This doesn't fix any bugs. Use int to hold character, instead
18082 of constantly refetching from Emacs object. Use XFASTINT, not
18083 XINT, for value known to be a character. Don't bother comparing
18084 a single byte to 0400, as it's always less.
18085
395fcb93 18086 * floatfns.c (Fexpt):
327eeec8
PE
18087 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18088
abbd3d23
PE
18089 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18090 for characters.
18091
684a03ef
PE
18092 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18093
0fed43f3
PE
18094 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18095 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18096 incorrectly succeed when S was a string, because 4294967386 was
18097 truncated before it was used.
18098
8fd02eb7
PE
18099 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18100 Otherwise, an out-of-range integer could cause undefined behavior
18101 on a 64-bit host.
18102
f8c86b69
PE
18103 * composite.c: Use int, not EMACS_INT, for characters.
18104 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18105 EMACS_INT, for values that are known to be in character range.
18106 This doesn't fix any bugs but is the usual style inside Emacs and
18107 may generate better code on 32-bit machines.
18108
34206dd2
PE
18109 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18110 This is for reasons similar to the recent CHAR_STRING fix.
18111 * charset.c (Fencode_char): Check that character arg is actually
18112 a character. Pass an int to ENCODE_CHAR.
18113 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18114 wider than 'int', as a compile-time check to prevent future regressions
18115 in this area.
18116
c5958d4c 18117 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
18118
18119 Make sure a 64-bit char is never passed to CHAR_STRING.
18120 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18121 by silently ignoring the top 32 bits, allowing some values
18122 that were far too large to be valid characters.
18123 * character.h: Include <verify.h>.
18124 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18125 arguments are no wider than unsigned, as a compile-time check
18126 to prevent future regressions in this area.
18127 * data.c (Faset):
01103c44 18128 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
18129 (Fsubst_char_in_region):
18130 * fns.c (concat):
18131 * xdisp.c (decode_mode_spec_coding):
18132 Adjust to CHAR_STRING's new requirement.
18133 * editfns.c (Finsert_char, Fsubst_char_in_region):
18134 * fns.c (concat): Check that character args are actually
18135 characters. Without this test, these functions did the wrong
18136 thing with wildly out-of-range values on 64-bit hosts.
18137
d37ca623
PE
18138 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18139 These casts should not be needed on 32-bit hosts, either.
18140 * keyboard.c (read_char):
18141 * lread.c (Fload): Remove casts to unsigned.
18142
ea204efb
PE
18143 * lisp.h (UNSIGNED_CMP): New macro.
18144 This fixes comparison bugs on 64-bit hosts.
18145 (ASCII_CHAR_P): Use it.
18146 * casefiddle.c (casify_object):
01103c44 18147 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
18148 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18149 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18150 * dispextern.h (FACE_FROM_ID):
18151 * keyboard.c (read_char): Use UNSIGNED_CMP.
18152
41cb286c
PE
18153 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18154 not to EMACS_INT, to avoid GCC warning.
18155
4a1b9832
PE
18156 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18157
55daad71
PE
18158 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18159 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18160 isn't needed on 32-bit machines.
8f95c75c 18161
01103c44
PE
18162 * buffer.c (Fgenerate_new_buffer_name):
18163 Use EMACS_INT for count, not int.
0ceccced 18164 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
18165
18166 * data.c (Qcompiled_function): Now static.
18167
c6f072e7
PE
18168 * window.c (window_body_lines): Now static.
18169
20ce5912
PE
18170 * image.c (gif_load): Rename local to avoid shadowing.
18171
9c4c5f81
PE
18172 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18173 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18174 * alloc.c (make_save_value): Integer argument is now of type
18175 ptrdiff_t, not int.
18176 (mark_object): Use ptrdiff_t, not int.
18177 * lisp.h (pD): New macro.
18178 * print.c (print_object): Use it.
18179
c0c5c8ae
PE
18180 * alloc.c: Use EMACS_INT, not int, to count objects.
18181 (total_conses, total_markers, total_symbols, total_vector_size)
18182 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
18183 (total_free_floats, total_floats, total_free_intervals)
18184 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
18185 Now EMACS_INT, not int. All uses changed.
18186 (Fgarbage_collect): Compute overall total using a double, so that
18187 integer overflow is less likely to be a problem. Check for overflow
18188 when converting back to an integer.
5a25e253
PE
18189 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18190 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18191 These were 'int' variables that could overflow on 64-bit hosts;
18192 they were never used, so remove them instead of repairing them.
211a0b2a 18193 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
18194 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18195 Previously, this ceilinged at INT_MAX, but that doesn't work on
18196 64-bit machines.
e46bb31a 18197 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 18198
c78baabf 18199 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 18200 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
18201 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18202 when a (possibly-narrower) signed value would do just as well.
18203 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 18204
c9d624c6
PE
18205 * alloc.c: Catch some string size overflows that we were missing.
18206 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18207 for convenience in STRING_BYTES_MAX.
18208 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18209 The definition here is exact; the one in lisp.h was approximate.
18210 (allocate_string_data): Check for string overflow. This catches
18211 some instances we weren't catching before. Also, it catches
18212 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18213 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18214 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 18215
c9d624c6
PE
18216 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18217 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 18218 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 18219
353032ce
PE
18220 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18221
2bccce07
PE
18222 * alloc.c (Fmake_string): Check for out-of-range init.
18223
0ac30604
SM
182242011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18225
18226 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18227
c195f2de
JD
182282011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18229
18230 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18231 xg_get_default_scrollbar_width.
18232
18233 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18234 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18235 (style_changed_cb): Call update_theme_scrollbar_width and call
18236 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18237 all frames (Bug#8505).
18238 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18239 Call gtk_window_set_resizable if HAVE_GTK3.
18240 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18241 and height if HAVE_GTK3 (Bug#8505).
18242 (scroll_bar_width_for_theme): New variable.
18243 (update_theme_scrollbar_width): New function.
18244 (xg_get_default_scrollbar_width): Move code to
18245 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18246 (xg_initialize): Call update_theme_scrollbar_width.
18247
18248 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18249
18250 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18251
e10ac9f1
MR
182522011-06-12 Martin Rudalics <rudalics@gmx.at>
18253
18254 * frame.c (make_frame): Call other_buffer_safely instead of
18255 other_buffer.
18256
18257 * window.c (temp_output_buffer_show): Call display_buffer with
18258 second argument Vtemp_buffer_show_specifiers and reset latter
18259 immediately after the call.
18260 (Vtemp_buffer_show_specifiers): New variable.
18261 (auto_window_vscroll_p, next_screen_context_lines)
18262 (Vscroll_preserve_screen_position): Remove leading asterisks from
18263 doc-strings.
18264
2d3c217e 182652011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 18266
7b7f97e8 18267 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
18268 * buffer.c (Qclone_number): Remove for now, as it's unused.
18269 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18270 (record_buffer): Remove unused local.
18271 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18272 (set_frame_buffer_list): Remove; unused.
18273 * frame.h (other_visible_frames): Remove decl.
18274 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18275 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18276 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18277 if HAVE_GPM.
18278 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18279 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18280 Define only if HAVE_GPM.
18281 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18282 (update_hints_inhibit): Remove; never set. All uses removed.
18283 * widgetprv.h (emacsFrameClassRec): Remove decl.
18284 * window.c (delete_deletable_window): Now returns void, since it
18285 wasn't returning anything.
18286 (compare_window_configurations): Remove unused locals.
18287 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18288 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18289 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18290 the same widths as pointers. This follows up on the 2011-05-06 patch.
18291 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18292 * xterm.h: Likewise.
18293 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18294
1384b89e
JB
182952011-06-12 Juanma Barranquero <lekktu@gmail.com>
18296
18297 * makefile.w32-in: Update dependencies.
18298 (LISP_H): Add lib/intprops.h.
18299
1100a63c
CY
183002011-06-11 Chong Yidong <cyd@stupidchicken.com>
18301
18302 * image.c (gif_load): Add animation frame delay to the metadata.
18303 (syms_of_image): Use DEFSYM. New symbol `delay'.
18304
6198ccd0
MR
183052011-06-11 Martin Rudalics <rudalics@gmx.at>
18306
18307 * window.c (delete_deletable_window): Re-add.
18308 (Fset_window_configuration): Rewrite to handle dead buffers and
18309 consequently deletable windows.
18310 (window_tree, Fwindow_tree): Remove. Supply functionality in
18311 window.el.
18312 (compare_window_configurations): Simplify code.
18313
b6e3633c
AS
183142011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18315
1ab0dee5
AS
18316 * image.c (imagemagick_load_image): Fix type mismatch.
18317 (Fimagemagick_types): Likewise.
18318
b6e3633c
AS
18319 * window.h (replace_buffer_in_windows): Declare.
18320
9397e56f
MR
183212011-06-11 Martin Rudalics <rudalics@gmx.at>
18322
18323 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18324 Qclone_number. Remove external declaration of Qdelete_window.
18325 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18326 code.
640c8776
SM
18327 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18328 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18329 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18330 buffer list implementation.
18331 (other_buffer_safely): New function.
18332 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18333 calls to replace_buffer_in_windows and
18334 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18335 if allowed.
18336 (record_buffer): Inhibit quitting and rewrite using quittable
18337 functions. Run Qbuffer_list_update_hook if allowed.
18338 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18339 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18340 Move switch-to-buffer to window.el.
9397e56f
MR
18341 (bury-buffer): Move to window.el.
18342 (Vbuffer_list_update_hook): New variable.
18343
18344 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18345 section.
18346
18347 * window.h (resize_frame_windows): Move up in code.
18348 (Fwindow_frame): Remove EXFUN.
18349 (replace_buffer_in_all_windows): Remove prototype.
18350 (replace_buffer_in_windows_safely): Add prototype.
18351
18352 * window.c: Declare Qdelete_window static again. Move down
18353 declaration of select_count.
18354 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18355 (Fother_window): Move to window.el.
18356 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18357 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18358 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18359 window.el.
18360 (replace_buffer_in_windows): Implement by calling
18361 Qreplace_buffer_in_windows.
18362 (replace_buffer_in_all_windows): Remove with some functionality
18363 moved into replace_buffer_in_windows_safely.
18364 (replace_buffer_in_windows_safely): New function.
18365 (select_window_norecord, select_frame_norecord): Move in front
18366 of run_window_configuration_change_hook. Remove now obsolete
18367 declarations.
640c8776
SM
18368 (Fset_window_buffer): Rewrite doc-string.
18369 Call Qrecord_window_buffer.
9397e56f
MR
18370 (keys_of_window): Move binding for other-window to window.el.
18371
b50691aa
CY
183722011-06-11 Chong Yidong <cyd@stupidchicken.com>
18373
18374 * dispextern.h (struct image): Replace data member, whose int_val
18375 and ptr_val fields were not used by anything, with a single
18376 lisp_val object.
18377
18378 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18379 (gif_clear_image, gif_load, imagemagick_load_image)
18380 (gs_clear_image, gs_load): Callers changed.
18381
3f754b86
PE
183822011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18383
cca69397
PE
18384 * buffer.h: Include <time.h>, for time_t.
18385 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18386
109e28d0
PE
18387 Fix minor problems found by static checking.
18388
60737f02
PE
18389 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18390
4b66faf3
PE
18391 Make identifiers static if they are not used in other modules.
18392 * data.c (Qcompiled_function, Qframe, Qvector):
18393 * image.c (QimageMagick, Qsvg):
18394 * minibuf.c (Qmetadata):
18395 * window.c (resize_window_check, resize_root_window): Now static.
18396 * window.h (resize_window_check, resize_root_window): Remove decls.
18397
109e28d0
PE
18398 * window.c (window_deletion_count, delete_deletable_window):
18399 Remove; unused.
46a4ce9e
PE
18400 (window_body_lines): Now static.
18401 (Fdelete_other_windows_internal): Mark vars as initialized.
18402 Make sure 'resize_failed' is initialized.
18403 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18404 (resize_window_apply): Remove unused local.
18405 * window.h (delete_deletable_window): Remove decl.
18406
109e28d0 18407 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
18408 (imagemagick_load_image): Fix pointer signedness problem by changing
18409 last arg from unsigned char * to char *. All uses changed.
18410 Also, fix a local for similar reasons.
18411 Remove unused locals. Remove locals to avoid shadowing.
18412 (fn_rsvg_handle_free): Remove; unused.
18413 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 18414 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 18415
3f754b86
PE
18416 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18417
2547adb1
CY
184182011-06-10 Chong Yidong <cyd@stupidchicken.com>
18419
18420 * image.c (gif_load): Fix omitted cast error introduced by
18421 2011-06-06 change.
18422
2c8e37d4
MR
184232011-06-10 Martin Rudalics <rudalics@gmx.at>
18424
18425 * window.h (resize_proportionally, orig_total_lines)
18426 (orig_top_line): Remove from window structure.
18427 (set_window_height, set_window_width, change_window_heights)
18428 (Fdelete_window): Remove prototypes.
18429 (resize_frame_windows): Remove duplicate declaration.
18430
440a42e3
EZ
184312011-06-10 Eli Zaretskii <eliz@gnu.org>
18432
18433 * window.h (resize_frame_windows, resize_window_check)
18434 (delete_deletable_window, resize_root_window)
18435 (resize_frame_windows): Declare prototypes.
18436
18437 * window.c (resize_window_apply): Make definition be "static" to
18438 match the prototype.
18439
562dd5e9
MR
184402011-06-10 Martin Rudalics <rudalics@gmx.at>
18441
18442 * window.c: Remove declarations of Qwindow_size_fixed,
18443 window_min_size_1, window_min_size_2, window_min_size,
18444 size_window, window_fixed_size_p, enlarge_window, delete_window.
18445 Remove static from declaration of Qdelete_window, it's
18446 temporarily needed by Fbury_buffer.
18447 (replace_window): Don't assign orig_top_line and
18448 orig_total_lines.
18449 (Fdelete_window, delete_window): Remove. Window deletion is
18450 handled by window.el.
640c8776
SM
18451 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18452 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
18453 (Fdelete_other_windows): Remove. Deleting other windows is
18454 handled by window.el.
18455 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18456 handled in window.el.
18457 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18458 Window minimum sizes are handled in window.el.
18459 (shrink_windows, size_window, set_window_height)
18460 (set_window_width, change_window_heights, window_height)
18461 (window_width, CURBEG, CURSIZE, enlarge_window)
18462 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18463 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18464 handled in window.el.
18465 (make_dummy_parent): Rename to make_parent_window and give it a
18466 second argument horflag.
18467 (make_window): Don't set resize_proportionally any more.
18468 (Fsplit_window): Remove. Windows are split in window.el.
18469 (save_restore_action, save_restore_orig_size)
18470 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18471 Resize mini windows in window.el.
18472 (grow_mini_window, shrink_mini_window): Implement by calling
18473 Qresize_root_window_vertically, resize_window_check and
18474 resize_window_apply.
640c8776
SM
18475 (saved_window, Fset_window_configuration, save_window_save):
18476 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
18477 resize_proportionally.
18478 (window_min_height, window_min_width): Move to window.el.
18479 (keys_of_window): Move bindings for delete-other-windows,
18480 split-window, delete-window and enlarge-window to window.el.
18481
18482 * buffer.c: Temporarily extern Qdelete_window.
18483 (Fbury_buffer): Temporarily call Qdelete_window instead of
18484 Fdelete_window (Fbury_buffer will move to window.el soon).
18485
18486 * frame.c (set_menu_bar_lines_1): Remove code handling
18487 orig_top_line and orig_total_lines.
18488
18489 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18490 set_window_height but set heights directly.
18491 (change_frame_size_1): Use resize_frame_windows.
18492
18493 * xdisp.c (init_xdisp): Don't use set_window_height but set
18494 heights directly.
18495
640c8776
SM
18496 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18497 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
18498 run_window_configuration_change_hook.
18499
18500 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18501 instead of change_window_heights and run
18502 run_window_configuration_change_hook.
18503
1a13852e
MR
185042011-06-09 Martin Rudalics <rudalics@gmx.at>
18505
18506 * window.c (replace_window): Rename second argument REPLACEMENT to
18507 NEW. New third argument SETFLAG. Rewrite.
18508 (delete_window, make_dummy_parent): Call replace_window with
18509 third argument 1.
18510 (window_list_1): Move down in code.
18511 (run_window_configuration_change_hook): Move set_buffer part
18512 before select_frame_norecord part in order to unwind correctly.
18513 Rename count1 to count.
18514 (recombine_windows, delete_deletable_window, resize_root_window)
18515 (Fdelete_other_windows_internal)
18516 (Frun_window_configuration_change_hook, make_parent_window)
18517 (resize_window_check, resize_window_apply, Fresize_window_apply)
18518 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
18519 (Fdelete_window_internal, Fresize_mini_window_internal):
18520 New functions.
1a13852e
MR
18521 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18522
f3d1777e
MR
185232011-06-08 Martin Rudalics <rudalics@gmx.at>
18524
496e208e
MR
18525 * window.h (window): Add some new members to window structure -
18526 normal_lines, normal_cols, new_total, new_normal, clone_number,
18527 splits, nest, prev_buffers, next_buffers.
18528 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 18529 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 18530
f3d1777e
MR
18531 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18532 Remove.
496e208e
MR
18533 (make_dummy_parent): Set new members of windows structure.
18534 (make_window): Move down in code. Handle new members of window
18535 structure.
18536 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18537 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18538 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18539 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
18540 (Fset_window_next_buffers, Fset_window_clone_number):
18541 New functions.
496e208e
MR
18542 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18543 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18544 Doc-string fixes.
18545 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18546 Argument WINDOW can be now internal window too.
18547 (Fwindow_use_time): Move up in code.
18548 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18549 Rewrite doc-string.
18550 (Fset_window_configuration, saved_window)
18551 (Fcurrent_window_configuration, save_window_save): Handle new
18552 members of window structure.
b9e809c2
MR
18553 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18554 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18555 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18556 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18557 Qget_mru_window, Qresize_root_window,
18558 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18559 Qauto_buffer_name; staticpro them.
f3d1777e 18560
abde8f8c
MR
185612011-06-07 Martin Rudalics <rudalics@gmx.at>
18562
18563 * window.c (Fwindow_total_size, Fwindow_left_column)
18564 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18565 (Fwindow_list_1): New functions.
18566 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18567 (Fwindow_width, Fscroll_left, Fscroll_right):
18568 Use window_body_cols instead of window_box_text_cols.
18569 (delete_window, Fset_window_configuration):
18570 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18571 (delete_all_subwindows): Take a window as argument and not a
18572 structure. Rewrite.
190b47e6
MR
18573 (window_loop): Remove handling of GET_LRU_WINDOW and
18574 GET_LARGEST_WINDOW.
18575 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18576
18577 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18578 window_box_text_cols. delete_all_subwindows now takes a
18579 Lisp_Object as argument.
abde8f8c 18580
640c8776
SM
18581 * indent.c (compute_motion, Fcompute_motion):
18582 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18583
fa8a67e6
MR
18584 * frame.c (delete_frame): Call delete_all_subwindows with root
18585 window as argument.
18586
a54e3482
DC
185872011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18588
18589 * fns.c (Fputhash): Document return value.
18590
60002bf5
CY
185912011-06-06 Chong Yidong <cyd@stupidchicken.com>
18592
18593 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18594
0c671da6 185952011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18596
b862a52a 18597 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18598
be44ca6c
PE
18599 Check for overflow when converting integer to cons and back.
18600 * charset.c (Fdefine_charset_internal, Fdecode_char):
18601 Use cons_to_unsigned to catch overflow.
18602 (Fencode_char): Use INTEGER_TO_CONS.
18603 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18604 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18605 * data.c (long_to_cons, cons_to_long): Remove.
18606 (cons_to_unsigned, cons_to_signed): New functions.
18607 These signal an error for invalid or out-of-range values.
18608 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18609 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18610 * font.c (Ffont_variation_glyphs):
18611 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18612 * lisp.h: Include <intprops.h>.
18613 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18614 (cons_to_signed, cons_to_unsigned): New decls.
18615 (long_to_cons, cons_to_long): Remove decls.
18616 * undo.c (record_first_change): Use INTEGER_TO_CONS.
18617 (Fprimitive_undo): Use CONS_TO_INTEGER.
18618 * xfns.c (Fx_window_property): Likewise.
18619 * xselect.c: Include <limits.h>.
18620 (x_own_selection, selection_data_to_lisp_data):
18621 Use INTEGER_TO_CONS.
18622 (x_handle_selection_request, x_handle_selection_clear)
18623 (x_get_foreign_selection, Fx_disown_selection_internal)
18624 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
18625 (lisp_data_to_selection_data): Use cons_to_unsigned.
18626 (x_fill_property_data): Use cons_to_signed.
18627 Report values out of range.
18628
d1f3d2af
PE
18629 Check for buffer and string overflow more precisely.
18630 * buffer.h (BUF_BYTES_MAX): New macro.
18631 * lisp.h (STRING_BYTES_MAX): New macro.
18632 * alloc.c (Fmake_string):
18633 * character.c (string_escape_byte8):
18634 * coding.c (coding_alloc_by_realloc):
18635 * doprnt.c (doprnt):
18636 * editfns.c (Fformat):
18637 * eval.c (verror):
18638 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
18639 since they may not be the same number.
18640 * editfns.c (Finsert_char):
18641 * fileio.c (Finsert_file_contents):
18642 Likewise for BUF_BYTES_MAX.
18643
dd52fcea
PE
18644 * image.c: Use ptrdiff_t, not int, for sizes.
18645 (slurp_file): Switch from int to ptrdiff_t.
18646 All uses changed.
18647 (slurp_file): Check that file size fits in both size_t (for
18648 malloc) and ptrdiff_t (for sanity and safety).
18649
7f9bbdbb
PE
18650 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
18651 if b->modtime has its maximal value.
18652
dfe18f82
PE
18653 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
18654
84acfcf0
PE
18655 Don't assume time_t can fit into int.
18656 * buffer.h (struct buffer.modtime): Now time_t, not int.
18657 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
18658 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
18659
ccd9a01a
PE
18660 Minor fixes for signed vs unsigned integers.
18661 * character.h (MAYBE_UNIFY_CHAR):
18662 * charset.c (maybe_unify_char):
18663 * keyboard.c (read_char, reorder_modifiers):
18664 XINT -> XFASTINT, since the integer must be nonnegative.
18665 * ftfont.c (ftfont_spec_pattern):
18666 * keymap.c (access_keymap, silly_event_symbol_error):
18667 XUINT -> XFASTINT, since the integer must be nonnegative.
18668 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
18669 since it makes no difference and we prefer signed.
18670 * keyboard.c (record_char): Use XUINT when all the neighbors do.
18671 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
18672 nonnegative.
18673
d6d100dd
SM
186742011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
18675
18676 * window.h (Fwindow_frame): Declare.
18677
2b6148e4
PE
186782011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18679
18680 * alloc.c: Simplify handling of large-request failures (Bug#8800).
18681 (SPARE_MEMORY): Always define.
18682 (LARGE_REQUEST): Remove.
18683 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
18684
f230ecc9
MR
186852011-06-06 Martin Rudalics <rudalics@gmx.at>
18686
727e958e
MR
18687 * lisp.h: Move EXFUNS for Fframe_root_window,
18688 Fframe_first_window and Fset_frame_selected_window to window.h.
18689
18690 * window.h: Move EXFUNS for Fframe_root_window,
18691 Fframe_first_window and Fset_frame_selected_window here from
18692 lisp.h.
18693
18694 * frame.c (Fwindow_frame, Fframe_first_window)
18695 (Fframe_root_window, Fframe_selected_window)
18696 (Fset_frame_selected_window): Move to window.c.
18697 (Factive_minibuffer_window): Move to minibuf.c.
18698 (Fother_visible_frames_p): New function.
18699
18700 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
18701
f230ecc9
MR
18702 * window.c (decode_window, decode_any_window): Move up in code.
18703 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
18704 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
18705 (Fwindow_buffer): Move up and rewrite doc-string.
18706 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
18707 (Fwindow_prev): New functions.
727e958e
MR
18708 (Fwindow_frame): Move here from frame.c. Accept any window as
18709 argument.
18710 (Fframe_root_window, Fframe_first_window)
18711 (Fframe_selected_window): Move here from frame.c. Accept frame
18712 or arbitrary window as argument. Update doc-strings.
18713 (Fminibuffer_window): Move up in code.
18714 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
18715 (Fset_frame_selected_window): Move here from frame.c.
18716 Marginal rewrite.
727e958e
MR
18717 (Fselected_window, select_window, Fselect_window): Move up in
18718 code. Minor doc-string fixes.
f230ecc9 18719
4d09bcf6
PE
187202011-06-06 Paul Eggert <eggert@cs.ucla.edu>
18721
18722 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
18723 Do not assume that spare memory exists; that assumption is valid
18724 only if SYSTEM_MALLOC.
18725 (LARGE_REQUEST): New macro, so that the issue of large requests
18726 is separated from the issue of spare memory.
18727
810928a2
AS
187282011-06-05 Andreas Schwab <schwab@linux-m68k.org>
18729
172418ad
AS
18730 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
18731 format. (Bug#8806)
18732
43f862f7
AS
18733 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
18734
810928a2
AS
18735 * xfns.c (x_set_scroll_bar_default_width): Move declarations
18736 before statements.
18737
a059fe24
JD
187382011-06-05 Jan Djärv <jan.h.d@swipnet.se>
18739
18740 * gtkutil.c (xg_get_default_scrollbar_width): New function.
18741
18742 * gtkutil.h: Declare xg_get_default_scrollbar_width.
18743
18744 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
18745 min width by calling x_set_scroll_bar_default_width (Bug#8505).
18746
989bf368
JB
187472011-06-05 Juanma Barranquero <lekktu@gmail.com>
18748
18749 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
18750
4b80f674
CY
187512011-06-04 Chong Yidong <cyd@stupidchicken.com>
18752
18753 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
18754 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
18755 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
18756 New error handlers.
4b80f674
CY
18757 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
18758 Obey Vx_select_enable_clipboard_manager. Catch errors in
18759 x_clipboard_manager_save (Bug#8779).
18760 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 18761 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 18762
99a33b77 187632011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
18764
18765 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
18766
99a33b77 187672011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
18768
18769 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
18770 in the current matrix if keep_current_p is non-zero.
18771
8264569d
EZ
187722011-06-04 Eli Zaretskii <eliz@gnu.org>
18773
18774 * bidi.c (bidi_level_of_next_char): Fix last change.
18775
57f97249
EZ
187762011-06-03 Eli Zaretskii <eliz@gnu.org>
18777
fec2107c 18778 Support bidi reordering of text covered by display properties.
57f97249 18779
fec2107c
EZ
18780 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
18781 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
18782 (bidi_cache_search, bidi_cache_iterator_state)
18783 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
18784 (bidi_level_of_next_char, bidi_move_to_visually_next):
18785 Support character positions inside a run of characters covered by a
fec2107c
EZ
18786 display string.
18787 (bidi_paragraph_init, bidi_resolve_explicit_1)
18788 (bidi_level_of_next_char): Call bidi_fetch_char and
18789 bidi_fetch_char_advance instead of FETCH_CHAR and
18790 FETCH_CHAR_ADVANCE.
18791 (bidi_init_it): Initialize new members.
18792 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
18793 definitions.
18794 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
18795 instead of using explicit *_CHAR codes.
d6d100dd
SM
18796 (bidi_resolve_explicit, bidi_resolve_weak):
18797 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
18798 bidirectional text is supported only in multibyte buffers.
18799 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
18800 it to initialize the frame_window_p member of struct bidi_it.
18801 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
18802 (bidi_resolve_explicit, bidi_resolve_weak)
18803 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
18804 bidi_it->nchars is non-positive.
18805 (bidi_level_of_next_char): Don't try to lookup the cache for the
18806 next/previous character if nothing is cached there yet, or if we
18807 were just reseat()'ed to a new position.
c40e2fb2 18808
0e14fe90
EZ
18809 * xdisp.c (set_cursor_from_row): Set start and stop points
18810 according to the row's direction when priming the loop that looks
18811 for the glyph on which to display cursor.
18812 (single_display_spec_intangible_p): Function deleted.
18813 (display_prop_intangible_p): Reimplement to call
18814 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
18815 Accept 3 additional arguments needed by handle_display_spec.
18816 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
18817 values: lists, `(when COND...)' forms, etc.
18818 (single_display_spec_string_p): Support property values that are
18819 lists with the argument STRING its top-level element.
18820 (display_prop_string_p): Fix the condition for processing a
18821 property that is a list to be consistent with handle_display_spec.
fec2107c 18822 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
18823 last portion of handle_display_prop.
18824 (compute_display_string_pos): Accept additional argument
18825 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
18826 value of a `display' property is a "replacing spec".
18827 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
18828 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
18829 the display property, but just return a value indicating whether
18830 the display property will replace the characters it covers.
18831 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
18832 frame_window_p members of struct bidi_it.
d6d100dd
SM
18833 (compute_display_string_pos, compute_display_string_end):
18834 New functions.
fec2107c
EZ
18835 (push_it): Accept second argument POSITION, where pop_it should
18836 jump to continue iteration.
18837 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 18838
fec2107c
EZ
18839 * keyboard.c (adjust_point_for_property): Adjust the call to
18840 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
18841
18842 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
18843 (bidi_init_it): Update prototypes.
18844 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
18845 (compute_display_string_pos, compute_display_string_end):
18846 Declare prototypes.
fec2107c
EZ
18847 (struct bidi_it): New members nchars and disp_pos. ch_len is now
18848 EMACS_INT.
fc6f18ce 18849
40087514 188502011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 18851
57f53182
PE
18852 Malloc failure behavior now depends on size of allocation.
18853 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
18854 * lisp.h: Change signatures accordingly.
18855 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
18856 All callers changed. (Bug#8762)
18857
18858 * gnutls.c: Use Emacs's memory allocators.
18859 Without this change, the gnutls library would invoke malloc etc.
18860 directly, which causes problems on non-SYNC_INPUT hosts, and which
18861 runs afoul of improving memory_full behavior. (Bug#8761)
18862 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
18863 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
18864 xfree instead of the default malloc, realloc, free.
18865 (Fgnutls_boot): No need to check for memory allocation failure,
18866 since xmalloc does that for us.
18867
ac32cd99 18868 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
18869 * category.c (hash_get_category_set):
18870 * ccl.c (ccl_driver):
18871 * charset.c (Fdefine_charset_internal):
18872 * charset.h (struct charset.hash_index):
18873 * composite.c (get_composition_id, gstring_lookup_cache)
18874 (composition_gstring_put_cache):
18875 * composite.h (struct composition.hash_index):
18876 * dispextern.h (struct image.hash):
18877 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
18878 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
18879 (hashfn_equal, hashfn_user_defined, make_hash_table)
18880 (maybe_resize_hash_table, hash_lookup, hash_put)
18881 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
18882 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
18883 (Fsxhash, Fgethash, Fputhash, Fmaphash):
18884 * image.c (make_image, search_image_cache, lookup_image)
18885 (xpm_put_color_table_h):
18886 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 18887 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 18888 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 18889 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
18890 * alloc.c (allocate_vectorlike):
18891 Check for overflow in vector size calculations.
18892 * ccl.c (ccl_driver):
18893 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
18894 * fns.c, image.c: Remove unnecessary static decls that would otherwise
18895 need to be updated by these changes.
40087514
PE
18896 * fns.c (make_hash_table, maybe_resize_hash_table):
18897 Check for integer overflow with large hash tables.
0de4bb68
PE
18898 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
18899 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
18900 (SXHASH_REDUCE): New macro.
18901 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
18902 Use it instead of discarding useful hash info with large hash values.
18903 (sxhash_float): New function.
18904 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
18905 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
18906 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
18907 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
18908 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
18909 Adjust signatures to match updated version of code.
18910 (consing_since_gc): Now EMACS_INT, since a single hash table can
18911 use more than INT_MAX bytes.
18912
698d32e2
DN
189132011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
18914
18915 Make it possible to build with GCC-4.6+ -O2 -flto.
18916
18917 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
18918
fd6fa53f
SM
189192011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
18920
18921 * minibuf.c (get_minibuffer, read_minibuf_unwind):
18922 Call minibuffer-inactive-mode.
18923
864db017
JB
189242011-05-31 Juanma Barranquero <lekktu@gmail.com>
18925
18926 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
18927 Update dependencies.
18928
2ad0baf4
DN
189292011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18930
18931 * data.c (init_data): Remove code for UTS, this system is not
18932 supported anymore.
18933
4fcc2638
DN
189342011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18935
18936 Don't force ./temacs to start in terminal mode.
18937
18938 * frame.c (make_initial_frame): Initialize faces in all cases, not
18939 only when CANNOT_DUMP is defined.
18940 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
18941
c56e0fd5
DN
189422011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18943
18944 * dispnew.c (add_window_display_history): Use const for the string
18945 pointer. Remove declaration, not needed.
18946
333d54da 189472011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 18948
55d4c1b2 18949 Use 'inline', not 'INLINE'.
333d54da 18950 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
18951 * alloc.c, fontset.c (INLINE): Remove.
18952 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
18953 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
18954 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
18955 * gmalloc.c (register_heapinfo): Use inline unconditionally.
18956 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
18957
738db178
DN
189582011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
18959
18960 Make it possible to run ./temacs.
18961
18962 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
18963 syms_of_callproc does the same thing. Remove test for
18964 "initialized", do it in the caller.
18965 * emacs.c (main): Avoid calling set_initial_environment when dumping.
18966
620c53a6
SM
189672011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
18968
18969 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
18970 (read_minibuf): Use get_minibuffer.
18971 (syms_of_minibuf): Use DEFSYM.
18972 (Qmetadata): New var.
18973 * data.c (Qbuffer): Don't make it static.
18974 (syms_of_data): Use DEFSYM.
18975
e003a292
PE
189762011-05-31 Paul Eggert <eggert@cs.ucla.edu>
18977
18978 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
18979 (CCL_CODE_MIN): New macro.
18980
ed008a6d
PE
189812011-05-30 Paul Eggert <eggert@cs.ucla.edu>
18982
3687c2ef
PE
18983 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
18984
ed008a6d
PE
18985 * eval.c (Qdebug): Now static.
18986 * lisp.h (Qdebug): Remove decl. This reverts a part of the
18987 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
18988 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
18989
d66c4c7c
CY
189902011-05-29 Chong Yidong <cyd@stupidchicken.com>
18991
18992 * image.c: Various fixes to ImageMagick code comments.
18993 (Fimagemagick_types): Doc fix.
18994
5fbc2025
PE
189952011-05-29 Paul Eggert <eggert@cs.ucla.edu>
18996
0196f88a
PE
18997 Minor fixes prompted by GCC 4.6.0 warnings.
18998
18999 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19000
5fbc2025
PE
19001 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19002 (x_clipboard_manager_save_all): Move extern decl to ...
19003 * xterm.h: ... here, so that it can be checked for consistency.
19004
1dd3c2d9
CY
190052011-05-29 Chong Yidong <cyd@stupidchicken.com>
19006
19007 * xselect.c (x_clipboard_manager_save_frame)
19008 (x_clipboard_manager_save_all): New functions.
19009 (Fx_clipboard_manager_save): Lisp function deleted.
19010
19011 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19012 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19013
19014 * xterm.h: Update prototype.
19015
5ba6571d
WX
190162011-05-28 William Xu <william.xwl@gmail.com>
19017
19018 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19019 exiting (Bug#8239).
19020
3eaff834
JM
190212011-05-28 Jim Meyering <meyering@redhat.com>
19022
e1900994 19023 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
19024 * fns.c (to_uchar): Define.
19025 (crypto_hash_function): Use it to convert some newly-signed
19026 variables to unsigned, to avoid sign-extension bugs. For example,
19027 without this change, (md5 "truc") would evaluate to
19028 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19029 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 19030 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 19031
0f6990a7
PE
190322011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19033
19034 Integer overflow fixes.
c8a9ca5a 19035
08686060
PE
19036 * dbusbind.c: Serial number integer overflow fixes.
19037 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
19038 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19039 to hold a serial number that is too large for a fixnum.
19040 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19041 Check for serial numbers out of range. Decode any serial number
59568bf0 19042 that was so large that it became a float. (Bug#8722)
08686060 19043
2d1fc3c7
PE
19044 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19045 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19046 Use XFASTINT rather than XUINT when numbers are nonnegative.
19047 (xd_append_arg, Fdbus_method_return_internal):
19048 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19049 arguments, check that Lisp number is nonnegative, rather than
59568bf0 19050 silently wrapping negative numbers around. (Bug#8722)
30217ff0 19051 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 19052 (Bug#8722)
2d1fc3c7 19053
c8a9ca5a
PE
19054 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19055
519e1d69
PE
19056 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19057
6df6ae42 19058 ccl: Add integer overflow checks.
30569699
PE
19059 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19060 (IN_INT_RANGE): New macros.
19061 (ccl_driver): Use them to check for integer overflow when
19062 decoding a CCL program. Many of the new checks are whether XINT (x)
19063 fits in int; it doesn't always, on 64-bit hosts. The new version
19064 doesn't catch all possible integer overflows, but it's an
847044ea 19065 improvement. (Bug#8719)
30569699 19066
c11285dc
PE
19067 * alloc.c (make_event_array): Use XINT, not XUINT.
19068 There's no need for unsigned here.
19069
fdccd48e
PE
19070 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19071 This follows up to the 2011-05-06 change that substituted uintptr_t
19072 for EMACS_INT. This case wasn't caught back then.
19073
37910ab2
PE
19074 Rework Fformat to avoid integer overflow issues.
19075 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19076 now (part of C89). Include <verify.h>.
19077 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19078 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19079 (Fformat): Avoid the prepass trying to compute sizes; it was only
19080 approximate and thus did not catch overflow reliably. Instead, walk
19081 through the format just once, formatting and computing sizes as we go,
19082 checking for integer overflow at every step, and allocating a larger
19083 buffer as needed. Keep track separately whether the format is
19084 multibyte. Keep only the most-recently calculated precision, rather
19085 than them all. Record whether each argument has been converted to
19086 string. Use EMACS_INT, not int, for byte and char and arg counts.
19087 Support field widths and precisions larger than INT_MAX. Avoid
19088 sprintf's undefined behavior with conversion specifications such as %#d
19089 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19090 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19091 formatting out-of-range floating point numbers with int
9173deec 19092 formats. (Bug#8668)
37910ab2 19093
2e6578fb
PE
19094 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19095
0ae6bdee
PE
19096 * data.c: Avoid integer truncation in expressions involving floats.
19097 * data.c: Include <intprops.h>.
19098 (arith_driver): When there's an integer overflow in an expression
19099 involving floating point, convert the integers to floating point
19100 so that the resulting value does not suffer from catastrophic
19101 integer truncation. For example, on a 64-bit host (* 4
19102 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19103 Do not rely on undefined behavior after integer overflow.
19104
de883a70
PE
19105 merge count_size_as_multibyte, parse_str_to_multibyte
19106 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 19107 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
19108 Check for integer overflow.
19109 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19110 since it's now a duplicate of the other. This is more of
19111 a character than a buffer op, so better that it's in character.c.
19112 * fns.c, print.c: Adjust to above changes.
19113
2ff916cb
PE
191142011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19115
19116 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19117
f1b54466
PE
191182011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19119
fb1ac845
PE
19120 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19121 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19122 (x_clipboard_manager_save): Now static.
19123 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19124
f1b54466
PE
19125 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19126 (crypto_hash_function): Now static.
19127 Fix pointer signedness problems. Avoid unnecessary initializations.
19128
a9f737ee
CY
191292011-05-27 Chong Yidong <cyd@stupidchicken.com>
19130
19131 * termhooks.h (Vselection_alist): Make it terminal-local.
19132
19133 * terminal.c (create_terminal): Initialize it.
19134
19135 * xselect.c: Support for clipboard managers.
19136 (Vselection_alist): Move to termhooks.h as terminal-local var.
19137 (LOCAL_SELECTION): New macro.
19138 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19139 (symbol_to_x_atom): Remove gratuitous arg.
19140 (x_handle_selection_request, lisp_data_to_selection_data)
19141 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
19142 (x_own_selection, x_get_local_selection, x_convert_selection):
19143 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
19144 (some_frame_on_display): Delete unused function.
19145 (Fx_own_selection_internal, Fx_get_selection_internal)
19146 (Fx_disown_selection_internal, Fx_selection_owner_p)
19147 (Fx_selection_exists_p): New optional frame arg.
19148 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19149 (x_handle_selection_clear): Don't treat other terminals with the
19150 same keyboard specially. Use the terminal-local Vselection_alist.
19151 (x_clear_frame_selections): Use Frun_hook_with_args.
19152
19153 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19154
19155 * xterm.h: Add support for those atoms.
19156
e067f0c1
CY
191572011-05-26 Chong Yidong <cyd@stupidchicken.com>
19158
19159 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19160 (converted_selections, conversion_fail_tag): New global variables.
19161 (x_selection_request_lisp_error): Free the above.
19162 (x_get_local_selection): Remove unnecessary code.
19163 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
19164 of converted selections stored in converted_selections.
19165 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
19166 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19167 (x_convert_selection): New function.
19168 (x_handle_selection_event): Simplify.
19169 (x_get_foreign_selection): Don't ignore incoming requests while
19170 waiting for an answer; this will fail when we implement
19171 SAVE_TARGETS, and seems unnecessary anyway.
19172 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19173 (Vx_sent_selection_functions): Doc fix.
19174
0f4aebc0
LL
191752011-05-26 Leo Liu <sdl.web@gmail.com>
19176
19177 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19178
e61124cd
YM
191792011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19180
19181 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19182
19183 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19184 for fringe update if it has periodic bitmap.
ac389d0c 19185 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
19186 and fringe_bitmap_periodic_p.
19187
19188 * fringe.c (get_fringe_bitmap_data): New function.
19189 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19190 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19191 row. Mark glyph row for fringe update if periodicity changed.
19192
19193 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19194 for fringe update unless it has periodic bitmap.
19195
f16d9837
KH
191962011-05-25 Kenichi Handa <handa@m17n.org>
19197
19198 * xdisp.c (get_next_display_element): Set correct it->face_id for
19199 a static composition.
19200
e1b90ef6
LL
192012011-05-24 Leo Liu <sdl.web@gmail.com>
19202
19203 * deps.mk (fns.o):
19204 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19205
19206 * fns.c (crypto_hash_function, Fsha1): New function.
19207 (Fmd5): Use crypto_hash_function.
19208 (syms_of_fns): Add Ssha1.
19209
7400048f
PE
192102011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19211
19212 * gnutls.c: Remove unused macros.
19213 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19214 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19215 Remove macros that are defined and never used.
19216 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19217
abb71cf4
CY
192182011-05-22 Chong Yidong <cyd@stupidchicken.com>
19219
19220 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19221 (Fx_get_selection_internal): Minor cleanup.
19222 (Fx_own_selection_internal): Rename arguments for consistency with
19223 select.el.
19224
6307db39
PE
192252011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19226
19227 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19228
f3d4e0a4
CY
192292011-05-22 Chong Yidong <cyd@stupidchicken.com>
19230
19231 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19232
4d8ade89
YM
192332011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19234
19235 * dispnew.c (scrolling_window): Don't exclude the case that the
19236 last enabled row in the desired matrix touches the bottom boundary.
19237
32078c8d
GM
192382011-05-21 Glenn Morris <rgm@gnu.org>
19239
19240 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
19241 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19242 and add some more files.
32078c8d 19243
7285dc67
EZ
192442011-05-20 Eli Zaretskii <eliz@gnu.org>
19245
19246 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19247 report_file_error introduced by the change from 2011-05-07.
19248
89d1bd22
PE
192492011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19250
19251 * systime.h (Time): Define only if emacs is defined.
19252 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19253 where the include path doesn't have X11/X.h by default. See
19254 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19255
cd394be1 192562011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
19257
19258 * composite.c (find_automatic_composition): Fix previous change.
19259
b9704ad9
GM
192602011-05-20 Glenn Morris <rgm@gnu.org>
19261
19262 * lisp.mk: New file, split from Makefile.in.
19263 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19264 (shortlisp): Remove.
19265 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19266
4a720484
GM
192672011-05-19 Glenn Morris <rgm@gnu.org>
19268
19269 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19270 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19271 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19272 (lisp): Set the order to that of loadup.el.
19273 (shortlisp): Make it a copy of $lisp.
19274 (SOME_MACHINE_LISP): Remove.
19275 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19276 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19277
a28d4396
KH
192782011-05-18 Kenichi Handa <handa@m17n.org>
19279
19280 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19281 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19282 (find_automatic_composition): Mostly rewrite for efficiency.
19283
a2b1fa8e
JB
192842011-05-18 Juanma Barranquero <lekktu@gmail.com>
19285
19286 * makefile.w32-in: Update dependencies.
19287
8e1f5610
CS
192882011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19289
19290 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19291 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19292
7025ee00 192932011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19294
cdfa6eab
PE
19295 Fix some integer overflow issues, such as string length overflow.
19296
06d6db33
PE
19297 * insdel.c (count_size_as_multibyte): Check for string overflow.
19298
2b4560a8
PE
19299 * character.c (lisp_string_width): Check for string overflow.
19300 Use EMACS_INT, not int, for string indexes and lengths; in
19301 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19302 the resulting string length overflows an EMACS_INT; instead,
19303 report a string overflow if no precision given. When checking for
19304 precision exhaustion, use a check that cannot possibly have
19305 integer overflow. (Bug#8675)
19306 * character.h (lisp_string_width): Adjust to new signature.
19307
cb93f9be
PE
19308 * alloc.c (string_overflow): New function.
19309 (Fmake_string): Use it. This doesn't change behavior, but saves
19310 a few bytes and will simplify future changes.
19311 * character.c (string_escape_byte8): Likewise.
19312 * lisp.h (string_overflow): New decl.
19313
1a1f3366
PE
19314 Fixups, following up to the user-interface timestamp change.
19315 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19316 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19317 * msdos.c (mouse_get_pos): Likewise.
19318 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19319 * w32gui.h (Time): Define by including "systime.h" rather than by
19320 declaring it ourselves. (Bug#8664)
19321
d4e3e4d3
PE
19322 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19323 * image.c (clear_image_cache): Likewise.
19324
f6a24d19
PE
19325 * term.c (term_mouse_position): Don't assume time_t wraparound.
19326
08dc5ae6
PE
19327 Be more systematic about user-interface timestamps.
19328 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19329 and sometimes 'EMACS_UINT', to represent these timestamps.
19330 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19331 This makes the code easier to follow, and makes it easier to catch
19332 integer overflow bugs such as Bug#8664.
19333 * frame.c (Fmouse_position, Fmouse_pixel_position):
19334 Use Time, not unsigned long, for user-interface timestamps.
19335 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19336 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19337 * keyboard.h (last_event_timestamp): Likewise.
19338 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19339 * menu.h (xmenu_show): Likewise.
19340 * term.c (term_mouse_position): Likewise.
19341 * termhooks.h (struct input_event.timestamp): Likewise.
19342 (struct terminal.mouse_position_hook): Likewise.
19343 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19344 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19345 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19346 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19347 what it was before.
19348 * menu.h, termhooks.h: Include "systime.h", for Time.
19349
8e55734a
PE
19350 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19351 Don't assume that the difference between two unsigned long values
19352 can fit into an integer. At this point, we know button_down_time
19353 <= event->timestamp, so the difference must be nonnegative, so
19354 there's no need to cast the result if double-click-time is
19355 nonnegative, as it should be; check that it's nonnegative, just in
19356 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19357 apart (about 25 days). (Bug#8664)
8e55734a 19358
841f1b75 19359 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 19360 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 19361
3e26f69c
PE
19362 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19363 that always fit in int. Use a sentinel instead of a counter, to
19364 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
19365 * frame.h (struct frame): Use int for menu_bar_items_used
19366 instead of EMACS_INT, since it always fits in int.
3e26f69c 19367
5cc152c0
PE
19368 * menu.c (grow_menu_items): Check for int overflow.
19369
d89eb65e
PE
19370 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19371
5235bd3e
PE
19372 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19373 Before, the code was not consistent. These values cannot exceed
19374 2**31 - 1 so there's no need to make them unsigned.
19375 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19376 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19377 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19378 as modifiers.
19379 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19380
bc827e23
PE
19381 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19382 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19383 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19384 presumably because the widths might not match.
19385
78eb494e
PE
19386 * window.c (size_window): Avoid needless test at loop start.
19387
04f2d78b
CB
193882011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19389
19390 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19391
d2fc7e3d 193922011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
19393
19394 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19395
d2fc7e3d 193962011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
19397
19398 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19399 `width' to `bar_area_x' and `bar_area_width', respectively.
19400 (x_scroll_run): Take account of fringe background extension.
19401
04f2d78b
CB
19402 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19403 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
19404 `bar_area_width', respectively.
19405 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19406 background extension.
19407
79b70037
GM
194082011-05-10 Jim Meyering <meyering@redhat.com>
19409
19410 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19411
2f142cc5
JB
194122011-05-10 Juanma Barranquero <lekktu@gmail.com>
19413
19414 * image.c (Finit_image_library): Return t for built-in image types,
19415 like pbm and xbm. (Bug#8640)
19416
57679c86
AS
194172011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19418
19419 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19420
888c9e86
EZ
194212011-05-07 Eli Zaretskii <eliz@gnu.org>
19422
b0512a1d
EZ
19423 * w32console.c (Fset_screen_color): Doc fix.
19424 (Fget_screen_color): New function.
19425 (syms_of_ntterm): Defsubr it.
19426
7285dc67
EZ
19427 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19428 unlink the temporary file if Fcall_process didn't create it in the
19429 first place.
19430 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19431 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
19432 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19433 cue to call_process_cleanup not to close that handle.
19434
4d3fcc8e
BK
194352011-05-07 Ben Key <bkey76@gmail.com>
19436
19437 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19438 one of two shell specific rules, either bootstrap-temacs-CMD or
19439 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19440 to the previous implementation of the bootstrap-temacs rule.
19441 The bootstrap-temacs-CMD rule is similar to the previous
19442 implementation of the bootstrap-temacs rule except that it
19443 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19444 variable.
19445
19446 These changes, along with some changes to nt/configure.bat,
19447 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19448 earlier fix to add support for --cflags and --ldflags options
19449 that include quotes so that it works whether make uses cmd or
19450 sh as the shell.
19451
b4289b64
MA
194522011-05-06 Michael Albinus <michael.albinus@gmx.de>
19453
19454 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19455 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19456 is a constant.
19457 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19458 a string. Handle both cases.
19459 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19460 (Fdbus_register_method): Use Qinvalid_function.
19461
af4c0e28
JB
194622011-05-06 Juanma Barranquero <lekktu@gmail.com>
19463
19464 * makefile.w32-in: Update dependencies.
19465 (LISP_H): Add inttypes.h and stdin.h.
19466 (PROCESS_H): Add unistd.h.
19467
c51453d9
EZ
194682011-05-06 Eli Zaretskii <eliz@gnu.org>
19469
19470 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19471 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19472
8ff0ac3c 194732011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 19474
4c4b566b
PE
19475 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19476
aab2b9b5
PE
19477 * term.c (vfatal): Remove stray call to va_end.
19478 It's not needed and the C Standard doesn't allow it here anyway.
19479
c378da0b
PE
19480 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19481 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19482
288b08c7
PE
19483 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19484 bytes.
19485
e3601888
PE
19486 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19487
db6c0e74
PE
19488 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19489
dd5963ea
PE
19490 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19491
88c9450f
PE
19492 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19493
2f9442b8
PE
19494 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19495
c032b5f8
PE
19496 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19497 * charset.c (Fdefine_charset_internal): Don't initialize
19498 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 19499 32-bit int (Bug#8600).
a108c10b
PE
19500
19501 * lread.c (read_integer): Be more consistent with string-to-number.
19502 Use string_to_number to do the actual conversion; this avoids
19503 rounding errors and fixes some other screwups. Without this fix,
19504 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19505 (digit_to_number): Move earlier, for benefit of read_integer.
19506 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 19507 not a digit in any supported base. (Bug#8602)
a108c10b 19508
ad5f9eea
PE
19509 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19510
aec1708a
PE
19511 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19512 to match comment at start of function. This also removes a
19513 GCC warning about overflow in a 32+64-bit port.
19514
47be4ab5
PE
19515 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19516
371cac43
PE
19517 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19518 Reported by Stefan Monnier in
19519 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
19520 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19521 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 19522
d01a7826
PE
19523 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19524 (EMACS_UINTPTR): Likewise, with uintptr_t.
19525
7fd47d5c
PE
19526 * lisp.h: Prefer 64-bit EMACS_INT if available.
19527 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19528 on 32-bit hosts that have 64-bit int, so that they can access
19529 large files.
122b0c86
PE
19530 However, temporarily disable this change unless the temporary
19531 symbol WIDE_EMACS_INT is defined.
7fd47d5c 19532
8727937b
PE
19533 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19534
8ac068ac
PE
19535 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19536 This removes an assumption that EMACS_INT and long are the same
19537 width as pointers. The assumption is true for Emacs porting targets
19538 now, but we want to make other targets possible.
19539 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19540 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19541 In the rest of the code, change types of integers that hold casted
19542 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19543 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19544 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19545 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19546 No need to cast type when ORing.
19547 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19548 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19549 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19550 assume EMACS_INT is the same width as char *.
19551 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19552 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19553 Remove no-longer-needed casts.
19554 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19555 (xg_tool_bar_help_callback, xg_make_tool_item):
19556 Use EMACS_INTPTR to hold an integer
19557 that will be cast to void *; this can avoid a GCC warning
19558 if EMACS_INT is not the same width as void *.
19559 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19560 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19561 (current_message_1, set_message_1):
19562 Use a local to convert to proper width without a cast.
19563 * xmenu.c (dialog_selection_callback): Likewise.
19564
ede49d71
PE
19565 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19566 Also, don't assume VALBITS / RAND_BITS is less than 5,
19567 and don't rely on undefined behavior when shifting a 1 left into
19568 the sign bit.
19569 * lisp.h (get_random): Change signature to match.
19570
2f30ecd0
PE
19571 * lread.c (hash_string): Use size_t, not int, for hash computation.
19572 Normally we prefer signed values; but hashing is special, because
19573 it's better to use unsigned division on hash table sizes so that
19574 the remainder is nonnegative. Also, size_t is the natural width
19575 for hashing into memory. The previous code used 'int', which doesn't
19576 retain enough info to hash well into very large tables.
19577 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19578
2a866e7b
PE
19579 * dbusbind.c: Don't possibly lose pointer info when converting.
19580 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19581 Use XPNTR rather than XHASH, so that the high-order bits of
19582 the pointer aren't lost when converting through void *.
19583
51639eac
PE
19584 * eval.c (Fautoload): Don't double-shift a pointer.
19585
92394119
PE
19586 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19587
dbdb9a7c
JB
195882011-05-06 Juanma Barranquero <lekktu@gmail.com>
19589
19590 * gnutls.c (DEF_GNUTLS_FN):
19591 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19592
db7a0b4f
AS
195932011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19594
19595 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19596 marker. (Bug#8610)
19597
cd394be1 195982011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19599
19600 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19601 New version that can reserve upto 2GB of heap space.
19602
f7ff1b0f 196032011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19604
19605 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19606
639c109b
TZ
196072011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19608
19609 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19610 `gnutls_certificate_set_x509_key_file'.
19611
d2127135
JB
196122011-05-05 Juanma Barranquero <lekktu@gmail.com>
19613
19614 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19615 Update dependencies.
19616
e968f4f3
JB
196172011-05-04 Juanma Barranquero <lekktu@gmail.com>
19618
19619 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
19620 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
19621 Remove unused parameter `fildes'.
19622 * process.c (read_process_output, send_process): Don't pass it.
19623
84d358f0
JB
196242011-05-04 Juanma Barranquero <lekktu@gmail.com>
19625
19626 Fix previous change: the library cache is defined in w32.c.
19627 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
19628 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
19629
0898ca10
JB
196302011-05-04 Juanma Barranquero <lekktu@gmail.com>
19631
19632 Implement dynamic loading of GnuTLS on Windows.
19633
19634 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
19635 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
19636 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19637 Declare.
19638
19639 * gnutls.c (Qgnutls_dll): Define.
19640 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
19641 (gnutls_*): Declare function pointers.
19642 (init_gnutls_functions): New function to initialize function pointers.
19643 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
19644 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
19645 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
19646 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
19647 (emacs_gnutls_write, emacs_gnutls_read)
19648 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
19649 (Fgnutls_available_p): New function.
19650 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
19651 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
19652 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
19653
19654 * image.c: Include w32.h.
19655 (Vimage_type_cache): Delete.
19656 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
19657 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
19658 (w32_delayed_load): Move to w32.c.
19659
19660 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
19661
19662 * w32.c (QCloaded_from, Vlibrary_cache): Define.
19663 (w32_delayed_load): Move from image.c. When loading a library, record
19664 its filename in the :loaded-from property of the library id.
19665 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
19666 Initialize and staticpro them.
19667 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
19668
19669 * process.c: Include lisp.h before w32.h, not after.
19670 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
19671 instead of gnutls_record_check_pending.
19672
19673 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
19674
ff4de4aa
TZ
196752011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
19676
19677 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
19678 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
19679 as passed in.
19680
abe95abb
JD
196812011-05-03 Jan Djärv <jan.h.d@swipnet.se>
19682
19683 * xterm.c (x_set_frame_alpha): Do not set property on anything
19684 else than FRAME_X_OUTER_WINDOW (Bug#8608).
19685
e16e55d4
JB
196862011-05-02 Juanma Barranquero <lekktu@gmail.com>
19687
19688 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
19689
bafcf6a5
JB
196902011-05-02 Juanma Barranquero <lekktu@gmail.com>
19691
19692 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
19693 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
19694 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
19695 (gnutls_global_initialized, Qgnutls_bootprop_priority)
19696 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
19697 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
19698 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
19699 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
19700 (Qgnutls_bootprop_callbacks_verify): Make static.
19701
e7a6747f
AS
197022011-05-01 Andreas Schwab <schwab@linux-m68k.org>
19703
19ed11ba
AS
19704 * callproc.c: Indentation fixup.
19705
e7a6747f 19706 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
19707 (wait_for_termination, interruptible_wait_for_termination):
19708 Move after wait_for_termination_1.
e7a6747f 19709
1ef14cb4
LMI
197102011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
19711
19712 * sysdep.c (interruptible_wait_for_termination): New function
19713 which is like wait_for_termination, but allows keyboard
19714 interruptions.
19715
19716 * callproc.c (Fcall_process): Add (:file "file") as an option for
19717 the STDOUT buffer.
19718 (Fcall_process_region): Ditto.
19719
330d880c
EZ
197202011-04-30 Eli Zaretskii <eliz@gnu.org>
19721
8db90b73
EZ
19722 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
19723 rather than `XVECTOR (FOO)->size'.
19724
330d880c
EZ
19725 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
19726 inttypes.h, as a gnulib replacement is used if it not available in
19727 system headers.
19728
15cbd324
EZ
197292011-04-21 Eli Zaretskii <eliz@gnu.org>
19730
19731 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
19732 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
19733 of MOST_POSITIVE_FIXNUM. (Bug#8528)
19734
19735 * coding.c (coding_alloc_by_realloc): Error out if destination
19736 will grow beyond MOST_POSITIVE_FIXNUM.
19737 (decode_coding_emacs_mule): Abort if there isn't enough place in
19738 charbuf for the composition carryover bytes. Reserve an extra
19739 space for up to 2 characters produced in a loop.
19740 (decode_coding_iso_2022): Abort if there isn't enough place in
19741 charbuf for the composition carryover bytes.
19742
197432011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 19744
ae940cca
EZ
19745 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
19746 aborting when %lld or %lll format is passed.
19747 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
19748 %llo or %llx format is passed. (Bug#8545)
19749
03ab8921
EZ
19750 * window.c (window_scroll_line_based): Use a marker instead of
19751 simple variables to record original value of point. (Bug#7952)
19752
afda1437
EZ
19753 * doprnt.c (doprnt): Fix the case where a multibyte sequence
19754 produced by %s or %c overflows available buffer space. (Bug#8545)
19755
f76dee0c
PE
197562011-04-28 Paul Eggert <eggert@cs.ucla.edu>
19757
19758 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 19759 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 19760
fdc5744d
JB
197612011-04-28 Juanma Barranquero <lekktu@gmail.com>
19762
19763 * w32.c (init_environment): Warn about defaulting HOME to C:\.
19764
638f053a
JB
197652011-04-28 Juanma Barranquero <lekktu@gmail.com>
19766
19767 * keyboard.c (Qdelayed_warnings_hook): Define.
19768 (command_loop_1): Run `delayed-warnings-hook'
19769 if Vdelayed_warnings_list is non-nil.
19770 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
19771 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
19772
d178f871
EZ
197732011-04-28 Eli Zaretskii <eliz@gnu.org>
19774
19775 * doprnt.c (doprnt): Don't return value smaller than the buffer
19776 size if the message was truncated. (Bug#8545).
19777
b124fd93
JB
197782011-04-28 Juanma Barranquero <lekktu@gmail.com>
19779
19780 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
19781 (Fx_window_property): #if-0 the whole functions, not just the bodies.
19782
e810457d
PE
197832011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19784
19785 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
19786
ea51cceb
JB
197872011-04-27 Juanma Barranquero <lekktu@gmail.com>
19788
19789 * makefile.w32-in: Update dependencies.
19790
94dcfacf
EZ
197912011-04-27 Eli Zaretskii <eliz@gnu.org>
19792
19793 Improve `doprnt' and its usage. (Bug#8545)
19794 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
19795 `format_end'. Remove support for %l as a conversion specifier.
19796 Don't use xrealloc. Improve diagnostics when the %l size modifier
19797 is used. Update the commentary.
19798
19799 * eval.c (verror): Simplify calculation of size_t.
19800
19801 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
19802 messages.
19803
f61f41d7
PE
198042011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
19805
19806 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
19807 change.
19808
96fb4434
PE
198092011-04-27 Paul Eggert <eggert@cs.ucla.edu>
19810
19811 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
19812 This makes this file independent of the recent pseudovector change.
19813
671875da 198142011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 19815
69e9b5a3
PE
19816 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
19817
b5f869a7 19818 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 19819 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 19820 Remove unused local.
c8926152 19821 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 19822
841a1577 19823 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
19824 GCC 4.6.0 optimizes based on type-based alias analysis.
19825 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
19826 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
19827 != &v->size, and therefore "v->size = 1; b->size = 2; return
19828 v->size;" must therefore return 1. This assumption is incorrect
19829 for Emacs, since it type-puns struct Lisp_Vector * with many other
19830 types. To fix this problem, this patch adds a new type struct
f904488f 19831 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
19832 and pseudovectors, and helps optimizing compilers not get fooled
19833 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
19834 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
19835 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
19836 the size member.
eab3844f
PE
19837 (XSETPVECTYPE): Rewrite in terms of new macro.
19838 (XSETPVECTYPESIZE): New macro, specifying both type and size.
19839 This is a bit clearer, and further avoids the possibility of
19840 undesirable aliasing.
19841 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 19842 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
19843 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
19844 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
19845 (ASIZE): Now uses header.size rather than size.
19846 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
19847 to avoid the hassle of writing XVECTOR (foo)->header.size.
19848 (struct vectorlike_header): New type.
eab3844f
PE
19849 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
19850 object, to help avoid aliasing.
19851 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
19852 (SUBRP): Likewise, since Lisp_Subr is a special case.
19853 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
19854 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
19855 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 19856 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
19857 changed to be "header.size" and "header.next".
19858 * buffer.h (struct buffer): Likewise.
19859 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
19860 * frame.h (struct frame): Likewise.
19861 * process.h (struct Lisp_Process): Likewise.
19862 * termhooks.h (struct terminal): Likewise.
19863 * window.c (struct save_window_data, struct saved_window): Likewise.
19864 * window.h (struct window): Likewise.
19865 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
19866 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
19867 * buffer.c (init_buffer_once): Likewise.
19868 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
19869 special case.
19870 * process.c (Fformat_network_address): Use local var for size,
19871 for brevity.
19872
0df1eac5
PE
19873 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
19874
847ab9d1 19875 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
19876 * data.c (atof): Remove decl; no longer used or needed.
19877 (digit_to_number): Move to lread.c.
19878 (Fstring_to_number): Use new string_to_number function, to be
19879 consistent with how the Lisp reader treats infinities and NaNs.
19880 Do not assume that floating-point numbers represent EMACS_INT
19881 without losing information; this is not true on most 64-bit hosts.
19882 Avoid double-rounding errors, by insisting on integers when
19883 parsing non-base-10 numbers, as the documentation specifies.
19884 * lisp.h (string_to_number): New decl, replacing ...
19885 (isfloat_string): Remove.
bc0a5c13 19886 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 19887 (read1): Do not accept +. and -. as integers; this
452f4150
PE
19888 appears to have been a coding error. Similarly, do not accept
19889 strings like +-1e0 as floating point numbers. Do not report
19890 overflow for integer overflows unless the base is not 10 which
19891 means we have no simple and reliable way to continue.
19892 Break out the floating-point parsing into a new
19893 function string_to_number, so that Fstring_to_number parses
19894 floating point numbers consistently with the Lisp reader.
04f2d78b 19895 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
19896 (E_CHAR, EXP_INT): Remove, replacing with ...
19897 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
19898 (string_to_number): New function, replacing isfloat_string.
19899 This function checks for valid syntax and produces the resulting
19900 Lisp float number too. Rework it so that string-to-number
bc0a5c13 19901 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
19902 so that overflow for non-base-10 numbers is reported only when
19903 there's no portable and simple way to convert to floating point.
452f4150 19904
67769ffc
PE
19905 * textprop.c (set_text_properties_1): Rewrite for clarity,
19906 and to avoid GCC warning about integer overflow.
19907
c20db43f
PE
19908 * intervals.h (struct interval): Use EMACS_INT for members
19909 where EMACS_UINT might cause problems. See
19910 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
19911 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
19912 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
19913 All uses changed.
37aa2f85
PE
19914 (offset_intervals): Tell GCC not to worry about length overflow
19915 when negating a negative length.
c20db43f 19916
2538aa2f
PE
19917 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
19918 (overrun_check_free): Likewise.
19919
f2d3008d
PE
19920 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
19921 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
19922 word size.
19923
ec8df744
PE
19924 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19925 (gnutls_make_error): Rename local to avoid shadowing.
19926 (gnutls_emacs_global_deinit): ifdef out; not used.
19927 (Fgnutls_boot): Use const for pointer to readonly storage.
19928 Comment out unused local. Fix pointer signedness problems.
19929
640ee02d
PE
19930 * lread.c (openp): Don't stuff size_t into an 'int'.
19931 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
19932 about possible signed overflow.
19933
6048fb2a
PE
19934 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
19935 (GDK_KEY_g): Don't define if already defined.
19936 (xg_prepare_tooltip): Avoid pointer signedness problem.
19937 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
19938
fa3c87e1
PE
19939 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
19940 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
19941
2172544b
PE
19942 * xfns.c (Fx_window_property): Simplify a bit,
19943 to make a bit faster and to avoid GCC 4.6.0 warning.
19944 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
19945
9b821a21
PE
19946 * fns.c (internal_equal): Don't assume size_t fits in int.
19947
3c616cfa
PE
19948 * alloc.c (compact_small_strings): Tighten assertion a little.
19949
c2982e87
PE
19950 Replace pEd with more-general pI, and fix some printf arg casts.
19951 * lisp.h (pI): New macro, generalizing old pEd macro to other
19952 conversion specifiers. For example, use "...%"pI"d..." rather
19953 than "...%"pEd"...".
19954 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 19955 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
19956 * alloc.c (check_pure_size): Don't overflow by converting size to int.
19957 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
19958 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
19959 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
19960 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
19961 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
19962 64-bit hosts.
19963 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
19964 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
19965 * print.c (safe_debug_print, print_object): Likewise.
19966 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
19967 to int.
6f04d126
PE
19968 Use pI instead of if-then-else-abort. Use %p to avoid casts,
19969 avoiding the 0 flag, which is not portable.
c2982e87
PE
19970 * process.c (Fmake_network_process): Use pI to avoid cast.
19971 * region-cache.c (pp_cache): Likewise.
19972 * xdisp.c (decode_mode_spec): Likewise.
19973 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
19974 behavior on 64-bit hosts with printf arg.
6f04d126 19975 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
19976 (x_stop_queuing_selection_requests): Likewise.
19977 (x_get_window_property): Don't truncate byte count to an 'int'
19978 when tracing.
0b432f21 19979
5e073ec7
PE
19980 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
19981 here, since it parses constructs like leading '-' and spaces,
19982 which are not wanted; and it overflows with large numbers.
19983 Instead, simply match F[0-9]+, which is what is wanted anyway.
19984
36372bf9
PE
19985 * alloc.c: Remove unportable assumptions about struct layout.
19986 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
19987 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
19988 (allocate_vectorlike, make_pure_vector): Use the new macros,
19989 plus offsetof, to remove unportable assumptions about struct layout.
19990 These assumptions hold on all porting targets that I know of, but
19991 they are not guaranteed, they're easy to remove, and removing them
19992 makes further changes easier.
19993
0b432f21
PE
19994 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
19995 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
19996 (string_overrun_cookie): Now const. Use initializers that
19997 don't formally overflow signed char, to avoid warnings.
000098c1
PE
19998 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
19999 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
20000 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20001 multiple of sizeof (EMACS_INT); it need not be, if
20002 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 20003 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 20004
895009e1
JB
200052011-04-26 Juanma Barranquero <lekktu@gmail.com>
20006
20007 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20008
6a7a1b0b
TZ
200092011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20010
20011 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 20012 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
20013 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20014
841a1577 200152011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
20016
20017 * lisp.h (Qdebug): List symbol.
895009e1 20018 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
20019 * keyboard.c (debug-on-event): New variable.
20020 (handle_user_signal): Break into debugger when debug-on-event
20021 matches the current signal symbol.
20022
f2d3ba6f
DN
200232011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20024
20025 * alloc.c (check_sblock, check_string_bytes)
20026 (check_string_free_list): Convert to standard C.
20027
42ce4c63
TZ
200282011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20029
20030 * w32.c (emacs_gnutls_push): Fix typo.
20031
825cd63c
EZ
200322011-04-25 Eli Zaretskii <eliz@gnu.org>
20033
fb11d64d
EZ
20034 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20035 "cast to pointer from integer of different size".
20036
825cd63c
EZ
20037 Improve doprnt and its use in verror. (Bug#8545)
20038 * doprnt.c (doprnt): Document the set of format control sequences
20039 supported by the function. Use SAFE_ALLOCA instead of always
20040 using `alloca'.
20041
20042 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20043 is one byte too soon. Don't use xrealloc; instead xfree and
20044 xmalloc anew.
20045
e061a11b
TZ
200462011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20047
20048 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20049 callbacks stage.
20050
20051 * gnutls.c: Renamed global_initialized to
20052 gnutls_global_initialized. Added internals for the
20053 :verify-hostname-error, :verify-error, and :verify-flags
20054 parameters of `gnutls-boot' and documented those parameters in the
20055 docstring. Start callback support.
9173deec
JB
20056 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20057 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20058 on error. Return error code.
e061a11b
TZ
20059 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20060 (emacs_gnutls_read): Likewise.
20061 (Fgnutls_boot): Return handshake error code.
20062 (emacs_gnutls_handle_error): New function.
20063 (wsaerror_to_errno): Likewise.
20064
20065 * w32.h (emacs_gnutls_pull): Add prototype.
20066 (emacs_gnutls_push): Likewise.
20067
20068 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20069 (emacs_gnutls_push): Likewise.
20070
200712011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20072
20073 * process.c (wait_reading_process_output): Check if GnuTLS
20074 buffered some data internally if no FDs are set for TLS
20075 connections.
20076
20077 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20078 (LIBS): Link to USER_LIBS.
20079 ($(BLD)/gnutls.$(0)): New target.
20080
fa6996bc
EZ
200812011-04-24 Eli Zaretskii <eliz@gnu.org>
20082
eb35682e
EZ
20083 * xdisp.c (handle_single_display_spec): Rename the
20084 display_replaced_before_p argument into display_replaced_p, to
20085 make it consistent with the commentary. Fix typos in the
20086 commentary.
20087
e2ad650c
EZ
20088 * textprop.c (syms_of_textprop): Remove dead code.
20089 (copy_text_properties): Delete obsolete commentary about an
20090 interface that was deleted long ago. Fix typos in the description
20091 of arguments.
20092
1b2de274
EZ
20093 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20094 to changes in oldXMenu/XMenu.h from 2011-04-16.
20095 <menu_help_message, prev_menu_help_message>: Constify.
20096 (IT_menu_make_room): menu->help_text is now `const char **';
20097 adjust.
20098
20099 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20100 to changes in oldXMenu/XMenu.h from 2011-04-16.
20101 (struct XMenu): Declare `help_text' `const char **'.
20102
20103 * xfaces.c <Qunspecified>: Make extern again.
20104
20105 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 20106 required by POSIX.
1b2de274 20107
762b15be
EZ
20108 * doc.c (get_doc_string): Improve the format passed to `error'.
20109
20110 * doprnt.c (doprnt): Improve commentary.
20111
20112 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20113
20114 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20115 them with etags.
20116
f1052e5d
EZ
20117 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20118 changes in globals.h immediately force recompilation.
762b15be
EZ
20119 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20120 $(CURDIR)/s/ms-w32.h.
20121 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 20122
fa6996bc
EZ
20123 * character.c (Fchar_direction): Function deleted.
20124 (syms_of_character): Don't defsubr it.
20125 <char-direction-table>: Deleted.
20126
e6c3da20
EZ
201272011-04-23 Eli Zaretskii <eliz@gnu.org>
20128
20129 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20130 * doprnt.c: Include limits.h.
20131 (SIZE_MAX): New macro.
04f2d78b
CB
20132 (doprnt): Return a size_t value. 2nd arg is now size_t.
20133 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
20134 Improve overflow protection. Support `l' modifier for integer
20135 conversions. Support %l conversion. Don't assume an EMACS_INT
20136 argument for integer conversions and for %c.
20137
20138 * lisp.h (doprnt): Restore prototype.
20139
20140 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20141 $(SRC)/character.h.
20142
20143 * Makefile.in (base_obj): Add back doprnt.o.
20144
20145 * deps.mk (doprnt.o): Add back prerequisites.
20146 (callint.o): Depend on character.h.
20147
20148 * eval.c (internal_lisp_condition_case): Include the handler
20149 representation in the error message.
20150 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20151 when breaking from the loop.
20152
20153 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20154
20155 * callint.c (Fcall_interactively): When displaying error message
20156 about invalid control letter, pass the character's codepoint, not
20157 a pointer to its multibyte form. Improve display of the character
20158 in octal and display also its hex code.
20159
20160 * character.c (char_string): Use %x to display the (unsigned)
20161 codepoint of an invalid character, to avoid displaying a bogus
20162 negative value.
20163
20164 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20165 `error', not SYMBOL_NAME itself.
20166
20167 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20168 character arguments to `error'.
20169
20170 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20171 to `error' in error message about FINAL_CHAR argument. Make sure
20172 FINAL_CHAR is a character, and use %c when it is passed as
20173 argument to `error'.
20174
4ffd0d6b 201752011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
20176
20177 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20178
20179 * w32.c: Include <time.h>.
20180 (sys_localtime): New function.
20181
4ffd0d6b 201822011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
20183
20184 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20185
4ffd0d6b 20186 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 20187
4ffd0d6b 201882011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 20189
4ffd0d6b
GM
20190 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20191 zombies (Bug#8467).
aac0c6e3 20192
04c56954
EZ
201932011-04-19 Eli Zaretskii <eliz@gnu.org>
20194
20195 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20196 gl_state.e_property when gl_state.object is Qt.
20197
20198 * insdel.c (make_gap_larger): Remove limitation of buffer size
20199 to <= INT_MAX.
20200
16a43933
CY
202012011-04-18 Chong Yidong <cyd@stupidchicken.com>
20202
20203 * xdisp.c (lookup_glyphless_char_display)
20204 (produce_glyphless_glyph): Handle cons cell entry in
20205 glyphless-char-display.
20206 (Vglyphless_char_display): Document it.
20207
20208 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20209 glyphless-char-display.
20210
4581706e
CY
202112011-04-17 Chong Yidong <cyd@stupidchicken.com>
20212
20213 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20214
20215 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20216
20217 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20218 definition for no-X builds.
20219
4887c6e2 202202011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 20221
fd35b6f9
PE
20222 Static checks with GCC 4.6.0 and non-default toolkits.
20223
5c1ccb01
PE
20224 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20225
006c5daa
PE
20226 * process.c (keyboard_bit_set): Define only if SIGIO.
20227 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20228 (send_process): Repair possible setjmp clobbering.
20229
efc736d3
PE
20230 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20231
4e2fe2e6
PE
20232 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20233
f97334a2
PE
20234 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20235
4e75f29d
PE
20236 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20237 Define only if needed.
20238
90efadd1
PE
20239 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20240 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 20241 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 20242
3c647824
PE
20243 * dispextern.h (struct redisplay_interface): Rename param
20244 to avoid shadowing.
e264f262 20245 * termhooks.h (struct terminal): Likewise.
761383f4 20246 * xterm.c (xembed_send_message): Likewise.
3c647824 20247
b58c5c4a
PE
20248 * insdel.c (make_gap_smaller): Define only if
20249 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20250
cad59032
PE
20251 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20252 it.
20253
c339dc2e
PE
20254 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20255 so that we aren't warned about unused symbols.
20256
91a3e27b
PE
20257 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20258
399c71d3 20259 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 20260
8ffc96f5
PE
20261 * xfns.c (x_real_positions): Mark locals as initialized.
20262
eef9bc79
PE
20263 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20264
098db9dd
PE
20265 * xterm.c: Fix problems found by static analysis with other toolkits.
20266 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
20267 (x_dispatch_event): Declare static if USE_GTK, and
20268 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 20269 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 20270 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
20271 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20272 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 20273
eb18f6cc
PE
20274 * xmenu.c (menu_help_callback): Pointer type fixes.
20275 Use const pointers when pointing at readonly data. Avoid pointer
20276 signedness clashes.
20277 (FALSE): Remove unused macro.
20278 (update_frame_menubar): Remove unused decl.
20279
1fe72bf8
PE
20280 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20281
60d9e1db
PE
20282 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20283 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20284 (single_menu_item): Rename local to avoid shadowing.
20285
39261c26
PE
20286 * keyboard.c (make_lispy_event): Remove unused local var.
20287
018c5e19
PE
20288 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20289 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20290
63d2b86e
PE
20291 * bitmaps: Change bitmaps from unsigned char back to the X11
20292 compatible char. Avoid the old compiler warnings about
20293 out-of-range initializers by using, for example, '\xab' rather
20294 than 0xab.
20295
aefd87e1
PE
20296 * xgselect.c (xgselect_initialize): Check vs interface
20297 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20298
bf501fb9
PE
20299 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20300
e9829fdf
PE
20301 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20302 to read-only memory.
20303
1086c095
PE
20304 * fns.c (vector): Remove; this old hack is no longer needed.
20305
2baccd04 20306 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20307 Remove unused var.
dde42981 20308 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20309
72391843 20310 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20311
436c16df 20312 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20313 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20314 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20315
92bb796d 20316 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20317 (x_term_init): Remove local to avoid shadowing.
92bb796d 20318
764430a3 20319 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20320
20321 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20322 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20323
d1dfb56c
EZ
203242011-04-16 Eli Zaretskii <eliz@gnu.org>
20325
c4354cb4
EZ
20326 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20327
d1dfb56c
EZ
20328 Fix regex.c, syntax.c and friends for buffers > 2GB.
20329 * syntax.h (struct gl_state_s): Declare character position members
20330 EMACS_INT.
20331
20332 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20333
04f2d78b
CB
20334 * textprop.c (verify_interval_modification, interval_of):
20335 Declare arguments EMACS_INT.
d1dfb56c
EZ
20336
20337 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20338 EMACS_INT.
20339
20340 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20341
20342 * indent.c (Fvertical_motion): Local variable it_start is now
20343 EMACS_INT.
20344
20345 * regex.c (re_match, re_match_2, re_match_2_internal)
20346 (bcmp_translate, regcomp, regexec, print_double_string)
20347 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20348 (re_compile_pattern, re_exec): Declare arguments and local
20349 variables `size_t' and `ssize_t' and return values `regoff_t', as
20350 appropriate.
20351 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20352 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20353 <compile_stack_type>: `size' and `avail' are now `size_t'.
20354
20355 * regex.h <regoff_t>: Use ssize_t, not int.
20356 (re_search, re_search_2, re_match, re_match_2): Arguments that
20357 specify buffer/string position and length are now ssize_t and
20358 size_t. Return type is regoff_t.
20359
613052cd
BK
203602011-04-16 Ben Key <bkey76@gmail.com>
20361
20362 * nsfont.m: Fixed bugs in ns_get_family and
20363 ns_descriptor_to_entity that were caused by using free to
20364 deallocate memory blocks that were allocated by xmalloc (via
20365 xstrdup). This caused Emacs to crash when compiled with
20366 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20367 --enable-checking=xmallocoverrun). xfree is now used to
20368 deallocate these memory blocks.
20369
4170f62f 203702011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 20371
71b41406
PE
20372 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20373
9587a89d
PE
20374 emacs_write: Accept and return EMACS_INT for sizes.
20375 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20376 et seq.
20377 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20378 Accept and return EMACS_INT.
20379 (emacs_gnutls_write): Return the number of bytes written on
20380 partial writes.
20381 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
20382 (emacs_read, emacs_write): Remove check for negative size, as the
20383 Emacs source code has been audited now.
9587a89d
PE
20384 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20385 (emacs_read, emacs_write): Use it.
273a5f82
PE
20386 * process.c (send_process): Adjust to the new signatures of
20387 emacs_write and emacs_gnutls_write. Do not attempt to store
20388 a byte offset into an 'int'; it might overflow.
9587a89d 20389 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 20390
3e047f51
PE
20391 * sound.c: Don't assume sizes fit in 'int'.
20392 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 20393 Return EMACS_INT, not int.
3e047f51 20394 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
20395 Accept EMACS_INT, not int.
20396 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
20397 record read return values.
20398
cc39a9db
BK
203992011-04-15 Ben Key <bkey76@gmail.com>
20400
c9d0ec6d
JB
20401 * keyboard.c (Qundefined): Don't declare static since it is used
20402 in nsfns.m.
20403 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20404 static since they are used in nsfont.m.
cc39a9db 20405
6c60eb9f
SM
204062011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20407
20408 * process.c (Qprocessp): Don't declare static.
20409 * lisp.h (Qprocessp): Declare again.
20410
7990b61a
JB
204112011-04-15 Juanma Barranquero <lekktu@gmail.com>
20412
20413 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20414
5d4cb038
PE
204152011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20416
8bd7b830 20417 Improve C-level modularity by making more things 'static'.
cd64ea1d 20418
e3b27b31
PE
20419 Don't publish debugger-only interfaces to other modules.
20420 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20421 (verify_bytepos, count_markers): Move decls to the only modules
20422 that need them.
20423 * region-cache.h (pp_cache): Likewise.
20424 * window.h (check_all_windows): Likewise.
20425 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20426
5d4cb038
PE
20427 * sysdep.c (croak): Now static, if
20428 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20429 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
20430
20431 * alloc.c (refill_memory_reserve): Now static if
20432 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20433 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 20434
e87b6180
PE
20435 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20436 Define only if USE_LUCID.
20437
ac64929e
PE
20438 * xrdb.c (x_customization_string, x_rm_string): Now static.
20439
6f37259d
PE
20440 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20441 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20442
1683e3ab
PE
20443 * xdisp.c (draw_row_with_mouse_face): Now static.
20444 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20445
de9c2632
PE
20446 * window.h (check_all_windows): Mark externally visible.
20447
2b96acb7
PE
20448 * window.c (window_deletion_count): Now static.
20449
20450 * undo.c: Make symbols static if they're not exported.
20451 (last_undo_buffer, last_boundary_position, pending_boundary):
20452 Now static.
20453
50436f33
PE
20454 * textprop.c (interval_insert_behind_hooks): Now static.
20455 (interval_insert_in_front_hooks): Likewise.
20456
64520e5c
PE
20457 * term.c: Make symbols static if they're not exported.
20458 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20459 (max_frame_lines, tty_set_terminal_modes):
20460 (tty_reset_terminal_modes, tty_turn_off_highlight):
20461 (get_tty_terminal): Now static.
20462 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20463 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 20464 HAVE_WINDOW_SYSTEM.
64520e5c
PE
20465 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20466 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20467
1fa53021
PE
20468 * sysdep.c: Make symbols static if they're not exported.
20469 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20470 Now static.
20471 (sigprocmask_set, full_mask): Remove; unused.
20472 (wait_debugging): Mark as visible.
20473 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20474 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20475
d4b43b22
PE
20476 * syntax.c (syntax_temp): Define only if !__GNUC__.
20477
b7c513d0
PE
20478 * sound.c (current_sound_device, current_sound): Now static.
20479
989b29ad
PE
20480 * search.c (searchbufs, searchbuf_head): Now static.
20481
13a55a78
PE
20482 * scroll.c (scroll_cost): Remove; unused.
20483 * dispextern.h (scroll_cost): Remove decl.
20484
de68a1fc
PE
20485 * region-cache.h (pp_cache): Mark as externally visible.
20486
40ccffa6
PE
20487 * process.c: Make symbols static if they're not exported.
20488 (process_tick, update_tick, create_process, chan_process):
20489 (Vprocess_alist, proc_buffered_char, datagram_access):
20490 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20491 (deactivate_process): Mark defn as static, as well as decl.
20492 * lisp.h (create_process): Remove decl.
20493 * process.h (chan_process, Vprocess_alist): Remove decls.
20494
ad64fc97
PE
20495 * print.c: Make symbols static if they're not exported.
20496 (print_depth, new_backquote_output, being_printed, print_buffer):
20497 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20498 (print_interval, print_number_index, initial_stderr_stream):
20499 Now static.
20500 * lisp.h (Fprinc): Remove decl.
20501 (debug_output_compilation_hack): Mark as externally visible.
20502
adddb265
PE
20503 * sysdep.c (croak): Move decl from here to syssignal.h.
20504 * syssignal.h (croak): Put it here, so the API can be checked when
20505 'croak' is called from dissociate_if_controlling_tty.
20506
1717ede2
PE
20507 * minibuf.c: Make symbols static if they're not exported.
20508 (minibuf_save_list, choose_minibuf_frame): Now static.
20509 * lisp.h (choose_minibuf_frame): Remove decl.
20510
fa5fb2bc
PE
20511 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20512
1e3890d1
PE
20513 * lread.c: Make symbols static if they're not exported.
20514 (read_objects, initial_obarray, oblookup_last_bucket_number):
20515 Now static.
20516 (make_symbol): Remove; unused.
20517 * lisp.h (initial_obarray, make_symbol): Remove decls.
20518
8a1414fa
PE
20519 * keyboard.c: Make symbols static if they're not exported.
20520 (single_kboard, recent_keys_index, total_keys, recent_keys):
20521 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20522 (this_single_command_key_start, echoing, last_auto_save):
20523 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20524 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20525 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20526 (Vlispy_mouse_stem, double_click_count):
20527 Now static.
20528 (force_auto_save_soon): Define only if SIGDANGER.
20529 (ignore_mouse_drag_p): Now static if
20530 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20531 (print_help): Remove; unused.
20532 (stop_character, last_timer_event): Mark as externally visible.
20533 * keyboard.h (ignore_mouse_drag_p): Declare only if
20534 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20535 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20536 * lisp.h (echoing): Remove decl.
20537 (force_auto_save_soon): Declare only if SIGDANGER.
20538 * xdisp.c (redisplay_window): Simplify code, to make it more
20539 obvious that ignore_mouse_drag_p is not accessed if !defined
20540 USE_GTK && !defined HAVE_NS.
20541
93ea6e8f
PE
20542 * intervals.c: Make symbols static if they're not exported.
20543 (merge_properties_sticky, merge_interval_right, delete_interval):
20544 Now static.
20545 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20546
77382fcc
PE
20547 * insdel.c: Make symbols static if they're not exported.
20548 However, leave prepare_to_modify_buffer alone. It's never
20549 called from outside this function, but that appears to be a bug.
20550 (combine_after_change_list, combine_after_change_buffer):
4889fc82 20551 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
20552 (adjust_after_replace_noundo): Remove; unused.
20553 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 20554 (signal_before_change): Remove decls.
77382fcc 20555
9306c32e
PE
20556 * indent.c (val_compute_motion, val_vmotion): Now static.
20557
cd44d2eb
PE
20558 * image.c: Make symbols static if they're not exported.
20559 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20560 if USE_GTK.
20561 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20562 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20563
ad9a7a06
PE
20564 * fringe.c (standard_bitmaps): Now static.
20565 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20566
81626931
PE
20567 * frame.c: Make symbols static if they're not exported.
20568 (x_report_frame_params, make_terminal_frame): Now static.
20569 (get_frame_param): Now static, unless HAVE_NS.
20570 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20571 (x_get_resource_string): Remove; not used.
20572 * frame.h (make_terminal_frame, x_report_frame_params):
20573 (x_get_resource_string); Remove decls.
20574 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20575 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20576
239f9db9
PE
20577 * font.c, fontset.c: Make symbols static if they're not exported.
20578 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20579 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20580 * font.c (font_close_object): Now static.
20581 * font.h (font_close_object): Remove.
20582 * fontset.c (FONTSET_OBJLIST): Remove.
20583 (free_realized_fontset) #if-0 the body, which does nothing.
20584 (face_suitable_for_char_p): #if-0, as it's never called.
20585 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20586 * xfaces.c (face_at_string_position):
20587 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20588 since 0 is always ASCII.
20589
dfcf3579
PE
20590 * fns.c (weak_hash_tables): Now static.
20591
5045092b
PE
20592 * fileio.c: Make symbols static if they're not exported.
20593 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20594 (Vwrite_region_annotation_buffers): Now static.
20595
57a96f5c
PE
20596 * eval.c: Make symbols static if they're not exported.
20597 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20598 * lisp.h (backtrace_list): Remove decl.
20599
35f08c38
PE
20600 * emacs.c: Make symbols static if they're not exported.
20601 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20602 (fatal_error_code, fatal_error_signal_hook, standard_args):
20603 Now static.
20604 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20605 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20606 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20607 * lisp.h (fatal_error_signal_hook): Remove decl.
20608 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20609
f44bd759
PE
20610 * editfns.c: Move a (normally-unused) function to its only use.
20611 * editfns.c, lisp.h (get_operating_system_release): Remove.
20612 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20613 worth the hassle of breaking this out.
20614
b532497d
PE
20615 * xterm.c: Make symbols static if they're not exported.
20616 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
20617 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
20618 (x_destroy_window, x_delete_display):
20619 Now static.
20620 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
20621 (x_mouse_leave): Remove; unused.
20622 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
20623 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
20624 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
20625 Remove decls.
20626 (x_mouse_leave): Declare only if WINDOWSNT.
20627 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
20628 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
20629 USE_X_TOOLKIT.
20630
1675728f
PE
20631 * ftxfont.c: Make symbols static if they're not exported.
20632 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
20633 HAVE_FREETYPE.
20634 * font.h (ftxfont_driver): Likewise.
20635
e4cebfca
PE
20636 * xfns.c: Make symbols static if they're not exported.
20637 (x_last_font_name, x_display_info_for_name):
20638 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
20639 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
20640 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
20641 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
20642 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
20643 (last_show_tip_args): Now static.
20644 (xic_defaut_fontset, xic_create_fontsetname): Define only if
20645 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
20646 (x_screen_planes): Remove; unused.
20647 * dispextern.h (x_screen_planes): Remove decl.
20648
5bf46f05
PE
20649 * dispnew.c: Make symbols static if they're not exported.
20650 * dispextern.h (redraw_garbaged_frames, scrolling):
20651 (increment_row_positions): Remove.
20652 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
20653 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
20654 Now static.
20655 (redraw_garbaged_frames): Remove; unused.
20656
435f4c28
PE
20657 * xfaces.c: Make symbols static if they're not exported.
20658 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
20659 Remove decls.
20660 * xterm.h (defined_color): Remove decls.
20661 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
20662 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
20663 (menu_face_changed_default, defined_color, free_realized_face):
20664 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
20665 (ascii_face_of_lisp_face): Remove; unused.
20666
8524aef3
PE
20667 * xdisp.c: Make symbols static if they're not exported.
20668 * dispextern.h (scratch_glyph_row, window_box_edges):
20669 (glyph_to_pixel_coords, set_cursor_from_row):
20670 (get_next_display_element, set_iterator_to_next):
20671 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
20672 (show_mouse_face): Remove decls
20673 * frame.h (message_buf_print): Likewise.
20674 * lisp.h (pop_message, set_message, check_point_in_composition):
20675 Likewise.
20676 * xterm.h (set_vertical_scroll_bar): Likewise.
20677 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
20678 (message_buf_print, scratch_glyph_row, displayed_buffer):
20679 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
20680 (get_next_display_element, show_mouse_face, window_box_edges):
20681 (frame_to_window_pixel_xy, check_point_in_composition):
20682 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
20683 (glyph_to_pixel_coords): Remove; unused.
20684
16390cd2
PE
20685 * dired.c (file_name_completion): Now static.
20686
20687 * dbusbind.c (xd_in_read_queued_messages): Now static.
20688
a25f4dfa
PE
20689 * lisp.h (circular_list_error, FOREACH): Remove; unused.
20690 * data.c (circular_list_error): Remove.
20691
14a9c8df
PE
20692 * commands.h (last_point_position, last_point_position_buffer):
20693 (last_point_position_window): Remove decls.
20694 * keyboard.c: Make these variables static.
20695
04f2d78b
CB
20696 * coding.h (coding, code_convert_region, encode_coding_gap):
20697 Remove decls.
74ab6df5
PE
20698 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
20699 (iso_code_class, detect_coding, code_convert_region): Now static.
20700 (encode_coding_gap): Remove; unused.
20701
38dfbee1
PE
20702 * chartab.c (chartab_chars, chartab_bits): Now static.
20703
a2cb4e63
PE
20704 * charset.h (charset_iso_8859_1): Remove decl.
20705 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
20706 Now static.
20707
127198fd
PE
20708 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
20709 * ccl.c (Vccl_program_table): Now static.
20710 (check_ccl_update): Remove; unused.
20711
d85b608f
PE
20712 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
20713 * category.h: ... from here.
20714 * category.c (check_category_table, set_category_set): Now static.
20715
31cd66f3
PE
20716 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
20717 * lisp.h: Remove these decls.
20718
c358e587
PE
20719 * buffer.c (buffer_count): Remove unused var.
20720
e78aecca
PE
20721 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
20722 so that it's not optimized away.
20723 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
20724 * dispextern.h (bidi_dump_cached_states): Remove, since it's
20725 exported only to the debugger.
20726
e192d7d3 20727 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 20728 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 20729
92470028
PE
20730 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
20731 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
20732 was inaccessible from Lisp.
20733 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
20734 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
20735
244ed907
PE
20736 alloc.c: Import and export fewer symbols, and remove unused items.
20737 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
20738 is defined.
20739 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
20740 it's not optimized away by whole-program optimization.
20741 (message_enable_multibyte, free_misc): Remove.
20742 (catchlist, handlerlist, mark_backtrace):
20743 Declare only if BYTE_MARK_STACK.
20744 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
20745 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
20746 (message_enable_multibyte): Remove decl.
20747 (free_misc, interval_free_list, float_block, float_block_index):
20748 (n_float_blocks, float_free_list, cons_block, cons_block_index):
20749 (cons_free_list, last_marked_index):
20750 Now static.
20751 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
20752 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20753 (mark_backtrace): Define only if BYTE_MARK_STACK.
20754 * xdisp.c (message_enable_multibyte): Now static.
20755
61c2b50e 20756 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
20757 This makes it easier for human readers (and static analyzers)
20758 to see whether these variables are used from other modules.
20759 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
20760 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
20761 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
20762 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
20763 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
20764 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
20765 * xmenu.c, xselect.c:
20766 Declare Q* vars static if they are not used in other modules.
20767 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
20768 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
20769 Remove decls of unexported vars.
20770 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
20771
95c82688
PE
20772 * lisp.h (DEFINE_FUNC): Make sname 'static'.
20773
16a97296
PE
20774 Make Emacs functions such as Fatom 'static' by default.
20775 This makes it easier for human readers (and static analyzers)
20776 to see whether these functions can be called from other modules.
20777 DEFUN now defines a static function. To make the function external
20778 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
20779 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
20780 (Finit_image_library):
16a97296
PE
20781 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
20782 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
20783 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
20784 Remove decls, since these functions are now static.
20785 (Funintern, Fget_internal_run_time): New decls, since these functions
20786 were already external.
95c82688 20787
16a97296
PE
20788 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
20789 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
20790 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
20791 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
20792 * keyboard.c, keymap.c, lread.c:
20793 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
20794 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
20795 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
20796 Mark functions with DEFUE instead of DEFUN,
20797 if they are used in other modules.
20798 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
20799 decls for now-static functions.
20800 * buffer.h (Fdelete_overlay): Remove decl.
20801 * callproc.c (Fgetenv_internal): Mark as internal.
20802 * composite.c (Fremove_list_of_text_properties): Remove decl.
20803 (Fcomposition_get_gstring): New forward static decl.
20804 * composite.h (Fcomposite_get_gstring): Remove decl.
20805 * dired.c (Ffile_attributes): New forward static decl.
20806 * doc.c (Fdocumntation_property): New forward static decl.
20807 * eval.c (Ffetch_bytecode): New forward static decl.
20808 (Funintern): Remove extern decl; now in .h file where it belongs.
20809 * fileio.c (Fmake_symbolic_link): New forward static decl.
20810 * image.c (Finit_image_library): New forward static decl.
20811 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
20812 * intervals.h (Fprevious_property_change):
20813 (Fremove_list_of_text_properties): Remove decls.
20814 * keyboard.c (Fthis_command_keys): Remove decl.
20815 (Fcommand_execute): New forward static decl.
20816 * keymap.c (Flookup_key): New forward static decl.
20817 (Fcopy_keymap): Now static.
20818 * keymap.h (Flookup_key): Remove decl.
20819 * process.c (Fget_process): New forward static decl.
20820 (Fprocess_datagram_address): Mark as internal.
20821 * syntax.c (Fsyntax_table_p): New forward static decl.
20822 (skip_chars): Remove duplicate decl.
20823 * textprop.c (Fprevious_property_change): New forward static decl.
20824 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
20825 Now internal.
20826 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
20827 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
20828
785bbd42
PE
20829 * editfns.c (Fformat): Remove unreachable code.
20830
8b913b57
AS
208312011-04-14 Andreas Schwab <schwab@linux-m68k.org>
20832
20833 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
20834 change. (Bug#8496)
20835
a6744a35
EZ
208362011-04-13 Eli Zaretskii <eliz@gnu.org>
20837
20838 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
20839 when at ZV. (Bug#8487)
20840
e7974947
AS
208412011-04-12 Andreas Schwab <schwab@linux-m68k.org>
20842
baad03f0
AS
20843 * charset.c (Fclear_charset_maps): Use xfree instead of free.
20844 (Bug#8437)
20845 * keyboard.c (parse_tool_bar_item): Likewise.
20846 * sound.c (sound_cleanup, alsa_close): Likewise.
20847 * termcap.c (tgetent): Likewise.
20848 * xfns.c (x_default_font_parameter): Likewise.
20849 * xsettings.c (read_and_apply_settings): Likewise.
20850
e7974947
AS
20851 * alloc.c (overrun_check_malloc, overrun_check_realloc)
20852 (overrun_check_free): Protoize.
20853
28272684
PE
208542011-04-12 Paul Eggert <eggert@cs.ucla.edu>
20855
20856 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
20857 since callers should never pass a negative size.
20858 Change the signature to match that of plain 'read' and 'write'; see
20859 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
20860 * lisp.h: Update prototypes of emacs_write and emacs_read.
20861
11997c76
EZ
208622011-04-11 Eli Zaretskii <eliz@gnu.org>
20863
20864 * xdisp.c (redisplay_window): Don't try to determine the character
20865 position of the scroll margin if the window start point w->startp
e896f03c 20866 is outside the buffer's accessible region. (Bug#8468)
11997c76 20867
8a2cbd72
EZ
208682011-04-10 Eli Zaretskii <eliz@gnu.org>
20869
20870 Fix write-region and its subroutines for buffers > 2GB.
20871 * fileio.c (a_write, e_write): Modify declaration of arguments and
20872 local variables to support buffers larger than 2GB.
20873 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
20874
20875 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
20876 argument, local variables, and return value.
20877
20878 * lisp.h: Update prototypes of emacs_write and emacs_read.
20879
20880 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
20881
4073e537 208822011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 20883
1ebfdcb6
PE
20884 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
20885
b2ded58d
PE
20886 Fix more problems found by GCC 4.6.0's static checks.
20887
7d66342c
PE
20888 * xdisp.c (vmessage): Use a better test for character truncation.
20889
bbf47d44
PE
20890 * charset.c (load_charset_map): <, not <=, for optimization,
20891 and to avoid potential problems with integer overflow.
9248994d 20892 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 20893 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 20894 * editfns.c (Fformat): Likewise.
1e69125e 20895 * syntax.c (skip_chars): Likewise.
3befa583 20896
e3019616
PE
20897 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
20898 This also lets GCC 4.6.0 generate slightly better loop code.
20899
becfa255
PE
20900 * callint.c (Fcall_interactively): <, not <=, for optimization.
20901 (Fcall_interactively): Count the number of arguments produced,
20902 not the number of arguments given. This is simpler and lets GCC
20903 4.6.0 generate slightly better code.
20904
dae0cd48
PE
20905 * ftfont.c: Distingish more carefully between FcChar8 and char.
20906 The previous code passed unsigned char * to a functions like
20907 strlen and xstrcasecmp that expect char *, which does not
20908 conform to the C standard.
20909 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
20910 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
20911 char * when the C standard requires it.
20912
76032d70
PE
20913 * keyboard.c (read_char): Remove unused var.
20914
eb3f1cc8
PE
20915 * eval.c: Port to Windows vsnprintf (Bug#8435).
20916 Include <limits.h>.
20917 (SIZE_MAX): Define if the headers do not.
20918 (verror): Do not give up if vsnprintf returns a negative count.
20919 Instead, grow the buffer. This ports to Windows vsnprintf, which
20920 does not conform to C99. Problem reported by Eli Zaretskii.
20921 Also, simplify the allocation scheme, by avoiding the need for
20922 calling realloc, and removing the ALLOCATED variable.
20923
70476b54
PE
20924 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
20925
12020a9e
PE
20926 Remove invocations of doprnt, as Emacs now uses vsnprintf.
20927 But keep the doprint source code for now, as we might revamp it
20928 and use it again (Bug#8435).
ea6c7ae6
PE
20929 * lisp.h (doprnt): Remove.
20930 * Makefile.in (base_obj): Remove doprnt.o.
20931 * deps.mk (doprnt.o): Remove.
20932
5fdb398c
PE
20933 error: Print 32- and 64-bit integers portably (Bug#8435).
20934 Without this change, on typical 64-bit hosts error ("...%d...", N)
20935 was used to print both 32- and 64-bit integers N, which relied on
20936 undefined behavior.
61bdb816 20937 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
20938 * lisp.h (error, verror): Mark as printf-like functions.
20939 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
20940 Report overflow in size calculations when allocating printf buffer.
20941 Do not truncate output string at its first null byte.
20942 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
20943 Truncate the output at a character boundary, since vsnprintf does not
20944 do that.
20945 * charset.c (check_iso_charset_parameter): Convert internal
20946 character to string before calling 'error', since %c now has the
20947 printf meaning.
20948 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
20949 overflow when computing char to be passed to 'error'. Do not
20950 pass Lisp_Object to 'error'; pass the integer instead.
20951 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
20952 formatted with plain %d.
20953
b189fa66
PE
20954 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
20955
bff87ef0
PE
20956 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
20957
7e2cac20
PE
20958 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
20959
ce4d90b5
PE
20960 * xterm.c (x_catch_errors): Remove duplicate declaration.
20961
266c9547
PE
20962 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
20963
79c49ad2
PE
20964 * xdisp.c, lisp.h (message_nolog): Remove; unused.
20965
368f4090
JM
209662011-04-10 Jim Meyering <meyering@redhat.com>
20967
20968 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
20969 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
20970 return ssize_t not "int", and use size_t as the buffer length.
20971 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
20972 * gnutls.h: Update declarations.
20973 * process.c (read_process_output): Use ssize_t, to match.
20974 (send_process): Likewise.
20975
a32d4040
CY
209762011-04-09 Chong Yidong <cyd@stupidchicken.com>
20977
20978 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
20979
8546720e 209802011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 20981
04f2d78b
CB
20982 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
20983 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 20984
8546720e
GM
20985 * xterm.c (handle_one_xevent):
20986 * xmenu.c (create_and_show_popup_menu):
20987 * xselect.c (x_decline_selection_request)
20988 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 20989
0a2f5c1a 209902011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
20991
20992 Fix some uses of `int' instead of EMACS_INT.
20993 * search.c (string_match_1, fast_string_match)
20994 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
20995 (scan_buffer, find_next_newline_no_quit)
20996 (find_before_next_newline, search_command, Freplace_match)
20997 (Fmatch_data): Make some `int' variables be EMACS_INT.
20998
20999 * xdisp.c (display_count_lines): 3rd argument and return value now
21000 EMACS_INT. All callers changed.
21001 (pint2hrstr): Last argument is now EMACS_INT.
21002
21003 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21004 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21005 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21006 (decode_coding_utf_16, decode_coding_emacs_mule)
21007 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21008 (decode_coding_ccl, decode_coding_charset)
21009 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21010 (decode_coding_iso_2022, decode_coding_emacs_mule)
21011 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21012 <char_offset, last_offset>: Declare EMACS_INT.
21013 (encode_coding_utf_8, encode_coding_utf_16)
21014 (encode_coding_emacs_mule, encode_invocation_designation)
21015 (encode_designation_at_bol, encode_coding_iso_2022)
21016 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21017 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21018 Declare EMACS_INT.
21019 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21020 (encode_invocation_designation): Last argument P_NCHARS is now
21021 EMACS_INT.
21022 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21023 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21024
21025 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21026 All users changed.
21027
21028 * ccl.c (Fccl_execute_on_string): Declare some variables
21029 EMACS_INT.
21030
8546720e 210312011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
21032
21033 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21034
4e19a977
CS
210352011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21036
21037 * process.c (Fformat_network_address): Doc fix.
21038
87302331
R
210392011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21040
ee7683eb 21041 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 21042
cbb59342
CY
210432011-04-08 Chong Yidong <cyd@stupidchicken.com>
21044
21045 * keyboard.c (read_char): Call Lisp function help-form-show,
21046 instead of using internal_with_output_to_temp_buffer.
21047 (Qhelp_form_show): New var.
e0d38eeb 21048 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
21049
21050 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21051
21052 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21053
e67a13ab
CY
210542011-04-06 Chong Yidong <cyd@stupidchicken.com>
21055
04f2d78b
CB
21056 * process.c (Flist_processes): Remove to Lisp.
21057 (list_processes_1): Delete.
e67a13ab 21058
973f782d
EZ
210592011-04-06 Eli Zaretskii <eliz@gnu.org>
21060
7c106b1e
EZ
21061 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21062
973f782d
EZ
21063 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21064
41cf7d1a 210652011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 21066
ca23cc88
PE
21067 Fix more problems found by GCC 4.6.0's static checks.
21068
f390e2d5
PE
21069 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21070
42eea0d0
PE
21071 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21072
b69769da 21073 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 21074
f9541e84
PE
21075 * xdisp.c (vmessage): Mark as a printf-like function.
21076
13841b55
PE
21077 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21078
c136c10f
PE
21079 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21080
5e2d4a30
PE
21081 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21082 printf-like functions.
21083 (tiff_load): Add casts to remove these marks before passing them
21084 to system-supplied API.
21085
583f48b9
PE
21086 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21087
b25d760e
PE
21088 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21089 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
21090 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21091 directly, rather than having caller test rule sign. This avoids
21092 some unnecessary tests.
21093 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21094 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21095 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 21096
bc7b6697 21097 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 21098 (xfont_open): Avoid unnecessary tests.
bc7b6697 21099
27ccc379
PE
21100 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21101
dcd5c89a
PE
21102 * composite.h, composite.c (composition_gstring_put_cache):
21103 Use EMACS_INT, not int, for length.
21104
b13a45c6
PE
21105 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21106 breaking out part of COMPOSITION_DECODE_RULE.
21107 (COMPOSITION_DECODE_RULE): Use it.
21108 * composite.c (get_composition_id): Remove unused local vars,
21109 by using the new macro.
21110
1e792e4d
PE
21111 * textprop.c (set_text_properties_1): Change while to do-while,
21112 since the condition is always true at first.
21113
dc6c6455 21114 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
21115 (interval_deletion_adjustment): Return unsigned value.
21116 All uses changed.
dc6c6455 21117
aba7731a
PE
21118 * process.c (list_processes_1, create_pty, read_process_output):
21119 (exec_sentinel): Remove vars that were set but not used.
afd4052b 21120 (create_pty): Remove unnecessary "volatile"s.
bc57d757 21121 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 21122 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 21123 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 21124
fdfc4bf3
PE
21125 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21126
fca8fe46 21127 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 21128 (update_syntax_table): Use unsigned instead of int.
fca8fe46 21129
06a0259a 21130 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 21131 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 21132 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 21133
e7b9e80f
PE
21134 * print.c (print_error_message): Avoid int overflow.
21135
56201685
PE
21136 * font.c (font_list_entities): Redo for clarity,
21137 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21138
78834453 21139 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 21140 (font_score): Avoid potential overflow in diff calculation.
78834453 21141
0bc0b309 21142 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 21143 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 21144
e610eaca
PE
21145 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21146
b895abce
PE
21147 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21148 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21149 can always succeed if overflow has undefined behavior.
21150
1f1d9321 21151 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 21152 (wordify): Omit three unnecessary tests.
1f1d9321 21153
c59478bc
PE
21154 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21155 All callers changed. This avoids the need for an unused var.
21156
79b73827
PE
21157 * casefiddle.c (casify_region): Remove var that is set but not used.
21158
a4db5dfe
PE
21159 * dired.c (file_name_completion): Remove var that is set but not used.
21160
43aae36e
PE
21161 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21162
2a47c44d 21163 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 21164 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 21165
a37c69bf
PE
21166 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21167 Check for integer overflow on size calculations.
21168
328ab8e7
PE
21169 * buffer.c (Fprevious_overlay_change): Remove var that is set
21170 but not used.
21171
e5a2a5cb
PE
21172 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21173 Remove vars that are set but not used.
8d84a6eb 21174 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 21175 (timer_check_2): Mark vars as initialized.
e5a2a5cb 21176
a60e5f68
PE
21177 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21178
f661cb61 21179 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 21180 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 21181
f0397f5a
PE
21182 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21183 that are set but not used.
21184
8664db06 21185 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 21186 if XCreateBitmapFromData fails (Bug#8410).
8664db06 21187
6abdaa4a
PE
21188 * xselect.c (x_get_local_selection, x_handle_property_notify):
21189 Remove vars that are set but not used.
21190
0ce7538d 21191 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 21192 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 21193
9ae848fc
PE
21194 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21195 Remove var that is set but not used.
0b918413
PE
21196 (scroll_bar_windows_size): Now size_t, not int.
21197 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21198 Check for overflow.
9ae848fc 21199
a5a62657
PE
21200 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21201 (map_tty_color) [!defined MSDOS]: Likewise.
21202
5c5cdd39
PE
21203 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21204
66ebf983
PE
21205 * coding.c: Remove vars that are set but not used.
21206 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21207 All callers changed.
21208 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21209 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21210 (decode_coding_charset): Remove vars that are set but not used.
21211
1be4d761
PE
21212 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21213 that is set but not used.
21214
47553fa8
PE
21215 * print.c (print_object): Remove var that is set but not used.
21216
1f7196bf 21217 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
21218 The gnulib version avoids calling malloc in the usual case,
21219 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21220 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21221 * filelock.c (current_lock_owner): Likewise.
21222 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21223 * sysdep.c: Include allocator.h, careadlinkat.h.
21224 (emacs_no_realloc_allocator): New static constant.
21225 (emacs_readlink): New function.
fdb61804
PE
21226 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21227 ../lib/careadlinkat.h.
d1fdcab7 21228
f84c17c7
SM
212292011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21230
21231 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21232 first non-nil return value).
21233
ef3862ad
JD
212342011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21235
21236 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21237 if not defined (Bug#8403).
21238
376a7006
JB
212392011-04-02 Juanma Barranquero <lekktu@gmail.com>
21240
21241 * xdisp.c (display_count_lines): Remove parameter `start',
21242 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21243 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21244 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21245 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21246 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21247 and thereabouts. All callers changed.
21248 (get_per_char_metric): Remove parameter `f', unused since
21249 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21250
6ca3801d
JM
212512011-04-02 Jim Meyering <meyering@redhat.com>
21252
21253 do not dereference NULL upon failed strdup
21254 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21255 (ns_get_family): Likewise.
21256
d8e2b5ba
JB
212572011-04-02 Juanma Barranquero <lekktu@gmail.com>
21258
21259 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21260
8c74fcbd
JD
212612011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21262
21263 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21264 later (Bug#8403).
21265
7200d79c
SM
212662011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21267
03408648 21268 Add lexical binding.
7200d79c 21269
03408648
SM
21270 * window.c (Ftemp_output_buffer_show): New fun.
21271 (Fsave_window_excursion):
21272 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21273
21274 * lread.c (lisp_file_lexically_bound_p): New function.
21275 (Fload): Bind Qlexical_binding.
21276 (readevalloop): Remove `evalfun' arg.
21277 Bind Qinternal_interpreter_environment.
21278 (Feval_buffer): Bind Qlexical_binding.
21279 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21280 Mark as dynamic.
21281 (syms_of_lread): Declare `lexical-binding'.
21282
21283 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21284
21285 * keyboard.c (eval_dyn): New fun.
21286 (menu_item_eval_property): Use it.
ca105506
SM
21287
21288 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21289
03408648
SM
21290 * fns.c (concat, mapcar1): Accept byte-code-functions.
21291
21292 * eval.c (Fsetq): Handle lexical vars.
21293 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21294 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21295 (FletX, Flet): Obey lexical binding.
21296 (Fcommandp): Handle closures.
21297 (Feval): New `lexical' arg.
21298 (eval_sub): New function extracted from Feval. Use it almost
21299 everywhere where Feval was used. Look up vars in lexical env.
21300 Handle closures.
21301 (Ffunctionp): Move from subr.el.
21302 (Ffuncall): Handle closures.
21303 (apply_lambda): Remove `eval_flags'.
21304 (funcall_lambda): Handle closures and new byte-code-functions.
21305 (Fspecial_variable_p): New function.
21306 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21307 but without exporting it to Lisp.
23aba0ea 21308
23aba0ea 21309 * doc.c (Fdocumentation, store_function_docstring):
03408648 21310 * data.c (Finteractive_form): Handle closures.
23aba0ea 21311
03408648
SM
21312 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21313 interactive spec.
ba83908c 21314
04f2d78b
CB
21315 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21316 New byte-codes.
03408648
SM
21317 (exec_byte_code): New function extracted from Fbyte_code to handle new
21318 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21319
03408648 21320 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21321
03408648 21322 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21323
e2abce01
JB
213242011-03-31 Juanma Barranquero <lekktu@gmail.com>
21325
21326 * xdisp.c (redisplay_internal): Fix prototype.
21327
63696a73 213282011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21329
63696a73 21330 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21331 (try_scrolling): Use it when setting scroll_limit.
21332 Limit scrolling to 100 screen lines.
63696a73
EZ
21333 (redisplay_window): Even when falling back on "recentering",
21334 position point in the window according to scroll-conservatively,
21335 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21336
21337 (try_scrolling): When point is above the window, allow searching
21338 as far as scroll_max, or one screenful, to compute vertical
21339 distance from PT to the scroll margin position. This prevents
21340 try_scrolling from unnecessarily failing when
21341 scroll-conservatively is set to a value slightly larger than the
21342 window height. Clean up the case of PT below the margin at bottom
21343 of window: scroll_max can no longer be INT_MAX. When aggressive
21344 scrolling is in use, don't let point enter the opposite scroll
21345 margin as result of the scroll.
21346 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21347 threshold of 100 lines for never-recentering scrolling.
21348
e4cc2dfc
JB
213492011-03-31 Juanma Barranquero <lekktu@gmail.com>
21350
21351 * dispextern.h (move_it_by_lines):
21352 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21353 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21354 (message_log_check_duplicate): Remove parameters `prev_bol' and
21355 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21356 (redisplay_internal): Remove parameter `preserve_echo_area',
21357 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21358
21359 * indent.c (Fvertical_motion):
21360 * window.c (window_scroll_pixel_based, Frecenter):
21361 Don't pass `need_y_p' to `move_it_by_lines'.
21362
1c470562
SM
213632011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21364
44f230aa
SM
21365 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21366 steal a few bits to be more compact.
21367 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21368 Remove unneeded casts.
21369
1c470562
SM
21370 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21371
888adce9
ZK
213722011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21373
21374 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21375 binding" message (bug#7967).
21376
f838ed7b
PE
213772011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21378
77861b95
PE
21379 Fix more problems found by GCC 4.6.0's static checks.
21380
de6dbc14
PE
21381 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21382 Remove unused local var.
21383
f838ed7b
PE
21384 * editfns.c (Fmessage_box): Remove unused local var.
21385
792c7b2b
PE
21386 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21387 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21388 Omit unused local vars.
c499e557 21389 * window.c (shrink_windows): Omit unused local var.
b01a1c29 21390 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
21391 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21392 Omit unused local var.
21393
ba0165e1
PE
21394 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21395 Don't assume string length fits in int.
32ad8845 21396 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 21397 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 21398
3c59b4c9
PE
21399 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21400 instead of alloca (Bug#8344).
21401
a3eed478 21402 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 21403 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 21404
eb4d412d
PE
21405 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21406
1658b401
PE
21407 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21408 concerns.
21409
21410 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21411
21412 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 21413
9a2c6e05
PE
21414 * keyboard.c (syms_of_keyboard): Use the same style as later
21415 in this function when indexing through an array. This also
21416 works around GCC bug 48267.
21417
03d0a109
PE
21418 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21419
44f730c8
PE
21420 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21421
fe75f926
PE
21422 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21423 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21424
ffa8c828
PE
21425 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21426 This avoids undefined behavior on integer overflow, and is a bit
21427 more convenient anyway since it is compared to a size_t variable.
21428
c5101a77
PE
21429 Variadic C functions now count arguments with size_t, not int.
21430 This avoids an unnecessary limitation on 64-bit machines, which
21431 caused (substring ...) to crash on large vectors (Bug#8344).
21432 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21433 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 21434 All variadic functions and their callers changed accordingly.
c5101a77
PE
21435 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21436 * data.c (arith_driver, float_arith_driver): Likewise.
21437 * editfns.c (general_insert_function): Likewise.
21438 * eval.c (struct backtrace.nargs, interactive_p)
21439 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21440 (funcall_lambda, mark_backtrace): Likewise.
21441 * fns.c (concat): Likewise.
21442 * frame.c (x_set_frame_parameters): Likewise.
21443 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21444 0 if not found, not -1. All callers changed.
21445
dd3f25f7
PE
21446 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21447 (stack_copy_size): Now size_t, not int.
21448 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21449
461c2ab9
JB
214502011-03-28 Juanma Barranquero <lekktu@gmail.com>
21451
21452 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21453 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21454 All callers changed.
21455
21456 * lisp.h (multibyte_char_to_unibyte):
21457 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21458 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21459 * character.h (CHAR_TO_BYTE8):
21460 * cmds.c (internal_self_insert):
21461 * editfns.c (general_insert_function):
21462 * keymap.c (push_key_description):
21463 * search.c (Freplace_match):
21464 * xdisp.c (message_dolog, set_message_1): All callers changed.
21465
f6d62986
SM
214662011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21467
21468 * keyboard.c (safe_run_hook_funcall): New function.
21469 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21470 don't set the hook to nil, but remove the offending function instead.
21471 (Qcommand_hook_internal): Remove, unused.
21472 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21473 Vcommand_hook_internal.
21474
21475 * eval.c (enum run_hooks_condition): Remove.
21476 (funcall_nil, funcall_not): New functions.
21477 (run_hook_with_args): Call each function through a `funcall' argument.
21478 Remove `cond' argument, now redundant.
21479 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21480 (Frun_hook_with_args_until_failure): Adjust accordingly.
21481 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21482
1db5b1ad
JB
214832011-03-28 Juanma Barranquero <lekktu@gmail.com>
21484
21485 * dispextern.h (string_buffer_position): Remove declaration.
21486
21487 * print.c (strout): Remove parameter `multibyte', unused since
21488 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21489
21490 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21491 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21492 All callers changed.
21493
21494 * w32.c (_wsa_errlist): Use braces for struct initializers.
21495
21496 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21497 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21498 All callers changed.
21499 (string_buffer_position): Likewise. Also, make static (it's never
21500 used outside xdisp.c).
21501 (cursor_row_p): Remove parameter `w', unused since
21502 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21503 (decode_mode_spec): Remove parameter `precision', introduced during
21504 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21505 All callers changed.
21506
5ffb62aa
JD
215072011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21508
21509 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21510
461c2ab9 215112011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
21512
21513 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21514 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21515 (ns_update_auto_hide_menu_bar): New functions.
21516 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21517 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21518 ns_constrain_all_frames.
21519 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21520 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21521
5c380ffb
JD
215222011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21523
21524 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21525
9af30bdf
GM
215262011-03-27 Glenn Morris <rgm@gnu.org>
21527
21528 * syssignal.h: Replace RETSIGTYPE with void.
21529 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21530 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21531 Replace SIGTYPE with void everywhere.
21532 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21533 * s/template.h (SIGTYPE): Remove commented out definition.
21534
e2abce01
JB
215352011-03-26 Eli Zaretskii <eliz@gnu.org>
21536
21537 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21538 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21539
f868cd8a
JB
215402011-03-26 Juanma Barranquero <lekktu@gmail.com>
21541
59eb0929
JB
21542 * w32.c (read_unc_volume): Use parameter `henum', instead of
21543 global variable `wget_enum_handle'.
21544
21545 * keymap.c (describe_vector): Remove parameters `indices' and
21546 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21547 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21548
f868cd8a
JB
21549 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21550
21551 * keyboard.c (timer_check): Remove parameter `do_it_now',
21552 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21553 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21554 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21555
21556 * keyboard.c (read_char):
21557 * w32menu.c (w32_menu_display_help):
21558 * xmenu.c (show_help_event, menu_help_callback):
21559 Adjust calls to `show_help_echo'.
21560
21561 * gtkutil.c (xg_maybe_add_timer):
21562 * keyboard.c (readable_events):
21563 * process.c (wait_reading_process_output):
21564 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21565
21566 * insdel.c (adjust_markers_gap_motion):
21567 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21568 (gap_left, gap_right): Don't call it.
21569
2ecf6fdb
CY
215702011-03-25 Chong Yidong <cyd@stupidchicken.com>
21571
21572 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21573 incurred during fontification.
21574
6b1f9ba4
JB
215752011-03-25 Juanma Barranquero <lekktu@gmail.com>
21576
21577 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21578 (DEFVAR_PER_BUFFER): Don't pass it.
21579
21580 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21581 (scrolling_window): Don't pass it.
21582
0f4a96b5
JB
215832011-03-25 Juanma Barranquero <lekktu@gmail.com>
21584
21585 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21586
21587 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21588 and `suffix'.
21589 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21590 of variables specific to SELinux and computation of `encoded_absname'.
21591
21592 * image.c (XPutPixel): Remove unused variable `height'.
21593
21594 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21595
21596 * unexw32.c (get_section_info): Remove unused variable `section'.
21597
21598 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21599 (system_process_attributes): Remove unused variable `sess'.
21600 (sys_read): Remove unused variable `err'.
21601
21602 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21603 (w32_wnd_proc): Remove unused variable `isdead'.
21604 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21605 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21606 (x_create_tip_frame): Remove unused variable `tem'.
21607
21608 * w32inevt.c (w32_console_read_socket):
21609 Remove unused variable `no_events'.
21610
21611 * w32term.c (x_draw_composite_glyph_string_foreground):
21612 Remove unused variable `width'.
21613
1149507c
JB
216142011-03-24 Juanma Barranquero <lekktu@gmail.com>
21615
21616 * w32term.c (x_set_glyph_string_clipping):
21617 Don't pass uninitialized region to CombineRgn.
21618
9c88f339
JB
216192011-03-23 Juanma Barranquero <lekktu@gmail.com>
21620
21621 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
21622 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
21623 (Fx_close_connection): Remove unused variable `i'.
21624
21625 * w32font.c (w32font_draw): Return number of glyphs.
21626 (w32font_open_internal): Remove unused variable `i'.
21627 (w32font_driver): Add missing initializer.
21628
21629 * w32menu.c (utf8to16): Remove unused variable `utf16'.
21630 (fill_in_menu): Remove unused variable `items_added'.
21631
21632 * w32term.c (last_mouse_press_frame): Remove static global variable.
21633 (w32_clip_to_row): Remove unused variable `f'.
21634 (x_delete_terminal): Remove unused variable `i'.
21635
21636 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
21637 (NOTHING): Remove unused static global variable.
21638 (uniscribe_check_otf): Remove unused variable `table'.
21639 (uniscribe_font_driver): Add missing initializers.
21640
dee091a3
JD
216412011-03-23 Julien Danjou <julien@danjou.info>
21642
21643 * term.c (Fsuspend_tty, Fresume_tty):
21644 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
21645 * window.c (temp_output_buffer_show):
21646 * insdel.c (signal_before_change):
21647 * frame.c (Fhandle_switch_frame):
21648 * fileio.c (Fdo_auto_save):
21649 * emacs.c (Fkill_emacs):
21650 * editfns.c (save_excursion_restore):
21651 * cmds.c (internal_self_insert):
21652 * callint.c (Fcall_interactively):
21653 * buffer.c (Fkill_all_local_variables):
21654 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
21655 Use Frun_hooks.
0f4a96b5 21656 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 21657 unconditionally since it does the check itself.
dee091a3 21658
2c520ab5 216592011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 21660
c9c49752
PE
21661 Fix more problems found by GCC 4.5.2's static checks.
21662
8abc3f12
PE
21663 * coding.c (encode_coding_raw_text): Avoid unnecessary test
21664 the first time through the loop, since we know p0 < p1 then.
21665 This also avoids a gcc -Wstrict-overflow warning.
21666
a2d26660
PE
21667 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
21668 leading to a memory leak, possible in functions like
21669 load_charset_map_from_file that can allocate an unbounded number
b12ef411 21670 of objects (Bug#8318).
a2d26660 21671
916c72e9
PE
21672 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
21673 that could (at least in theory) be that large.
21674
19ab8a18
PE
21675 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
21676 This is less likely to overflow, and avoids undefined behavior if
21677 overflow does occur. All callers changed. Use strtoul to scan
21678 for the unsigned long integer.
b7cbbd6f
PE
21679 (pint2hrstr): Simplify and tune code slightly.
21680 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 21681
f0641eff
PE
21682 * scroll.c (do_scrolling): Work around GCC bug 48228.
21683 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
21684
7f650bb9
PE
21685 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
21686 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
21687 (validate_x_resource_name): Simplify count usage.
21688 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 21689
37dd57d1
PE
21690 * fileio.c (Fcopy_file): Report error if fchown or fchmod
21691 fail (Bug#8306).
81e56e61 21692
699979fc 21693 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 21694
401bf9b4
PE
21695 * process.c (Fmake_network_process): Use socklen_t, not int,
21696 where POSIX says socklen_t is required in portable programs.
21697 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 21698 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
21699 (Fmake_network_process, server_accept_connection):
21700 (wait_reading_process_output, read_process_output):
21701 Likewise.
21702
b93aacde
PE
21703 * process.c: Rename or move locals to avoid shadowing.
21704 (list_processes_1, Fmake_network_process):
21705 (read_process_output_error_handler, exec_sentinel_error_handler):
21706 Rename or move locals.
4dc343ee 21707 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 21708 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 21709 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 21710 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 21711 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 21712
af8a867c 21713 Make tparam.h and terminfo.c consistent.
44f230aa
SM
21714 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
21715 Include tparam.h instead, since it declares them.
af8a867c
PE
21716 * cm.h (PC): Remove extern decl; tparam.h now does this.
21717 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
21718 * terminfo.c: Include tparam.h, to check interfaces.
21719 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
21720 (tparam): Adjust signature to match interface in tparam.h;
21721 this removes some undefined behavior. Check that outstring and len
21722 are zero, which they always are with Emacs.
21723 * tparam.h (PC, BC, UP): New extern decls.
21724
0248044d 21725 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 21726 (xftfont_open): Rename locals to avoid shadowing.
0248044d 21727
8ff096c1 21728 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
21729 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
21730 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 21731 (ftfont_list): Remove unused local.
49eaafba
PE
21732 (get_adstyle_property, ftfont_pattern_entity):
21733 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
21734 Rename locals to avoid shadowing.
8ff096c1 21735
e2be39f6
PE
21736 * xfont.c (xfont_list_family): Mark var as initialized.
21737
c9735e30
PE
21738 * xml.c (make_dom): Now static.
21739
8f5201ae
PE
21740 * composite.c (composition_compute_stop_pos): Rename local to
21741 avoid shadowing.
b246f932
PE
21742 (composition_reseat_it): Remove unused locals.
21743 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 21744 (composition_update_it): Mark var as initialized.
11b61122
PE
21745 (find_automatic_composition): Mark vars as initialized,
21746 with a FIXME (Bug#8290).
8f5201ae 21747
760fbc2c
PE
21748 character.h: Rename locals to avoid shadowing.
21749 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
21750 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
21751 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
21752 (BUF_DEC_POS): Be more systematic about renaming local temporaries
21753 to avoid shadowing.
21754
ff08eb85
PE
21755 * textprop.c (property_change_between_p): Remove; unused.
21756
fc7bf025
PE
21757 * intervals.c (interval_start_pos): Now static.
21758
235d7abc
PE
21759 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
21760
44f230aa
SM
21761 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
21762 Rename locals to avoid shadowing.
3e7d6594 21763
50060332
PE
21764 * sound.c (wav_play, au_play, Fplay_sound_internal):
21765 Fix pointer signedness.
d01f234b 21766 (alsa_choose_format): Remove unused local var.
c83b8872
PE
21767 (wav_play): Initialize a variable to 0, to prevent undefined
21768 behavior (Bug#8278).
50060332 21769
c4fc4e30
PE
21770 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
21771
918436ed
PE
21772 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
21773
c939f91b
PE
21774 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
21775 clobbering (Bug#8298).
b9c7f648
PE
21776 * sysdep.c (sys_subshell): Likewise.
21777 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 21778
6bd8c144
PE
21779 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
21780 This should get cleaned up, so that child_setup has the
21781 same signature on all platforms.
21782
7710357c 21783 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 21784 (relocate_fd): Rename locals to avoid shadowing.
7710357c 21785
c59da222
CY
217862011-03-22 Chong Yidong <cyd@stupidchicken.com>
21787
21788 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
21789 not to be necessary, and produces flickering.
21790
66b87493
GM
217912011-03-20 Glenn Morris <rgm@gnu.org>
21792
21793 * config.in: Remove file.
21794
45b6f6d5
JB
217952011-03-20 Juanma Barranquero <lekktu@gmail.com>
21796
21797 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
21798 are now in src/globals.h.
21799 (syms_of_minibuf): Remove spurious & from previous change.
21800
cd394be1 218012011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
21802
21803 * minibuf.c (completing-read-function): New variable.
21804 (completing-read-default): Rename from completing-read.
21805 (completing-read): Call completing-read-function.
21806
b14e3e21
CY
218072011-03-19 Juanma Barranquero <lekktu@gmail.com>
21808
21809 * xfaces.c (Fx_load_color_file):
21810 Read color file from absolute filename (bug#8250).
21811
f2b726e6
JB
218122011-03-19 Juanma Barranquero <lekktu@gmail.com>
21813
21814 * makefile.w32-in: Update dependencies.
21815
09f6ff02
EZ
218162011-03-17 Eli Zaretskii <eliz@gnu.org>
21817
21818 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
21819
29a6015a
PE
218202011-03-17 Paul Eggert <eggert@cs.ucla.edu>
21821
a3a6c54e
PE
21822 Fix more problems found by GCC 4.5.2's static checks.
21823
b766f867
PE
21824 * process.c (make_serial_process_unwind, send_process_trap):
21825 (sigchld_handler): Now static.
21826
be02381c
PE
21827 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
21828 That way, the code declares only the vars that it needs.
21829 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
21830 * s/cygwin.h (PTY_ITERATION): Likewise.
21831 * s/darwin.h (PTY_ITERATION): Likewise.
21832 * s/gnu-linux.h (PTY_ITERATION): Likewise.
21833
57048744
PE
21834 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
21835 * process.c (allocate_pty): Don't declare stb unless it's needed.
21836
7914961c 21837 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
21838 (CONSTANTLIM): Remove; unused.
21839 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
21840 Define only if needed.
7914961c 21841
b3967b18
PE
21842 * unexelf.c (unexec): Name an expression,
21843 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
21844 Use a different way to cause a compilation error if anyone uses
21845 n rather than nn, a way that does not involve shadowing.
73366a00 21846 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 21847
29a6015a
PE
21848 * deps.mk (unexalpha.o): Remove; unused.
21849
43cfc33e 21850 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 21851 * unexec.h: New file.
ce701a33
PE
21852 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
21853 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
21854 Depend on unexec.h.
21855 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
21856 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
21857 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 21858 Change as necessary to match prototype in unexec.h.
ce701a33 21859
01f44d5a
PE
21860 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
21861 shadowing.
4f63c6bb 21862 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 21863
a6670b0b
PE
21864 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
21865 Rename locals to avoid shadowing.
21866
cef2010d 21867 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 21868 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 21869
d4d7173a
PE
21870 * print.c (Fredirect_debugging_output): Fix pointer signedess.
21871
f08b802a
PE
21872 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
21873 warning when compiling print.c.
21874
3ddb0639
PE
21875 * font.c (font_unparse_fcname): Abort in an "impossible" situation
21876 instead of using an uninitialized var.
5ad03b97 21877 (font_sort_entities): Mark var as initialized.
3ddb0639 21878
170a2692
PE
21879 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
21880
e663c700
PE
21881 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
21882 pointers to constants.
89bc529a 21883 (font_parse_fcname): Remove unused vars.
7b81e2d0 21884 (font_delete_unmatched): Now static.
ea838e10 21885 (font_get_spec): Remove; unused.
13a547c6
PE
21886 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
21887 (font_update_drivers, Ffont_get_glyphs, font_add_log):
21888 Rename or move locals to avoid shadowing.
e663c700 21889
2a80c887 21890 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 21891 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 21892
1384fa33 21893 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 21894 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 21895
8b2c52e9
PE
21896 * alloc.c (mark_backtrace): Move decl from here ...
21897 * lisp.h: ... to here, so that it can be checked.
21898
475545b5 21899 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 21900 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
21901 (lisp_indirect_variable): Name an expression,
21902 to avoid gcc -Wbad-function-cast warning.
1faed8ae 21903 (Fdefvar): Rename locals to avoid shadowing.
475545b5 21904
b1349114 21905 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 21906 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 21907 Use const pointer when appropriate.
b1349114 21908
a2928364
PE
21909 * lisp.h (get_system_name, get_operating_system_release):
21910 Move decls here, to check interfaces.
21911 * process.c (get_operating_system_release): Move decl to lisp.h.
21912 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
21913 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
21914 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
21915 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
21916 (Fformat_time_string, Fencode_time, Finsert_char):
21917 (Ftranslate_region_internal, Fformat):
21918 Rename or remove local vars to avoid shadowing.
9710023e 21919 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 21920
a415e694
PE
21921 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
21922 avoid shadowing.
21923
8ef4622d
PE
21924 * lisp.h (eassert): Check that the argument compiles, even if
21925 ENABLE_CHECKING is not defined.
21926
946f9a5b
PE
21927 * data.c (Findirect_variable): Name an expression, to avoid
21928 gcc -Wbad-function-cast warning.
112396d6 21929 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 21930 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
21931 (Fmake_variable_buffer_local, Fmake_local_variable):
21932 Mark variables as initialized.
52746918 21933 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 21934
e5aab7e7 21935 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
21936 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
21937 Rename locals to avoid shadowing.
dff45157
PE
21938 (mark_stack): Move local variables into the #ifdef region where
21939 they're used.
7bc26fdb
PE
21940 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
21941 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
21942 needed otherwise.
21943 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
21944 (GC_STRING_CHARS): Remove; not used.
d40d4be1 21945 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 21946
e5aab7e7
PE
21947 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
21948 avoids undefined behavior in theory.
21949
4da60324
PE
21950 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
21951
88043301
PE
21952 Use functions, not macros, for up- and down-casing (Bug#8254).
21953 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
21954 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
21955 to use the following functions instead of these macros.
21956 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
21957 EMACS_INT, since callers assume the returned value fits in int.
21958 (upcase1): Likewise, for UPCASE_TABLE.
21959 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 21960 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 21961 the race-condition problem in the old DOWNCASE.
88043301 21962
19ed5445
PE
21963 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
21964 Rename locals to avoid shadowing.
21965 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
21966 (regex_compile, re_search_2, re_match_2_internal):
21967 Remove unused local vars.
952db0d7
PE
21968 (FREE_VAR): Rewrite so as not to use empty "else",
21969 which gcc can warn about.
da053e48 21970 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
21971 (RETALLOC_IF): Define only if needed.
21972 (WORDCHAR_P): Likewise. This one is never needed, but is used
21973 only in a comment talking about a compiler bug, so put inside
21974 the #if 0 of that comment.
21975 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
21976 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
21977 Remove; unused.
19ed5445 21978
1f3561e4 21979 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
21980 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
21981 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 21982
ded6f8f7
PE
21983 * search.c (simple_search): Remove unused var.
21984
dbd37a95
PE
21985 * dired.c (compile_pattern): Move decl from here ...
21986 * lisp.h: ... to here, so that it can be checked.
21987 (struct re_registers): New forward decl.
21988
7e47afad
PE
21989 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
21990
85f24f61
PE
21991 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
21992 All uses changed.
21993 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
21994 Rename locals to avoid shadowing.
5671df8f 21995 (Fvertical_motion): Mark locals as initialized.
85f24f61 21996
181aa2be 21997 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 21998 (casify_region): Mark local as initialized.
181aa2be 21999
930d429c
PE
22000 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22001
7082eac6
PE
22002 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22003 New macros, so that the caller can use some names other than
22004 gcpro1, gcpro2, etc.
22005 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22006 of the new macros.
22007 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22008 argument, for consistency with GCPRO2_VAR, etc: it is now the
22009 prefix of the variable, not the variable itself. All uses
22010 changed.
38b2c076
PE
22011 * dired.c (directory_files_internal, file_name_completion):
22012 Rename locals to avoid shadowing.
22013
15206ed9
PE
22014 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22015 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22016 dired.c's scmp function, had undefined behavior.
22017 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22018 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22019 * buffer.h: ... to here, because these macros use current_buffer,
22020 and the new implementation with inline functions needs to have
22021 current_buffer in scope now, rather than later when the macros
22022 are used.
22023 (downcase, upcase1): New static inline functions.
22024 (DOWNCASE, UPCASE1): Reimplement using these functions.
22025 This avoids undefined behavior in expressions like
22026 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22027 from race conditions in accessing the global variables
22028 case_temp1 and case_temp2.
22029 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22030 * lisp.h (case_temp1, case_temp2): Remove their decls.
22031 * character.h (ASCII_CHAR_P): Move from here ...
22032 * lisp.h: ... to here, so that the inline functions mentioned
22033 above can use them.
22034
4a6bea26
PE
22035 * dired.c (directory_files_internal_unwind): Now static.
22036
f14b7e14
PE
22037 * fileio.c (file_name_as_directory, directory_file_name):
22038 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22039 Now static.
2893f146
PE
22040 (file_name_as_directory): Use const pointers when appropriate.
22041 (Fexpand_file_name): Likewise. In particular, newdir might
22042 point at constant storage, so make it a const pointer.
fd4ead52 22043 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
22044 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22045 signedness issues.
f839df0c
PE
22046 (Fset_file_times, Finsert_file_contents, auto_save_error):
22047 Rename locals to avoid shadowing.
f14b7e14 22048
5716756e 22049 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
22050 (Ftry_completion, Fall_completions): Rename or remove locals
22051 to avoid shadowing.
5716756e 22052
b4c3046a
PE
22053 * marker.c (bytepos_to_charpos): Remove; unused.
22054
b45db522
PE
22055 * lisp.h (verify_bytepos, count_markers): New decls,
22056 so that gcc does not warn that these functions aren't declared.
22057
85876d07
PE
22058 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22059 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 22060 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 22061 (copy_text): Remove unused local var.
85876d07 22062
03d78a21 22063 * filelock.c (within_one_second): Now static.
b3dd38ab 22064 (lock_file_1): Rename local to avoid shadowing.
03d78a21 22065
5df8f01b
PE
22066 * buffer.c (fix_overlays_before): Mark locals as initialized.
22067 (fix_start_end_in_overlays): Likewise. This function should be
22068 simplified by using pointers-to-pointers, but that's a different
22069 matter.
b1d876f1 22070 (switch_to_buffer_1): Now static.
8f54f30a
PE
22071 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22072 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 22073
a70072c9 22074 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 22075 Fix pointer signedness issue.
edced198
PE
22076 (sys_subshell): Mark local as volatile if checking for lint,
22077 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 22078 (MAXPATHLEN): Define only if needed.
a70072c9 22079
a0977c44
PE
22080 * process.c (serial_open, serial_configure): Move decls from here ...
22081 * systty.h: ... to here, so that they can be checked.
22082
a884fdcc
PE
22083 * fns.c (get_random, seed_random): Move extern decls from here ...
22084 * lisp.h: ... to here, so that they can be checked.
22085
604efe86 22086 * sysdep.c (reset_io): Now static.
b8950c94 22087 (wait_for_termination_signal): Remove; unused.
604efe86 22088
38fc62d9
PE
22089 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22090 (copy_keymap_item, append_key, push_text_char_description):
22091 Now static.
1004a21a 22092 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 22093 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
22094 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22095 (describe_map_tree):
22096 Rename locals to avoid shadowing.
38fc62d9 22097
2f2650da
PE
22098 * keyboard.c: Declare functions static if they are not used elsewhere.
22099 (echo_char, echo_dash, cmd_error, top_level_2):
22100 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
22101 (read_char, kbd_buffer_get_event, make_lispy_position):
22102 (make_lispy_event, make_lispy_movement, apply_modifiers):
22103 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22104 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22105 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 22106 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 22107 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 22108
a053e86c 22109 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
22110 (mark_kboards): Move decl here ...
22111 * alloc.c (mark_kboards): ... from here.
a053e86c 22112
4752793e
PE
22113 * lisp.h (force_auto_save_soon): New decl.
22114
74f10ca7 22115 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
22116 (DEFINE_DUMMY_FUNCTION): New macro.
22117 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22118 Use it.
c03cd23f
PE
22119 (main): Add casts to avoid warnings
22120 if GCC considers string literals to be constants.
74f10ca7 22121
022e70d4
PE
22122 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22123
59d6fe83
PE
22124 * dbusbind.c: Pointer signedness fixes.
22125 (xd_signature, xd_append_arg, xd_initialize):
22126 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22127 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22128 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22129 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22130
78320123
PE
22131 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22132 if GCC considers string literals to be constants.
49cebcca 22133 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 22134
35ac2a97
SM
221352011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22136
fb103ca9
SM
22137 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22138 (print_preprocess, print_object): New macro to fix last change.
22139
35ac2a97
SM
22140 * print.c (print_preprocess): Don't forget font objects.
22141
62973b41
JB
221422011-03-16 Juanma Barranquero <lekktu@gmail.com>
22143
22144 * emacs.c (USAGE3): Doc fixes.
22145
0e48bb22
AS
221462011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22147
22148 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22149 structure.
22150
7684e57b
JB
221512011-03-14 Juanma Barranquero <lekktu@gmail.com>
22152
22153 * lisp.h (VWindow_system, Qfile_name_history):
22154 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22155 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22156 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22157
22158 * w32select.c: Don't #include "keyboard.h".
c96bbc66 22159 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
22160
22161 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22162 * w32console.c (detect_input_pending, read_input_pending)
22163 (encode_terminal_code):
22164 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22165 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22166 (w32_system_caret_y, Qfile_name_history):
22167 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22168 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22169 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22170 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22171 * w32proc.c (Qlocal, report_file_error):
22172 * w32term.c (Vwindow_system, updating_frame):
22173 * w32uniscribe.c (initialized, uniscribe_font_driver):
22174 Remove unneeded extern declarations.
22175
2aa46d6c
CY
221762011-03-14 Chong Yidong <cyd@stupidchicken.com>
22177
c96bbc66 22178 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 22179
cffc6f3b
CY
221802011-03-13 Chong Yidong <cyd@stupidchicken.com>
22181
22182 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22183 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22184 These macros can no longer be used for assignment.
22185
44f230aa
SM
22186 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22187 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
22188 (record_buffer_markers, fetch_buffer_markers): New functions for
22189 recording and fetching special buffer markers.
22190 (set_buffer_internal_1, set_buffer_temp): Use them.
22191
22192 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22193
22194 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22195
22196 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22197 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22198
22199 * xdisp.c (hscroll_window_tree):
22200 (reconsider_clip_changes): Use PT instead of BUF_PT.
22201
d251f04b
EZ
222022011-03-13 Eli Zaretskii <eliz@gnu.org>
22203
22204 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22205 $(EMACS_ROOT)/lib/intprops.h.
22206
f0c77cd1
PE
222072011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22208
3eca4629
PE
22209 Fix more problems found by GCC 4.5.2's static checks.
22210
7c86ee98
PE
22211 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22212 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
22213 (xg_free_frame_widgets): Make it clear that a local variable is
22214 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
22215 (gdk_window_get_screen): Make it clear that this macro is needed
22216 only if USE_GTK_TOOLTIP.
1e5524e7
PE
22217 (int_gtk_range_get_value): New function, which avoids a diagnostic
22218 from gcc -Wbad-function-cast.
22219 (xg_set_toolkit_scroll_bar_thumb): Use it.
22220 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22221 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
22222 (get_utf8_string, xg_get_file_with_chooser):
22223 Rename locals to avoid shadowing.
22224 (create_dialog): Move locals to avoid shadowing.
7c86ee98 22225
41729b81
PE
22226 * xgselect.c (xg_select): Remove unused var.
22227
f0c77cd1
PE
22228 * image.c (four_corners_best): Mark locals as initialized.
22229 (gif_load): Initialize transparent_p to zero (Bug#8238).
22230 Mark another local as initialized.
ec6cf4c6 22231 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 22232
ce0ad53d 22233 * image.c (clear_image_cache): Now static.
d5d5a617 22234 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 22235 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
22236 (x_edge_detection): Remove unnecessary cast that
22237 gcc -Wbad-function-cast diagnoses.
2037898d 22238 (gif_load): Fix pointer signedness.
6ae141d6
PE
22239 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22240 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 22241
33383987 222422011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 22243
d32df629
PE
22244 Improve quality of tests for time stamp overflow.
22245 For example, without this patch (encode-time 0 0 0 1 1
22246 1152921504606846976) returns the obviously-bogus value (-948597
22247 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22248 reports time overflow. See
22249 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
22250 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22251 * editfns.c: Include limits.h and intprops.h.
22252 (TIME_T_MIN, TIME_T_MAX): New macros.
22253 (time_overflow): Move earlier, to before first use.
22254 (hi_time, lo_time): New functions, for an accurate test for
22255 out-of-range times.
22256 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22257 (Fget_internal_run_time): Don't assume time_t fits in int.
22258 (make_time): Use list2 instead of Fcons twice.
22259 (Fdecode_time): More accurate test for out-of-range times.
22260 (check_tm_member): New function.
22261 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
22262 (lisp_time_argument): Don't rely on undefined left-shift and
22263 right-shift behavior when checking for time stamp overflow.
8be6f318 22264
fe31d94c
PE
22265 * editfns.c (time_overflow): New function, refactoring common code.
22266 (Fformat_time_string, Fdecode_time, Fencode_time):
22267 (Fcurrent_time_string): Use it.
22268
8be6f318
PE
22269 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22270 * dired.c (make_time): Move to ...
22271 * editfns.c (make_time): ... here.
22272 * systime.h: Note the move.
22273
09d9db2c 222742011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 22275
126bc0dc
YM
22276 * fringe.c (update_window_fringes): Remove unused variables.
22277
c47cbdfd
YM
22278 * unexmacosx.c (copy_data_segment): Also copy __got section.
22279 (Bug#8223)
22280
7ac80be9
EZ
222812011-03-12 Eli Zaretskii <eliz@gnu.org>
22282
c96bbc66 22283 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22284 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22285 Constify `char *' arguments and their references according to
22286 prototypes in tparam.h.
22287
ecb0f94d 22288 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22289
7ac80be9
EZ
22290 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22291 Adapt all references accordingly.
22292
22293 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22294
ef1fd07e
TT
222952011-03-11 Tom Tromey <tromey@redhat.com>
22296
22297 * buffer.c (syms_of_buffer): Remove obsolete comment.
22298
7ef4b50c
EZ
222992011-03-11 Eli Zaretskii <eliz@gnu.org>
22300
22301 * termhooks.h (encode_terminal_code): Declare prototype.
22302
22303 * msdos.c (encode_terminal_code): Don't declare prototype.
22304
22305 * term.c (encode_terminal_code): Now external again, used by
22306 w32console.c and msdos.c.
22307
44f230aa
SM
22308 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22309 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22310
4b1ec863 223112011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22312
1714f52b 22313 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22314
4b1ec863
PE
22315 * fringe.c (update_window_fringes): Mark locals as initialized
22316 (Bug#8227).
22317 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22318
524c7aa6
PE
22319 * alloc.c (mark_fringe_data): Move decl from here ...
22320 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22321 to check its interface.
22322 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22323
a5c0af81 22324 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22325 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22326 (fontset_font): Mark local as initialized.
a9a06e0b 22327 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22328
b4716021
PE
22329 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22330
811e9bac 22331 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22332 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22333 (x_own_selection, Fx_disown_selection_internal): Rename locals
22334 to avoid shadowing.
22335 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22336
7e3ab302
PE
22337 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22338 so that the caller can use some name other than gcpro1.
22339 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22340 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22341 (Fx_backspace_delete_keys_p):
22342 Use them to avoid shadowing, and rename vars to avoid shadowing.
22343 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22344 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22345 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22346 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22347 Remove unused locals.
7e3ab302
PE
22348 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22349 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22350 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22351 macros.
f78faa98 22352
e2b13473
PE
22353 * xterm.h (x_mouse_leave): New decl.
22354
77f23912
PE
22355 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22356 Remove unused functions.
cdf4ba58
PE
22357 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22358 (x_calc_absolute_position): Now static.
7411c686 22359 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 22360 Don't declare local "event" unless it's used.
ed7bf3a5
PE
22361 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22362 unless they are used.
38d0b34a
PE
22363 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22364 (x_fatal_error_signal): Remove; not used.
a6067996
PE
22365 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22366 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22367 (x_error_catcher, x_connection_closed, x_error_handler):
22368 (x_error_quitter, xembed_send_message, x_iconify_frame):
22369 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 22370 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 22371 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 22372
44f230aa
SM
22373 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22374 Rename or move locals to avoid shadowing.
6b463e58 22375 (tty_defined_color, merge_face_heights): Now static.
5967d051 22376 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
22377 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22378 does not deduce is never used uninitialized.
73719eba
PE
22379 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22380 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 22381
426994c3 22382 * terminal.c (store_terminal_param): Now static.
5489860b 22383
032f1620 22384 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 22385 (set_frame_menubar): Remove unused local.
d4323972 22386 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
22387 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22388 since they might point to immutable storage.
281585b0
PE
22389 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22390 since it's unused otherwise.
032f1620 22391
367c19e5 22392 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 22393 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
22394 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22395 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 22396 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
22397 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22398 does not deduce are never used uninitialized.
70739cbe 22399
07b48fa9
PE
22400 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22401
8868a238 22402 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
22403 * window.c (window_loop, size_window):
22404 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 22405
7e5cf297 22406 * window.c (display_buffer): Now static.
d6550a9f
PE
22407 (size_window): Mark variables that gcc -Wuninitialized
22408 does not deduce are never used uninitialized.
a586633d
PE
22409 * window.h (check_all_windows): New decl, to forestall
22410 gcc -Wmissing-prototypes diagnostic.
5b555da1 22411 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 22412
f6095868
PE
22413 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22414 shadowing.
22415 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
22416 Include <limits.h>.
22417 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22418 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
22419 (load_charset_map): Mark variables that gcc -Wuninitialized
22420 does not deduce are never used uninitialized.
53df7c11 22421 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 22422
f38b440c
PE
22423 * coding.c (coding_set_source, coding_set_destination):
22424 Use "else { /* comment */ }" rather than "else /* comment */;"
22425 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
22426 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22427 a block, when the outer 'i' will do.
22428 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22429 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22430 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22431 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22432 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22433 Rename locals to avoid shadowing.
22434 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
22435 * coding.c (emacs_mule_char, encode_invocation_designation):
22436 Now static, since they're not used elsewhere.
413bb2db 22437 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 22438 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
22439 (decode_coding_emacs_mule): Mark variables that gcc
22440 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
22441 (detect_coding_iso_2022): Initialize a local variable that might
22442 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 22443 this initialization is needed. (Bug#8211)
5f58e762
PE
22444 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22445 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22446 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22447 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22448 Remove unused macros.
f38b440c 22449
232b38b9 22450 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 22451 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 22452 * character.c (string_count_byte8): Likewise.
232b38b9 22453
fb90da1b
PE
22454 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22455 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22456
fb93dbc2
PE
22457 * chartab.c (copy_sub_char_table): Now static, since it's not used
22458 elsewhere.
5c156ace
PE
22459 (sub_char_table_ref_and_range, char_table_ref_and_range):
22460 Rename locals to avoid shadowing.
bbcd0949 22461 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 22462
7d3b3862 22463 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 22464 (BIDI_BOB): Remove unused macro.
7d3b3862 22465
6be7d3da
PE
22466 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22467 deduce are never used uninitialized.
c2ed9c8b 22468 * term.c (encode_terminal_code): Likewise.
6be7d3da 22469
75f8807f 22470 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 22471
50938595
PE
22472 * tparam.h: New file.
22473 * term.c, tparam.h: Include it.
22474 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22475 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22476 Move these decls to tparam.h, and make them agree with what
22477 is actually in tparam.c. The previous trick of using incompatible
22478 decls in different modules does not conform to the C standard.
22479 All callers of tparam changed to use tparam's actual API.
22480 * tparam.c (tparam1, tparam, tgoto):
22481 Use const pointers where appropriate.
22482
fbceeba2
PE
22483 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22484 * cm.h (struct cm): Likewise.
22485 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22486 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22487 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22488 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22489 (turn_on_face, init_tty): Likewise.
22490 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 22491
7f3f1250
PE
22492 * term.c (term_mouse_position): Rename local to avoid shadowing.
22493
e6ca6543
PE
22494 * alloc.c (mark_ttys): Move decl from here ...
22495 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22496
c40f8d15
AS
224972011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22498
22499 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22500
cfe0661d
JB
225012011-03-09 Juanma Barranquero <lekktu@gmail.com>
22502
22503 * search.c (compile_pattern_1): Remove argument regp, unused since
22504 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22505 (compile_pattern): Don't pass it.
22506
0afb4571
J
225072011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22508
22509 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22510 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22511 for ! HAVE_GTK3.
22512 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22513
22514 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22515
22516 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22517 gdk_window_get_screen, gdk_window_get_geometry,
22518 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22519 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22520 (xg_get_pixbuf_from_pixmap): New function.
22521 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22522 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22523 Call xg_get_pixbuf_from_pixmap instead of
22524 gdk_pixbuf_get_from_drawable.
22525 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22526 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22527 (xg_check_special_colors): Use GtkStyleContext and its functions
22528 for HAVE_GTK3.
22529 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22530 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22531 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
22532 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22533 Call gtk_widget_get_preferred_size.
0afb4571
J
22534 (xg_frame_resized): gdk_window_get_geometry only takes 5
22535 parameters.
44f230aa
SM
22536 (xg_win_to_widget, xg_event_is_for_menubar):
22537 Call gdk_x11_window_lookup_for_display.
0afb4571
J
22538 (xg_set_widget_bg): New function.
22539 (delete_cb): New function.
895009e1 22540 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 22541 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
22542 (xg_set_background_color): Call xg_set_widget_bg.
22543 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22544 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22545 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22546 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22547 if ! HAVE_GTK3.
22548 (update_frame_tool_bar): Call gtk_widget_hide.
22549 (xg_initialize): Use GDK_KEY_g.
22550
22551 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22552 if ! HAVE_GTK3
22553 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22554
22555 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22556 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22557 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22558
1c2cc4ef
JB
225592011-03-08 Juanma Barranquero <lekktu@gmail.com>
22560
22561 * w32xfns.c (select_palette): Check success of RealizePalette against
22562 GDI_ERROR, not zero.
22563
33383987 22564See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22565
22566;; Local Variables:
22567;; coding: utf-8
aac0c6e3
MR
22568;; End:
22569
ab422c4d 22570 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22571
22572 This file is part of GNU Emacs.
22573
22574 GNU Emacs is free software: you can redistribute it and/or modify
22575 it under the terms of the GNU General Public License as published by
22576 the Free Software Foundation, either version 3 of the License, or
22577 (at your option) any later version.
22578
22579 GNU Emacs is distributed in the hope that it will be useful,
22580 but WITHOUT ANY WARRANTY; without even the implied warranty of
22581 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22582 GNU General Public License for more details.
22583
22584 You should have received a copy of the GNU General Public License
22585 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.