Fix last change.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
7fd8c501
PE
12013-03-13 Paul Eggert <eggert@cs.ucla.edu>
2
d9df6f40
PE
3 Static checking by Sun C 5.12.
4 * alloc.c (buffer_memory_full) [REL_ALLOC]:
5 * bytecode.c (exec_byte_code):
6 * dispnew.c (init_display):
7 * eval.c (error):
8 * fileio.c (Fsubstitute_in_file_name):
9 * keyboard.c (Fevent_convert_list):
10 * keymap.c (Fsingle_key_description):
11 * term.c (maybe_fatal, fatal):
12 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
13 * xsmfns.c (Fhandle_save_session):
14 Omit unreachable code.
15 * keymap.c (map_keymap_char_table_item): Cast void * to
16 a function pointer type; the C Standard requires this.
17
7fd8c501
PE
18 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
19 Include <sys/param.h> unconditionally, as that works elsewhere and
20 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
21 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
22 and FreeBSD now.
23
cb0290df
PE
242013-03-11 Paul Eggert <eggert@cs.ucla.edu>
25
26 * insdel.c (adjust_after_replace): Use bool for boolean.
27
cbae07d5
SM
282013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * keyboard.c: Move keyboard decoding to read_key_sequence.
31 (decode_keyboard_code): Remove.
32 (tty_read_avail_input): Don't try to decode input.
33 (read_decoded_char): New function.
34 (read_key_sequence): Use it.
35
819e2da9
DC
362013-03-10 Daniel Colascione <dancol@dancol.org>
37
38 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
39 (GUI_SDATA, guichar_t): Macros to abstract out differences between
40 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
41 w32fns.c.
42
43 * w32term.c (construct_drag_n_drop): Use the above macros to make
44 drag-and-drop work for non-ASCII filenames in cygw32 builds.
45
46 * w32fns.c (x_set_name, x_set_title): Use the above macros to
47 properly display non-ASCII frame titles in cygw32 builds.
48
49 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
50 call ShellExecute in cygw32 builds.
51
52 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
53 common file dialog code.
54
55 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
56 can just use du like other systems.
57
58 * coding.c (from_unicode_buffer): Declare.
59 * coding.c (from_unicode_buffer): Implement.
60
99ec1647
SM
612013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
62
d2e24f92
SM
63 * lread.c: Minor cleanup.
64 (FROM_FILE_P): New macro.
65 (skip_dyn_bytes, unreadchar, read1): Use it.
66 (read_list): Consolidate duplicated code.
67
99ec1647
SM
68 * bytecode.c (struct byte_stack): Remove `constants' when unused.
69
138c0ae8
EZ
702013-03-10 Eli Zaretskii <eliz@gnu.org>
71
72 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
73 (redisplay_internal, set_cursor_from_row, try_window)
74 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
75 (display_line, notice_overwritten_cursor)
99ec1647
SM
76 (mouse_face_from_buffer_pos, note_mouse_highlight):
77 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 78 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
79 (mouse_face_from_string_pos, fast_find_string_pos):
80 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
81
82 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
83
84 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
85
86 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
87 MATRIX_MODE_LINE_ROW.
88
89 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
90
c230dd7d
KH
912013-03-10 handa <handa@gnu.org>
92
93 * lisp.h (adjust_after_replace): Extern it.
94
95 * coding.c (detect_coding): Cound the heading ASCII bytes in the
96 case of detection for coding_category_utf_8_auto.
99ec1647
SM
97 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
98 Skip decoding if all bytes are ASCII.
c230dd7d
KH
99
100 * insdel.c (adjust_after_replace): Make it public. New arg
101 text_at_gap_tail.
102 (adjust_after_insert): Call adjust_after_replace with the new arg
103 value 0.
104
27a98a62
SM
1052013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
106
107 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
108 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
109 from Elisp via unread-command-events.
110
111 * keyboard.c (access_keymap_keyremap): Accept nil return value from
112 functions to mean "no change".
113
457882c2
PE
1142013-03-08 Paul Eggert <eggert@cs.ucla.edu>
115
116 region-cache.c, scroll.c, search.c: Use bool for booleans.
117 * lisp.h (compile_pattern):
118 * scroll.c (do_scrolling, do_direct_scrolling):
119 * search.c (struct regexp_cache, compile_pattern_1)
120 (compile_pattern, string_match_1, search_command)
121 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
122 (search_regs_saved, Fregexp_quote):
123 Use bool for boolean.
124 * region-cache.c (region_cache_forward, region_cache_backward):
125 Fix comments to match code: these functions return int, not boolean.
126
b5426561
DA
1272013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
128
129 * search.c (find_newline): Accept start and end byte positions
130 as arguments and allow -1 if not known.
131 (find_newline_no_quit): Likewise for start position.
132 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
133 * bidi.c (bidi_find_paragraph_start): Pass byte position to
134 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
135 * editfns.c (Fconstrain_to_field): Break long line.
136 Adjust call to find_newline.
b5426561
DA
137 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
138 Use DEC_BOTH to start next search from the previous buffer
139 position, where appropriate.
140 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
141 (get_visually_first_element, move_it_vertically_backward): Likewise.
142 Obtain byte position from the display iterator, where appropriate.
143
0bce5d9e
PE
1442013-03-08 Paul Eggert <eggert@cs.ucla.edu>
145
146 print.c, process.c: Use bool for booleans.
147 * lisp.h (wait_reading_process_output):
148 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
149 (strout, debug_output_compilation_hack, float_to_string, print)
150 (print_object):
151 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
152 (decode_status, status_message, create_process, create_pty)
153 (Fmake_network_process, Fnetwork_interface_info)
154 (wait_reading_process_output, read_process_output)
155 (write_queue_push, write_queue_pop, process_send_signal)
156 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
157 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
158 Use bool for booleans.
159 * process.c (Fnetwork_interface_list): Remove unused local.
160 (connect_counter): Now EMACS_INT, not int.
161
36075a19
DA
1622013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
163
164 * bidi.c (bidi_fetch_char): Swap first and second arguments
165 to match other functions accepting character and byte positions.
166 Adjust comment.
167 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
168 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
169 when you need just to move to the previous buffer position.
170 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
171
4aae1914
EZ
1722013-03-07 Eli Zaretskii <eliz@gnu.org>
173
174 * .gdbinit (prowlims): Display the enabled_p flag of the row.
175
c54aa166
DA
1762013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
177
178 Avoid character to byte conversions in motion subroutines.
179 * indent.h (compute_motion, vmotion): Add byte position argument.
180 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
181 Add eassert.
182 (Fcompute_motion): Break long line. Adjust call to compute_motion.
183 Use list5 for return value.
184 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
185 Adjust comments, style and calls to compute_motion.
186 (Fvertical_motion): Adjust call to vmotion.
187 * window.c (Fdelete_other_windows_internal): Record window start
188 byte position and adjust call to vmotion.
189 (window_scroll_line_based): Likewise with call to compute_motion.
190 Use SET_PT_BOTH.
191 (Frecenter): Adjust calls to vmotion.
192
3de717bd
DA
1932013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
194
195 * lisp.h (list2i, list3i): New functions.
196 (list4i): Move from window.c and make LISP_INLINE.
197 * editfns.c (make_lisp_time):
198 * fns.c (Flocale_info):
199 * keyboard.c (parse_modifiers):
200 * xterm.c (x_ewmh_activate_frame): Use list2i.
201 * instel.c (signal_after_change):
202 * nsfns.m (Fx_server_version, Fxw_color_values):
203 * w32fns.c (Fxw_color_values, Fx_server_version):
204 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
205 * fileio.c (Fvisited_file_modtime):
206 * nsfns.m (Fns_display_usable_bounds):
207 * w32.c (ltime): Use list4i.
208
d26e478e
EZ
2092013-03-06 Eli Zaretskii <eliz@gnu.org>
210
a611149e
EZ
211 * search.c (find_newline_no_quit): Rename from find_next_newline.
212 Add commentary.
213
214 * lisp.h (find_newline_no_quit): Rename prototype.
215
216 * xdisp.c (back_to_previous_line_start)
217 (forward_to_next_line_start, get_visually_first_element)
218 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
219 * indent.c (vmotion): Callers of find_newline_no_quit changed.
220 * bidi.c (bidi_find_paragraph_start): Callers of
221 find_newline_no_quit changed.
222
d26e478e
EZ
223 * msdos.c: Change encoding to cp850. (Bug#13879)
224 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
225
1af1a51a
DA
2262013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
227
228 Coding system support cleanup and minor refactoring.
229 * coding.h (enum coding_result_code): Remove
230 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
231 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
232 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
233 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
234 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
235 (decode_coding_region, encode_coding_region, decode_coding_string):
236 Remove unused compatibility macros.
237 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
238 (record_conversion_result): Adjust user.
239 (syms_of_coding): Likewise.
240 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
241 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
242 (decode_coding_object): Simplify since xrealloc never returns NULL.
243 Add eassert.
244
0bafabe7 2452013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 246
9b1c3271 247 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
248 * sysdep.c (list_system_processes)
249 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 250 Make it a stub in this case; otherwise the build might fail,
0845a75c 251 and this code hasn't been tested on such hosts anyway.
725eb027 252 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
253 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
254 and analyzed by Jérémie Courrèges-Anglas in
255 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 256
ffc65bee
DA
2572013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
258
259 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
260 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
261 (get_visually_first_element, move_it_vertically_backward): Ajust users.
262 * bidi.c (bidi_find_paragraph_start): Likewise.
263 * indent.c (vmotion): Likewise.
264
70743157
PE
2652013-03-05 Paul Eggert <eggert@cs.ucla.edu>
266
267 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
268 * filelock.c: Include <c-ctype.h>.
269 (MAX_LFINFO): New top-level constant.
270 (lock_info_type): Remove members pid, boot_time. Add members at,
271 dot, colon. Change user member to be the entire buffer, not a
272 pointer. This allows us to handle the case where a foreign
273 pid or boot time exceeds the local range. All uses changed.
274 (LINKS_MIGHT_NOT_WORK): New constant.
275 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
276 (defined_WINDOWSNT): Remove.
277 (MAKE_LOCK_NAME, file_in_lock_file_name):
278 Always use .#FILE (not .#-FILE) for the file lock,
279 even if it is a regular file.
280 (rename_lock_file): New function.
281 (create_lock_file): Use it.
282 (create_lock_file, read_lock_data):
283 Prefer a symbolic link for the lock file, falling back on a
284 regular file if symlinks don't work. Do not try to create
285 symlinks on MS-Windows, due to security hassles. Stick with
286 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
287 link, rename, unlink, mkstemp) when creating locks, as a GNUish
288 host may be using a Windowsish file system, and cannot use
289 MS-Windows-only system calls. Fall back on mktemp if mkstemp
290 doesn't work. Don't fail merely because of a symlink-contents
291 length limit in the current file system; fall back on regular
292 files. Increase the symlink contents length limit to 8 KiB, this
293 should be big enough for any real use and doesn't crunch the
294 stack.
295 (create_lock_file, lock_file_1, read_lock_data):
296 Simplify allocation of lock file buffers now that they fit in 8 KiB.
297 (lock_file_1): Return error number, not bool. All callers changed.
298 (ELOOP): New macro, if not already defined.
299 (read_lock_data): Return size of lock file contents, not Lisp object.
300 All callers changed. Handle a race condition if some other process
301 replaces a regular-file lock with a symlink lock or vice versa,
302 while we're trying to read the lock.
303 (current_lock_owner): Parse contents more carefully, to help avoid
304 confusing a regular-file lock with some other application's use
305 of the file. Check for lock file contents being too long, or
306 not parsing correctly.
307 (current_lock_owner, lock_file):
308 Allow foreign pid and boot times that exceed the local range.
309 (current_lock_owner, lock_if_free, lock_file):
310 Simplify allocation of lock file contents.
311 * w32.c (sys_rename_replace): New function, containing most of
312 the contents of the old sys_rename.
313 (sys_rename): Use it.
314 (fchmod): New dummy function.
315 * w32.h (sys_rename_replace, fchmod): New decls.
316
05e193f1
EZ
3172013-03-05 Eli Zaretskii <eliz@gnu.org>
318
319 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
320 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
321 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
322 <dmantipov@yandex.ru>.
323
3bfc46eb
DA
3242013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
325
326 * composite.c (get_composition_id, fill_gstring_header):
327 Use make_uninit_vector where appropriate.
328 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
329 * xselect.c (clean_local_selection_data): Likewise.
330
84ac6f9d
PE
3312013-03-04 Paul Eggert <eggert@cs.ucla.edu>
332
333 Fix misuse of ImageMagick that caused core dump (Bug#13846).
334 * image.c (imagemagick_load_image): Calculate height and width
335 after flattening the image, not before.
336
42926ec8
DA
3372013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
338
339 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
340 * ftfont.c (ftfont_shape_by_flt): Likewise.
341 * w32uniscribe.c (uniscribe_shape): Likewise.
342
b5029e23
PE
3432013-03-02 Paul Eggert <eggert@cs.ucla.edu>
344
345 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
346 The old approach, which fell back on DIR/.#FILE.0 through
347 DIR/.#FILE.9, had race conditions that could not be easily fixed.
348 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
349 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
350 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
351 because the locking mechanism was never reliable in that case).
352 This patch fixes this and other bugs discovered by a code
353 inspection that was prompted by
354 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
355 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
356 to avoid interoperability problems between the MS-Windows and
357 non-MS-Windows implementations. MS-Windows and non-MS-Windows
358 instances of Emacs now ignore each others' locks.
359 * filelock.c (defined_WINDOWSNT): New constant.
360 (MAKE_LOCK_NAME, fill_in_lock_file_name):
361 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
362 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
363 regular files on MS-Windows hosts.
364 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
365 Use SAFE_ALLOCA to avoid problems with long file names.
366 (MAX_LFINFO): Now a local constant, not a global macro.
367 (IS_LOCK_FILE): Remove.
368 (lock_file_1): Don't inspect errno if symlink call succeeds;
369 that's not portable.
370 (lock_file): Document that this function can return if lock
371 creation fails.
2db41375 372 (lock_file): Don't access freed storage.
b5029e23 373
b270d116
AS
3742013-03-02 Andreas Schwab <schwab@linux-m68k.org>
375
376 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
377
81c23309
PE
3782013-03-02 Paul Eggert <eggert@cs.ucla.edu>
379
380 * textprop.c: Use bool for booleans.
381 (validate_interval_range, Fadd_text_properties)
382 (Fremove_text_properties): Prefer bool to int when either works.
383
18f2ac09
EZ
3842013-03-02 Eli Zaretskii <eliz@gnu.org>
385
27a98a62
SM
386 * textprop.c (Fadd_text_properties, Fremove_text_properties):
387 If the interval tree changes as a side effect of calling
18f2ac09
EZ
388 modify_region, re-do processing starting from the call to
389 validate_interval_range. (Bug#13743)
390
929aeac6 3912013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
392
393 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
394 (Bug#13546).
395
531e70ec
EZ
3962013-02-27 Eli Zaretskii <eliz@gnu.org>
397
398 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
399 _SH_DENYRW flag, instead of emacs_open, to deny any other process
400 access to the lock file until it is written and closed.
401 (Bug#13807)
402
6e65b9cc
PE
4032013-02-27 Paul Eggert <eggert@cs.ucla.edu>
404
405 * callint.c (Qcall_interactively):
406 * macros.c (Qexecute_kbd_macro):
407 Now static.
408
3b166f09
BG
4092013-02-26 Bastien Guerry <bzg@gnu.org>
410
411 * window.c (Frecenter): Tiny docstring enhancement.
412
ecc0fdd4
PE
4132013-02-26 Paul Eggert <eggert@cs.ucla.edu>
414
415 Minor textprop integer cleanup.
416 * intervals.h, textprop.c (add_text_properties_from_list):
417 Return void, not int, since nobody uses the return value.
418 * textprop.c (validate_plist, add_properties, remove_properties)
419 (Fadd_text_properties):
420 Don't assume list length fits in int.
421 (interval_has_all_properties, interval_has_some_properties)
422 (interval_has_some_properties_list, add_properties, remove_properties)
423 (Fadd_text_properties, Fremove_text_properties)
424 (Fremove_list_of_text_properties, text_property_stickiness):
425 Use bool for booleans.
426 (Fadd_text_properties, Fremove_text_properties):
427 (Fremove_list_of_text_properties):
428 Reindent do-while as per GNU style.
429
0248b0d7
EZ
4302013-02-25 Eli Zaretskii <eliz@gnu.org>
431
343a2aef
EZ
432 Implement CLASH_DETECTION for MS-Windows.
433
434 * filelock.c [WINDOWSNT]: Include w32.h.
435 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
436 function of that name. Up-case the macro arguments.
437 (IS_LOCK_FILE): New macro.
438 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
439 (create_lock_file): New function, with body extracted from
440 lock_file_1.
441 [WINDOWSNT]: Implement lock files by writing a regular file with
442 the lock information as its contents.
443 (read_lock_data): New function, on Posix platforms just calls
444 emacs_readlinkat.
445 [WINDOWSNT]: Read the lock info from the file.
446 (current_lock_owner): Call read_lock_data instead of calling
447 emacs_readlinkat directly.
448 (lock_file) [WINDOWSNT]: Run the file name through
449 dostounix_filename.
450
451 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
452 just check if the process by that PID exists.
453
454 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
455 also present, as doing so will fail to error out if the file
456 already exists.
457
458 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
459
0248b0d7
EZ
460 * textprop.c (Fadd_text_properties, Fremove_text_properties)
461 (Fremove_list_of_text_properties): Skip all of the intervals in
462 the region between START and END that already have resp. don't
27a98a62
SM
463 have the requested properties, not just the first one.
464 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
465 properties. (Bug#13743)
466
b5071fc7
SM
4672013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
468
469 * callint.c (Fcall_interactively): Use the right lexical environment
470 for `interactive' specs (bug#13811).
471 * eval.c (Feval): Accept a lexical environment.
472
1ddc2bd6
PE
4732013-02-25 Paul Eggert <eggert@cs.ucla.edu>
474
475 Simplify data_start configuration (Bug#13783).
476 This is a followon simplification to the fix for Bug#13650.
477 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
478 (START_FILES): Remove. All uses removed.
479 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
480 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
481 (buildobj.h): Use it.
482 ($(ALLOBJS)): Depend on globals.h.
483 (temacs$(EXEEXT)): Use $(ALLOBJS).
484 * autodeps.mk (ALLOBJS): Move to Makefile.in.
485 * deps.mk (vm-limit.o):
486 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
487 Do not depend on mem-limits.h.
488 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
489 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
490 [__GNUC__ && !ORDINARY_LINK]: Remove.
491 * mem-limits.h, pre-crt0.c: Remove.
492 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
493 * unexcoff.c (etext): New decl.
494 (make_hdr): Use DATA_START instead of start_of_data.
495 * vm-limit.c: Move most of mem-limits.h's contents here.
496 (data_start): New decl. It's OK if this is approximate,
497 so simplify-away some unnecessary exactness.
498 (POINTER): Remove; all uses removed.
499 (data_space_start): Now char *, to avoid casts.
500 (exceeds_lisp_ptr): New function, replacing the old
501 EXCEEDS_LISP_PTR macro. All uses changed.
502 (check_memory_limits): Simplify and remove casts.
503 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
504 (memory_warnings): Use data_start instead of start_of_data.
505
51aa2a8b
AS
5062013-02-24 Andreas Schwab <schwab@linux-m68k.org>
507
508 * xdisp.c (set_message): Only check for debug-on-message if STRING
509 is a string. (Bug#13797)
510
1938d88c
PE
5112013-02-24 Paul Eggert <eggert@cs.ucla.edu>
512
513 Fix regression introduced by July 10 filelock.c patch.
514 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
515 2012-07-10 patch to this file. Reported by Eli Zaretskii in
516 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
517 and diagnosed by Andreas Schwab in
518 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
519
fcee5028
PE
5202013-02-22 Paul Eggert <eggert@cs.ucla.edu>
521
522 Assume C89 or better.
523 * ralloc.c (SIZE, POINTER, NIL):
524 * vm-limit.c (POINTER):
525 Remove, replacing all uses with C89 equivalents. These old
526 symbols were present only for porting to pre-C89 platforms.
527
d78cf5ed
CB
5282013-02-22 Claudio Bley <claudio.bley@gmail.com>
529
530 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
531 This avoids warning messages reported as part of Bug#13546.
532
6bcd97a4
KB
5332013-02-21 Ken Brown <kbrown@cornell.edu>
534
535 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
536
b6c2bfff
SM
5372013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
538
e11dacb5
SM
539 * sheap.c (report_sheap_usage): Prefer message1_nolog.
540
b6c2bfff
SM
541 * keyboard.c (Qcommand_execute): New var.
542 (command_loop_1, read_char): Use it.
543 (Fcommand_execute): Remove, replace by an Elisp implementation.
544 (syms_of_keyboard): Adjust accordingly.
545
d69f1120 5462013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 547
d69f1120
DC
548 * sheap.c (report_sheap_usage): Use message, not message1, so
549 that we don't try to create a buffer while we're in the middle
550 of dumping Emacs. Explain why.
b6c2bfff 551
2a14a4f1 5522013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 553
2a14a4f1
DA
554 * search.c (find_newline): Return byte position in bytepos.
555 Adjust comment.
b6c2bfff
SM
556 (find_next_newline_no_quit, find_before_next_newline):
557 Add bytepos argument.
2a14a4f1
DA
558 * lisp.h (find_newline, find_next_newline_no_quit)
559 (find_before_next_newline): Adjust prototypes.
560 * bidi.c (bidi_find_paragraph_start):
561 * editfns.c (Fconstrain_to_field, Fline_end_position):
562 * indent.c (compute_motion, vmotion):
563 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
564 (get_visually_first_element, move_it_vertically_backward):
565 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
566
872faefb 5672013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
568
569 * w32proc.c (new_child): Avoid leaking handles if the subprocess
570 resources were not orderly released.
571
fd80c659
EZ
5722013-02-17 Eli Zaretskii <eliz@gnu.org>
573
574 * xdisp.c (x_draw_vertical_border): For a window that is neither
575 the leftmost nor the rightmost, redraw both the left and the right
576 vertical borders. (Bug#13723)
577
2f73da9c
SM
5782013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
579
580 * xml.c (init_libxml2_functions):
581 * sound.c (sound_warning):
582 * sheap.c (report_sheap_usage):
583 * process.c (wait_reading_process_output):
584 * msdos.c (XMenuActivate):
585 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
586 * keyboard.c (top_level_1):
587 * editfns.c (Fmessage, Fmessage_box):
588 * callint.c (Fcall_interactively):
589 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
590
fd9547e8
JD
5912013-02-17 Jan Djärv <jan.h.d@swipnet.se>
592
593 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
594 * frame.c (syms_of_frame): ... to here.
595
f277993b
EZ
5962013-02-16 Eli Zaretskii <eliz@gnu.org>
597
c7939585
EZ
598 * w32.c (sys_chown): Remove unused function.
599
cd91fb4b
EZ
600 * w32term.c <input_signal_count>: Declare 'volatile'
601 unconditionally. (Bug#9066)
602
f277993b
EZ
603 * w32.c (set_errno): Reset h_errno and don't set it to any other
604 value. Set errno instead.
605 (check_errno): Reset h_errno.
606 (sys_socket, socket_to_fd, sys_bind, sys_connect)
607 (sys_gethostname, sys_getservbyname, sys_getpeername)
608 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
609 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
610 h_errno.
611 (sys_gethostbyname): Set h_errno only errors detected.
612
e454145b
PE
6132013-02-15 Paul Eggert <eggert@cs.ucla.edu>
614
615 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
616
bcf7fe2a
EZ
6172013-02-15 Eli Zaretskii <eliz@gnu.org>
618
ef9c57e2
EZ
619 * keyboard.c (read_char): Fix calculation of auto-save time out
620 when auto-save-timeout is less than 4. (Bug#13720)
621
ef862e20 622 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 623 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 624
bcf7fe2a
EZ
625 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
626 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
627 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
628 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
629 make sure errno is set to an appropriate value. (Bug#13546)
630 (socket_to_fd): Add assertion against indexing fd_info[] with a
631 value that is out of bounds.
632 (sys_accept): If fd is negative, do not set up the child_process
633 structure for reading.
634
0063fdb1
DA
6352013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
636
637 * composite.c (fill_gstring_header): Remove useless prototype.
638 Break long line.
639 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
640 * print.c (PRINTDECLARE, print_object):
641 * search.c (compile_pattern, fast_looking_at, search_buffer):
642 (simple_search, boyer_moore, Freplace_match):
643 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
644 (get_overlay_arrow_glyph_row, display_mode_element):
645 (decode_mode_spec_coding, message3):
646 * xfaces.c (face_at_string_position): Use bool for booleans.
647 Adjust comments.
648
648e5523 6492013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 650
35b3a27e
PE
651 Fix AIX port (Bug#13650).
652 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
653 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
654 was #undeffed earlier, so it cannot be used as a macro here.
655 Use the constant and not the macro.
35b3a27e 656
648e5523 6572013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 658
0e4e7b74
EZ
659 * w32proc.c (new_child): If no vacant slots are found in
660 child_procs[], make another pass looking for slots whose process
661 has exited or died. (Bug#13546)
662
6e432f0c
EZ
663 * w32.c (sys_pipe): When failing due to file descriptors above
664 MAXDESC, set errno to EMFILE.
665 (_sys_read_ahead): Update cp->status when failing to read serial
666 communications input, so that the status doesn't stay at
667 STATUS_READ_IN_PROGRESS. (Bug#13546)
668
51b3a99c
JD
6692013-02-14 Jan Djärv <jan.h.d@swipnet.se>
670
671 * gtkutil.c (tb_size_cb): New function.
672 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
673
e31560a7
SM
6742013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
675
676 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
677 an event.
678
fe336261
SM
6792013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
680
681 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
682
5a655b9f
DA
6832013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
684
685 * font.c (font_range): Add pos_byte argument. Adjust comment
686 and break long line.
687 * font.h (font_range): Adjust prototype.
688 * composite.c (autocmp_chars): Pass byte position to font_range.
689 Break long line. Remove useless prototype and format comment.
690
1a359750
GM
6912013-02-13 Glenn Morris <rgm@gnu.org>
692
693 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
694
01fcc3a5 6952013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 696
f53f992a
PE
697 Improve AIX port some more (Bug#13650).
698 With this, it should be as good as it was in 23.3, though it's
699 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
700 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
701 * unexaix.c (start_of_text): Remove.
702 (_data, _text): Declare as char[], not int, as AIX manual suggests.
703 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
704 (orig_load_scnptr, orig_data_scnptr):
705 Now off_t, not long, since they are file offsets.
706 (make_hdr): Use _data, not start_of_data ().
707 This is the key part of the fix.
708 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
709 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
710
4458c255
PE
711 * pre-crt0.c (data_start): Initialize to 1.
712 This ports to compilers that optimize the external declaration
713 'int x = 0;' as if it were 'int x;' to shrink the executable.
714
227be86d
PE
715 Improve AIX port (Bug#13650).
716 This doesn't fix the bug, but it makes progress: Emacs builds now.
717 * unexaix.c: Include inttypes.h, stdarg.h.
718 (report_error, report_error_1): Mark as _Noreturn.
719 (report_error): Don't report the wrong errno.
720 (report_error_1): Now varargs. All callers changed.
721 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
722 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
723 (write_ptr): Use %p to print address rather than %lx and a cast
724 to unsigned long. Grow buffer a bit, to be safer.
725
01fcc3a5 7262013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
727
728 * bidi.c (bidi_resolve_neutral): After finding the next
729 non-neutral character, accept NEUTRAL_ON type as well, because
730 directional control characters, such as LRE and RLE, have their
731 type converted to that by bidi_resolve_weak. This avoids aborts
732 when LRE/RLE follows a run of neutrals.
733 (bidi_move_to_visually_next): Assert that return value of
734 bidi_peek_at_next_level is non-negative. Negative values will
735 cause an infloop.
736
83be8524
PE
7372013-02-13 Paul Eggert <eggert@cs.ucla.edu>
738
739 Minor getenv-related fixes.
740 * callproc.c (Fcall_process_region) [!DOS_NT]:
741 Avoid unnecessary duplicate call to getenv.
742 * callproc.c (init_callproc):
743 * dispnew.c (init_display):
744 * sysdep.c (sys_subshell):
745 Omit unnecessary cast of getenv or egetenv.
746
45b2b768
JB
7472013-02-13 Juanma Barranquero <lekktu@gmail.com>
748
749 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
750 Update dependencies.
751
33b49d71
EZ
7522013-02-12 Eli Zaretskii <eliz@gnu.org>
753
754 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
755 marker's position.
756 (display_line): Set w->region_showing to the value of
757 it->region_beg_charpos, not to -1. This fixes redisplay
758 optimization when cursor is moved up after M->. (Bug#13623)
759 (Bug#13626)
c4131562
EZ
760 (try_scrolling): Scroll text up more if point is too close to ZV
761 and inside the scroll margin. This makes sure point is moved
762 outside the scroll margin in these cases.
33b49d71
EZ
763
764 * window.h (struct window): region_showing can no longer be
765 negative.
766
b09a4810
PE
7672013-02-11 Paul Eggert <eggert@cs.ucla.edu>
768
a84b7c53
PE
769 Tune by using memchr and memrchr.
770 * doc.c (Fsnarf_documentation):
771 * fileio.c (Fsubstitute_in_file_name):
772 * search.c (find_newline, scan_newline):
773 * xdisp.c (pos_visible_p, display_count_lines):
774 Use memchr and memrchr rather than scanning byte-by-byte.
775 * search.c (find_newline): Rename from scan_buffer.
776 Omit first arg TARGET, as it's always '\n'. All callers changed.
777
b09a4810
PE
778 Clean up read_key_sequence a tiny bit more.
779 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
780 (read_key_sequence): Remove unused locals.
781
99d0d6dc
SM
7822013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
783
784 Clean up read_key_sequence a bit; reread active keymaps after first event.
785 * keyboard.c (read_char, read_char_x_menu_prompt)
786 (read_char_minibuf_menu_prompt):
787 Replace nmaps+maps with a single `map' arg.
788 (follow_key): Operate on a single map.
789 (active_maps): New function.
790 (test_undefined): Also return true for nil bindings.
791 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
792 a single (composed) keymap. Remember `first_event' to choose the right
793 set of active keymaps. Recompute the set of keymaps after receiving
794 the first event. Remove GOBBLE_FIRST_EVENT.
795 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
796 * keyboard.h (read_char): Update declaration.
797 * lread.c (read_filtered_event): Adjust call to read_char.
798
f5e1b680
EZ
7992013-02-11 Eli Zaretskii <eliz@gnu.org>
800
99d0d6dc
SM
801 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
802 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
803 in the window. (Bug#13675)
804
f74de345
DA
8052013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
806
807 * marker.c (set_marker_internal): If desired position is passed
808 as a marker, avoid call to buf_charpos_to_bytepos.
809 * window.c (Fset_window_point): Omit redundant type checking.
810 (Fset_window_start): Likewise. Format comment.
811 (window_scroll_pixel_based): Use set_marker_restricted_both
812 with character and byte positions obtained from an iterator.
813 (Fset_window_configuration): Use set_marker_restricted_both.
814 * xdisp.c (message_dolog): Likewise.
815
a4ba3963
EZ
8162013-02-10 Eli Zaretskii <eliz@gnu.org>
817
99d0d6dc
SM
818 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
819 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
820 too far. This speeds up some redisplay operations. (Bug#13675)
821
68643cde
DA
8222013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
823
824 * syntax.c (scan_sexps_forward): Fix byte position calculation
825 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
826
7ba11bee
PE
8272013-02-10 Paul Eggert <eggert@cs.ucla.edu>
828
829 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
830 that was not needed.
831
eff1c190
PE
8322013-02-09 Paul Eggert <eggert@cs.ucla.edu>
833
834 Minor hashing refactoring.
835 * fns.c (SXHASH_REDUCE): Move to lisp.h.
836 (sxhash_float): Return EMACS_UINT, for consistency with the other
837 hash functions.
838 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
839 non-static inline function and therefore can't use static vars.
840 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
841 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
842 with the other hash functions.
843
6b48c831
EZ
8442013-02-09 Eli Zaretskii <eliz@gnu.org>
845
4dde2087
EZ
846 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
847 XXXXXX part of the temporary file pattern is not downcased even
848 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 849
8549f9e8
EZ
850 * xdisp.c (decode_mode_spec): Remove handling of %t.
851
6b48c831
EZ
852 * msdos.c (careadlinkatcwd): Remove.
853
75a65c7e
SM
8542013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
855
856 * lread.c (skip_dyn_bytes): New function (bug#12598).
857 (read1): Use it. Use getc instead of READCHAR to read bytes.
858 (load_each_byte): Remove. Update users.
859
8ca30920
DA
8602013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
861
862 * search.c (scan_buffer): Calculate end byte position just once.
863 (scan_newline): Do not recalculate start_byte.
864 (search_command): Use eassert.
865 * syntax.c (struct lisp_parse_state): New member location_byte.
866 (scan_sexps_forward): Record from_byte and avoid redundant
867 character to byte position calculation ...
868 (Fparse_partial_sexp): ... here. Break too long line.
869
25721f5b
DA
8702013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
871
872 * lisp.h (make_uninit_vector): New function.
873 * alloc.c (Fvector, Fmake_byte_code):
874 * ccl.c (Fregister_ccl_program):
875 * charset.c (Fdefine_charset_internal, define_charset_internal):
876 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
877 * composite.c (syms_of_composite):
878 * font.c (Fquery_font, Ffont_info, syms_of_font):
879 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
880 * ftfont.c (ftfont_shape_by_flt):
881 * indent.c (recompute_width_table):
882 * nsselect.m (clean_local_selection_data):
883 * syntax.c (init_syntax_once):
884 * w32unsubscribe.c (uniscribe_shape):
885 * window.c (Fcurrent_window_configuration):
886 * xfaces.c (Fx_family_fonts):
887 * xselect.c (selection_data_to_lisp_data): Use it.
888
9a9d91d9
DA
8892013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
890
891 * coding.c (Fdefine_coding_system_internal): Use AREF where
892 argument is known to be a vector.
893 * fns.c (Flocale_info): Likewise for ASET.
894 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
895 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
896
6871e574
JD
8972013-02-05 Jan Djärv <jan.h.d@swipnet.se>
898
899 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
900 height.
901
902 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
903 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
904 updateCollectionBehaviour.
905
906 * nsterm.m (NEW_STYLE_FS): Remove.
907 (ns_last_use_native_fullscreen): New variable.
908 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
909 (x_set_window_size): Do not take title bar and tool bar into account
910 if isFullscreen returns YES.
911 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
912 (check_native_fs): New function.
913 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
914 (ns_term_init): Remove NEW_STYLE_FS.
915 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
916 and tool bar if isFullscreen returns NO.
917 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
918 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
919 with HAVE_NATIVE_FS.
920 (window:willUseFullScreenPresentationOptions:): New method.
921 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
922 Hide toolbar if not enabled (Bug#13444).
923 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
924 Restore tool bar if enabled, hide it otherwise (Bug#13444).
925 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
926 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
927 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
928 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
929 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
930 (syms_of_nsterm): Add ns-use-native-fullscreen.
931
3f011c7f
PE
9322013-02-04 Paul Eggert <eggert@cs.ucla.edu>
933
934 * fileio.c (Qchoose_write_coding_system): Now static.
935
86f7c0fe
EZ
9362013-02-04 Eli Zaretskii <eliz@gnu.org>
937
938 * xdisp.c (window_buffer_changed): region_showing can be negative,
939 which still means region is being displayed.
940 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
941 whole window when showing region and the mark has changed.
942 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
943 (display_line): If it->region_beg_charpos is non-zero, set the
944 window's region_showing member to -1. (Bug#13623) (Bug#13626)
945
946 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
947 not bitfield of 1 bit.
948
5257b701
DC
9492013-02-03 Daniel Colascione <dancol@dancol.org>
950
951 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
952 daemon mode works on cygw32 when Emacs is installed and not just
953 during development.
954
8ea41ea9
PE
9552013-02-02 Paul Eggert <eggert@cs.ucla.edu>
956
957 Avoid file time stamp bug on MS-Windows (Bug#13149).
958 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
959 as FAT32 doesn't update time stamps when truncating them.
960 Also, check that a file time stamp is not a multiple of 100 ns;
961 this should catch all instances of the problem on MS-Windows,
962 as its native file system resolution is 100 ns or worse, and
963 checking for a non-multiple of 100 ns should impose only a small
964 overhead on systems with ns resolution.
965
94fbc901 9662013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 967
e7ac588e
EZ
968 Avoid encoding file names on MS-Windows when they need to be run
969 through dostounix_filename.
970 * w32.c (normalize_filename): Accept an additional argument
971 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
972 downcase it even if w32-downcase-file-names is non-nil.
973 (dostounix_filename): Accept an additional argument MULTIBYTE and
974 pass it to normalize_filename.
975 (emacs_root_dir): Adjust.
976
977 * msdos.h (dostounix_filename): Adjust prototype.
978
979 * w32.h (dostounix_filename): Adjust prototype.
980
981 * msdos.c (dostounix_filename): Accept an additional argument and
982 ignore it.
983 (init_environment): Adjust callers of dostounix_filename.
984
985 * fileio.c (Ffile_name_directory, file_name_as_directory)
986 (directory_file_name, Fexpand_file_name)
987 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
988 dostounix_filename.
989 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
990 non-nil.
991 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
992 variables, as egetenv is case-insensitive for DOS_NT.
993
994 * dired.c (file_name_completion): Don't call Fdirectory_file_name
995 with an encoded file name.
996
99d0d6dc
SM
997 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
998 Adjust calls to dostounix_filename.
e7ac588e
EZ
999
1000 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1001
1002 * unexw32.c (unexec): Adjust call to dostounix_filename.
1003
1004 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1005
1006 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1007 dostounix_filename.
1008
1009 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1010 dostounix_filename.
1011
e7c3fb06
EZ
1012 * callproc.c (Fcall_process): Make sure program name in PATH and
1013 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1014 is passed to exec/spawnve, which fails unless the file-name
1015 encoding is UTF-8.
1016
18a80473
EZ
1017 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1018 even if w32-quote-process-args is nil.
1019
35e85499
PE
10202013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1021
1022 Fix timestamp bug when write-region appends nothing (Bug#13149).
1023 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1024 the file's time stamp doesn't change if Emacs happens to write nothing
1025 to the file, and on a buggy file system this could cause Emacs to
1026 incorrectly infer that the file system doesn't have the bug.
1027 Avoid this problem by inhibiting the inference in this case.
1028
422ff52b
DA
10292013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1030
1031 * window.h (struct window): Convert base_line_number, base_line_pos
1032 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1033 Convert region_showing member from Lisp_Object to bitfield.
1034 Remove sequence_number member. Adjust comments.
1035 * window.c (sequence_number): Remove.
1036 (make_window): Initialize column_number_displayed.
1037 * print.c (print_object): Follow the printed representation of
1038 frames and print window pointer to distinguish between windows.
1039 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1040 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1041 (wset_column_number_displayed, wset_region_showing): Remove.
1042 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1043 (try_scrolling, try_cursor_movement, redisplay_window)
1044 (try_window_reusing_current_matrix, try_window_id, display_line)
1045 (display_mode_lines, decode_mode_spec): Adjust users.
1046 * .gdbinit (pwinx): Do not print sequence_number.
1047
8654f9d7
PE
10482013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1051 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1052 * dired.c: Include <fcntl.h>.
1053 (open_directory): New function, which uses open and fdopendir
1054 rather than opendir. DOS_NT platforms still use opendir, though.
1055 (directory_files_internal, file_name_completion): Use it.
1056 (file_attributes): New function, with most of the old Ffile_attributes.
1057 (directory_files_internal, Ffile_attributes): Use it.
1058 (file_attributes, file_name_completion_stat): First arg is now fd,
1059 not dir name. All uses changed. Use fstatat rather than lstat +
1060 stat.
1061 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1062 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1063 (emacs_readlinkat): New function, with much of the old
1064 Ffile_symlink_p, but with an fd argument for speed.
1065 It uses readlinkat rather than careadlinkatcwd, so that it
1066 need not assume the working directory.
1067 (Ffile_symlink_p): Use it.
1068 * filelock.c (current_lock_owner): Use emacs_readlinkat
1069 rather than emacs_readlink.
1070 * lisp.h (emacs_readlinkat): New decl.
1071 (READLINK_BUFSIZE, emacs_readlink): Remove.
1072 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1073 (emacs_norealloc_allocator, emacs_readlink): Remove.
1074 This stuff is moved to fileio.c.
1075 * w32.c (fstatat, readlinkat): New functions.
1076 (careadlinkat): Don't check that fd == AT_FDCWD.
1077 (careadlinkatcwd): Remove; no longer needed.
1078
9dbda100
GM
10792013-01-31 Glenn Morris <rgm@gnu.org>
1080
1081 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
1082 (Fwrite_region): Update for new choose_write_coding_system args.
1083 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
1084 (syms_of_fileio): Add choose-write-coding-system.
1085
3f82a88a 10862013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
1087
1088 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1089 (sys_close): Zero out the flags for the file descriptor before
1090 closing it. (Bug#13546)
1091
806fed21 1092 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
1093 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1094 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
1095 DBCS. (Bug#13553)
1096
6ee4509a
EZ
1097 * w32.c (w32_get_long_filename, init_environment, readlink):
1098 Support file names encoded in DBCS codepages.
26854e9c
EZ
1099 (readlink): Use the current file-name-coding-system, not the ANSI
1100 codepage, to decode and handle targets of symlinks.
6ee4509a 1101
cf01a359
EZ
11022013-01-28 Eli Zaretskii <eliz@gnu.org>
1103
1104 * w32.c (opendir): Now accepts a 'const char *'.
1105
6fd326b7
DA
11062013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1107
1108 Remove obsolete redisplay code. See the discussion at
1109 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1110 * dispnew.c (preemption_period, preemption_next_check): Remove.
1111 (Vredisplay_preemption_period): Likewise.
1112 (update_frame, update_single_window, update_window, update_frame_1):
1113 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1114 used, following the 2012-06-22 change.
1115
d8cd7742
EZ
11162013-01-25 Eli Zaretskii <eliz@gnu.org>
1117
1118 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1119
266fee4f
DA
11202013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1121
1122 * font.c (num_fonts): Remove the leftover from old
1123 debugging code. Adjust comment style here and there.
59e624b3
DA
1124 * insdel.c (insert_1): Remove.
1125 * lisp.h (insert_1): Remove prototype.
1126 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 1127
830e46e6 11282013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
1129
1130 * w32.c (max_filename_mbslen): New function.
1131 (normalize_filename, readdir): Use it to detect locales where ANSI
1132 encoding of file names uses a double-byte character set (DBCS).
1133 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
1134 CharNextExA, instead of incrementing a 'char *' pointer.
1135 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 1136
81abbb95
EZ
1137 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1138 request of memory reservation to 1.7GB. (Bug#13065)
1139
830e46e6 11402013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
1141
1142 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1143 at check_extra_latin label. (Bug#13505)
1144
fd3ceb09
DA
11452013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1146
1147 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1148 Avoid redundant calls to strlen.
1149
edfa7fa0
DA
11502013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1151
1152 Drop async_visible and async_iconified fields of struct frame.
1153 This is possible because async input is gone; for details, see
1154 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1155 * frame.h (struct frame): Remove async_visible and async_iconified
1156 members, convert garbaged to unsigned bitfield. Adjust comments.
1157 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1158 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1159 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1160 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1161 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1162 * w32term.c: Ditto.
1163 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1164 properly. Likewise for obscured.
1165 * xterm.c: Ditto.
266fee4f 1166 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
1167 properly.
1168 * nsterm.m: Ditto.
1169 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1170
5ad86e34
DA
11712013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1172
1173 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1174 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1175
b09cca6a
SM
11762013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1177
1178 * xdisp.c (message2, message2_nolog): Remove functions.
1179 (message3, message3_nolog): Extract nbytes and multibyteness directly
1180 from the string. Change all callers.
1181 (message3_nolog): Don't set message_enable_multibyte since set_message
1182 will reset it anyway.
1183 (message1, message1_nolog): Use message3.
1184 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1185 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1186 (set_message): Drop all but the second arg, which has to be a string.
1187 (set_message_1): Simplify now that we know that a1 is NULL and the
1188 second arg is a string.
1189 * frame.h (struct frame): Remove `message_buf' field.
1190 Use glyphs_initialized_p instead.
1191 (FRAME_MESSAGE_BUF): Remove macro.
1192 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1193 * lisp.h (message2, message2_nolog): Remove declarations.
1194 (message3, message3_nolog): Update declarations.
1195 * keyboard.c (read_char_minibuf_menu_text)
1196 (read_char_minibuf_menu_width): Remove vars.
1197 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1198 to correctly handle multibyte strings.
1199 * frame.c (delete_frame): Don't free message_buf any more.
1200 * editfns.c (message_text, message_length): Remove vars.
1201 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1202 * fileio.c (auto_save_error): Use message3 instead of message2.
1203 * dispnew.c (adjust_frame_message_buffer): Remove function.
1204
54ab1c5a
EZ
12052013-01-23 Eli Zaretskii <eliz@gnu.org>
1206
1207 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1208 real estate used for the tool bar and the menu bar.
1209
6c27465b
DA
12102013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1211
1212 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1213 hidden buffer is prepared to modification (Bug#13164).
1214
9d93ce29
DA
12152013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1216
1217 * window.h (struct window): Change window_end_valid member from
1218 Lisp_Object to a bitfield. Adjust comments.
1219 (wset_window_end_valid): Remove.
1220 * window.c (adjust_window_count): Clear window_end_valid.
1221 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1222 (Fwindow_line_height, set_window_buffer, Frecenter)
1223 (Fsplit_window_internal, Fdelete_other_windows_internal)
1224 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1225 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1226 * xdisp.c (check_window_end, reconsider_clip_changes)
1227 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1228 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1229 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1230
1dcb8ea2
DA
12312013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1232
1233 * xdisp.c (mark_window_display_accurate): Simplify the loop
1234 assuming that the only one of vchild, hchild or buffer window
1235 slots is non-nil. Call mark_window_display_accurate_1 for
1236 the leaf windows only.
1237 (mark_window_display_accurate_1): Always assume leaf window.
1238 Adjust comment.
1239
b41b8a7e
PE
12402013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1241
593a5f2e
PE
1242 * emacs.c (Qkill_emacs_hook): Now static.
1243
b41b8a7e
PE
1244 * fileio.c (Finsert_file_contents): Simplify.
1245 Remove unnecessary assignments and tests.
1246
84e5ed96
EZ
12472013-01-21 Eli Zaretskii <eliz@gnu.org>
1248
1249 * w32.c (acl_set_file): Don't test for errors unless
1250 set_file_security returns FALSE. Avoids spurious errors when
1251 saving files.
1252
2ef88fd4
DA
12532013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1254
1255 * fileio.c (Finsert_file_contents): Revert code introduced at
1256 2013-01-18 in favor of the simpler and generally better fix.
1257 Save stack space by removing 'buffer' and reusing 'read_buf'
1258 where appropriate.
1259
d7a0a7c9
PE
12602013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1261
1262 * lisp.h (eabs): Define unconditionally (Bug#13419).
1263 The old "#if !defined (eabs)" was an unnecessary revenant of back
1264 when this macro was called "abs". Document 'eabs' better.
1265
795e7a5b 12662013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
1267
1268 * fns.c (Frandom): Doc fix.
1269
59ac2d13
EZ
12702013-01-19 Eli Zaretskii <eliz@gnu.org>
1271
1272 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1273 segfault when there are lots of overlays.
1274
1275 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
1276 when there are lots of overlays.
1277 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
1278 for the details and a way to reproduce.
1279
b3fbb395
PE
12802013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1281
3a955a1f
PE
1282 * fileio.c: Use O_APPEND to append.
1283 This corresponds better to the natural interpretation of "append",
1284 and avoids the need to open the output file twice, or to invoke
1285 lseek when APPEND is neither nil nor a number.
1286 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1287 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1288 file possibly twice, and lseeking to its end; this avoids the
1289 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1290 at the same time: the combination is never needed and apparently
1291 it doesn't work with DOS_NT.
1292
21cd50b8
PE
1293 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1294 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1295
b3fbb395
PE
1296 Allow floating-point file offsets.
1297 Problem reported by Vitalie Spinu in
1298 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1299 * fileio.c (emacs_lseek): Remove.
1300 (file_offset): New function.
1301 (Finsert_file_contents, Fwrite_region): Use it.
1302
73c14218
CY
13032013-01-19 Chong Yidong <cyd@gnu.org>
1304
1305 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1306 aborting on Fsignal (Bug#13289).
1307
6a9465f3
EZ
13082013-01-19 Eli Zaretskii <eliz@gnu.org>
1309
1310 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1311 set_file_security as failure due to insufficient privileges.
1312 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1313 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1314
fa705c99
PE
13152013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1316
9fe43ff6
PE
1317 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1318 The bug was observed on Ubuntu operating inside a virtual machine,
1319 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1320 The workaround introduces a race condition on non-buggy hosts,
1321 but it's an unlikely race and anyway there's a nearly identical
1322 nearby race that can't be fixed.
1323 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1324 New static vars.
1325 (Fwrite_region): Test for file system time stamp bug.
1326 (init_fileio): New function.
1327 * lisp.h (init_fileio): Declare it.
1328 * emacs.c (main): Call it.
1329
fa705c99
PE
1330 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1331 and make it more consistent with other stat-failure diagnostics.
1332
e07469fa
DA
13332013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1334
99d0d6dc
SM
1335 Fix crash when inserting data from non-regular files.
1336 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1337 for the error description produced by valgrind.
1338 * fileio.c (read_non_regular): Rename to read_contents.
1339 Free Lisp_Save_Value object used to pass parameters.
1340 (read_non_regular_quit): Rename to read_contents_quit.
1341 (Finsert_file_contents): Redesign internal file reading loop to adjust
1342 gap and end positions after each read and so help make_gap to work
1343 properly. Do not signal an I/O error too early and so do not leave
1344 not yet decoded characters in a buffer, which was the reason of
1345 redisplay crash. Use list2 to build return value. Adjust comments.
1346
67722112
PE
13472013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1348
1349 Close a race when statting and reading files (Bug#13149).
1350 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1351 This avoids a race if the file is renamed between stat and open.
1352 This race is not the problem originally noted in Bug#13149;
1353 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1354
468afbac
DA
13552013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1356
1357 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1358 objects, related functions and macros.
1359 (make_save_value): Adjust prototype.
1360 (make_save_pointer): New prototype.
1361 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1362 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1363 * alloc.c (format_save_value): Rename to make_save_value.
1364 (make_save_pointer): New function.
1365 (record_xmalloc): Use make_save_pointer.
1366 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1367 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1368 Change users of make_save_value to make_save_pointer.
1369 Likewise for format_save_value and make_save_value.
1370
0e70695a
DA
13712013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1372
1373 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1374 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1375 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1376 debugging stubs.
1377
963ea40f
PE
13782013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1379
1380 * alloc.c (free_save_value): Now static.
1381
3346c1d0
DA
13822013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1383
1384 * keymap.c (map_keymap_internal): Use format_save_value.
1385 (map_keymap_char_table_item): Adjust accordingly.
1386 * fileio.c (non_regular_fd, non_regular_inserted)
1387 (non_regular_nbytes): Remove.
99d0d6dc
SM
1388 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1389 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
1390 (read_non_regular): Use XSAVE_ macros to extract parameters.
1391 Adjust comment.
1392 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1393 format_save_value.
1394 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1395
2b30549c
DA
13962013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1397
1398 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1399 extraction from any Lisp_Save_Value slot. Add type checking.
1400 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1401 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1402 * xselect.c: All users changed.
1403
1b971ac1
DA
14042013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1405
1406 Some convenient bits to deal with Lisp_Save_Values.
1407 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1408 (allocate_misc): Remove prototype.
1409 (format_save_value): New prototype.
1410 * alloc.c (allocate_misc): Revert back to static.
1411 (format_save_value): New function to build Lisp_Save_Value
1412 object with the specified internal structure.
1413 (make_save_value): Reimplement using format_save_value.
1414 * editfns.c (save_excursion_save): Use format_save_value.
1415 (save_excursion_restore): Use XSAVE_OBJECT.
1416
c50cf2ea
PE
14172013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 Avoid needless casts with XSAVE_POINTER.
1420 * alloc.c (mark_object) [GC_MARK_STACK]:
1421 * dired.c (directory_files_internal_unwind):
1422 * fileio.c (do_auto_save_unwind):
1423 * gtkutil.c (pop_down_dialog):
1424 * keymap.c (map_keymap_char_table_item):
1425 * lread.c (load_unwind):
1426 * nsmenu.m (pop_down_menu):
1427 * print.c (print_object) [GC_MARK_STACK]:
1428 * xfns.c (clean_up_file_dialog):
1429 * xmenu.c (cleanup_widget_value_tree):
1430 Omit casts between XSAVE_POINTER and a pointer type.
1431
9d5a1260
DA
14322013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1433
1434 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1435 * eval.c (eval_sub): Protect `form' from being GCed before its
1436 car and cdr becomes protected with the backtrace entry.
1437
73ebd38f
DA
14382013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1439
1440 Make Lisp_Save_Value more versatile storage for up to four objects.
1441 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1442 (struct Lisp_Save_Value): New layout. Adjust comments.
1443 (XSAVE_POINTER): New macro.
1444 (XSAVE_INTEGER): Likewise.
1445 (allocate_misc): Add prototype.
1446 (free_misc): Likewise.
1447 * alloc.c (allocate_misc): Now global.
1448 (free_misc): Likewise. Adjust comment.
1449 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1450 (free_save_value): Likewise.
1451 (mark_object): Likewise.
1452 * editfns.c (save_excursion_save): Pack everything within
1453 Lisp_Save_Value and so avoid xmalloc.
1454 (save_excursion_restore): Adjust to match new layout. Use free_misc
1455 because we do not allocate extra memory any more. Add eassert.
1456 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1457 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1458 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1459 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1460 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1461
b826986f
JD
14622013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1463
1464 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1465 (nsfont_draw): Remove disabling of LCD smoothing.
1466 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 1467 Bug#11484 with LCD smoothing on.
b826986f 1468
c0511b57 14692013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 1470
b6f960a0
PE
1471 Fix SIGDANGER handlers, for AIX (Bug#13408).
1472 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1473 Move handlers here from emacs.c; they were out of place.
1474
616763d5
JD
14752013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1476
1477 * xterm.c (syms_of_xterm): Adjust documentation for
1478 scroll-bar-adjust-thumb-portion.
1479
0b59090b 14802012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
1481
1482 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1483 determine whether scroll bar thumb size should be adjusted or
1484 not. Use variable for MOTIF.
1485
1486 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1487 GTK.
1488
7bc916b4
JD
14892013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1490
eac4d08f
JD
1491 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1492 event is generated.
1493 (doCommandBySelector:): Set processingCompose to NO.
1494
7bc916b4
JD
1495 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1496 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1497 (nsfont_list_family): Add block/unblock_input calls.
1498 (nsfont_open): Move block_input earlier. Add unblock_input before early
1499 return.
1500 (nsfont_draw): Add block/unblock_input calls.
1501
bdc9b756
PE
15022013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1503
1504 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1505 for old_charpos and old_bytepos.
1506
ee56a6dc
PE
15072013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1508
1509 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1510 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1511 Clear tzvalbuf_in_environ if this workaround is in effect.
1512 Problem and fix reported by Kazuhiro Ito.
1513
9fc9a531
AH
15142013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1515
99d0d6dc
SM
1516 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1517 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
1518
1519 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1520 doc string cross-reference(s).
1521
1522 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1523 string cross-reference(s).
1524
6020559a
DA
15252013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1526
1527 Avoid unnecessary byte position calculation for the gap movement.
1528 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1529 anyway, all of them should use move_gap_both instead.
1530 * lisp.h (move_gap): Remove prototype.
1531 * insdel.c (move_gap): Remove.
1532 (move_gap_both): Add eassert.
1533 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1534 * xml.c (parse_region): Likewise.
1535
b8956427
PE
15362013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 emacsclient -t should not suspend Emacs server (Bug#13387)
1539 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1540 New functions.
1541 * term.c (init_tty): Use them instead of rolling our own code.
1542 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1543 switches from 'signal' to 'pthread_sigmask', which is safer in
1544 multithreaded applications.
1545 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1546 which has already arranged for that.
1547 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1548 This is the main part of the bug fix.
1549
0b59090b 15502013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
1551
1552 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1553 x_last_font_name (Bug#13403).
1554
58cc0a01
DA
15552013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1556
1557 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1558 the type of per-buffer values where appropriate.
1559 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1560 predicate, which is how it's really used now. Adjust comment.
1561 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1562 * buffer.c (buffer_slot_type_mismatch): Remove.
1563 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1564 predicate. Adjust comment.
1565 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1566 fill-column, left-margin, tab-width, buffer-saved-size,
1567 left-margin-width, right-margin-width, left-fringe-width,
1568 right-fringe-width, scroll-bar-width and buffer-display-count.
1569 Use Qstringp for default-directory, buffer-file-name,
1570 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1571 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1572 line-spacing.
1573 * data.c (store_symval_forwarding): Adjust to call the predicate.
1574
5104861e
JB
15752013-01-09 Juanma Barranquero <lekktu@gmail.com>
1576
1577 * w32.c (get_name_and_id, acl_set_file):
1578 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1579
eefd7278
DA
15802013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1581
1582 * lisp.h (make_gap_1): New prototype.
1583 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1584 gap size values.
1585 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1586 naming convention.
1587 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 1588 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
1589 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1590 (make_gap_1): New function to adjust the gap of any buffer.
1591 * coding.c (coding_alloc_by_making_gap): Use it.
1592 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1593 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1594
073ca75b
JL
15952013-01-08 Juri Linkov <juri@jurta.org>
1596
1597 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1598 of (supports :underline (:style wave)). (Bug#13000)
1599
3bace969
AH
16002013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1601
1602 * undo.c (Fprimitive_undo): Move to simple.el.
1603 (syms_of_undo): Remove declarations for Sprimitive_undo.
1604
63a63bd4
SM
16052013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1606
1607 * keyboard.c (echo_add_key): Rename from echo_add_char.
1608
56ed110a
CY
16092013-01-06 Chong Yidong <cyd@gnu.org>
1610
1611 * keyboard.c (echo_add_char): New function, factored out from
1612 echo_char. Don't add a space if the previous echo string was
1613 empty (Bug#13255).
1614 (echo_char): Use it.
1615 (read_key_sequence): When echoing mock input, ensure that the
1616 trailing dash is properly added.
1617
b630991b
EZ
16182013-01-05 Eli Zaretskii <eliz@gnu.org>
1619
1620 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1621 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
1622 digits for buffer positions, before misalignment starts.
1623 Display "0" for integer "object" field.
b630991b
EZ
1624 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1625 Display the newline glyph more unambiguously.
1626
f032a318
YM
16272013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1628
1629 * nsterm.m (ns_draw_underwave):
1630 * w32term.c (w32_draw_underwave):
1631 * xterm.c (x_draw_underwave): Make underwave look more triangular
1632 and also degrade gracefully for small fonts. (Bug#13000)
1633
4240dd3c
YM
1634 * nsterm.m (ns_draw_text_decoration):
1635 * w32term.c (x_draw_glyph_string):
1636 * xterm.c (x_draw_glyph_string): Don't use previous underline
1637 thickness and position if previous underline type is underwave.
1638
553081a5
SM
16392013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1640
1641 * fileio.c (Ffile_acl): Undocument return format.
1642
9539d465 16432013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
1644
1645 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1646
71376d4b
PE
16472013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1648
1649 Simplify via eabs.
1650 * dired.c (file_name_completion):
1651 * doc.c (get_doc_string):
1652 * floatfns.c (round2):
1653 * font.c (font_score, font_delete_unmatched):
1654 * fringe.c (compute_fringe_widths):
1655 * lread.c (read_list):
1656 * minibuf.c (Ftry_completion):
1657 * term.c (tty_ins_del_lines):
1658 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1659 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1660
a7f11948
EZ
16612012-12-31 Eli Zaretskii <eliz@gnu.org>
1662
1663 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
1664 correctly.
1665 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
1666 for the bug this caused.
1667
84cc1ab6
PE
16682012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1669
1670 * coding.c (Qmac): Now static.
1671
5a1d858b
JD
16722012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1673
1674 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1675 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1676 handlebox_widget. Set toolbar_in_hbox to false/true, set
1677 toolbar_is_packed to true.
1678 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1679 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1680 Show all on TOOLBAR_TOP_WIDGET.
1681 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1682 by TOOLBAR_TOP_WIDGET.
1683 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1684 Check toolbar_is_packed.
8b745d92
JD
1685 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1686 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1687 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1688 false.
1689 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1690 (xg_update_menubar): Update title only if
1691 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1692 (xg_update_submenu): Skip tearoff only if
1693 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1694 (xg_initialize): Initialize xg_detached_menus only if
1695 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1696
1697 * xterm.h (struct x_output): Surround handlebox_widget with
1698 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1699 toolbar_in_hbox is bool.
1700
d5e5e7b4 17012012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1702
1703 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1704 (LIBS_GNUSTEP): Define.
1705 (LIBES): Add $(LIBS_GNUSTEP).
1706 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1707
d5e5e7b4 17082012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1709
1710 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1711 continuation glyph on a TTY with an indication of an empty line.
1712 (Bug#13277)
1713
e7ae8039
EZ
17142012-12-29 Eli Zaretskii <eliz@gnu.org>
1715
ccad023b
EZ
1716 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1717 file's SELinux context or ACLs successfully set, nil otherwise.
1718 (Bug#13298)
8d23a331 1719 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1720
e7ae8039
EZ
1721 * w32proc.c (reader_thread): Avoid passing NULL handles to
1722 SetEvent and WaitForSingleObject.
1723
7456e13f
PE
17242012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1725
1726 Port EXTERNALLY_VISIBLE to Clang 3.2.
1727 * conf_post.h (__has_attribute): New macro.
1728 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1729
1ab0c851
GM
17302012-12-27 Glenn Morris <rgm@gnu.org>
1731
1732 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1733 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1734
82e2a1f0 17352012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1736
63a63bd4
SM
1737 * fileio.c (file_name_as_directory, directory_file_name):
1738 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1739 came from a multibyte or a unibyte Lisp string; all callers
1740 adjusted. Don't assume the input string is always multibyte.
1741 (Bug#13262)
1742 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1743 don't ENCODE_FILE them, and return a unibyte string if the input
1744 was unibyte.
1745 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1746 don't assume the input strings will always be multibyte. If the
1747 input strings are multibyte, decode strings obtained from C
1748 library functions.
1749
8847a0de
DA
17502012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1751
1752 * lisp.h (toplevel): Add two notices to the comment about
1753 defining a new Lisp data type.
6cda572a
DA
1754 * print.c (print_object): If Lisp_Save_Value object's pointer
1755 is the address of a memory area containing Lisp_Objects, try
1756 to print them.
1757 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 1758
4b298d5a
DA
17592012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1760
1761 * keyboard.c (record_asynch_buffer_change): Initialize an event
1762 only if it's really needed.
1763 * frame.h (enum output_method): Remove output_mac member since
1764 it's a leftover from the deleted code.
1765 * frame.c (Fframep): Adjust user here ...
1766 * terminal.c (Fterminal_live_p): ... and here.
1767 * coding.c (Qmac): Now here because it's only used to denote
1768 end-of-line encoding type.
1769 (syms_of_coding): DEFSYM it.
1770 * frame.h (Qmac): Remove duplicated declaration.
1771
12384b01
PE
17722012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1773
1774 * window.c (select_window_1): Now static, since it's used only here.
1775
f1665bdc
EZ
17762012-12-25 Eli Zaretskii <eliz@gnu.org>
1777
1778 * window.c (window_body_cols): Subtract display margins from the
1779 window body width on TTYs as well. See
1780 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1781 for the original report.
1782
9a0d4f34
DA
17832012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1784
1785 * xdisp.c (redisplay_window): Remove inner local variable
1786 because the outer shadowed one has the same meaning.
cd78d9b1
DA
1787 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1788 set but never used.
1789 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1790 (xg_create_tool_bar): Adjust users.
9a0d4f34 1791
f9e7c67e
DA
17922012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1793
1794 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1795 * buffer.c (Fget_buffer_create): Use it to set compact field of
1796 struct buffer_text to avoid accessing an uninitialized value
1797 when compact_buffer is called for the first time.
1798 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
1799 (Fset_buffer_modified_p): Use buffer_window_count to check
1800 whether the buffer is displayed in some window.
1801 * xdisp.c (message_dolog): Likewise.
f9e7c67e 1802
299614f3
EZ
18032012-12-23 Eli Zaretskii <eliz@gnu.org>
1804
40ff07a5
EZ
1805 * w32.c (acl_set_file): If setting the file security descriptor
1806 fails, and the new DACL is identical to the existing one, silently
1807 return success. This fixes problems for users backing up their
1808 own files without having the necessary privileges for setting
1809 security descriptors.
1810
299614f3
EZ
1811 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1812 values.
1813 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1814 after WaitForSingleObject returns normally. This expedites reader
1815 thread shutdown when delete_child triggers it.
1816 (reap_subprocess): More accurate commentary for why we call
1817 delete_child only when cp->fd is negative.
1818
1819 * w32.c (sys_close): Do not call delete_child on a subprocess
1820 whose handle is not yet closed. Instead, set its file descriptor
1821 to a negative value, so that reap_subprocess will call
63a63bd4
SM
1822 delete_child on that subprocess when its SIGCHLD arrives.
1823 This avoids closing handles used for communications between sys_select
299614f3
EZ
1824 and reader_thread, which doesn't give sys_select a chance to
1825 notice that the process exited and invoke the SIGCHLD handler for
1826 it.
1827
cf162aee
JD
18282012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1829
1830 * nsfns.m (Fns_do_applescript): Run event loop until script has
1831 been executed (Bug#12969).
1832 (ns_run_ascript): Chech as_script for nil, set to nil after
1833 executing script.
1834
94900bfe
MR
18352012-12-22 Martin Rudalics <rudalics@gmx.at>
1836
1837 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1838
b2faf49c
EZ
18392012-12-22 Eli Zaretskii <eliz@gnu.org>
1840
1841 * w32term.c (w32fullscreen_hook): New function.
1842 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1843
7efa3fb3
EZ
18442012-12-21 Eli Zaretskii <eliz@gnu.org>
1845
bb085aed
EZ
1846 * fileio.c (Finsert_file_contents): Doc fix.
1847
7efa3fb3
EZ
1848 * w32proc.c (new_child, delete_child, find_child_pid): For a
1849 subprocess, consider its slot being in use as long as its process
1850 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1851 slot when a new process is started immediately after killing
1852 another one, without waiting enough time for the first process to
1853 be reaped and resources allocated for it be orderly freed.
1854 (Bug#13086)
1855 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1856
c1f02afa
CY
18572012-12-21 Chong Yidong <cyd@gnu.org>
1858
1859 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1860
5bec25eb
CY
1861 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1862
a4b0cca1 18632012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
1864
1865 * w32.c (get_name_and_id): Always pass NULL as the first argument
1866 of lookup_account_sid. Avoids crashes with UNC file names that
1867 refer to DFS domains, not to specific machine names. (Bug#12621)
1868 Remove now unused argument FNAME; all callers changed.
1869 (get_file_owner_and_group): Remove now unused argument FNAME; all
1870 callers changed.
1871
34b4b7eb
CY
18722012-12-21 Chong Yidong <cyd@gnu.org>
1873
1874 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1875 error for invalid chars, don't check for a nil return value.
1876
13002885
DA
18772012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1878
1879 Avoid calls to CHAR_TO_BYTE if byte position is known.
1880 * editfns.c (make_buffer_string_both): Use move_gap_both.
1881 (Fbuffer_string): Use make_buffer_string_both.
1882 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1883 Adjust comment.
1884 (buf_bytepos_to_charpos): Likewise.
1885 (charpos_to_bytepos): Remove.
1886 * fileio.c (Finsert_file_contents): Use move_gap_both.
1887 * search.c (Freplace_match): Likewise.
9a0d4f34 1888 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
1889 names for byte positions.
1890 * lisp.h (charpos_to_bytepos): Remove prototype.
1891 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1892 * insdel.c (move_gap): Likewise.
1893
99e9311c
PE
18942012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1895
1896 * xdisp.c (redisplay_internal): Remove now-unused local.
1897
e02230bf
SM
18982012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1899
1900 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1901 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 1902 proper value of frame-local variables (bug#13225).
e02230bf 1903
1687fb14
DA
19042012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1905
1906 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1907 Rename 4th argument since it may be buffer or string. Adjust comment.
1908 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1909
a2f07cd2
DA
19102012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1911
1912 * coding.c (Fdetect_coding_region): Do not check start and end with
1913 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1914 (code_convert_region): Likewise.
1915
474d441e
EZ
19162012-12-18 Eli Zaretskii <eliz@gnu.org>
1917
1918 * w32.c (acl_get_file, acl_set_file): Run the file name through
1919 map_w32_filename, and resolve any symlinks in the file name, like
1920 Posix platforms do.
1921 (acl_set_file): Call revert_to_self, if any privileges were
1922 enabled.
1923
8725c076
JB
19242012-12-17 Juanma Barranquero <lekktu@gmail.com>
1925
1926 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1927 ($(BLD)/w32.$(O)): Update dependencies.
1928
1e101a4b
SM
19292012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1930
1931 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1932 propagate redisplay's scrolling (if any) to the right window.
1933 (redisplay_internal): Use ensure_selected_frame.
1934 (display_mode_lines): Complete last fix.
1935 * window.c (select_window_1): New func, extracted from select_window.
1936 (select_window): Use it.
1937 * window.h (select_window_1): Declare.
1938
66447e07
EZ
19392012-12-17 Eli Zaretskii <eliz@gnu.org>
1940
1941 Emulate Posix ACL APIs on MS-Windows.
1942 * w32.c: Include sddl.h and sys/acl.h.
1943 (SDDL_REVISION_1): Define if not already defined.
1944 (g_b_init_get_security_descriptor_dacl)
1945 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1946 (g_b_init_is_valid_security_descriptor)
1947 (g_b_init_set_file_security): New static flags.
1948 (globals_of_w32): Initialize them to zero.
1949 (SetFileSecurity_Name): New string constant.
1950 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
1951 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
1952 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
1953 (IsValidSecurityDescriptor_Proc): New typedefs.
1954 (get_file_security, get_security_descriptor_owner)
1955 (get_security_descriptor_group): Set errno to ENOTSUP.
1956 (set_file_security, get_security_descriptor_dacl)
1957 (is_valid_security_descriptor, convert_sd_to_sddl)
1958 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
1959 (acl_free, acl_get_file, acl_set_file): New functions.
1960
1961 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
1962
207a7ef0
PE
19632012-12-17 Paul Eggert <eggert@cs.ucla.edu>
1964
1965 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
1966 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
1967 for some of that bug's symptoms can now cause Emacs to abort.
1968 Remove the workaround.
1969 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
1970 The bug that caused SIGCHLD to get lost has been fixed, and the
1971 workaround for it can now cause Emacs to abort.
1972
17fdfc15
PE
19732012-12-16 Paul Eggert <eggert@cs.ucla.edu>
1974
1975 * sysdep.c (emacs_abort): Bump backtrace size to 40.
1976 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
1977 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1978
7c3d167f
RF
19792012-12-16 Romain Francoise <romain@orebokech.com>
1980
1981 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
1982 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 1983 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
1984 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
1985
1986 * Makefile.in (LIBACL_LIBS): New macro.
1987 (LIBES): Use it.
1988
7d80ea23
PE
19892012-12-15 Paul Eggert <eggert@cs.ucla.edu>
1990
1991 * fileio.c (internal_delete_file): Use bool for boolean.
1992
b0728617
EZ
19932012-12-15 Eli Zaretskii <eliz@gnu.org>
1994
1995 Fix bug #13079 on MS-Windows with temp files not being deleted.
1996 * w32.h (_child_process): New members input_file and
1997 pending_deletion.
1998 (register_child): First argument is now pid_t.
1999 (record_infile, record_pending_deletion): New prototypes.
2000
2001 * w32proc.c (new_child): Initialize input_file and
2002 pending_deletion members of the child.
2003 (delete_child): Delete the child's temporary input file, if any,
2004 that is pending deletion.
2005 (register_child): First argument is now pid_t.
2006 (record_infile, record_pending_deletion): New functions.
2007 (reap_subprocess): Fix a typo in DebPrint string.
2008 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2009
2010 * fileio.c (internal_delete_file): Return an int again: non-zero
2011 if delete-file succeeds, zero otherwise.
2012
2013 * lisp.h (internal_delete_file): Adjust prototype.
2014
2015 * callproc.c (Fcall_process): Don't overwrite infile with result
2016 of DECODE_FILE.
2017 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2018 asynchronous subprocess, record the name of the input file name,
2019 if any.
2020 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2021 delete the file, record it as pending deletion when the subprocess
2022 exits.
2023
7e90af26
EZ
20242012-12-14 Eli Zaretskii <eliz@gnu.org>
2025
2026 * editfns.c [HAVE_PWD_H]: Include grp.h.
2027
2028 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2029
97976f9f
PE
20302012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2031
2032 Fix permissions bugs with setgid directories etc. (Bug#13125)
2033 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2034 to mark it as a placeholder. The old value was often wrong.
2035 The only user of this attribute has been changed to use
2036 file-ownership-preserved-p instead, with its new group arg.
2037 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2038
26ec1f49
SM
20392012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2040
ad966fe7
SM
2041 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2042 Keep selected_window and selected_frame in sync.
26ec1f49 2043
5c207910
EZ
20442012-12-14 Eli Zaretskii <eliz@gnu.org>
2045
2046 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2047 try to get accurate owner and group information from NT file
2048 security APIs. This is to make most callers of 'stat' and
2049 'lstat', which don't need that information, much faster.
2050
26ec1f49
SM
2051 * dired.c (Ffile_attributes) [WINDOWSNT]:
2052 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
2053 owner and group information from 'lstat'.
2054
893f52d8
PE
20552012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2056
4c95c9a5
PE
2057 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2058 as that confuses set-auto-coding, so insist on the head-read
2059 returning the full 1024 bytes. Let lseek compute the tail offset;
2060 less work for us. Do not ignore I/O errors when reading the tail.
2061
893f52d8
PE
2062 * xdisp.c: Minor style fixes.
2063 (init_iterator): Hoist assignment out of if-expression.
2064 (markpos_of_region): Callers now test for sign, not for -1.
2065
40d1e434
DA
20662012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2067
2068 Minor redisplay optimization when the region length is zero.
2069 * xdisp.c (markpos_of_region): New function.
2070 (init_iterator): Do not highlight the region of zero length.
2071 (redisplay_window): Check whether the region is of non-zero length.
2072 (try_cursor_movement): Allow if the region length is zero.
2073 (try_window_reusing_current_matrix, try_window_id): Likewise.
2074
727f9739 20752012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
2076
2077 * search.c (search_buffer): Check the inverse translations of each
2078 character in pattern when the buffer being searched is unibyte.
2079 (Bug#13084)
2080
727f9739 20812012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
2082
2083 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2084 files, fixing a regression from 24.2.
645c6a30 2085 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 2086
d20704ef
PE
20872012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2088
2089 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2090 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2091 Remove unnecessary S_ISLNK test, as (contra the comments) this
2092 function can't copy symlinks. Improve quality of error message
2093 when attempting to copy files that are neither regular files nor
2094 directories.
2095
2dd61a9b
DA
20962012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2099 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2100 * window.c (Frecenter):
2101 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2102 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2103
cc98b684
DC
21042012-12-12 Daniel Colascione <dancol@dancol.org>
2105
1e101a4b 2106 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
2107 the dumped Emacs is not a sparse file, greatly improving Cygwin
2108 "make bootstrap" performance.
2109
38e791fd
MA
21102012-12-11 Michael Albinus <michael.albinus@gmx.de>
2111
2112 * inotify.c (inotify_callback): Generate an Emacs event for every
2113 incoming inotify event.
2114
f9d1448f
EZ
21152012-12-11 Eli Zaretskii <eliz@gnu.org>
2116
2117 * xdisp.c (handle_face_prop): Fix logic of computing
2118 it->start_of_box_run_p.
2119 (append_space_for_newline): If the glyph row is R2L, reset the
2120 iterator's end_of_box_run_p flag before prepending the space glyph.
2121 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2122 iterator's start_of_box_run_p flag before prepending the stretch.
2123 (append_glyph, produce_image_glyph, append_composite_glyph)
2124 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2125 left_box_line_p and right_box_line_p flags of the glyph for R2L
2126 glyph rows. (Bug#13011)
2127
c6afe371
DA
21282012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2129
2130 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2131 if changed buffer is not shown in a window.
2132 * insdel.c (prepare_to_modify_buffer): Likewise.
2133 * window.c (replace_buffer_in_windows_safely): Do nothing
2134 if buffer is not shown in a window.
2135 (Fforce_window_update): Likewise if string or buffer argument
2136 is passed.
2137
1b47babd
EZ
21382012-12-11 Eli Zaretskii <eliz@gnu.org>
2139
2140 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2141 encoded_file_name, which is what it is.
2142
4c1acb95
DA
21432012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2144
2145 Consistently use marker_position and marker_byte_position.
2146 * fringe.c (Ffringe_bitmaps_at_pos):
2147 * indent.c (Fvertical_motion):
2148 * insdel.c (prepare_to_modify_buffer):
2149 * keyboard.c (make_lispy_position):
2150 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2151 (window_scroll_pixel_based, displayed_window_lines)
2152 (Fset_window_configuration):
2153 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2154 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2155 Replace direct access to marker fields with calls
2156 to marker_position and/or marker_byte_position.
2157
0eeb69fe
JB
21582012-12-11 Juanma Barranquero <lekktu@gmail.com>
2159
2160 * makefile.w32-in (SIG2STR_H): New macro.
2161 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2162 ($(BLD)/w32notify.$(O)): Update dependencies.
2163
1cf1bbd5
DC
21642012-12-10 Daniel Colascione <dancol@dancol.org>
2165
8db4b52f
DC
2166 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2167 Windows file notification functionality unless WINDOWSNT.
2168
1cf1bbd5
DC
2169 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2170 declarations.
2171
2172 * w32fns.c (cache_system_info): Initialize the global hinst
2173 variable here so various initialization calls DTRT.
2174
1e101a4b 2175 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
2176 (hinst): Remove unneeded extern declaration.
2177 (_start): Remove initialization of above variables; remove
2178 initialization of hinst, as cache_system_info now does that.
2179
2180 * emacs.c (main): Call cache_system_info early in startup; we
2181 previously weren't calling it in Cygwin builds.
2182
26ec1f49
SM
2183 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2184 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
2185 and link it to Emacs.
2186
98a07056
DA
21872012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2188
2189 Per-buffer window counters.
2190 * buffer.h (struct buffer): New member window_count.
2191 (buffer_window_count): New function.
2192 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2193 Initialize window_count.
2194 (Fkill_buffer): Verify window_count for the buffer being killed.
2195 (modify_overlay): Do not force redisplay if buffer is not shown
2196 in any window.
2197 (init_buffer_once): Initialize window_count for buffer_defaults
2198 and buffer_local_symbols.
2199 * window.h (buffer_shared): Remove declaration.
2200 (wset_buffer): Convert from inline ...
2201 * window.c (wset_buffer): ... to an ordinary function.
2202 (adjust_window_count): New function.
2203 (make_parent_window): Use it.
2204 * xdisp.c (buffer_shared): Remove.
2205 (redisplay_internal, redisplay_window): Adjust users.
2206 (buffer_shared_and_changed): Use per-buffer window counter.
2207
2b8c9064
EZ
22082012-12-10 Eli Zaretskii <eliz@gnu.org>
2209
2210 Support for filesystem notifications on MS-Windows.
2211 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2212 and this is a TTY frame, signal the caller that keyboard input is
2213 available.
2214
2215 * w32xfns.c (drain_message_queue): Now returns an int: an
2216 indication whether any WM_EMACS_FILENOTIFY messages were found in
2217 the queue.
2218
2219 * w32inevt.c (handle_file_notifications): New function.
2220 (w32_console_read_socket): Call it to process file notifications.
2221
2222 * w32console.c (initialize_w32_display): Record the main thread ID
2223 in dwMainThreadId.
2224
2225 * deps.mk (inotify.o): New dependency list.
2226
2227 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2228
2229 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2230 (WM_EMACS_END): Bump value by 1.
2231 (notification_buffer_in_use, file_notifications)
2232 (notifications_size, notifications_desc): Declare.
2233 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2234 Add prototypes.
2235
2236 * w32term.c (lispy_file_action, queue_notifications): New functions.
2237 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2238 <Qrenamed_to>: New symbols.
2239 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2240
2241 * w32notify.c: New file, implements file event notifications for
2242 MS-Windows.
2243
2244 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2245 by posting it to the w32_read_socket queue.
2246
1e101a4b 2247 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
2248
2249 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2250 (GLOBAL_SOURCES): Add w32notify.c
2251 ($(BLD)/w32notify.$(O)): New set of dependencies.
2252
2253 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2254
1e101a4b
SM
2255 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2256 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
2257 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2258 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2259 w32notify-handle-event by default.
2260
2261 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2262 syms_of_w32notify.
2263
81606b10
RS
22642012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2265
2b8c9064 2266 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 2267 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
2268
2269 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2270
2271 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2272 (syms_of_keyboard): DEFSYM it.
2273 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2274 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2275 Qfile_inotify events.
2276 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2277 special-event-map to inotify-handle-event.
2278
2279 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2280
2281 * Makefile.in (base_obj): Add inotify.o.
2282
2283 * inotify.c: New file.
2284
265c2fbf 22852012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
2286
2287 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2288
265c2fbf 22892012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
2290
2291 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2292 DWORD_PTR, for compatibility with 64-bit builds.
2293
a06ae17d 2294 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
2295 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2296 (system_process_attributes): Use SIZE_T rather than DWORD, for
2297 compatibility with 64-bit builds.
2298
265c2fbf 22992012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
2300
2301 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2302
265c2fbf 23032012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
2304
2305 * indent.c (Fvertical_motion): If a display string will be
2306 displayed on the left or the right margin, don't consider it as a
2307 factor in cursor positioning. (Bug#13108)
2308
265c2fbf 23092012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
2310
2311 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2312
5f460827
PE
23132012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2314
2315 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2316 for string length.
2317
a16e75cd
EZ
23182012-12-08 Eli Zaretskii <eliz@gnu.org>
2319
2320 * w32.c (unsetenv): Return 0 if the input string is too long.
2321
5745a7df
PE
23222012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2323
2324 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2325 * alloc.c (xputenv): New function.
2326 * dbusbind.c (Fdbus_init_bus):
2327 * emacs.c (main):
2328 * xterm.c (x_term_init):
2329 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2330 * editfns.c (initial_tz): Move static var decl up.
2331 (tzvalbuf_in_environ): New static var.
2332 (init_editfns): Initialize these two static vars.
2333 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2334 Save old TZ value on stack, if it's small.
2335 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2336 instead, use xputenv+unsetenv to set and restore TZ.
2337 (environbuf): Remove static var. All uses removed.
2338 (Fset_time_zone_rule): Do not save TZ and environ;
2339 no longer needed here.
2340 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2341 Move to inside set_time_zone_rule; they don't need file scope any more.
2342 (set_time_zone_rule): Maintain the TZ=value string separately.
2343 (syms_of_editfns): Don't initialize initial_tz;
2344 init_editfns now does it.
2345 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2346 * lisp.h (xputenv): New decl.
2347
c56efa40
FP
23482012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2349
2350 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2351
75ceee05
EZ
23522012-12-08 Eli Zaretskii <eliz@gnu.org>
2353
2354 * w32.c (unsetenv, sys_putenv): New functions.
2355
1b6dbfeb
CY
23562012-12-08 Chong Yidong <cyd@gnu.org>
2357
2358 * editfns.c (Finsert_char): Make the error message more
2359 informative (Bug#12992).
2360
d983a10b
PE
23612012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2362
7be78020
PE
2363 Simplify get_lim_data.
2364 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2365 Remove USG and vlimit methods; no longer used these days.
2366 Add #error catchall just in case.
2367
d983a10b
PE
2368 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2369 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2370 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2371 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2372 (deleted_pid_list, Fdelete_process, create_process)
2373 (record_child_status_change, handle_child_signal, deliver_child_signal)
2374 (init_process_emacs, syms_of_process):
2375 Assume SIGCHLD is defined.
2376 (parse_signal): Remove. All uses removed.
2377 (abbr_to_signal): New static function.
2378 (Fsignal_process): Use it to convert signal names to ints.
2379 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2380 kill (getpgrp (), ...).
2381 (emacs_sigaction_init): Assume SIGCHLD is defined.
2382 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2383 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2384 * syssignal.h (EMACS_KILLPG): Remove.
2385 All uses replaced by 'kill' with a negative pid.
2386 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2387 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2388
9cdde1e2
PE
23892012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2390
2391 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2392 This will cause a production Emacs to dump core instead of
2393 infinite-looping.
2394
822995f8
DA
23952012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2396
2397 * frame.c (make_frame): Do not set window's buffer to t.
2398 * window.c (Fsplit_window_internal): Likewise. Previously it was
2399 used to indicate that the window is being set up. Now we use
2400 set_window_buffer for all new windows, so the condition in ...
2401 (Fset_window_buffer): ... is always true and can be removed.
2402
ed08365b
DA
24032012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2404
2405 Convenient macro to check whether the buffer is hidden.
2406 * buffer.h (BUFFER_HIDDEN_P): New macro.
2407 * frame.c (make_frame): Use it. Adjust comment.
2408 * buffer.c (candidate_buffer): New function.
2409 (Fother_buffer, other_buffer_safely): Use it.
2410
e86f5134
EZ
24112012-12-06 Eli Zaretskii <eliz@gnu.org>
2412
2413 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2414 if the child process is still running. Instead, exit the wait
2415 loop and return zero. (Bug#13086)
2416
1700db3c
DA
24172012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2418
2419 * frame.h (x_char_width, x_char_height): Remove prototypes.
2420 * w32term.h (x_char_width, x_char_height): Likewise.
2421 * xfns.c (x_char_width, x_char_height): Remove.
2422 * w32fns.c (x_char_width, x_char_height): Likewise.
2423 * nsfns.c (x_char_width, x_char_height): Likewise.
2424 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2425 all window frames.
2426 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2427 * keyboard.c (command_loop_1): Remove prototype.
2428 (command_loop_2, top_level_1): Add static to match prototype.
2429
35fb8050
PE
24302012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2431
2432 Fix a recently-introduced delete-process race condition.
2433 * callproc.c, process.h (record_kill_process):
2434 New function, containing part of the old call_process_kill.
2435 (call_process_kill): Use it.
2436 This does not change call_process_kill's behavior.
2437 * process.c (Fdelete_process): Use record_kill_process to fix a
2438 race condition that could cause Emacs to lose track of a child.
2439
565212e5
DA
24402012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2441
2442 Avoid code duplication between prev_frame and next_frame.
2443 * frame.c (candidate_frame): New function. Add comment.
2444 (prev_frame, next_frame): Use it. Adjust comment.
2445
d8ad4d3f 24462012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
2447
2448 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2449 fails, signal an error instead of continuing with an empty
2450 string. (Bug#13079)
7c2fcf9b
EZ
2451 Encode expanded temp file pattern before passing it to mkstemp or
2452 mktemp.
d3cefd13 2453
2e7cddd3
EZ
2454 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2455 Encode the file name before passing it to dostounix_filename, in
2456 case it will downcase it (under w32-downcase-file-names).
2457 (Bug#12933)
2458
644d3f0d
PE
24592012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 Minor call-process cleanups.
2462 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2463 at the same time as other platforms, to simplify analysis.
2464 No need for fd0_volatile since we have synch_process_fd.
2465 Avoid needless emacs_close; arg is always negative.
2466
396376f1
AS
24672012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2468
2469 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2470 processes.
2471
350f51ad
DA
24722012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2473
2474 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2475 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2476 and mouse_face_hidden members to a bitfields.
2477 * frame.h (struct frame): Remove set-but-not-used space_width member.
2478 (FRAME_SPACE_WIDTH): Remove.
2479 * nsterm.m, w32term.c, xterm.c: Adjust users.
2480 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2481 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2482 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2483 members to a bitfields.
2484
bc9dbce6
PE
24852012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2486
bb5f74ee
PE
2487 Don't let call-process be a zombie factory (Bug#12980).
2488 Fixing this bug required some cleanup of the signal-handling code.
2489 As a side effect, this change also fixes a longstanding rare race
2490 condition whereby Emacs could mistakenly kill unrelated processes,
2491 and it fixes a bug where a second C-g does not kill a recalcitrant
2492 synchronous process in GNU/Linux and similar platforms.
2493 The patch should also fix the last vestiges of Bug#9488,
2494 a bug which has mostly been fixed on the trunk by other changes.
2495 * callproc.c, process.h (synch_process_alive, synch_process_death)
2496 (synch_process_termsig, sync_process_retcode):
2497 Remove. All uses removed, to simplify analysis and so that
2498 less consing is done inside critical sections.
2499 * callproc.c (call_process_exited): Remove. All uses replaced
2500 with !synch_process_pid.
2501 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2502 These take the role of what used to be in unwind-protect arg.
2503 All uses changed.
2504 (block_child_signal, unblock_child_signal):
2505 New functions, to avoid races that could kill innocent-victim processes.
2506 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2507 (call_process_kill): Record killed processes as deleted, so that
2508 zombies do not clutter up the system. Do this inside a critical
2509 section, to avoid a race that would allow the clutter.
2510 (call_process_cleanup): Fix code so that the second C-g works again
2511 on common platforms such as GNU/Linux.
2512 (Fcall_process): Create the child process in a critical section,
2513 to fix a race condition. If creating an asynchronous process,
2514 record it as deleted so that zombies do not clutter up the system.
2515 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2516 light of these changes. Omit unnecessary call to emacs_close
2517 before failure, as the unwind-protect code does that.
2518 * callproc.c (call_process_cleanup):
2519 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2520 * process.c (record_deleted_pid): New function, containing
2521 code refactored out of Fdelete_process.
2522 (Fdelete_process): Use it.
2523 (process_status_retrieved): Remove. All callers changed to use
2524 child_status_change.
2525 (record_child_status_change): Remove, folding its contents into ...
2526 (handle_child_signal): ... this signal handler. Now, this
2527 function is purely a handler for SIGCHLD, and is not called after
2528 a synchronous waitpid returns; the synchronous code is moved to
2529 wait_for_termination. There is no need to worry about reaping
2530 more than one child now.
2531 * sysdep.c (get_child_status, child_status_changed): New functions.
2532 (wait_for_termination): Now takes int * status and bool
2533 interruptible arguments, too. Do not record child status change;
2534 that's now the caller's responsibility. All callers changed.
2535 Reimplement in terms of get_child_status.
2536 (wait_for_termination_1, interruptible_wait_for_termination):
2537 Remove. All callers changed to use wait_for_termination.
2538 * syswait.h: Include <stdbool.h>, for bool.
2539 (record_child_status_change, interruptible_wait_for_termination):
2540 Remove decls.
2541 (record_deleted_pid, child_status_changed): New decls.
2542 (wait_for_termination): Adjust to API changes noted above.
2543
bc9dbce6
PE
2544 * bytecode.c, lisp.h (Qbytecode): Remove.
2545 No longer needed after 2012-11-20 interactive-p changes.
2546
3cf3c607
EZ
25472012-12-03 Eli Zaretskii <eliz@gnu.org>
2548
2549 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2550 the scroll margin, move point outside the margin. (Bug#13055)
2551
005c8d13
JD
25522012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2553
2554 * gtkutil.c (my_log_handler): New function.
2555 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2556
20edc1c9
DA
25572012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2558
2559 * lisp.h (modify_region): Rename to...
2560 (modify_region_1): ...new prototype.
2561 * textprop.c (modify_region): Now static. Adjust users.
2562 * insdel.c (modify_region): Rename to...
2563 (modify_region_1): ...new function to work with current buffer.
2564 Adjust comment and users. Use true and false for booleans.
2565
62c2e5ed
DA
25662012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2567
2568 * alloc.c (free_save_value): New function.
2569 (safe_alloca_unwind): Use it.
2570 * lisp.h (free_save_value): New prototype.
2571 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2572 Add comment.
2573 (save_excursion_restore): Adjust to match saved data structure.
2574 Use free_save_value to offload some work from GC. Drop obsolete
2575 #if 0 code.
2576
c5bc2d1d 25772012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
2578
2579 * fileio.c (Vauto_save_list_file_name): Doc fix.
2580
c5bc2d1d 25812012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
2582
2583 * w32fns.c: Remove prototype of atof.
1e101a4b 2584 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 2585 builds.
1e101a4b 2586 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
2587
2588 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2589 with 64-bit builds.
2590
2591 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2592 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2593 defined.
2594
c5bc2d1d 25952012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 2596
a9de9f0c 2597 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 2598
21e54a94
PE
25992012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2600
2dd2e622
PE
2601 Fix xpalloc confusion after memory is exhausted.
2602 * alloc.c (xpalloc): Comment fix.
2603 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2604 and signals an error, do not clear charset_table_size, as
2605 charset_table is still valid.
2606 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2607
21e54a94
PE
2608 Use execve to avoid need to munge environ (Bug#13054).
2609 * callproc.c (Fcall_process):
2610 * process.c (create_process):
2611 Don't save and restore environ; no longer needed.
2612 * callproc.c (child_setup):
2613 Use execve, not execvp, to preserve environ.
2614
3e5490f7
PE
26152012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2616
2617 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2618
75b4f59c
YM
26192012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2620
2621 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2622 display for sliced images (Bug#10500).
2623
2624 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2625
f8aff4c6
JB
26262012-11-30 Juanma Barranquero <lekktu@gmail.com>
2627
2628 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2629 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2630
3940b924
DA
26312012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2632
2633 * xdisp.c (window_outdated): Remove eassert since it hits
2634 some suspicious corner cases (see Bug#13007 and Bug#13012).
2635 (mode_line_update_needed): New function.
2636 (redisplay_internal, redisplay_window): Use it.
2637 (ensure_selected_frame): New function.
2638 (redisplay_internal, unwind_redisplay): Use it.
2639 (redisplay_internal): Move comment about buffer_shared...
2640 (buffer_shared_and_changed): ...near to its real use.
2641
4a9204fe
PE
26422012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 * callproc.c (Fcall_process): Don't misreport vfork failure.
2645
60aeceb8
PE
26462012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2647
2648 * callproc.c (Fcall_process): Fix vfork portability problems.
2649 Do not assume that fd[0], count, filefd, and save_environ survive
2650 vfork. Fix bug whereby wrong errno value could be reported for
2651 pipe failure. Some minor cleanups, too, as follows. Move buf and
2652 bufsize to the context where they're needed. Change new_argv to
2653 be of type char **, as this is more convenient and avoids casts.
2654 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2655 Now local constants, not macros.
2656
00dc3ead
KH
26572012-11-18 Kenichi Handa <handa@gnu.org>
2658
2659 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2660 for the variable "f".
2661
e1bf05c1
KH
26622012-11-13 Kenichi Handa <handa@gnu.org>
2663
2664 * font.c (font_unparse_xlfd): Exclude special characters from the
2665 generating XLFD name.
2666
22626a85
PE
26672012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2668
350e0088
PE
2669 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2670 * dired.c (stat_uname, stat_gname):
2671 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2672
22626a85
PE
2673 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2674 * dired.c (directory_files_internal, file_name_completion):
2675 Assume EAGAIN and EINTR are defined.
350e0088 2676
22626a85
PE
2677 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2678 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2679 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2680 * lread.c (readbyte_from_file): Assume EINTR is defined.
2681 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2682 Assume EIO and EAGAIN are defined.
2683 * unexcoff.c (write_segment): Assume EFAULT is defined.
2684
5c9cf0a3 26852012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2686
2687 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2688 (Bug#11964)
2689
22294a56
EZ
2690 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2691 highlighting on the frame was cleared. Prevents assertion
2692 violations when repeatedly clicking on the "Top" link of the
2693 "bread-crumbs" in Info buffers.
2694
5fbab051
PE
26952012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2696
2697 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2698
bcd77a2b
KB
26992012-11-24 Ken Brown <kbrown@cornell.edu>
2700
2701 * keyboard.c (HAVE_MOUSE):
2702 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2703 were always defined.
2704
d125ca15 27052012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2706
24becea4
EZ
2707 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2708 between bpos_covered and bpos_max. This fixes cursor display when
2709 several display strings follow each other.
2710
8654a41b
EZ
2711 * .gdbinit (pgx): If the glyph's object is a string, display the
2712 pointer to string data, rather than the value of the string object
2713 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2714
cb5867b1
EZ
2715 * indent.c (Fvertical_motion): If the starting position is covered
2716 by a display string, return to one position before that, to avoid
2717 overshooting it inside move_it_to. (Bug#12930)
2718
f418b22e
DA
27192012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2720
2721 * frame.h (struct frame): Remove display_preempted member
2722 since all users are dead long ago.
2723 * nsterm.h (struct x_output): Use the only dummy member.
2724 * w32menu.c (pending_menu_activation): Remove since not
2725 really used.
2726 (set_frame_menubar): Adjust user.
2727 * w32term.h (struct x_output): Drop outdated #if 0 code.
2728 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2729 asked_for_visible and menubar_active members.
2730 Drop unused pending_menu_activation member.
f418b22e
DA
2731 * xterm.h (struct x_output): Drop outdated #if 0 code.
2732 Use bitfields for explicit_parent, asked_for_visible,
2733 has_been_visible and net_wm_state_hidden_seen members.
2734
a879f0ea
EZ
27352012-11-23 Eli Zaretskii <eliz@gnu.org>
2736
2737 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2738 of a literal "/". (Bug#12955)
2739 (gl-stamp): Invoke fc.exe directly, not through cmd.
2740
95ef7787
PE
27412012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2742
2743 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2744 * dired.c: Assume HAVE_DIRENT_H.
2745 (NAMLEN): Remove, replacing with ...
2746 (dirent_namelen): New function. All uses changed. Use the GNU macro
2747 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2748 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2749 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2750 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2751 $(NT_INC)/dirent.h.
2752 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2753 * ndir.h: Rename to ../nt/inc/dirent.h.
2754 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2755 Do not include <dirent.h>; no longer needed.
2756 * w32.c: Include <dirent.h> rather than "ndir.h".
2757
12645ae6
CY
27582012-11-23 Chong Yidong <cyd@gnu.org>
2759
2760 * xftfont.c (xftfont_open): Remove duplicate assignment.
2761
5c747675
DA
27622012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2763
2764 * alloc.c (Fgarbage_collect): Unblock input after clearing
2765 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2766 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2767 * msdos.c (IT_frame_up_to_date): Use it here...
2768 * w32term.c (w32_frame_up_to_date): ...here...
2769 * xterm.c (XTframe_up_to_date): ...and here...
2770 * nsterm.m (ns_frame_up_to_date): ...but not here.
2771 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2772 Adjust users.
2773 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2774 Do not check whether GC is in progress.
2775
6ceeb5f1
DA
27762012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2777
2778 * xdisp.c (window_buffer_changed): New function.
2779 (update_menu_bar, update_tool_bar): Use it to
2780 simplify large 'if' statements.
2781 (redisplay_internal): Generalize commonly used
2782 'tail' and 'frame' local variables.
2783
ec84768f
EZ
27842012-11-22 Eli Zaretskii <eliz@gnu.org>
2785
2786 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2787 with Windows system header.
2788
9239d970
PE
27892012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2790
2791 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2792 * alloc.c: Assume unistd.h exists.
2793 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2794 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2795 (getwd) [USG]: Remove; no longer needed.
2796 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2797 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2798 * w32.h (getcwd): Remove decl.
2799
954bba56
SM
28002012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2801
2802 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2803 Make it set selected_window as well.
2804 (update_tool_bar): Use it.
2805
6ef2e5ef 28062012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
2807
2808 * emacs.c (main): Set the G_SLICE environment variable for all
2809 Cygwin builds, not just GTK builds. See
2810 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2811
6ef2e5ef 28122012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
2813
2814 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2815 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2816 Define for the MSVC compiler.
2817
6ef2e5ef 2818 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
2819
2820 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2821 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2822 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
2823 dostounix_filename assumes it gets a unibyte string.
2824 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
2825 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2826
eadf1faa
SM
28272012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2828
2829 Conflate Qnil and Qunbound for `symbol-function'.
2830 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2831 * lread.c (init_obarray): Set `function' fields to Qnil.
2832 * eval.c (Fcommandp): Ignore Qunbound.
2833 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2834 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2835 Test NILP rather than Qunbound.
2836 (Ffmakunbound): Set to Qnil.
2837 (Fsymbol_function): Never signal an error.
2838 (Finteractive_form): Ignore Qunbound.
2839
b83fdfa9
PE
28402012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 * eval.c (interactive_p): Remove no-longer-used decl.
2843
952580c5
DA
28442012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2845
2846 * xdisp.c (buffer_shared): Adjust comment.
2847 (buffer_shared_and_changed): New function.
2848 (prepare_menu_bars, redisplay_internal): Use it to
2849 decide whether all windows or frames should be updated.
ea6de9b1
DA
2850 (window_outdated): New function.
2851 (text_outside_line_unchanged_p, redisplay_window): Use it.
2852 (redisplay_internal): Likewise. Fix indentation.
952580c5 2853
23ba2705
SM
28542012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2855
2856 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2857 (syms_of_eval): Remove corresponding defsubr.
2858 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2859
6e9f7997
DC
28602012-11-19 Daniel Colascione <dancol@dancol.org>
2861
2862 * w32fns.c (Fx_file_dialog):
2863 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2864 cygwin_convert_file_name*.
2865
2866 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2867 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2868
552a1590
PE
28692012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2870
2871 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2872
2ac9538d 28732012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
2874
2875 * w32select.c: Include w32common.h before w32term.h, so that
2876 windows.h gets included before w32term.h uses some of its
2877 features, see below.
2878
23ba2705
SM
2879 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2880 New typedefs.
2881 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2882 New prototypes.
d8715cdf
EZ
2883 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2884
2ac9538d 28852012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
2886
2887 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2888 (ns_select): Return at once if events are held (Bug#12834).
2889
2ac9538d 28902012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 2891
2892 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2893 Needed following 2012-10-20 change. (Bug#12902)
2894
c1f7ba3a
JB
28952012-11-18 Juanma Barranquero <lekktu@gmail.com>
2896
2897 * w32proc.c (waitpid): Remove unused label get_result.
2898
a75ce9d3
JB
28992012-11-17 Juanma Barranquero <lekktu@gmail.com>
2900
2901 * makefile.w32-in (SYSWAIT_H): New macro.
2902 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2903 ($(BLD)/sysdep.$(O)): Update dependencies.
2904
49cdacda
PE
29052012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2906
2907 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2908 * callproc.c (relocate_fd): Assume F_DUPFD.
2909 * emacs.c, term.c (O_RDWR): Remove.
2910 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2911 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2912 * nsterm.m: Assume <fcntl.h> exists.
2913 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2914 (create_pty, Fmake_network_process, server_accept_connection)
2915 (wait_reading_process_output, init_process_emacs):
2916 Assume O_NONBLOCK.
2917 (wait_reading_process_output): Put in a special case for WINDOWSNT
2918 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2919 It's not clear this is needed, but it's a more-conservative change.
2920 (create_process): Assume FD_CLOEXEC.
2921 (create_process, create_pty): Assume O_NOCTTY.
2922 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2923 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2924 Omit if not DOS_NT, since F_GETFL is not defined there.
2925 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2926 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2927 (O_NOCTTY): Remove.
2928 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2929 lack it, since gnulib guarantees this.
2930 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2931
22bae83f
EZ
29322012-11-17 Eli Zaretskii <eliz@gnu.org>
2933
6ad30855
EZ
2934 * w32.c (faccessat): Pretend that directories have the execute bit
2935 set. Emacs expects that, e.g., in files.el:cd-absolute.
2936
22bae83f
EZ
2937 * w32proc.c (create_child): Don't clip the PID of the child
2938 process to fit into an Emacs integer, as this is no longer a
2939 restriction.
2940 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2941 reaping only the process specified by PID argument, if that is
2942 positive. Use PID instead of dead_child to know which process to
2943 reap. Wait for the child to die only if WNOHANG is not in
2944 OPTIONS.
2945 (sys_select): Don't set dead_child.
2946
2947 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
2948 as it is no longer needed.
2949
2950 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
2951 no longer needed.
2952 (record_child_status_change): Remove the setting of
2953 record_at_most_one_child for the !WNOHANG case.
2954
a631d0e0
PE
29552012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 Fix problems in ns port found by static checking.
2958 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
2959 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
2960 not to process group.
2961 (ns_select): Use emacs_write, not write, as that's more robust
2962 in the presence of signals.
2963 (fd_handler:): Check for read errors.
2964
d56f2e49
GM
29652012-11-16 Glenn Morris <rgm@gnu.org>
2966
2967 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
2968
96e05507 29692012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
2970
2971 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
2972
96e05507 29732012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
2974
2975 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
2976 use the same value of thread handle.
2977 (start_timer_thread): If the timer thread exited (due to error),
2978 clean up by closing the two handles it used. Duplicate the caller
2979 thread's handle here, so it gets duplicated only once, when
2980 launching the timer thread. Set priority of the timer thread, not
2981 the caller thread.
2982 (getitimer): Don't duplicate the caller thread's handle here.
2983 (Bug#12832)
2984
96e05507 29852012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
2986
2987 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
2988 called (Bug#12834).
2989
3d082a26
PE
29902012-11-16 Paul Eggert <eggert@cs.ucla.edu>
2991
2992 Remove no-longer-used pty_max_bytes variable.
2993 * process.c (pty_max_bytes): Remove; unused.
2994 (send_process): Do not set it.
2995
b72c161c
JB
29962012-11-15 Juanma Barranquero <lekktu@gmail.com>
2997
2998 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
2999 Update dependencies.
3000
bf20ea80
PE
30012012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3004 This follows up on the 2012-09-29 patch that removed indirection
3005 for the 'function' field. Reported by Sergey Vinokurov in
3006 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3007
14f20728
EZ
30082012-11-14 Eli Zaretskii <eliz@gnu.org>
3009
3010 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3011 different name, as the MS runtime does not have such a function,
3012 and probably never will.) All callers changed. Ignore DIRFD
3013 value if PATH is an absolute file name, to match Posix spec
3014 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3015 symlinks.
3016
77731919
DA
30172012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3018
3019 * xdisp.c (echo_area_display, redisplay_internal):
3020 Omit redundant check whether frame_garbaged is set.
3021
73dcdb9f
PE
30222012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3023
3024 Use faccessat, not access, when checking file permissions (Bug#12632).
3025 This fixes a bug that has been present in Emacs since its creation.
3026 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3027 which must set some sort of record. (Torek's bug report was against
3028 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3029 same common flaw.) See Torek's Usenet posting
3030 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3031 Posted: Fri Apr 8 14:18:56 1983.
3032 * Makefile.in (LIB_EACCESS): New macro.
3033 (LIBES): Use it.
3034 * callproc.c (init_callproc):
3035 * charset.c (init_charset):
3036 * fileio.c (check_existing, check_executable, check_writable)
3037 (Ffile_readable_p):
3038 * lread.c (openp, load_path_check):
3039 * process.c (allocate_pty):
3040 * xrdb.c (file_p):
3041 Use effective UID when checking permissions, not real UID.
3042 * callproc.c (init_callproc):
3043 * charset.c (init_charset):
3044 * lread.c (load_path_check, init_lread):
3045 Test whether directories are accessible, not merely whether they exist.
3046 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3047 * fileio.c (check_existing, check_executable, check_writable)
3048 (Ffile_readable_p):
3049 Use symbolic names instead of integers for the flags, as they're
3050 portable now.
3051 (check_writable): New arg AMODE. All uses changed.
3052 Set errno on failure.
3053 (Ffile_readable_p): Use faccessat, not stat + open + close.
3054 (Ffile_writable_p): No need to call check_existing + check_writable.
3055 Just call check_writable and then look at errno. This saves a syscall.
3056 dir should never be nil; replace an unnecessary runtime check
3057 with an eassert. When checking the parent directory of a nonexistent
3058 file, check that the directory is searchable as well as writable, as
3059 we can't create files in unsearchable directories.
3060 (file_directory_p): New function, which uses 'stat' on most platforms
3061 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3062 (Ffile_directory_p, Fset_file_times): Use it.
3063 (file_accessible_directory_p): New function, which uses a single
3064 syscall for efficiency.
3065 (Ffile_accessible_directory_p): Use it.
3066 * xrdb.c (file_p): Use file_directory_p.
3067 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3068 * lread.c (openp): When opening a file, use fstat rather than
3069 stat, as that avoids a permissions race. When not opening a file,
3070 use file_directory_p rather than stat.
3071 (dir_warning): First arg is now a usage string, not a format.
3072 Use errno. All uses changed.
3073 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3074 that merely introduced a race.
3075 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3076 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3077 and similarly for the other O_* flags.
3078 * w32.c (sys_faccessat): Rename from sys_access and switch to
3079 faccessat's API. All uses changed.
3080 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3081 (magic_db): Rename from magic_file_p.
3082 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3083 char *, so that we don't have to test for file existence
3084 separately from opening the file for reading. This removes a race
3085 fixes a permission-checking problem, and simplifies the code.
3086 All uses changed.
3087 (file_p): Remove; no longer needed.
3088
2a14f83b
DA
30892012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3090
3091 Omit glyphs initialization at startup.
3092 * dispnew.c (glyphs_initialized_initially_p): Remove.
3093 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3094 (Fredraw_frame): Move actual code from here...
c7085245 3095 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
3096 (Fredraw_display): Use redraw_frame.
3097 * xdisp.c (clear_garbaged_frames): Likewise.
3098
f78ee6af 30992012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
3100
3101 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3102 passed to pint2str and pint2hrstr to be at most the size of the
3103 frame's decode_mode_spec_buffer. This avoids crashes with very
3104 large values of FIELD_WIDTH argument to decode_mode_spec.
3105 (Bug#12867)
3106
b95a9c0c
PE
31072012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 Fix a race with verify-visited-file-modtime (Bug#12863).
3110 Since at least 1991 Emacs has ignored an mtime difference of no
3111 more than one second, but my guess is that this was to work around
3112 file system bugs that were fixed long ago. Since the race is
3113 causing problems now, let's remove that code.
3114 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3115 whose time stamp is off by no more than a second. Insist that the
3116 file time stamps match exactly.
3117
be49ba74
DA
31182012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3119
3120 * frame.h (struct frame): Convert external_tool_bar member to
3121 1-bit unsigned bitfield.
3122 * termhooks.h (struct terminal): Remove mouse_moved member since
3123 all users are long dead. Adjust comment on mouse_position_hook.
3124
5b04e9f9
DA
31252012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3126
3127 Simplify by using FOR_EACH_FRAME here and there.
3128 * frame.c (next_frame, prev_frame, other_visible_frames)
3129 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3130 * w32term.c (x_window_to_scroll_bar): Likewise.
3131 * window.c (window_list): Likewise.
3132 * xdisp.c (x_consider_frame_title): Likewise.
3133 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3134 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3135 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3136 * xmenu.c (menubar_id_to_frame): Likewise.
3137 * xselect.c (frame_for_x_selection): Likewise.
3138 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3139 (x_window_to_menu_bar): Likewise.
3140 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3141
76ae24d7
PE
31422012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3143
12cc4337
PE
3144 * data.c (Qdefalias_fset_function): Now static.
3145
76ae24d7
PE
3146 Another tweak to vectorlike_header change.
3147 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3148 Remove, and replace all uses with ...
3149 (next_in_free_list, set_next_in_free_list):
3150 New functions, which respect C's aliasing rules better.
3151
1479c557
PE
31522012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3153
3154 * window.c (list4i): Rename from 'quad'. All uses changed.
3155 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3156
11235c03
JB
31572012-11-11 Juanma Barranquero <lekktu@gmail.com>
3158
3159 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3160 warning about mixing declarations and code in ISO C90.
3161
6baf66d5 31622012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
3163
3164 * window.c (Fsplit_window_internal): Set combination limit of
3165 new parent window to t iff Vwindow_combination_limit is t;
3166 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 3167 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 3168
6baf66d5 31692012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
3170
3171 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3172 amount when the scroll margins are too large. When scrolling
3173 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
3174 scroll margin within a reasonable number of screen lines.
3175 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
3176 point is positioned many lines beyond the window top/bottom.
3177 (Bug#12811)
3178
508f51f5
EZ
3179 * ralloc.c (relinquish): If real_morecore fails to return memory
3180 to the system, don't crash; instead, leave the last heap
3181 unchanged and return. (Bug#12774)
3182
32e5c58c
SM
31832012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3184
3185 * lisp.h (AUTOLOADP): New macro.
3186 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3187 * data.c (Ffset): Remove special ad-advice-info handling.
3188 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3189 (Fsubr_arity): CSE.
3190 (Finteractive_form): Simplify.
3191 (Fquo): Don't insist on having at least 2 arguments.
3192 (Qdefalias_fset_function): New var.
3193
719b0aa5
JD
31942012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3195
4ab15c3e
JD
3196 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3197
719b0aa5
JD
3198 * nsfont.m (Qcondensed, Qexpanded): New variables.
3199 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3200 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3201
535cc8e9
DA
32022012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3203
3204 Fix recently introduced crash on MS-Windows (Bug#12839).
3205 * w32term.h (struct scroll_bar): Use convenient header.
3206 (SCROLL_BAR_VEC_SIZE): Remove.
3207 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3208
7d377c48
DA
32092012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3210
3211 Tweak last vectorlike_header change.
3212 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3213 vectorlike object on the free list. This is introduced to avoid
3214 some (but not all) pointer casting and aliasing problems, see
3215 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3216 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3217 objects.
3218 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3219
7ad27466
JD
32202012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3221
32e5c58c 3222 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
3223 been removed, so remove them here also.
3224
57618ecf
SM
32252012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3226
3227 * doc.c (Fdocumentation): Handle new property
3228 dynamic-docstring-function to replace the old ad-advice-info.
3229
53371430
PE
32302012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3231
3232 * fns.c (Qeql, hashtest_eq): Now static.
3233
61ddb1b9
SM
32342012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3235
3236 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3237 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3238 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3239 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3240
04a2d0d3
PE
32412012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3242
3243 Use same hash function for hashfn_profiler as for hash_string etc.
3244 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3245 * lisp.h (sxhash_combine): New inline function, with the contents
3246 of the old SXHASH_COMBINE.
3247 * profiler.c (hashfn_profiler): Use it, instead of having a
3248 special hash function containing a comparison that always yields 1.
3249
de5ef41a
SM
32502012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3251
3252 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3253 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3254 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3255 Remove unused vars.
3256
a23c4171
JD
32572012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3258
3259 * image.c (xpm_make_color_table_h): Fix compiler error because
3260 make_hash_table changed.
3261
0b59090b 32622012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
3263
3264 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3265
b7432bb2
SM
32662012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3267
3268 Use ad-hoc comparison function for the profiler's hash-tables.
3269 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3270 (make_log): Use them.
3271 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3272 call Fequal any more.
3273 (Ffunction_equal): New function.
3274 (cmpfn_profiler, hashfn_profiler): New functions.
3275 (syms_of_profiler): Initialize them.
3276 * lisp.h (struct hash_table_test): New struct.
3277 (struct Lisp_Hash_Table): Use it.
3278 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3279 * fns.c (make_hash_table): Take a struct to describe the test.
3280 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3281 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3282 (hash_lookup, hash_remove_from_table): Move assertion checking of
3283 hashfn result here. Check hash-equality before calling cmpfn.
3284 (Fmake_hash_table): Adjust call to make_hash_table.
3285 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3286 (syms_of_fns): Initialize them.
3287 * emacs.c (main): Move syms_of_fns earlier.
3288 * xterm.c (syms_of_xterm):
3289 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3290 * print.c (print_object): Adjust to new hash-table struct.
3291 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3292
88002743
EZ
32932012-11-08 Eli Zaretskii <eliz@gnu.org>
3294
3295 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3296 value of w32-scroll-lock-modifier is neither nil nor one of the
3297 known key modifiers. (Bug#12806)
3298
914adc42
DA
32992012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 Shrink struct vectorlike_header to the only size field.
3302 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3303 Adjust comment.
3304 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3305 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3306 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3307 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3308 information from the vector header. Adjust comment.
3309 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3310 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3311 layout.
3312 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3313 (struct vectorlike_header): Remove next member. Adjust comment.
3314 (struct Lisp_Subr): Add convenient header. Adjust comment.
3315 (allocate_pseudovector): Adjust prototype.
3316 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3317 (sweep_string, lisp_malloc): Remove useless prototypes.
3318 (enum mem_type): Adjust comment.
3319 (NEXT_IN_FREE_LIST): New macro.
3320 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3321 (Fmake_bool_vector): Likewise.
3322 (struct large_vector): New type to represent allocation unit for
3323 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3324 (large_vectors): Change type to struct large_vector.
3325 (allocate_vector_from_block): Simplify.
3326 (PSEUDOVECTOR_NBYTES): Replace with...
3327 (vector_nbytes): ...new function. Adjust users.
3328 (sweep_vectors): Adjust processing of large vectors.
3329 (allocate_vectorlike): Likewise.
3330 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3331 Add easserts. Adjust XSETPVECTYPESIZE usage.
3332 (allocate_buffer): Use BUFFER_PVEC_INIT.
3333 (live_vector_p): Adjust to match large vector.
3334 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3335 * buffer.h (struct buffer): Add next member.
3336 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3337 New macros.
3338 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3339 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3340 (copy_hash_table): Adjust to match vector header change.
3341 * lread.c (defsubr): Use XSETPVECTYPE.
3342 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3343 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3344 (xvecsize): New command.
3345
c66f21ea
DA
33462012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3347
3348 * keyboard.c (event_to_kboard): Do not dereference
3349 frame_or_window field of SELECTION_REQUEST_EVENT
3350 and SELECTION_CLEAR_EVENT events (Bug#12814).
3351 * xterm.h (struct selection_input_event): Adjust comment.
3352
eb147960
EZ
33532012-11-07 Eli Zaretskii <eliz@gnu.org>
3354
dab72075
EZ
3355 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3356 such as Scroll Lock, if the respective keys are treated as
3357 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3358 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3359
5890e400
DA
33602012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3361
3362 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3363
b6b3b294
PE
33642012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3365
3366 Restore some duplicate definitions (Bug#12814).
3367 This undoes part of the 2012-11-03 changes. Some people build
3368 with plain -g rather than with -g3, and they need the duplicate
3369 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3370 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3371 Define as macros, as well as as enums or as constants.
3372
e770aad5
JD
33732012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3374
3375 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3376 to keypad keys (Bug#12816).
3377
68f8f1c0
PE
33782012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3379
3380 Minor adjustments of recently-changed frame functions.
3381 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3382 known to be a frame (we're in the FRAMEP branch).
3383 * lisp.h (Qframep): Remove decl. frame.h declares this.
3384 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3385 since they're meant for Lisp fixnum values.
3386
72f94d4b
DA
33872012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3388
3389 * window.c (Fwindow_combination_limit): Revert to the only
3390 required argument and adjust docstring as suggested in
3391 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3392 by Martin Rudalics <rudalics@gmx.at>.
3393
d9f07150
DA
33942012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3395
3396 Widely used frame validity and checking functions.
3397 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3398 * frame.c (decode_live_frame, decode_any_frame): New functions.
3399 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3400 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3401 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3402 (Fframe_pointer_visible_p): Use decode_any_frame.
3403 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3404 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3405 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3406 (Fframe_focus): Likewise. Allow zero number of arguments.
3407 Adjust docstring.
3408 (frame_buffer_list, frame_buffer_predicate): Remove.
3409 * lisp.h (frame_buffer_predicate): Remove prototype.
3410 * buffer.c (Fother_buffer): Use decode_any_frame.
3411 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3412 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3413 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3414 (Fclose_font, Ffont_info): Use decode_live_frame.
3415 * fontset.c (check_fontset_name): Likewise.
3416 * terminal.c (Fframe_terminal): Likewise.
3417 * w32fns.c (check_x_frame): Likewise.
3418 * window.c (Fminibuffer_window, Fwindow_at)
3419 (Fcurrent_window_configuration): Likewise.
3420 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3421 Likewise. Allow zero number of arguments. Adjust docstring.
3422 * dispnew.c (Fredraw_frame): Likewise.
3423 * xfaces.c (frame_or_selected_frame): Remove.
3424 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3425 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3426 (Fframe_face_alist): Use decode_live_frame.
3427 * xfns.c (check_x_frame): Likewise.
3428
89bc0592
DA
34292012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 * window.c (quad): New function.
3432 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3433 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3434 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3435 (Fwindow_line_height): Use it.
3436 (Fwindow_fringes): Use list3.
3437 (Fwindow_scroll_bars): Use list4.
3438 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3439 (Fwindow_combination_limit): Allow zero number of arguments.
3440
c8e3a9c3
EZ
34412012-11-05 Eli Zaretskii <eliz@gnu.org>
3442
3443 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3444
8e2417bf 3445 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 3446 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 3447 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 3448
209c6a58
CY
34492012-11-05 Chong Yidong <cyd@gnu.org>
3450
3451 * process.c (wait_reading_process_output): Revert previous change.
3452
8148369c
PE
34532012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3454
dd0333b6
PE
3455 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3456 This removes code that has been obsolete since around 1990.
3457 * callproc.c (Fcall_process):
3458 * emacs.c (main):
3459 * process.c (create_process):
3460 * term.c (dissociate_if_controlling_tty):
3461 Assume setsid exists.
3462 * callproc.c (child_setup): Assume setpgid exists and behaves as
3463 per POSIX.1-1988 or later.
3464 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3465 * emacs.c (shut_down_emacs):
3466 * sysdep.c (sys_suspend, init_foreground_group):
3467 Assume getpgrp behaves as per POSIX.1-1998 or later.
3468 * msdos.c (setpgrp): Remove.
3469 (tcgetpgrp, setpgid, setsid): New functions.
3470 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3471 * term.c (no_controlling_tty): Remove; unused.
3472 * w32proc.c (setpgrp): Remove.
3473 (setsid, tcgetpgrp): New functions.
3474
8148369c
PE
3475 Simplify by assuming __fpending.
3476 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3477 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3478 Do not assume that __fpending's result fits in int.
3479
76abf5e5
PE
34802012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3481
06b63c9b
PE
3482 Remove EMACS_OUTQSIZE+sleep hack.
3483 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
3484 than 2400 bps, which throttled Emacs by having it sleep.
3485 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
3486 was added, and anyway those old terminals are long dead.
3487 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3488 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3489
76abf5e5
PE
3490 Fix data-loss with --version (Bug#9574).
3491 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3492 as we can't assume that emacs_strerror is initialized, and strerror
3493 is good enough here.
3494 (main): Invoke atexit earlier, to catch earlier instances of
3495 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3496
8f31e74b
MM
34972012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3498
3499 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3500 (keyDown): Remap keypad keys to X11 virtual key codes.
3501
0d879dca
PE
35022012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3503
7ccfb720
PE
3504 Fix data-loss with --batch (Bug#9574).
3505 * emacs.c: Include <close-stream.h>.
3506 (close_output_streams): New function.
3507 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3508 and handles errors appropriately.
3509 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3510 does that now.
3511
0b3d4a47
PE
3512 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3513 The symptom is a diagnostic "GLib-WARNING **: In call to
3514 g_spawn_sync(), exit status of a child process was requested but
3515 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3516 waitpid(), so exit status can't be returned." The diagnostic
3517 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3518 The real bug is a race condition between Emacs and glib: Emacs
3519 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3520 so that glib can't find it. Work around the bug by invoking
3521 waitpid only on subprocesses that Emacs itself creates.
3522 * process.c (create_process, record_child_status_change):
3523 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
3524 know the pid rather than having the callee infer it.
3525 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
3526 (create_process): Set new 'alive' member if child is created.
3527 (process_status_retrieved): New function.
3528 (record_child_status_change): Use it.
3529 Accept negative 1st argument, which means to wait for the
3530 processes that Emacs already knows about. Move special-case code
3531 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3532 processes that have already been waited for, by testing and
3533 clearing new 'alive' member.
3534 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3535 now does this internally.
3536 (handle_child_signal): Let record_child_status_change do all
3537 the work, since we do not want to reap all exited child processes,
3538 only the child processes that Emacs itself created.
3539 * process.h (Lisp_Process): New boolean member 'alive'.
3540
0d879dca
PE
3541 Omit duplicate definitions no longer needed with gcc -g3.
3542 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3543 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3544 Define only as macros. There's no longer any need to also define
3545 these symbols as enums or as constants, since we now assume
3546 gcc -g3 when debugging.
3547
3478f4b5
EZ
35482012-11-03 Eli Zaretskii <eliz@gnu.org>
3549
3550 * lisp.mk: Adjust comments to the fact that term/internal is now
3551 loaded from loadup.el.
3552
3553 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3554 (msdos_fatal_signal): New function.
3555 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3556 its argument list.
3557
3558 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3559 for GCC versions before 4.
3560 (emacs_raise): Define to call msdos_fatal_signal.
3561
3562 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3563 iterator when starting in the middle of a display or overlay
3564 string. (Bug#12745)
3565
85fabcb7
CY
35662012-11-03 Chong Yidong <cyd@gnu.org>
3567
3568 * process.c (wait_reading_process_output): Clean up the last
3569 change.
3570
893cc455
CY
35712012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3572
3573 * process.c (wait_reading_process_output): Avoid a race condition
3574 with SIGIO delivery (Bug#11536).
3575
0f7b074f
CY
35762012-11-03 Chong Yidong <cyd@gnu.org>
3577
3578 * buffer.c (cursor_type): Untabify docstring.
3579
3737fee7
DA
35802012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3581
3582 * frame.h (struct frame): Drop can_have_scroll_bars member
3583 which is meaningless for a long time. Adjust comments.
3584 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3585 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3586
b6a9e8b1
DA
35872012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3588
3589 * window.c (decode_next_window_args): Update window arg after
3590 calling decode_live_window and so fix crash reported at
3591 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3592 by Juanma Barranquero <lekktu@gmail.com>.
3593 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3594 * font.c (Ffont_at): Likewise.
3595
600d4768
JD
35962012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3597
3598 * widget.c (resize_cb): New function.
3599 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3600 (EmacsFrameResize): Check if all is up to date before changing frame
3601 size.
3602
1005b4b9
EZ
36032012-11-02 Eli Zaretskii <eliz@gnu.org>
3604
3605 Implement backtrace output for fatal errors on MS-Windows.
3606 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3607 (BACKTRACE_LIMIT_MAX): New macro.
3608 (w32_backtrace): New function.
3609 (emacs_abort): Use w32_backtrace when the user chooses not to
3610 attach a debugger. Update the text of the abort dialog.
3611
b9e9df47
DA
36122012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3613
3614 Window-related stuff cleanup here and there.
3615 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3616 Use decode_any_window.
3617 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3618 * xdisp.c (Fformat_mode_line): Likewise.
3619 * font.c (Ffont_at): Use decode_live_window.
3620 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3621 * window.c (decode_next_window_args): Likewise.
3622 (decode_any_window): Remove static.
3623 * window.h (decode_any_window): Add prototype.
3624 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3625 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3626 respectively.
3627
2b371ff7
DA
36282012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3629
3630 Remove pad from struct input_event.
3631 * termhooks.h (struct input_event): Remove padding field.
3632 Adjust comment.
3633 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3634 member is never cons for a long time. Adjust comment.
3635 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3636 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3637 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3638 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3639
7e8b50d9
EZ
36402012-11-01 Eli Zaretskii <eliz@gnu.org>
3641
3642 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3643
322aea6d
PE
36442012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3645
3646 Fix crash when using Emacs as commit editor for git (Bug#12697).
3647 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3648 and it is configured in conf_post.h.
3649 (Fcall_process): Don't invoke both setsid and setpgid; the former
3650 is enough, if it exists.
3651 * callproc.c (Fcall_process, child_setup):
3652 * process.c (create_process): Use setpgid.
3653 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3654 for the real thing.
3655 * dispnew.c (init_display): Initialize the foreground group
3656 if we are running a tty display.
3657 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3658 * lisp.h (init_foreground_group): New decl.
3659 * sysdep.c (inherited_pgroup): New static var.
3660 (init_foreground_group, tcsetpgrp_without_stopping)
3661 (narrow_foreground_group, widen_foreground_group): New functions.
3662 (init_sys_modes): Narrow foreground group.
3663 (reset_sys_modes): Widen foreground group.
3664
220cb2bd
MA
36652012-10-31 Michael Albinus <michael.albinus@gmx.de>
3666
3667 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3668
218e997a
MR
36692012-10-31 Martin Rudalics <rudalics@gmx.at>
3670
3671 * minibuf.c (read_minibuf): Restore current buffer since
3672 choose_minibuf_frame calling Fset_frame_selected_window may
3673 change it (Bug#12766).
3674
02615da0
JD
36752012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3676
3677 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3678
aee5b18e
KH
36792012-10-30 Kenichi Handa <handa@gnu.org>
3680
3681 * font.c (Ffont_at): If WINDOW is specified and it is not
3682 displaying the current buffer, signal an error.
3683
ba116008
DC
36842012-10-29 Daniel Colascione <dancol@dancol.org>
3685
de5ef41a
SM
3686 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3687 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3688 here...
3689
3690 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3691 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3692 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3693
640bf8ad
EZ
36942012-10-28 Eli Zaretskii <eliz@gnu.org>
3695
3696 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3697 (timer_loop, getitimer, setitimer): Use it instead of
3698 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3699 'clock'.
3700 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3701 literal 10000.
3702
64ccff5f
JD
37032012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3704
3705 * nsterm.m (NO_APPDEFINED_DATA): New define.
3706 (last_appdefined_event_data): New variable
3707 (last_appdefined_event): Remove.
3708 (ns_select): Initialize t from last_appdefined_event_data instead
3709 of [last_appdefined_event data1].
3710 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3711 remove last_appdefined_event (Bug#12698).
3712
e483264c
SM
37132012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3714
3715 * frame.c (x_set_font): Catch internal error.
3716
6c16c13e
EZ
37172012-10-27 Eli Zaretskii <eliz@gnu.org>
3718
e483264c
SM
3719 Avoid overflow in w32 implementation of interval timers.
3720 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3721 actually executes.
3722 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3723 'volatile ULONGLONG' types. All the other data which was
3724 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3725 (GetThreadTimes_Proc): New typedef.
3726 (w32_get_timer_time): New function, returns a suitable time value
3727 for the timer.
3728 (timer_loop): Enter critical section when accessing ULONGLONG
3729 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3730 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3731 Remove unused variable.
6c16c13e
EZ
3732 (init_timers): Initialize s_pfn_Get_Thread_Times.
3733 (start_timer_thread): Don't assign itimer->caller_thread here.
3734 (getitimer): Assign itimer->caller_thread here.
3735 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3736 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3737
ccc83f50
EZ
37382012-10-26 Eli Zaretskii <eliz@gnu.org>
3739
3740 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3741 mouse movement events if the menu bar is active. This avoids
3742 producing a busy "hour-glass" cursor by Windows if the mouse
3743 pointer is positioned over a tooltip shown for some menu item.
3744
69deda53
PE
37452012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3746
3747 Don't assume process IDs fit in int.
3748 * emacs.c (shut_down_emacs) [!DOS_NT]:
3749 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3750 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3751 Use pid_t, not int, to store process IDs, as 'int'
3752 is not wide enough on a few platforms (e.g., AIX and IRIX).
3753
7e70a152
KH
37542012-10-23 Kenichi Handa <handa@gnu.org>
3755
3756 The following change is to make face-font-rescale-alist work
3757 correctly for non-ASCII fonts.
3758
3759 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3760 (font_open_for_lface): Handle Vface_font_rescale_alist.
3761
49238e7f
CY
37622012-10-23 Chong Yidong <cyd@gnu.org>
3763
3764 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3765
5ec86886
JD
37662012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3767
ef446959
JD
3768 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3769 for screen font.
3770 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3771
5ec86886
JD
3772 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3773 event (Bug#12681).
3774
ee7a418d
GM
37752012-10-21 Glenn Morris <rgm@gnu.org>
3776
3777 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3778
4973679b
PE
37792012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3780
3781 Port to OpenBSD 5.1.
3782 * frame.c (Fmouse_position, Fmouse_pixel_position):
3783 * xdisp.c (produce_stretch_glyph):
3784 Declare local vars only when they're needed.
3785 This is clearer and avoids a warning on OpenBSD about unused vars.
3786 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3787 This is safer, and avoids OpenBSD warnings about unused vars.
3788 * keyboard.c (record_menu_key): Remove unnecessary decl.
3789 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3790 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3791 as our definition clashes with OpenBSD's.
3792 * xfaces.c (load_face_colors, check_lface_attrs)
3793 (get_lface_attributes_no_remap, get_lface_attributes)
3794 (lface_fully_specified_p, x_supports_face_attributes_p)
3795 (tty_supports_face_attributes_p, face_fontset, realize_face)
3796 (realize_x_face, realize_tty_face):
3797 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3798 merely Lisp_Object *. This is more informative and avoids
3799 a warning on OpenBSD about accessing beyond an object's size.
3800
c664f463
CY
38012012-10-20 Chong Yidong <cyd@gnu.org>
3802
3803 * lread.c (Fload): Doc fix (Bug#12592).
3804
6ec83f92 38052012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
3806
3807 * font.c (Ffont_at): Fix previous change.
3808
d2824928
EZ
38092012-10-19 Eli Zaretskii <eliz@gnu.org>
3810
e483264c
SM
3811 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3812 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
3813 for the reasons.
3814
d2824928
EZ
3815 * alloc.c (NSTATICS): Decrease to 0x800.
3816
f60d391f
SM
38172012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3818
4a0e1924 3819 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
3820 error (bug#12677).
3821
1a9327d5
JD
38222012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3823
3824 * nsterm.m (ns_select): Check writefds before call to
3825 FD_ISSET (Bug#12668).
3826
14145a1e
DC
38272012-10-18 Daniel Colascione <dancol@dancol.org>
3828
3829 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3830 (staticpro): If we run out of staticpro slots, die with an
3831 informative error instead of just calling emacs_abort.
3832
1f76f6f5
MR
38332012-10-18 Martin Rudalics <rudalics@gmx.at>
3834
3835 Fix two flaws reported by Dmitry Antipov.
3836 * window.c (Ftemp_output_buffer_show): Remove.
3837 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3838 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3839
fcf14875
EZ
38402012-10-17 Eli Zaretskii <eliz@gnu.org>
3841
1f76f6f5
MR
3842 * makefile.w32-in ($(BLD)/w32.$(O)):
3843 ($(BLD)/vm-limit.$(O)):
3844 ($(BLD)/term.$(O)):
3845 ($(BLD)/unexw32.$(O)):
3846 ($(BLD)/fileio.$(O)):
a68089e4
EZ
3847 ($(BLD)/dispnew.$(O)): Update dependencies.
3848
3849 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3850 Add prototypes.
3851
3852 * w32proc.c: Include ctype.h.
3853
3854 * w32.h (init_environment, check_windows_init_file)
3855 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3856 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3857 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3858 (sys_link): Add prototypes.
3859
3860 * w32.c: Include w32select.h.
3861 (sys_access, e_malloc, sys_select): Add prototypes.
3862 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3863
3864 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3865
3866 * unexw32.c: Include lisp.h and w32.h.
3867
3868 * term.c [WINDOWSNT]: Include w32term.h.
3869
3870 * process.c [WINDOWSNT]: Add prototype of sys_select.
3871
3872 * fileio.c [WINDOWSNT]: Include w32.h.
3873
3874 * dispnew.c [WINDOWSNT]: Include w32.h.
3875
fcf14875
EZ
3876 * cygw32.c (Fcygwin_convert_path_to_windows)
3877 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3878 Lisp_Object values. (Bug#12661)
3879
3880 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3881 to Lisp_Object. (Bug#12661)
3882
fe0b1ec4
KH
38832012-10-17 Kenichi Handa <handa@gnu.org>
3884
3885 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3886 invalidate.
3887
d556ebf9
DA
38882012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3889
3890 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 3891 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 3892
f0863a54
DA
38932012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 Do not verify indirection counters of killed buffers (Bug#12579).
3896 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3897 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3898
12fbe755
DA
38992012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3900
3901 * alloc.c (Fmake_byte_code): Fix typo in comment.
3902 * print.c (print_interval): Define as static to match prototype.
3903 * indent.c (disptab_matches_widthtab, recompute_width_table):
3904 Convert to eassert.
3905
61655b89
DA
39062012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3907
3908 * editfns.c (get_system_name): Remove.
3909 * lisp.h (get_system_name): Remove prototype.
3910 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3911 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3912
9520f2f2
DC
39132012-10-15 Daniel Colascione <dancol@dancol.org>
3914
3915 * dbusbind.c: Add comment explaining reason for previous change.
3916
dca778d5
MR
39172012-10-15 Martin Rudalics <rudalics@gmx.at>
3918
3919 * window.c (Fwindow_end): Rewrite check whether cached position
3920 can be used (Bug#12600).
3921 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3922 Set windows_or_buffers_changed.
3923
3e0341b0
DC
39242012-10-15 Daniel Colascione <dancol@dancol.org>
3925
3926 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3927 enabled by undefining the symbol "interface", which the platform
3928 headers define to something incompatible.
3929
33d4113c
DC
39302012-10-14 Daniel Colascione <dancol@dancol.org>
3931
3932 * image.c (init_tiff_functions, init_imagemagick_functions)
3933 (init_svg_functions): Fix cygw32 build break by using these
3934 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3935
a36fb15e
JD
39362012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3937
3938 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3939
537f336d
JD
39402012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3941
3942 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3943
0ba06a77
KH
39442012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3945
3946 * coding.c (detect_coding): Set coding->id before calling
3947 this->detector.
3948
ce2fe65a
AS
39492012-10-13 Andreas Schwab <schwab@linux-m68k.org>
3950
3951 * fileio.c: Formatting fixes.
3952
d6453ce4
PE
39532012-10-13 Paul Eggert <eggert@cs.ucla.edu>
3954
3955 Fix some stat-related races.
3956 * fileio.c (Fwrite_region): Avoid race condition if a file is
3957 removed or renamed by some other process immediately after Emacs
3958 writes it but before Emacs stats it. Do not assume that stat (or
3959 fstat) succeeds.
3960 * image.c (slurp_file): Resolve the file name with fopen + fstat
3961 rather than stat + fopen.
3962 (pbm_read_file) [0]: Remove unused code with stat race.
3963 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
3964 Remove ineffective code with stat race.
3965
06485aa8
SM
39662012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3967
3968 * doc.c (get_doc_string): Don't signal an error if the file is missing.
3969
167e3640
JD
39702012-10-12 Jan Djärv <jan.h.d@swipnet.se>
3971
3972 * nsterm.m (hold_event_q): New static variable.
3973 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
3974 ! q_event_ptr.
3975 (hold_event): New function.
3976 (ns_read_socket): If hold_event_q have events, store them and
3977 return (Bug#12384).
3978 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
3979 is zero (Bug#12384).
3980
c40239df
JB
39812012-10-12 Juanma Barranquero <lekktu@gmail.com>
3982
3983 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
3984
bb385a92
EZ
39852012-10-12 Eli Zaretskii <eliz@gnu.org>
3986
2a9f1099
EZ
3987 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
3988
bb385a92
EZ
3989 * fileio.c (check_existing): New function.
3990 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
3991 instead of calling 'stat', when what's needed is to check whether
3992 a file exists. This avoids expensive system calls on MS-Windows.
3993 (Bug#12587)
3994
8599b23a 3995 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
3996
3997 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
3998 determine whether a file exists and is not a directory.
3999
4000 * lisp.h (check_existing): Add prototype.
4001
2b9c2e68
JD
40022012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4003
4004 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4005
81749a23
GM
40062012-10-12 Glenn Morris <rgm@gnu.org>
4007
4008 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4009
5253a5fd
SM
40102012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4011
389a94a5
SM
4012 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4013
5253a5fd
SM
4014 * eval.c (Fautoload): Remember previous autoload status in load-history.
4015
7cded46f
PE
40162012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4017
4018 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4019 * lread.c (load_each_byte, new_backquote_flag, readchar)
4020 (read_filtered_event, lisp_file_lexically_bound_p)
4021 (safe_to_load_version, Fload, complete_filename_p, openp)
4022 (build_load_history, readevalloop, read_escape, read1)
4023 (string_to_number, read_vector, read_list):
4024 * macros.c (Fstart_kbd_macro):
4025 * marker.c (CONSIDER):
4026 * menu.c (parse_single_submenu, digest_single_submenu)
4027 (find_and_return_menu_selection, Fx_popup_menu):
4028 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4029 (Ftry_completion):
4030 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4031 (ns_menu_show):
4032 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4033 (xmenu_show, xdialog_show):
4034 Use bool for booleans.
4035 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4036 as it's not a predicate. All uses changed. Omit unnecessary
4037 buffer termination.
4038
549c3414
DA
40392012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4040
4041 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4042 (save_excursion_restore): Do not restore mark if it was not saved.
4043
e85aafe7
PE
40442012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4045
fd2f90cf
PE
4046 * marker.c (cached_modiff): EMACS_INT, not int.
4047
c1af190b
PE
4048 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4049 instead of having a wrong decl.
e85aafe7
PE
4050 * nsmenu.m (waiting_for_input): Remove wrong decl.
4051
e738ca56
PE
40522012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4053
9fa1de30
PE
4054 keyboard.c, keymap.c: Use bool for booleans.
4055 * dispnew.c (sit_for): Distinguish between 3-way display_option
4056 and boolean do_display.
4057 * keyboard.c (single_kboard, this_command_key_count_reset)
4058 (waiting_for_input, echoing, immediate_quit, input_pending)
4059 (interrupt_input, interrupts_deferred, pop_kboard)
4060 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4061 (command_loop_1, adjust_point_for_property)
4062 (safe_run_hooks_error, input_polling_used, read_char):
4063 (help_char_p, readable_events, kbd_buffer_events_waiting)
4064 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4065 (lucid_event_type_list_p, get_input_pending):
4066 (gobble_input, menu_separator_name_p, menu_bar_item)
4067 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4068 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4069 (keyremap_step, test_undefined, read_key_sequence)
4070 (detect_input_pending, detect_input_pending_ignore_squeezables)
4071 (detect_input_pending_run_timers, requeued_events_pending_p)
4072 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4073 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4074 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4075 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4076 (accessible_keymaps_1, Fkey_description, push_key_description):
4077 (shadow_lookup, struct where_is_internal_data)
4078 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4079 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4080 (describe_map, describe_vector):
4081 * menu.c (single_menu_item):
4082 * nsmenu.m (ns_update_menubar):
4083 * process.c (wait_reading_process_output):
4084 * search.c (scan_buffer, scan_newline):
4085 Use bool for boolean.
4086 * keyboard.c (timers_run, swallow_events)
4087 (detect_input_pending_run_timers):
4088 * process.c (wait_reading_process_output):
4089 Use unsigned for counter where wraparound-on-overflow is desired,
4090 since unsigned is guaranteed to have that behavior and signed is not.
4091 (read_char): Use ptrdiff_t for string length.
4092 (get_input_pending): Remove first argument, since it was always
4093 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4094 and behave as if it had that value. Return new value of
4095 input_pending. All callers changed.
4096 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4097 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4098 a string length.
4099 * keymap.c (push_key_description): Omit last arg, which was always 1.
4100 All callers changed.
4101
e738ca56
PE
4102 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4103
29f21cdf
JB
41042012-10-10 Juanma Barranquero <lekktu@gmail.com>
4105
4106 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4107 ($(BLD)/term.$(O)): Update dependencies.
4108
6aea7528
DA
41092012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4110
4111 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4112 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4113 initializer for PVEC_NORMAL_VECTOR.
4114
5f3f57be
PE
41152012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 Clean out old termopts cruft.
4118 * termopts.h (flow_control, meta_key): Remove unused decls.
4119 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4120 Don't include termopts.h.
4121
3e98c68e
DA
41222012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4123
4124 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4125
77e344e5
PE
41262012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4127
4128 * commands.h (immediate_quit): Remove duplicate decl.
4129
5683d7cd
JD
41302012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4131
4132 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4133 caching.
4134 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 4135 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 4136
cf5fc6db
EZ
41372012-10-09 Eli Zaretskii <eliz@gnu.org>
4138
b15736e6
EZ
4139 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4140 match what GetLastError returns. Explain why the function is
4141 needed.
4142
cf5fc6db
EZ
4143 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4144 'is_tooltip_frame', to avoid confusion with its global namesake.
4145
f99714ce
DC
41462012-10-08 Daniel Colascione <dancol@dancol.org>
4147
4148 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
4149 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4150 build that caused Emacs to display the hourglass cursor forever.
f99714ce 4151
fd59cb29
GM
4152 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4153 which is broken under remote desktop, calculate the number of
4154 colors available for a display based on the display's number of
4155 planes and number of bits per pixel per plane. (bug#10397).
4156
62c480c9 41572012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 4158
62c480c9
JD
4159 * nsfont.m (Vfonts_in_cache): New variable.
4160 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4161 are used. Add cached fonts to Vfonts_in_cache.
4162 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4163
607446ba
JB
41642012-10-08 Juanma Barranquero <lekktu@gmail.com>
4165
fd5125ad
JB
4166 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4167 in nt/config.nt.
46979e0b
JB
4168 (FONT_H): Define after FRAME_H.
4169 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4170 Update dependencies.
fd5125ad 4171
607446ba
JB
4172 * w32term.c: Remove leftover declaration of keyboard_codepage.
4173
b6f4e300
EZ
41742012-10-08 Eli Zaretskii <eliz@gnu.org>
4175
c54ebba4
EZ
4176 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4177 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4178 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4179 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
4180 ($(BLD)/unexw32.$(O)):
4181 ($(BLD)/w32.$(O)):
4182 ($(BLD)/w32console.$(O)):
4183 ($(BLD)/w32fns.$(O)):
4184 ($(BLD)/w32heap.$(O)):
4185 ($(BLD)/w32menu.$(O)):
15c720a3 4186 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 4187
b6f4e300
EZ
4188 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4189 'const char *'.
4190 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4191
501199a3
DC
41922012-10-08 Daniel Colascione <dancol@dancol.org>
4193
4194 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4195 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4196 accidental message numbering hole. Change other messages to
4197 match.
4198
4199 * w32select.h (HAVE_W32SELECT): Remove.
4200
4201 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 4202 w32common.h instead of w32heap.h.
501199a3
DC
4203
4204 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4205 (get_allocation_unit, get_processor_type, get_w32_major_version)
4206 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4207 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4208 (OS_NT, os_subtype, cache_system_info): Move declarations to
4209 w32common.
4210
4211 * w32heap.c: Include w32common.h.
4212 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
4213 (w32_minor_version, w32_build_number, w32_subtype):
4214 Remove duplicate definitions.
501199a3
DC
4215
4216 * w32fns.c: Include w32common.h; include w32heap.h only in
4217 WINDOWSNT.
4218
4219 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4220 Use `report_file_error' instead of `error' in order to better
4221 inform users of what went wrong. Increase NTGUI_UNICODE file
4222 dialog box file name length to 32k, the maximum allowed by the NT
4223 kernel.
4224
4225 * w32common.h: New file.
4226 (ROUND_UP, ROUND_DOWN, get_page_size)
4227 (get_allocation_unit, get_processor_type, get_w32_major_version)
4228 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4229 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4230 (OS_NT, os_subtype, cache_system_info): Move here.
4231
4232 * unexw32.c, unexcw.c: Include w32common.h.
4233
4234 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4235 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4236 to call syms_of_w32select.
4237
4238 * cygw32.h: Remove obsolete EXFUN declarations.
4239
4240 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4241
4242 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4243 of w32inevt.o from SOME_MACHINE_OBJECTS.
4244
93aa5c81
DC
42452012-10-08 Daniel Colascione <dancol@dancol.org>
4246
4247 * image.c: Permanent fix for JPEG compilation issue --- limit
4248 jpeglib `boolean' redefinition to Cygwin builds.
4249
d424f3d8
EZ
42502012-10-08 Eli Zaretskii <eliz@gnu.org>
4251
8ee4c6ce
EZ
4252 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4253
d424f3d8
EZ
4254 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4255 Cygwin.
4256
e08348a0
DC
42572012-10-08 Daniel Colascione <dancol@dancol.org>
4258
4259 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4260 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4261 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4262 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4263 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4264 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4265 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4266 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4267 now a supported configuration.
4268
4269 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 4270 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
4271
4272 * conf_post.h:
4273 (_DebPrint) declare tracing facility for W32 debugging. We need
4274 to unify tracing later.
4275
4276 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4277 unconditional use of W32 Unicode functions. Cygwin runs only on
4278 100% Unicode operating systems.
4279
4280 * cygw32.c: New file. Define Cygwin-specific facilities.
4281 (Fcygwin_convert_path_to_windows)
4282 (Fcygwin_convert_path_from_windows): New user functions for
4283 accessing Cygwin path-munging routines.
4284
4285 * cygw32.h: New file.
4286 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4287 UTF-16LE strings temporarily inside non-Lisp-visible string
4288 objects.
4289
4290 (w32_strerror): Just what it says on the tin.
4291
4292 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4293 also run for Cygwin; both systems have the same problem with using
4294 GUI facilities in a forked child. Also call syms_of_cygw32,
4295 syms_of_w32select in correct places.
4296
4297 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4298 needs fork-then-exec for daemon launching.
4299
4300 * font.h: Include frame.h.
4301
4302 * image.c: Use the image library cache machinery only when we're
4303 compiling for native WINDOWSNT; Cygwin can use shared libraries
4304 like any other Unixlike system.
4305
4306 * keyboard.c: Clarify a comment regarding the input loop.
4307
4308 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4309 functions directly instead of trying to detect at runtime that our
4310 host operating system supports them. We make this change for two
4311 reasons: Cygwin lacks support for the multibyte character
4312 conversion functions used by the legacy menu code, and Cygwin
4313 never needs to rely on non-Unicode APIs.
4314
4315 * unexw32.c (hinst): Declare extern.
4316
4317 * w32.c: Change header order;
4318 (w32_strerror): Move to w32fns.c because we need it for
4319 non-WINDOWSNT builds.
4320
4321 * w32.h: Add #error macro to make sure we don't include w32.h for
4322 Cygwin builds. Remove w32select declarations.
4323
4324 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4325 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4326
4327 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4328 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4329 POSIXy alternative.
4330 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4331 (w32_major_version, w32_minor_version, w32_build_number)
4332 (os_subtype, sound_type): Define here
4333 (w32_defined_color): Make color parameter const for consistency
4334 with other _defined_color functions.
4335 (w32_createwindow): Unconditionally call w32_init_class instead of
4336 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4337 through the code is complex and unnecessary because class
4338 registration is practically free.
4339 (w32_name_of_message): New EMACSDEBUG-only function.
4340 (Fset_message_beep): Move here
4341 (Fx_open_connection): Require that the display name for Windows be
4342 "w32" for consistency, emacsclient disambiguation, and maybe, one
4343 day, multi-window-system support.
4344 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4345 Cygwin files for W32 GUI facilities, since these clearly don't
4346 expect Cygwin names.
4347 (_DebPrint): Define.
4348 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4349 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4350 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4351 (w32_last_error): Remove.
4352
4353 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4354
4355 * w32heap.c (syspage_mask): Declare here.
4356 (cache_system_info): Remove.
4357
4358 * w32inevt.c (faked_key): Define globally, not statically.
4359 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4360 (w32_console_toggle_lock_key): Move to w32fns.c.
4361
4362 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4363
4364 * w32proc.c (_DebPrint): Move to w32fns.c.
4365 * w32select.c: Include string.h, stdio.h for Cygwin.
4366 * w32select.h: New File.
4367
4368 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4369 get_osfhandle.
4370 (w32_message_fd): New variable. Under Cygwin, holds the file
4371 descriptor the system used to tell us about pending thread
4372 messages.
4373
4374 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4375 that prevented compilation under non-WINDOWSNT systems.
4376
4377 (w32_initialize): Open /dev/windows and assign it to
4378 w32_message_fd. Provide w32 feature.
4379
4380 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4381 (WM_EMACS_INPUT_READY): add.
4382 (prepend_msg, w32_message_fd): Declare globally.
4383
4384 * w32xfns.c:
4385 (keyboard_handle): Use only when WINDOWSNT.
4386 (notify_msg_ready): New function. Posts a message to the main
4387 thread's message queue under CYGWIN, which wakes up the main
4388 thread from select(2) by making the /dev/windows file descriptor
4389 ready. Under WINDOWSNT, it sets an event the same way the old
4390 code did.
4391
4392 (post, prepend_msg): Actually call notify_msg_ready instead of
4393 setting the input event directly.
4394
98daa893
EZ
43952012-10-07 Eli Zaretskii <eliz@gnu.org>
4396
4397 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4398 but it still has blocs in it, don't return it to the system,
4399 instead of aborting. (Bug#12402)
4400
3bc0a2f7
JD
44012012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4402
8ad5b73b 4403 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 4404
335f5ae4
JD
4405 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4406 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
4407 (syms_of_nsterm): Remove comment about Panther and above for
4408 ns-antialias-text.
335f5ae4
JD
4409 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4410 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4411 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4412
4413 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4414 MAC_OS_X_VERSION_10_4.
4415
8ad5b73b
JD
4416 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4417 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
4418
4419 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4420
4421 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4422 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4423
3bc0a2f7
JD
4424 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4425 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
4426 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4427 Remove ns_in_resize check.
3bc0a2f7
JD
4428 (ns_clear_frame_area): Remove resize handle code.
4429
4430 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
4431 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4432 Remove ns_in_resize check.
3bc0a2f7 4433
c622b48f
PE
44342012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 Improve sys_siglist detection.
4437 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4438 defined as a macro, as is done in Solaris.
4439 (sys_siglist_entries): New macro.
4440 (save_strsignal): Use it.
4441 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4442 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4443
04fafa46
JD
44442012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4445
4446 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4447 fullscreen/Fullscreen.
4448
4449 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4450 tobar_height is new.
4451
4452 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4453 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4454 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4455 (windowDidResize:): Check for correct window if old style fullscreen.
4456 Capitalize word in comment. Remove incorrect comment.
4457 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4458 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4459 error in drawing background.
1f9f395d 4460 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
4461 Set toolbar values to zero, save old height in tobar_height.
4462 Restore tool bar height when leaving fullscreen.
4463 (canBecomeMainWindow): New function.
4464
c6e21c03
PE
44652012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4466
4467 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4468
0d9f584b
EZ
44692012-10-05 Eli Zaretskii <eliz@gnu.org>
4470
a65fbb5f
EZ
4471 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4472
0d9f584b 4473 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
4474 that time stamps of directories could also be changed.
4475 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
4476 FILE_WRITE_ATTRIBUTES access rights.
4477
4478 * fileio.c (Fset_file_times): Special-case ignoring errors for
4479 directories only on MSDOS, not on MS-Windows.
4480
e8757f09 44812012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
4482
4483 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4484
7604f298
EZ
44852012-10-04 Eli Zaretskii <eliz@gnu.org>
4486
4487 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4488 see whether CreateFile failed.
4489
88d69b7d
PE
44902012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4491
4492 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4493 to avoid similar races.
4494 * keyboard.c (pending_signals): Now bool, not int.
4495
7509f454
PE
4496 Port timers to OpenBSD, plus check for timer failures.
4497 OpenBSD problem reported by Han Boetes.
4498 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4499 and/or setitimer.
4500 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4501 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4502 like OpenBSD, which has timer_settime but does not declare it.
4503 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4504 whether to use itimerspec-related primitives. All uses of
4505 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4506
a3c5c0c5
PE
45072012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4508
4509 * profiler.c (handle_profiler_signal): Fix a malloc race
4510 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4511
914e743b
JD
45122012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4513
4514 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4515
d8ab37a8
EZ
45162012-10-02 Eli Zaretskii <eliz@gnu.org>
4517
4518 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4519 consistent with the change in return value of 'safe_strsignal'.
4520
b3ecad33
PE
45212012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4522
0a99eee1
PE
4523 Prefer plain 'static' to 'static inline' (Bug#12541).
4524 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4525 (bidi_set_sor_type, bidi_push_embedding_level)
4526 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4527 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4528 (bidi_cache_search, bidi_cache_ensure_space)
4529 (bidi_cache_iterator_state, bidi_cache_find)
4530 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4531 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4532 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4533 Now 'static', not 'static inline'.
4534
b3ecad33
PE
4535 Count overruns when profiling; change units to ns.
4536 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4537 Give extra weight to samples after overruns, to attempt to count
4538 the time more accurately.
4539 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4540 the underlying primitives nominally do ns.
4541 (Fprofiler_cpu_start): Document the change. Mention that
4542 the sampling intervals are only approximate.
4543
090cf9db
SM
45442012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4545
4546 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4547
4548 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4549 case for the special 0 coding-system.
4550
4551 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4552 (Fmake_overlay): Remove redundant tests.
64edc777 4553 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 4554
81550bf4
JB
45552012-10-02 Juanma Barranquero <lekktu@gmail.com>
4556
4557 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4558 Update dependencies.
4559
aa1ba90e
PE
45602012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 Fix a malloc race condition involving strsignal.
4563 A signal can arrive in the middle of a malloc, and Emacs's signal
4564 handler can invoke strsignal, which can invoke malloc, which is
4565 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4566 Fix it by altering the signal handler so that it does not invoke
4567 strsignal.
4568 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4569 * process.c (status_message): Use const pointer, in case strsignal
4570 is #defined to safe_strsignal.
4571 * sysdep.c (sys_siglist, init_signals): Always define and
4572 initialize a substitute sys_siglist if the system does not define
4573 one, even if HAVE_STRSIGNAL.
4574 (safe_strsignal): Rename from strsignal. Always define,
4575 using sys_siglist. Return a const pointer.
4576 * syssignal.h (safe_strsignal): New decl.
4577 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4578
ace917bd
EZ
45792012-10-01 Eli Zaretskii <eliz@gnu.org>
4580
4581 * w32proc.c (timer_loop): Fix code that waits for timer
4582 expiration, to avoid high CPU usage.
4583
9eb71b9c
SM
45842012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4585
4586 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4587 (sweep_weak_table): Remove redundant prototypes.
4588
b3317662
FP
45892012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4590
4591 * emacs.c: Move the inclusion of TERM_HEADER after including
4592 windows.h on WINDOWSNT. This avoids compilation problems with
4593 MSVC.
4594
f0e5f225
EZ
45952012-10-01 Eli Zaretskii <eliz@gnu.org>
4596
2d7d1608
EZ
4597 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4598 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4599 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4600 as the previous version used 'void *'.
4601
4602 * ralloc.c (ROUNDUP): Fix last change.
4603 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4604 'size_t'.
4605
f0e5f225
EZ
4606 * w32proc.c <disable_itimers>: New static flag.
4607 (init_timers): Initialize it to zero, after creating the critical
4608 sections used by the timer threads.
4609 (term_timers): Set to 1 before deleting the critical sections.
4610 (getitimer, setitimer): If disable_itimers is non-zero, return an
4611 error indication without doing anything. Reported by Fabrice
4612 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
4613 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4614 return results.
4615 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4616 support timers.
f0e5f225
EZ
4617
4618 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4619 term_ntproc after all the other bookkeeping, to get timers working
4620 as long as possible.
4621
82ef37c1
PE
46222012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4623
b3a4c387
PE
4624 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4625 Suggested by Juri Linkov in
4626 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4627
b0ab8123
PE
4628 Prefer plain 'static' to 'static inline' (Bug#12541).
4629 With static functions, modern compilers inline pretty well by
4630 themselves; advice from programmers often hurts as much as it helps.
4631 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4632 this change shrinks the text size of the Emacs executable by 1.1%
4633 without affecting CPU significantly in my benchmark.
4634 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4635 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4636 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4637 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4638 (bset_auto_fill_function, bset_auto_save_file_format)
4639 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4640 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4641 (bset_cache_long_line_scans, bset_case_fold_search)
4642 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4643 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4644 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4645 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4646 (bset_header_line_format, bset_indicate_buffer_boundaries)
4647 (bset_indicate_empty_lines, bset_invisibility_spec)
4648 (bset_left_fringe_width, bset_major_mode, bset_mark)
4649 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4650 (bset_name, bset_overwrite_mode, bset_pt_marker)
4651 (bset_right_fringe_width, bset_save_length)
4652 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4653 (bset_scroll_up_aggressively, bset_selective_display)
4654 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4655 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4656 (set_buffer_overlays_after):
4657 * category.c (bset_category_table):
4658 * charset.c (read_hex):
4659 * coding.c (produce_composition, produce_charset)
4660 (handle_composition_annotation, handle_charset_annotation)
4661 (char_encodable_p):
4662 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4663 (assign_row, set_frame_matrix_frame, make_current)
4664 (add_row_entry):
4665 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4666 * fns.c (maybe_resize_hash_table):
4667 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4668 * gmalloc.c (register_heapinfo):
4669 * image.c (lookup_image_type):
4670 * intervals.c (set_interval_object, set_interval_left)
4671 (set_interval_right, copy_interval_parent, rotate_right)
4672 (rotate_left, balance_possible_root_interval):
4673 * keyboard.c (kset_echo_string, kset_kbd_queue)
4674 (kset_keyboard_translate_table, kset_last_prefix_arg)
4675 (kset_last_repeatable_command, kset_local_function_key_map)
4676 (kset_overriding_terminal_local_map, kset_real_last_command)
4677 (kset_system_key_syms, clear_event, set_prop):
4678 * lread.c (digit_to_number):
4679 * marker.c (attach_marker, live_buffer, set_marker_internal):
4680 * nsterm.m (ns_compute_glyph_string_overhangs):
4681 * process.c (pset_buffer, pset_command)
4682 (pset_decode_coding_system, pset_decoding_buf)
4683 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4684 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4685 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4686 * syntax.c (bset_syntax_table, dec_bytepos):
4687 * terminal.c (tset_param_alist):
4688 * textprop.c (interval_has_some_properties)
4689 (interval_has_some_properties_list):
4690 * window.c (wset_combination_limit, wset_dedicated)
4691 (wset_display_table, wset_hchild, wset_left_fringe_width)
4692 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4693 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4694 (wset_right_fringe_width, wset_right_margin_cols)
4695 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4696 (wset_vertical_scroll_bar_type, wset_window_parameters):
4697 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4698 (wset_column_number_displayed, wset_region_showing)
4699 (window_box_edges, run_window_scroll_functions)
4700 (append_glyph_string_lists, prepend_glyph_string_lists)
4701 (append_glyph_string, set_glyph_string_background_width)
4702 (append_glyph, append_composite_glyph)
4703 (take_vertical_position_into_account):
4704 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4705 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4706 (lface_hash, lface_same_font_attributes_p, lookup_face):
4707 * xml.c (libxml2_loaded_p):
4708 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4709 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4710 Now 'static', not 'static inline'.
4711
05584c31
PE
4712 * bidi.c: Tune.
4713 (bidi_copy_it): Do the whole copy with a single memcpy.
4714 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4715
86ec63ba
PE
4716 Revert the FOLLOW-SYMLINKS change for file-attributes.
4717 Doing it right would require several changes to Tramp, and there's
4718 not enough time to get that tested before the freeze today.
4719 * dired.c (directory_files_internal, Ffile_attributes):
4720 Undo last change.
4721
82ef37c1
PE
4722 * frame.c (x_report_frame_params): Port better to wider ints.
4723 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4724 or that pointers can be printed in 15 decimal digits.
4725 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4726
62aba0d4
FP
47272012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4728
4729 Support x64 build on MS-Windows.
4730 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4731 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4732 compatibility with x64.
5e4daaf3 4733 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4734
4735 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4736 defining an XRectangle structure.
4737
4738 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4739 arithmetics for compatibility with x64.
4740
4741 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4742 compatibility with x64.
4743
4744 * w32heap.h: Adjust prototypes and declarations.
4745
4746 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4747 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4748 DWORD, long, and unsigned long, for compatibility with x64.
4749 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4750 (sbrk): Argument is now of type ptrdiff_t.
4751
4752 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4753 less than 0x0500.
4754 (w32_msg_pump): Use WPARAM type for 'result'.
4755
4756 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4757 architecture.
4758 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4759 compatibility with x64.
4760
4761 * vm-limit.c (lim_data): Now size_t.
4762 (check_memory_limits): Adjust prototypes of real_morecore and
4763 __morecore to receive argument of type ptrdiff_t. Use size_t for
4764 five_percent and data_size.
4765
4766 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4767 variables, for compatibility with x64.
4768 (rva_to_section, offset_to_section, relocate_offset)
4769 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4770 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4771 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4772 for compatibility with x64.
4773
4774 * sysdep.c (STDERR_FILENO): Define if not already defined.
4775
4776 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4777 (__morecore): Argument type is now ptrdiff_t.
4778 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4779 (relinquish): Use ptrdiff_t type for 'excess'.
4780 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4781
4782 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4783 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4784 instead of a literal number.
4785
4786 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4787 (min): Define only if not already defined.
4788
4789 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4790 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4791 hosts.
4792
4793 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4794 'bitmaps' is a pointer.
4795
4796 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4797
4798 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4799
e7a2937b
PE
48002012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4803 * dired.c (directory_files_internal, Ffile_attributes):
4804 New arg follow_symlinks. All uses changed.
4805
b43d62ae
SM
48062012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4807
4808 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4809
c06c382a
EZ
48102012-09-30 Eli Zaretskii <eliz@gnu.org>
4811
4812 Support atimers and CPU profiler via profile.c on MS-Windows.
4813 * w32proc.c (sig_mask, crit_sig): New static variables.
4814 (sys_signal): Support SIGALRM and SIGPROF.
4815 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 4816 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
4817 sigfillset, and sigprocmask are no longer no-ops.
4818 (sigismember): New function.
4819 (struct itimer_data): New definition.
4820 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4821 (crit_prof): New static variables.
4822 (MAX_SINGLE_SLEEP): New definition.
4823 (timer_loop, stop_timer_thread, term_timers, init_timers)
4824 (start_timer_thread, getitimer, setitimer): New functions.
4825 (alarm): No longer a no-op, calls setitimer.
4826
4827 * w32.c (term_ntproc): Call term_timers.
4828 (init_ntproc): Make sure all signals are unblocked at startup, to
4829 erase any traces of dumping. Call init_timers.
4830
4831 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4832 Windows-specific code to display the hourglass mouse pointer is no
4833 longer used.
4834 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4835 to hourglass timer expiration.
4836 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4837 Remove, no longer used.
b43d62ae
SM
4838 (w32_note_current_window, show_hourglass, hide_hourglass):
4839 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
4840 window systems.
4841 (syms_of_w32fns): Don't initialize hourglass_timer.
4842
4843 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4844 WINDOWSNT as well.
4845 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4846
4847 * w32.h (init_timers, term_timers): Add prototypes.
4848
95402d5f
KH
48492012-09-30 Kenichi Handa <handa@gnu.org>
4850
4851 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4852 to the buffer relocation which may be caused by ccl_driver.
4853
dd946752
JD
48542012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4855
d7e642cc
JD
4856 * xfns.c (Fx_file_dialog): Update comment.
4857
4858 * w32fns.c (Fx_file_dialog): Update comment.
4859
4860 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4861 Initialize panel name field if OSX >= 10.6.
4862
4863 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4864
dd946752
JD
4865 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4866
4867 * nsterm.m (NEW_STYLE_FS): New define.
4868 (ns_fullscreen_hook, windowWillEnterFullScreen)
4869 (windowDidEnterFullScreen, windowWillExitFullScreen)
4870 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4871 (setFSValue): New functions.
4872 (EmacsFSWindow): New implementation.
4873 (canBecomeKeyWindow): New function for EmacsFSWindow.
4874 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4875 (dealloc): Release nonfs_window if in fullscreen.
4876 (updateFrameSize:): Call windowDidMove to update top/left.
4877 (windowWillResize:toSize:): Check if frame is still maximized.
4878 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4879 next_maximized, maximized_width, maximized_height and nonfs_window.
4880 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4881 tbar_height.
4882 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 4883 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
4884
4885 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4886 (EmacsView): Add variables for fullscreen.
4887 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4888 (EmacsFSWindow): New interface for fullscreen.
4889
427730eb
JB
48902012-09-30 Juanma Barranquero <lekktu@gmail.com>
4891
4892 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4893
48de8b12
CY
48942012-09-30 Chong Yidong <cyd@gnu.org>
4895
4896 * fns.c (Frandom): Doc fix.
4897
5938d519
MR
48982012-09-30 Martin Rudalics <rudalics@gmx.at>
4899
4900 * window.c (Vwindow_combination_limit): New default value.
4901 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4902
cb5b0266
PE
49032012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4906 Suggested by Eli Zaretskii in
4907 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4908
84f72efd
EZ
49092012-09-30 Eli Zaretskii <eliz@gnu.org>
4910
4911 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4912 HAVE_TIMER_SETTIME is defined.
4913
9d4dcdc9
PE
49142012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4915
d89460ed
PE
4916 Profiler improvements: more-accurate timers, overflow checks.
4917 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4918 signal.h, setjmp.h. Include systime.h instead.
4919 (saturated_add): New function.
4920 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4921 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4922 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4923 New static vars.
84f72efd 4924 (enum profiler_cpu_running): New enum.
d89460ed
PE
4925 (profiler_cpu_running): Now of that enum type, not bool.
4926 All uses changed to store the new value.
4927 (handle_profiler_signal): Rename from sigprof_handler_1,
4928 for consistency with other handlers. Do not check whether
4929 cpu_log is a hash-table if garbage collecting, since it
4930 doesn't matter in that case.
4931 (deliver_profiler_signal): Rename from sigprof_handler,
4932 for consistency with other handlers.
4933 (setup_cpu_timer): New function, with much of what used to be in
4934 Fprofiler_cpu_start. Check for out-of-range argument.
4935 Prefer timer_settime if available, and prefer
4936 thread cputime clocks, then process cputime clocks, then
4937 monotonic clocks, to the old realtime clock. Use make_timeval
4938 to round more-correctly when falling back to setitimer.
4939 (Fprofiler_cpu_start): Use it.
4940 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4941 Don't assume that passing NULL as the 2nd argument of setitimer
4942 is the same as passing a pointer to all-zero storage.
4943 Ignore SIGPROF afterwards.
4944 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4945 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4946 non-fatal signal handlers. Ignore SIGPROF on startup.
4947 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
4948 in profiler.c, since sysdep.c now uses it.
4949
9d4dcdc9
PE
4950 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
4951 Suggested by Eli Zaretskii in
4952 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
4953
8e5691a0
JB
49542012-09-29 Juanma Barranquero <lekktu@gmail.com>
4955
4956 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4957
e7c1b6ef
SM
49582012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
4959
4960 * lisp.h (struct backtrace): Remove indirection for `function' field.
4961 * xdisp.c (redisplay_internal):
4962 * profiler.c (record_backtrace, sigprof_handler_1):
4963 * alloc.c (Fgarbage_collect):
4964 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
4965 (Fbacktrace_frame): Adjust accordingly.
4966
e61d39cd 49672012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
4968
4969 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
4970 (Frun_hook_with_args_until_failure): Doc fixes.
4971
404043ea
EZ
49722012-09-28 Eli Zaretskii <eliz@gnu.org>
4973
4974 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
4975 Qautomatic_redisplay and change the symbol name. All users changed.
4976
704d3f45
TM
49772012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
4978
4979 * profiler.c (sigprof_handler): Fix race condition.
4980
757140ff
GM
49812012-09-28 Glenn Morris <rgm@gnu.org>
4982
4983 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
4984
a615a3ae
PE
49852012-09-27 Paul Eggert <eggert@cs.ucla.edu>
4986
4987 Check more robustly for timer_settime.
89d17fd0
PE
4988 * Makefile.in (LIB_TIMER_TIME): New macro.
4989 (LIBES): Add it.
a615a3ae
PE
4990 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
4991 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
4992 call timer_settime.
4993
3670daf7
TM
49942012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
4995
4996 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
4997
6a586b7f
JB
49982012-09-26 Juanma Barranquero <lekktu@gmail.com>
4999
5000 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5001
41c8bfcf
PE
50022012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 * character.h (MAYBE_UNIFY_CHAR): Remove.
5005 * charset.c, charset.h (maybe_unify_char): Now static.
5006 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5007 Since this stuff is now private to charset.c, there's no need for
5008 a public macro and no need to inline by hand.
5009
3a880af4
SM
50102012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5011 Stefan Monnier <monnier@iro.umontreal.ca>
5012 Juanma Barranquero <lekktu@gmail.com>
611b7507 5013
3a880af4
SM
5014 * profiler.c: New file.
5015 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5016 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5017 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5018 * emacs.c (main): Call syms_of_profiler.
5019 * alloc.c (Qautomatic_gc): New constant.
5020 (MALLOC_PROBE): New macro.
5021 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5022 (total_bytes_of_live_objects): New function.
5023 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5024 Call malloc_probe for the memory profiler.
5025 (syms_of_alloc): Define Qautomatic_gc.
5026 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5027 race condition.
5028 (struct backtrace): Move definition...
5029 * lisp.h (struct backtrace): ..here.
5030 (Qautomatic_gc, profiler_memory_running): Declare vars.
5031 (malloc_probe, syms_of_profiler): Declare functions.
5032 * xdisp.c (Qautomatic_redisplay): New constant.
5033 (redisplay_internal): Record itself in backtrace_list.
5034 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 5035
5938d519 50362012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
50372012-09-25 Juanma Barranquero <lekktu@gmail.com>
5038
5039 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5040
e26fd2e4
PE
50412012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5042
5043 Prefer POSIX timers if available.
5044 They avoid a race if the timer is too close to the current time.
5045 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5046 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 5047 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 5048
eedec3ee
EZ
50492012-09-25 Eli Zaretskii <eliz@gnu.org>
5050
5051 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5052 CHAR_STRING_ADVANCE.
5053 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5054 STRING_CHAR_ADVANCE.
5055
aa15c6bb
JB
50562012-09-25 Juanma Barranquero <lekktu@gmail.com>
5057
5058 Move Vlibrary_cache to emacs.c and reset before dumping.
5059
5060 * lisp.h (reset_image_types): Declare.
5061 [WINDOWSNT] (Vlibrary_cache): Declare.
5062
5063 * image.c (reset_image_types): New function.
5064
5065 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5066 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5067 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5068
5069 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5070 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5071
5072 * w32.h (Vlibrary_cache): Do not declare.
5073
54d629be
EZ
50742012-09-25 Eli Zaretskii <eliz@gnu.org>
5075
16b22fef
EZ
5076 * w32proc.c (sys_signal): Handle all signals defined by the
5077 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5078 handlers for signals supported by Windows. Don't override
5079 term_ntproc as the handler for SIGABRT.
5080 (sigaction): Rewrite to call sys_signal instead of duplicating its
5081 code.
5082 (sys_kill): Improve commentary.
5083
5084 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5085 consistency with a signature of a signal handler. All callers
5086 changed.
5087 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5088 install term_ntproc as a signal handler for SIGABRT, as that
5089 should be done by the dumped Emacs.
5090
5091 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5092
5093 * w32select.c (term_w32select): Protect against repeated
5094 invocation by setting clipboard_owner to NULL after calling
5095 DestroyWindow.
5096
5097 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5098 and term_ntproc to their modified signatures.
5099
54d629be
EZ
5100 * character.c (char_string, string_char): Remove calls to
5101 MAYBE_UNIFY_CHAR. See the discussion starting at
5102 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5103 for the details.
5104
59f7af81
CY
51052012-09-25 Chong Yidong <cyd@gnu.org>
5106
5107 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5108
22e8cf4a
SM
51092012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5110
5111 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5112 when encountering an unknown bytecode.
5113
578098f3
PE
51142012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5115
5116 image.c, indent.c: Use bool for booleans.
5117 * dispextern.h (struct image_type): Members valid_p, load, init
5118 now return bool, not int. All uses changed.
5119 * image.c: Omit unnecessary static decls.
5120 (x_create_bitmap_mask, x_build_heuristic_mask):
5121 Return void, not int, since callers don't care about the return value.
5122 (x_create_bitmap_mask, define_image_type, valid_image_p)
5123 (struct image_keyword, parse_image_spec, image_spec_value)
5124 (check_image_size, image_background)
5125 (image_background_transparent, x_clear_image_1)
5126 (postprocess_image, lookup_image, x_check_image_size)
5127 (x_create_x_image_and_pixmap, xbm_image_p)
5128 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5129 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5130 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5131 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5132 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5133 (png_image_p, init_png_functions, png_load_body, png_load)
5134 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5135 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5136 (init_gif_functions, gif_load, imagemagick_image_p)
5137 (imagemagick_load_image, imagemagick_load, svg_image_p)
5138 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5139 (gs_load):
5140 * nsimage.m (ns_load_image):
5141 * nsterm.m (ns_defined_color):
5142 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5143 * xfns.c (x_defined_color):
5144 * xterm.c (x_alloc_lighter_color_for_widget)
5145 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5146 (x_alloc_lighter_color):
5147 * indent.c (disptab_matches_widthtab, current_column)
5148 (scan_for_column, string_display_width, indented_beyond_p)
5149 (compute_motion, vmotion, Fvertical_motion):
5150 Use bool for booleans.
5151
a5f2b6ec
CY
51522012-09-24 Chong Yidong <cyd@gnu.org>
5153
5154 * chartab.c (Fset_char_table_default): Obsolete function removed.
5155
18e27ea8
PE
51562012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5157
afea8a8a
PE
5158 Move pid_t related decls out of lisp.h.
5159 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5160 (interruptible_wait_for_termination):
5161 Move these decls from lisp.h to syswait.h, since they use pid_t.
5162 Needed on FreeBSD; see Herbert J. Skuhra in
5163 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5164 * callproc.c: Include syswait.h.
5165
18e27ea8
PE
5166 gnutls.c, gtkutil.c: Use bool for boolean.
5167 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5168 (emacs_gnutls_handle_error):
5169 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5170 (xg_hide_tooltip, xg_create_frame_widgets)
5171 (create_dialog, xg_uses_old_file_dialog)
5172 (xg_get_file_with_chooser, xg_get_file_with_selection)
5173 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5174 (xg_item_label_same_p, xg_update_menubar)
5175 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5176 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5177 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5178 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5179 (update_frame_tool_bar, free_frame_tool_bar):
5180 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5181 * nsmenu.m (ns_update_menubar):
5182 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5183 * xfns.c (Fx_show_tip) [USE_GTK]:
5184 Use bool for boolean.
5185 * gtkutil.c (xg_update_frame_menubar):
5186 * xmenu.c (update_frame_menubar):
5187 Return void, not int, since caller ignores return value.
5188 * gtkutil.c (xg_change_toolbar_position):
5189 Return void, not 1.
5190
af0e9f75
JB
51912012-09-23 Juanma Barranquero <lekktu@gmail.com>
5192
5193 * makefile.w32-in (BLOCKINPUT_H): Remove.
5194 (SYSSIGNAL_H): New macro.
5195 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5196 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5197 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5198 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5199 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5200 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5201 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5202 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5203 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5204 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5205 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5206 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5207 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5208 ($(BLD)/w32xfns.$(O)): Update dependencies.
5209
5101529e
EZ
52102012-09-23 Eli Zaretskii <eliz@gnu.org>
5211
5212 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5213 fatal_error_backtrace.
5214
5215 * w32proc.c (sys_kill): Undo last change: don't do anything when
5216 invoked to deliver SIGABRT to our own process. This is now
5217 handled by emacs_raise.
5218
2c3ee0ad
JB
52192012-09-23 Juanma Barranquero <lekktu@gmail.com>
5220
5221 * w32term.c (w32_read_socket): Remove leftover reference to
5222 interrupt_input_pending.
5223
62a1d661
PE
52242012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5225
5226 Do not use SA_NODEFER.
5227 Problem reported by Dani Moncayo in
5228 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5229 * alloc.c (die):
5230 * sysdep.c (emacs_abort): Do not reset signal handler.
5231 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5232 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5233 wanted even on POSIXish hosts, and it doesn't work on Windows.
5234
a0942b9a
JD
52352012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5236
5237 * xterm.c (x_term_init): Call fixup_locale before and after calling
5238 gtk_init (Bug#12392).
5239
d07ff9db
CY
52402012-09-23 Chong Yidong <cyd@gnu.org>
5241
5242 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5243 Vdynamic_library_alist.
5244
5245 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5246 (Fgnutls_available_p): Caller changed.
5247
5248 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5249 (Flibxml_parse_xml_region): Likewise.
5250
5251 * dispextern.h (struct image_type): Remove arg from init function.
5252
5253 * image.c (Finit_image_library, lookup_image_type)
5254 (define_image_type): Remove now-unneeded second arg.
5255 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5256 (init_tiff_functions, init_gif_functions, init_svg_functions):
5257 Arglist and w32_delayed_load calling convention changed.
5258 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 5259 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 5260
4d7e6e51
PE
52612012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5262
5263 Simplify and avoid signal-handling races (Bug#12471).
5264 * alloc.c (die):
5265 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5266 Avoid recursive loop if there's a fatal error in the function itself.
5267 * atimer.c (pending_atimers):
5268 * blockinput.h: Don't include "atimer.h"; no longer needed.
5269 (interrupt_input_pending): Remove. All uses removed.
5270 pending_signals now counts both atimers and ordinary interrupts.
5271 This is less racy than having three separate pending-signal flags.
5272 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5273 (input_blocked_p):
5274 Rename from their upper-case counterparts BLOCK_INPUT,
5275 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5276 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5277 This makes it easier to access volatile variables more accurately.
5278 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5279 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5280 that's more reliable if the code is buggy and sets
5281 interrupt_input_blocked to a negative value. All uses changed.
5282 * atimer.c (deliver_alarm_signal):
5283 Remove. No need to deliver this to the parent; any thread can
5284 handle this signal now. All uses replaced by underlying handler.
5285 * atimer.c (turn_on_atimers):
5286 * dispnew.c (handle_window_change_signal):
5287 * emacs.c (handle_danger_signal):
5288 * keyboard.c (kbd_buffer_get_event):
5289 Don't reestablish signal handler; not needed with sigaction.
5290 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5291 (UNBLOCK_INPUT_TO):
5292 Rework to avoid unnecessary accesses to volatile variables.
5293 (UNBLOCK_INPUT_TO): Now a function.
5294 (totally_unblock_input, unblock_input): New decls.
5295 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5296 (init_data): Remove. Necessary stuff now done in init_signal.
5297 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5298 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5299 (fatal_error_code): Remove; no longer needed.
5300 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5301 it doesn't always backtrace. All uses changed. No need to reset
5302 signal to default, since sigaction and/or die does that for us now.
5303 Use emacs_raise (FOO), not kill (getpid (), FOO).
5304 (main): Check more-accurately whether we're dumping.
5305 Move fatal-error setup to sysdep.c
5306 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5307 * gtkutil.c (xg_get_file_name, xg_get_font):
5308 Remove no-longer-needed signal-mask manipulation.
5309 * keyboard.c, process.c (POLL_FOR_INPUT):
5310 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5311 * keyboard.c (read_avail_input): Remove.
5312 All uses replaced by gobble_input.
5313 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5314 (kbd_buffer_store_event_hold, gobble_input):
5315 (record_asynch_buffer_change) [USABLE_SIGIO]:
5316 (store_user_signal_events):
5317 No need to mess with signal mask.
5318 (gobble_input): If blocking input and there are terminals, simply
5319 set pending_signals to 1 and return. All hooks changed to not
5320 worry about whether input is blocked.
5321 (process_pending_signals): Clear pending_signals before processing
5322 them, in case a signal comes in while we're processing.
5323 By convention callers now test pending_signals before calling us.
5324 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5325 New functions, to support changes to blockinput.h.
5326 (handle_input_available_signal): Now extern.
5327 (reinvoke_input_signal): Remove. All uses replaced by
5328 handle_async_input.
5329 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5330 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5331 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5332 Clear sigmask reliably, even if Fsignal returns, which it can.
5333 Omit unnecessary accesses to volatile var.
5334 (quit_throw_to_read_char): No need to restore sigmask.
5335 * keyboard.c (gobble_input, handle_user_signal):
5336 * process.c (wait_reading_process_output):
5337 Call signal-handling code rather than killing ourselves.
5338 * lisp.h: Include <float.h>, for...
5339 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5340 (pending_signals): Now volatile.
5341 (syms_of_data): Now const if IEEE floating point.
5342 (handle_input_available_signal) [USABLE_SIGIO]:
5343 (terminate_due_to_signal, record_child_status_change): New decls.
5344 * process.c (create_process): Avoid disaster if memory is exhausted
5345 while we're processing a vfork, by tightening the critical section
5346 around the vfork.
5347 (send_process_frame, process_sent_to, handle_pipe_signal)
5348 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5349 ignores SIGPIPE.
5350 (send_process): No need for setjmp/longjmp any more, since the
5351 SIGPIPE stuff is now gone. Instead, report an error if errno
5352 is EPIPE.
5353 (record_child_status_change): Now extern. PID and W are now args.
5354 Return void, not bool. All callers changed.
5355 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5356 Remove. All uses removed. This bug should be fixed now in a
5357 different way.
5358 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5359 and record the child status change directly. This avoids the
5360 need to futz with the signal mask.
5361 (process_fatal_action): Move here from emacs.c.
5362 (emacs_sigaction_flags): New function, containing
5363 much of what used to be in emacs_sigaction_init.
5364 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5365 caught by emacs, to make races less likely.
5366 (deliver_process_signal): Rename from handle_on_main_thread.
5367 All uses changed.
5368 (BACKTRACE_LIMIT_MAX): Now at top level.
5369 (thread_backtrace_buffer, threadback_backtrace_pointers):
5370 New static vars.
5371 (deliver_thread_signal, deliver_fatal_thread_signal):
5372 New functions, for more-accurate delivery of thread-specific signals.
5373 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5374 (deliver_arith_signal): Handle in this thread, not
5375 in the main thread, since it's triggered by this thread.
5376 (maybe_fatal_sig): New function.
5377 (init_signals): New arg DUMPING so that we can be more accurate
5378 about whether we're dumping. Caller changed.
5379 Treat thread-specific signals differently from process-general signals.
5380 Block all signals while handling fatal error; that's safer.
5381 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5382 on IEEE hosts.
5383 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5384 Ignore SIGPIPE unless batch.
5385 (emacs_backtrace): Output backtrace for the appropriate thread,
5386 which is not necessarily the main thread.
5387 * syssignal.h: Include <stdbool.h>.
5388 (emacs_raise): New macro.
5389 * xterm.c (x_connection_signal): Remove; no longer needed
5390 now that we use sigaction.
5391 (x_connection_closed): No need to mess with sigmask now.
5392 (x_initialize): No need to reset SIGPIPE handler here, since
5393 init_signals does this for us now.
5394
8f4635e9
JD
53952012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5396
5397 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 5398 background rect may be larger (Bug#12245).
8f4635e9 5399
3296976d
CY
54002012-09-23 Chong Yidong <cyd@gnu.org>
5401
5402 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5403
d41e491e
PE
54042012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5405
5406 * .gdbinit: Just stop at fatal_error_backtrace.
5407 See Stefan Monnier's request in
5408 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5409 Remove no-longer-used query of system type.
5410
c88b867f
CY
54112012-09-22 Chong Yidong <cyd@gnu.org>
5412
5413 * search.c (Freplace_match): Doc fix (Bug#12325).
5414
5415 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5416
5417 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5418 (Fline_end_position): Doc fix.
5419
5420 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5421
bb4d86b4
CY
54222012-09-22 Chong Yidong <cyd@gnu.org>
5423
5424 * dispextern.h (struct image_type): Add new slot, storing a type
5425 initialization function.
5426
5427 * image.c (define_image_type): Call the image initializer function
5428 if it is defined. Arguments and return value changed.
5429 (valid_image_p, make_image): Callers changed.
5430 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
5431 (gif_type, imagemagick_type, svg_type, gs_type):
5432 Add initialization functions.
bb4d86b4
CY
5433 (Finit_image_library): Call lookup_image_type.
5434 (CHECK_LIB_AVAILABLE): Macro deleted.
5435 (lookup_image_type): Call define_image_type here, rather than via
5436 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5437 (syms_of_image): Move define_image_type calls for xbm_type and
5438 pbm_type to lookup_image_type.
5439
df9685f3
EZ
54402012-09-22 Eli Zaretskii <eliz@gnu.org>
5441
5442 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5443 'idle_timers' from here ...
5444 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5445 lists, to avoid infloops when the timer does something stupid,
5446 like reinvoke itself with the same or smaller time-out.
5447 (Bug#12447)
5448
8e17c9ba
MR
54492012-09-22 Martin Rudalics <rudalics@gmx.at>
5450
5451 * window.c (Fsplit_window_internal): Handle only Qt value of
5452 Vwindow_combination_limit separately.
5453 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
5454 (Vwindow_combination_limit): New default value.
5455 Rewrite doc-string.
8e17c9ba 5456
589bd69b
EZ
54572012-09-22 Eli Zaretskii <eliz@gnu.org>
5458
5459 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5460 the new overlay string. (Bug#10159)
5461
01108e3f
PE
54622012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5463
5464 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5465 or that fprintf is async-signal-safe. POSIX doesn't require
5466 either assumption.
5467
82f8cd94
CY
54682012-09-22 Chong Yidong <cyd@gnu.org>
5469
5470 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5471 (Bug#8207).
5472
3cccbd87
KH
54732012-09-22 Kenichi Handa <handa@gnu.org>
5474
5475 * composite.c (composition_reseat_it): Handle the case that a
5476 grapheme cluster is not covered by a single font (Bug#12352).
5477
09c01941
CY
54782012-09-21 Chong Yidong <cyd@gnu.org>
5479
5480 * image.c (define_image_type): Avoid adding duplicate types to
5481 image_types (Bug#12463). Suggested by Jörg Walter.
5482
acfa068f 54832012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
5484
5485 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5486 (print_load_command_name): Add case LC_DATA_IN_CODE.
5487 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5488
acfa068f 54892012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
5490
5491 * eval.c (Frun_hook_with_args_until_success)
5492 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5493
acfa068f 54942012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
5495
5496 * fileio.c (Ffile_selinux_context): Only call freecon when
5497 lgetfilecon succeeded.
5498 (Fset_file_selinux_context): Likewise. (Bug#12444)
5499
acfa068f 55002012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
5501
5502 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5503 reordering, locate the cursor by calling set_cursor_from_row; if
5504 that fails, clear the desired glyph matrix before returning a
5505 failure indication to the caller. Fixes leaving garbled display
5506 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
5507 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5508 scrolling through multibyte text.
aa36e4d2 5509
e99f70c8
SM
55102012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5511
5512 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5513 calling mark_vectorlike since that's the one that marks the window.
5514 (mark_discard_killed_buffers): Mark the final cdr.
5515 * window.h (struct window): Move prev/next_buffers to the
5516 non-standard fields.
5517 * window.c (make_window): Initialize prev/next_buffers manually.
5518
f75beb47
PE
55192012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5520
5521 Omit unused arg EXPECTED from socket hooks.
5522 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5523 * nsterm.m (ns_term_init):
5524 * termhooks.h (struct terminal.read_socket_hook):
5525 * w32inevt.c (w32_console_read_socket):
5526 * w32term.c (w32_read_socket):
5527 * xterm.c (XTread_socket):
5528 Omit unused arg EXPECTED. All callers changed.
5529 (store_user_signal_events): Return void, not int, since callers no
5530 longer care about the return value. All uses changed.
5531
b019b76a
JB
55322012-09-20 Juanma Barranquero <lekktu@gmail.com>
5533
5534 * w32gui.h (XParseGeometry): Do not declare.
5535
05642592
PE
55362012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5537
e4bce92a 5538 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 5539 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
5540 <http://bugs.gnu.org/12471#8> (last line).
5541
05642592
PE
5542 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5543 (XParseGeometry): Now static. Substitute extremal values for
5544 values that are out of range.
5545
e543ae91
JD
55462012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5547
5548 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5549
5550 * nsfns.m (XParseGeometry): Remove.
5551 (Fx_create_frame): Call x_set_offset to correctly interpret
5552 top_pos in geometry.
5553
3a880af4 5554 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
5555 (Fx_parse_geometry): If there is a space in string, call
5556 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5557
45ba16c7
EZ
55582012-09-17 Eli Zaretskii <eliz@gnu.org>
5559
c8b9f1bc
EZ
5560 * search.c (scan_buffer): Use character positions in calls to
5561 region_cache_forward and region_cache_backward, not byte
5562 positions. (Bug#12196)
5563
b4c932a2
EZ
5564 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5565 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5566
45ba16c7
EZ
5567 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5568 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5569 emacs_blocked_malloc, now deleted.
5570
eeceac93
PE
55712012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5572
5573 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5574 The workaround was for improving performance on Solaris 2.4, but
5575 is getting in the way now. Emacs will still work if someone is
5576 still running Solaris 2.4 in a museum somewhere; Sun dropped
5577 support for Solaris 2.4 in 2003.
5578 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5579 * process.c (create_process) [HAVE_WORKING_VFORK]:
5580 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5581 since Emacs no longer uses vfork on that platform.
5582
78f83752
GM
55832012-09-17 Glenn Morris <rgm@gnu.org>
5584
5585 * emacs.c: Use COPYRIGHT.
5586
634b8cac
PE
55872012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5588
0caaedb1
PE
5589 Remove configure's --without-sync-input option (Bug#12450).
5590 When auditing signal-handling in preparation for cleaning it up,
5591 I found that SYNC_INPUT has race conditions and would be a real
5592 pain to fix. Since it's an undocumented and deprecated
5593 configure-time option, now seems like a good time to remove it.
5594 Also see <http://bugs.gnu.org/11080#16>.
5595 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5596 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5597 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5598 (malloc_hysteresis):
5599 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5600 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5601 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5602 (dont_register_blocks, bytes_used_when_reconsidered)
5603 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5604 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5605 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 5606 Remove. All uses removed.
0caaedb1
PE
5607 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5608 implementation, one that depends on whether the new macro
5609 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5610 is defined.
5611 * atimer.c (run_timers, handle_alarm_signal):
5612 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5613 (handle_async_input, process_pending_signals)
5614 (handle_input_available_signal, init_keyboard):
5615 * nsterm.m (ns_read_socket):
5616 * process.c (wait_reading_process_output):
5617 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5618 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5619 (emacs_write):
5620 * xterm.c (XTread_socket):
5621 Assume SYNC_INPUT.
5622 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5623 * eval.c (handling_signal): Remove. All uses removed.
5624 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5625 All uses replaced with the SYNC_INPUT version.
5626 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5627 Remove decls.
5628 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5629 Now static.
5630
634b8cac
PE
5631 * font.c (Ffont_shape_gstring): Remove unused local.
5632
83da1b55
GM
56332012-09-16 Glenn Morris <rgm@gnu.org>
5634
518650a5
GM
5635 * Makefile.in (clean): No longer run nextstep's clean.
5636
83da1b55
GM
5637 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5638 (ns_frag): Remove.
5639 (ns-app): Move here from ns.mk, and simplify.
5640 (clean): Simplify nextstep entry.
5641 * ns.mk: Remove file.
5642
85a43e2e
KH
56432012-09-17 Kenichi Handa <handa@gnu.org>
5644
5645 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5646 not covert the last few charactes.
5647
ba13e616 56482012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
5649
5650 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5651 here, but just check the validity of glyphs in the glyph-string.
5652
a8c729af
MR
56532012-09-16 Martin Rudalics <rudalics@gmx.at>
5654
3a880af4
SM
5655 * window.c (Fwindow_parameter, Fset_window_parameter):
5656 Accept any window as argument (Bug#12452).
a8c729af 5657
c077c059
JD
56582012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5659
5660 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5661 to ns_term_init to avoid memory leak.
5662
5663 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5664 explicit retain/release.
5665 (ns_term_init): Only allow one display. Initialize outerpool and
5666 ns_*_types.
5667
39a57ad0
PE
56682012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5669
5670 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5671 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5672 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5673 the Microsoft problem in a different way, by altering ../nt/config.nt.
5674
7105c8cb
EZ
56752012-09-15 Eli Zaretskii <eliz@gnu.org>
5676
5677 * w32xfns.c:
5678 * w32uniscribe.c:
5679 * w32term.c:
5680 * w32select.c:
5681 * w32reg.c:
5682 * w32proc.c:
5683 * w32menu.c:
5684 * w32inevt.c:
5685 * w32heap.c:
5686 * w32font.c:
5687 * w32fns.c:
5688 * w32console.c:
5689 * w32.c:
5690 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5691 by lisp.h. This completes removal of setjmp.h inclusion
5692 erroneously announced in the previous commit. (Bug#12446)
5693
5694 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5695 more accurate.
5696
5697 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5698 not defined as a macro. The latter happens on MS-Windows.
5699 (Bug#12446)
5700
0328b6de
PE
57012012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5702
5703 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5704 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5705 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5706 only reason for the instance was because "lisp.h" was included.
5707 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5708 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5709 and _longjmp with the new symbols. Emacs already uses _setjmp if
5710 available, so this change affects only POSIXish hosts that have
5711 sigsetjmp but not _setjmp, such as some versions of Solaris and
5712 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5713 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5714 (png_load_body) [HAVE_PNG]:
5715 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5716 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5717 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5718 since PNG requires jmp_buf. This is the only exception to the
5719 general rule that we now use sys_setjmp and sys_longjmp.
5720 This exception is OK since this code does not change the signal
5721 mask or longjmp out of a signal handler.
5722
2af03429
PE
57232012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5724
5725 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5726 Include "syssignal.h", for 'main_thread'.
5727
2f294edf
DA
57282012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5729
5730 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5731 * insdel.c (replace_range, replace_range_2):
5732 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5733 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5734 Remove redundant check before calling offset_intervals.
5735
6b533e9c
MR
57362012-09-14 Martin Rudalics <rudalics@gmx.at>
5737
5738 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5739 current buffer (Bug#12387).
5740
2a7931e3
JB
57412012-09-14 Juanma Barranquero <lekktu@gmail.com>
5742
5743 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5744
c18e885b
PE
57452012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5746
5747 Use a more backwards-compatible timer format (Bug#12430).
5748 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5749 vector element, not from the 4th, since PSECS is now at the end.
5750 (Fcurrent_idle_time): Doc fix.
5751
d59a1afb
DA
57522012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5753
5754 Function to mark objects and remove killed buffers at once.
5755 * alloc.c (discard_killed_buffers): Rename to ...
5756 (mark_discard_killed buffers) ... new name. Add marking
5757 of remaining objects. Fix comment. Adjust users.
5758 (mark_object): Do not touch frame buffer lists here.
5759 * frame.c (delete_frame): Reset frame buffer lists here.
5760
5f0cb45a
PE
57612012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5762
8ea47e3a
PE
5763 Better workaround for GNOME bug when --enable-gcc-warnings.
5764 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5765 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5766 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5767
4a4bbad2
PE
5768 Simplify SIGIO usage (Bug#12408).
5769 The code that dealt with SIGIO was crufty and confusing, e.g., it
5770 played tricks like "#undef SIGIO" but these tricks were not used
5771 consistently. Simplify mostly by not #undeffing standard symbols,
5772 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5773 or not as we please) rather than "defined SIGIO" (standard symbol
5774 that we probably shouldn't #undef).
5775 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5776 Modules that need it can include it.
5777 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5778 * dispextern.h (ignore_sigio): New decl.
5779 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5780 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5781 * emacs.c (shut_down_emacs):
5782 * keyboard.c (kbd_buffer_store_event_hold):
5783 Use ignore_sigio rather than invoking 'signal' directly.
5784 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5785 for FIONREAD.
5786 (FIONREAD, SIGIO): Do not #undef.
5787 (tty_read_avail_input): Use #error rather than a syntax error.
5788 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5789 for I_PIPE, used by SETUP_SLAVE_PTY.
5790 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5791 * sysdep.c (croak): Remove; no longer needed. This bit of
5792 temporary code, with Fred N. Fish's comment that it's temporary,
5793 has been in Emacs since at least 1992!
5794 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5795 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5796 * syssignal.h (croak): Remove decl.
5797 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5798 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5799 now that we're termios-only.
5800 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5801 * term.c (dissociate_if_controlling_tty): Use #error rather than
5802 a run-time error.
5803
5f0cb45a
PE
5804 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5805 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5806 to work around GNOME bug 683906.
5807 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5808 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5809 This works around GCC bug 54561.
5810
40bce90b
PE
58112012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5812
5813 More fixes for 'volatile' and setjmp/longjmp.
5814 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5815 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5816 (png_load_body) [HAVE_PNG]:
5817 (jpeg_load_body) [HAVE_JPEG]:
5818 New function, with most of the old parent function's body.
5819 (png_load) [HAVE_PNG]:
5820 (jpeg_load) [HAVE_JPEG]:
5821 Invoke the new function, to avoid longjmp munging our locals.
5822 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5823 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5824 longjmp is passed 2, as the C standard doesn't guarantee this.
5825 Instead, store the failure code into mgr->failure_code.
5826
bfeae2cf
SM
58272012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5828
5829 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5830 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5831 (syms_of_keyboard): Remove support for unread-command-char.
5832
8099e36b
EZ
58332012-09-12 Eli Zaretskii <eliz@gnu.org>
5834
5835 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5836 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5837 violation. (Bug#12426)
5838
92547ff9
PE
58392012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5840
5841 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5842
45b82ad0
SM
58432012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5844
5845 * eval.c: Add `inhibit-debugger'.
5846 (Qinhibit_debugger): New symbol.
5847 (call_debugger): Bind it instead of Qdebug_on_error.
5848 (maybe_call_debugger): Test Vinhibit_debugger.
5849 (syms_of_eval): Define inhibit-debugger.
5850 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5851 (syms_of_xdisp): Remove inhibit-debug-on-message.
5852
5779a1dc
PE
58532012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5854
50f2e553
PE
5855 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5856 If a nonvolatile local variable is written before a _longjmp to
5857 the frame containing the variable, and is read after the _longjmp,
5858 the value read is indeterminate. Some local variables of type
5859 'struct handler' and 'struct catchtag' are used in this way, so
5860 mark each of their slots as volatile if the slot can be set before
5861 _longjmp and read afterwards.
5862 * lisp.h (struct handler): var and chosen_clause are now volatile.
5863 (struct catchtag): val, next, and pdlcount are now volatile.
5864
ae1d87e2
PE
5865 * bidi.c (bidi_push_it, bidi_pop_it):
5866 * fns.c (copy_hash_table):
5867 * image.c (define_image_type):
5868 * keyboard.c (kbd_buffer_store_event_hold):
5869 * process.c (Fprocess_send_eof):
5870 * xfaces.c (x_create_gc) [HAVE_NS]:
5871 * xgselect.c (xg_select):
5872 Prefer assignment to memcpy when either will do.
5873
5779a1dc
PE
5874 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5875 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5876 time an item is removed. No need to mark this function 'inline';
5877 the compiler knows better than we do.
5878
c4c9756b
JD
58792012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5880
5881 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5882 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5883 to change_frame_size (Bug#12388).
5884 (windowDidResize:): Pass YES to updateFrameSize.
5885
5886 * nsterm.h: Add delay parameter to updateFrameSize.
5887
d73e321c
DA
58882012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5889
5890 Discard killed buffers from deleted window and frame objects.
5891 This reduces an amount of references to killed buffers and
5892 helps GC to reclaim them faster.
5893 * alloc.c (discard_killed_buffers): New function.
5894 (mark_object): Use it for deleted windows and frames.
5895 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 5896 or deleted frame, restore its global binding.
d73e321c
DA
5897 * data.c (swap_in_global_binding): Add GC notice.
5898 (swap_in_symval_forwarding): Use convenient set_blv_where.
5899 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5900 * window.h: ... to here.
5901
e578f381
DA
59022012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5903
5904 Convenient macro to check whether the buffer is live.
5905 * buffer.h (BUFFER_LIVE_P): New macro.
5906 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5907 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5908
3057e615
YM
59092012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5910
5911 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5912 composition cases (Bug#12364).
5913
5914 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5915 overhang of succeeding glyphs overlapping box cursor.
5916
5917 * w32term.c (x_draw_glyph_string): Likewise.
5918
6fda35f2
PE
59192012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5920
c990426a
PE
5921 Simplify, document, and port floating-point (Bug#12381).
5922 The porting part of this patch fixes bugs on non-IEEE platforms
5923 with frexp, ldexp, logb.
5924 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5925 Now static.
5926 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5927 support, by removing commented-out code and briefly listing the
5928 C89 functions excluded. The commented-out stuff was confusing
5929 maintenance, e.g., we thought we needed cbrt but it was commented out.
5930 (logb): Remove decl; no longer needed.
5931 (isfinite): New macro, if not already supplied.
5932 (isnan): Don't replace any existing macro.
5933 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5934 are present on all C89 platforms.
5935 (Ffrexp): Do not special-case zero, as frexp does the right thing
5936 for that case.
5937 (Flogb): Do not use logb, as it doesn't have the desired meaning
5938 on hosts that use non-base-2 floating point. Instead, stick with
5939 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5940 frexp, to avoid getting an unspecified result.
5941
6fda35f2
PE
5942 * xdisp.c (Qinhibit_debug_on_message): Now static.
5943
16130a58
JD
59442012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5945
5946 * nsterm.m (ns_update_begin): Set clip path to whole view by using
5947 NSBezierPath (Bug#12131).
5948
d105a573
CY
59492012-09-10 Chong Yidong <cyd@gnu.org>
5950
5951 * fns.c (Fdelq, Fdelete): Doc fix.
5952
ff55dfe8
PE
59532012-09-10 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
5956 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
5957
e7032e7c
SM
59582012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
5959
5960 * lisp.h (make_lisp_ptr): New macro to replace XSET.
5961 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
5962 Use it.
5963
e9957956
EZ
59642012-09-09 Eli Zaretskii <eliz@gnu.org>
5965
aba05ce9
EZ
5966 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
5967 left fringe if the window has a left margin. This avoids leaving
5968 traces of the cursor because its leftmost pixel is not drawn over.
5969
e9957956
EZ
5970 * dispnew.c (update_window_line): When the left margin area of a
5971 screen line is updated, set the redraw_fringe_bitmaps_p flag of
5972 that screen line. (Bug#12277)
5973
f6196b87
PE
59742012-09-09 Paul Eggert <eggert@cs.ucla.edu>
5975
5976 Assume C89 or later for math functions (Bug#12381).
5977 This simplifies the code, and makes it a bit smaller and faster,
5978 and (most important) makes it easier to clean up signal handling
5979 since we can stop worring about floating-point exceptions in
5980 library code. That was a problem before C89, but the problem
5981 went away many years ago on all practical Emacs targets.
5982 * data.c, image.c, lread.c, print.c:
5983 Don't include <math.h>; no longer needed.
5984 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
5985 might be autoconfigured, as that never happens.
5986 * data.c (fmod):
5987 * doprnt.c (DBL_MAX_10_EXP):
5988 * print.c (DBL_DIG):
5989 Remove. C89 or later always defines these.
5990 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
5991 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
5992 (arith_error, domain_error, domain_error2):
5993 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
5994 no longer needed -- we simply return what C returns. All uses removed.
5995 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
5996 the wrapped code.
5997 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
5998 Remove. All uses expanded, as these macros are no longer used
5999 more than once and are now more trouble than they're worth.
6000 (Ftan): Use tan, not sin / cos.
6001 (Flogb): Assume C89 frexp.
6002 (fmod_float): Assume C89 fmod.
6003 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6004 (init_floatfns): Remove. All uses removed.
6005
9d7f1863
JD
60062012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6007
6008 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6009 compositeToPoint for OSX < 10.6 (Bug#12390).
6010
eabf0404
PE
60112012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6012
6013 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6014 This produces more-accurate results.
6015
0b3b1d23
JD
60162012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6017
6018 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6019 changes (Bug#12088).
6020
6dcef6ec
CY
60212012-09-08 Chong Yidong <cyd@gnu.org>
6022
6023 * syntax.c (Fstring_to_syntax): Doc fix.
6024
aa7d57c5
JD
60252012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6026
6027 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6028 in the internal border.
6029 (x_set_window_size): Remove static variables and their usage.
6030 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
6031 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6032 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
6033 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6034 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6035 (ns_fix_rect_ibw): Remove.
6036 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6037 (ns_dumpglyphs_box_or_relief): Ditto.
6038 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6039 adjustment.
6040 (ns_dumpglyphs_image): Ditto.
fc0c31f8 6041 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
6042 border adjustment.
6043 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6044 their usage. Add fringe_extended_p and its use as in other terms.
6045 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6046 scroll bar was removed.
6047 (updateFrameSize): New function.
6048 (windowDidResize): Move code to updateFrameSize and call it.
6049
6050 * nsterm.h (EmacsView): Add updateFrameSize.
6051
1a5432bc
CY
60522012-09-07 Chong Yidong <cyd@gnu.org>
6053
b4f5313e
CY
6054 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6055
1a5432bc
CY
6056 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6057
1a4f1e9b
PE
60582012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6059
6060 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
6061 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6062 Problem introduced when merging patches. Noted by Eli Zaretskii in
6063 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
6064 * floatfns.c: Comment fix.
6065 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6066 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6067 and anyway the declaration is harmless even if SIGDANGER is not defined.
6068 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6069 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6070 source files not surprisingly expected syssignal.h to define, or
6071 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6072 Include <sys/ioctl.h>, for FIONREAD.
6073 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6074 This eliminates a problem whereby other files mysteriously had
6075 to include "syssignal.h" before including "systty.h" if they
6076 wanted to use "#ifdef SIGIO".
6077
bc8000ff
EZ
60782012-09-07 Eli Zaretskii <eliz@gnu.org>
6079
3e6d6928
EZ
6080 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6081
6082 * w32.c (sigemptyset): Empty the set.
6083 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6084
bc8000ff
EZ
6085 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6086
b4fa72f2
DA
60872012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6088
6089 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6090 (mark_object): Likewise for frame objects.
6091
30730c93
PE
60922012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6093
6094 * syssignal.h (handle_on_main_thread): Always declare,
6095 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6096 This ports to platforms without HAVE_PTHREAD.
6097
2fe28299
PE
60982012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 Signal-handler cleanup (Bug#12327).
6101 Emacs's signal handlers were written in the old 4.2BSD style with
6102 sigblock and sigmask and so forth, and this led to some
6103 inefficiencies and confusion. Rewrite these to use
6104 pthread_sigmask etc. without copying signal sets around. Also,
6105 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6106 'signal', and instead use functions that do not attempt to take
6107 over the system name space. This patch causes Emacs's text
6108 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6109 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6110 Do not include <signal.h> or "syssignal.h", as these
6111 modules do not use signals.
6112 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6113 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6114 Do not include <signal.h>, as "syssignal.h" does that for us now.
6115 * atimer.c (sigmask_atimers): New function.
6116 (block_atimers, unblock_atimers): New functions,
6117 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6118 All uses replaced.
6119 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6120 no longer needed here.
6121 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 6122 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
6123 * sysdep.c (struct save_signal): New member 'action', replacing
6124 old member 'handler'.
6125 (save_signal_handlers, restore_signal_handlers):
6126 Use sigaction instead of 'signal' to save and restore.
6127 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6128 New function. All users of 'signal' modified to use set_sighandler
6129 if they're writeonly, and to use sys_signal if they're read+write.
6130 (emacs_sigaction_init, forwarded_signal): New functions.
6131 (sys_signal): Remove. All uses replaced by calls to sigaction
6132 and emacs_sigaction_init, or by direct calls to 'signal'.
6133 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6134 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6135 all uses replaced by pthread_sigmask etc. calls.
6136 * syssignal.h: Include <signal.h>.
6137 (emacs_sigaction_init, forwarded_signal): New decls.
6138 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6139 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6140 (sigmask, sys_sigmask): Remove; no longer needed.
6141 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6142 (sigblock, sigunblock, sigfree):
6143 (sigsetmask) [!defined sigsetmask]:
6144 Remove. All uses replaced by pthread_sigmask.
6145 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6146 no longer need to be replaced, and its typical old uses
6147 are now done via emacs_sigaction_init and sigaction.
6148 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6149 (sys_sigdel): Remove; unused.
6150 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6151
0216c128
EZ
61522012-09-06 Eli Zaretskii <eliz@gnu.org>
6153
6154 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6155 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6156
c752cfa9
DA
61572012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6158
6159 Explicitly mark buffer_defaults and buffer_local_symbols.
6160 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6161 mark_local_symbols here.
6162 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6163 since special buffers aren't marked here any more.
6164 (allocate_buffer): Chain new buffer with all_buffers here...
6165 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6166 not here.
6167 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6168 (syms_of_buffer): Remove staticpro of the above.
6169 (init_buffer_once): Set names for buffer_defaults and
6170 buffer_local_symbols.
6171
a864ef14
PE
61722012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 Use bool for booleans in font-related modules.
6175 * font.c (font_intern_prop, font_style_to_value)
6176 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6177 (generate_otf_features, font_check_otf_features, font_check_otf)
6178 (font_match_p, font_list_entities, font_at):
6179 * fontset.c (fontset_id_valid_p, reorder_font_vector
6180 (fontset_find_font, Fset_fontset_font)
6181 (face_suitable_for_char_p) [0]:
6182 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6183 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6184 (m17n_flt_initialized, ftfont_shape_by_flt):
6185 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6186 * nsfont.m (nsfont_draw):
6187 * w32font.c (w32font_draw):
6188 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6189 Use bool for booleans.
6190 * font.h: Adjust to above API changes.
6191 (struct font, struct font_driver, struct font_driver_list):
6192 Use bool for booleans.
6193 (struct font): Remove useless member encoding_type.
6194 All users removed.
6195 * fontset.c, xftfont.c: Omit unnecessary static decls.
6196
0699fc18
DA
61972012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6198
6199 * alloc.c (mark_object): Revert window marking code
6200 since it's unsafe for the Fset_window_configuration.
6201
20ef56db
PE
62022012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6203
2fe28299 6204 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
6205 Be more systematic about preserving errno whenever a signal
6206 handler returns, even if it's not in the main thread. Do this by
6207 renaming signal handlers to distinguish between signal delivery
6208 and signal handling. All uses changed.
6209 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6210 * data.c (deliver_arith_signal): Rename from arith_error.
6211 * dispnew.c (deliver_window_change_signal): Rename from
6212 window_change_signal.
6213 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6214 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6215 * keyboard.c (deliver_input_available_signal): Rename from
6216 input_available_signal.
6217 (deliver_user_signal): Rename from handle_user_signal.
6218 (deliver_interrupt_signal): Rename from interrupt_signal.
6219 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6220 (deliver_child_signal): Rename from sigchld_handler.
6221 * atimer.c (handle_alarm_signal):
6222 * data.c (handle_arith_signal):
6223 * dispnew.c (handle_window_change_signal):
6224 * emacs.c (handle_fatal_signal, handle_danger_signal):
6225 * keyboard.c (handle_input_available_signal):
6226 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6227 * process.c (handle_pipe_signal, handle_child_signal):
6228 New functions, with the actual signal-handling code taken from the
6229 original respective signal handlers, sans the sporadic attempts to
6230 preserve errno, since that's now done by handle_on_main_thread.
6231 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6232 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6233 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6234 Move to sysdep.c.
6235 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6236 Move initialization of main_thread to sysdep.c's init_signals.
6237 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6238 our usage, and simplifies the mainline code.
6239 (record_child_status_change): New static function, as a helper
6240 for handle_child_signal, and with most of the old child handler's
6241 contents.
6242 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6243 (handle_child_signal): Use the above.
6244 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6245 Moved here from emacs.c.
6246 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6247 code moved here from emacs.c's main function.
6248 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
6249 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6250 This lets callers save and restore errno properly.
20ef56db 6251
e3ccf108
DA
62522012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6253
6254 Remove redundant or unused things here and there.
6255 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6256 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6257 * editfns.c (Fcompare_buffer_substrings): Likewise.
6258 * frame.h (struct terminal, struct font_driver_list):
6259 Remove redundant declarations.
6260 * window.h (Qleft, Qright): Likewise.
6261
697e1e39
DA
62622012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6263
6264 Do not mark objects from deleted buffers, windows and frames.
6265 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6266 (mark_object): Likewise for windows and frames.
6267
c1ca42ca
DA
62682012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6269
6270 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6271 buffer_defaults and buffer_local_symbols as valid objects.
6272 Return special value to denote them.
6273
014d93be
PE
62742012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6275
f75d7a91
PE
6276 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6277 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6278 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6279 (file_name_absolute_p, Fsubstitute_in_file_name):
6280 (check_executable, check_writable, Ffile_accessible_directory_p)
6281 (Fset_file_selinux_context, Fdefault_file_modes)
6282 (Finsert_file_contents, choose_write_coding_system)
6283 (Fwrite_region, build_annotations, a_write, e_write)
6284 (Fdo_auto_save):
6285 * filelock.c (boot_time_initialized, get_boot_time)
6286 (get_boot_time_1, lock_file_1, within_one_second):
6287 * floatfns.c (in_float):
6288 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6289 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6290 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6291 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6292 * window.c (compare_window_configurations):
6293 Use bool for booleans.
6294 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6295 (Fdefault_file_modes): Now mode_t, not int, for modes.
6296 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6297 (internal_delete_file): Now returns void, not a (boolean) int,
6298 since nobody was looking at the return value.
6299 * lisp.h, window.h: Adjust to above API changes.
6300
014d93be
PE
6301 * xdisp.c (set_message): Simplify and reindent last change.
6302
776f29e1
JB
63032012-09-05 Juanma Barranquero <lekktu@gmail.com>
6304
6305 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6306
7f7e0167
LI
63072012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6308
6309 * eval.c (call_debugger): Make the function non-static so that we
6310 can call it from set_message.
6311
6312 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6313 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6314
cf29dd84
PE
63152012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6316
6317 Give more-useful info on a fatal error (Bug#12328).
6318 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6319 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6320 of doing the work ourselves.
6321 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6322 do most of the work.
6323 (fatal_error_backtrace): New function, taken from the guts
6324 of the old fatal_error_signal, but with a new option to output
6325 a backtrace.
6326 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6327 info about the signal than just its number.
6328 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6329 * sysdep.c: Include <execinfo.h>
6330 (emacs_backtrace): New function, taken partly from the previous
6331 code of the 'die' function.
6332 (emacs_abort): Call fatal_error_backtrace rather than abort.
6333
972debf2
SM
63342012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6335
6336 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6337 eager (load-time) macro-expansion.
6338 * lisp.mk (lisp): Add macroexp.
6339
1088b922
PE
63402012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6341
6342 Simplify redefinition of 'abort' (Bug#12316).
6343 Do not try to redefine the 'abort' function. Instead, redo
6344 the code so that it calls 'emacs_abort' rather than 'abort'.
6345 This removes the need for the NO_ABORT configure-time macro
6346 and makes it easier to change the abort code to do a backtrace.
6347 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6348 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6349 Remove; sysdep.c's emacs_abort now takes its place.
6350 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6351 'abort' changed to use 'emacs_abort'.
6352 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6353 (abort) [!defined abort]: Rename to ...
6354 (emacs_abort): ... new name.
6355 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6356 the place of the old 'abort' in emacs.c.
6357 * w32.c, w32fns.c (abort): Do not #undef.
6358 * w32.c (emacs_abort): Rename from w32_abort.
6359
30934d33
EZ
63602012-09-04 Eli Zaretskii <eliz@gnu.org>
6361
6362 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6363 offsets[j].dv, since the y axis of the screen coordinates points
6364 down, while the y axis of the font definition coordinates points
6365 up. This fixes display of Arabic diacritics such as KASRA and
6366 KASRATAN. (Bug#11860)
6367
af26b72c
PE
63682012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6369
6370 Be more systematic about _setjmp vs setjmp.
6371 * alloc.c (test_setjmp, mark_stack):
6372 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6373 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6374 (png_load, my_error_exit, jpeg_load):
6375 * process.c (send_process_trap, send_process):
6376 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6377 The underscored versions are up to 30x faster on some hosts.
6378 Formerly, the code used setjmp+longjmp sometimes and
6379 _setjmp+_longjmp at other times, with no particular reason to
6380 prefer setjmp+longjmp.
6381
26d4541d
PE
63822012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6383
d42f4f0f 6384 Fix minor problem found by static checking.
26d4541d 6385 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 6386
c5e28e39
MR
63872012-09-03 Martin Rudalics <rudalics@gmx.at>
6388
6389 * buffer.c (Fdelete_all_overlays): New function.
6390
3eab3ca9
CY
63912012-09-03 Chong Yidong <cyd@gnu.org>
6392
6393 * gtkutil.c: Add extern decl for Qxft.
6394
c04889f8
PE
63952012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6396
1882aa38
PE
6397 * emacs.c, eval.c: Use bool for boolean.
6398 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6399 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6400 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6401 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6402 (main, decode_env_path, Fdaemon_initialized):
6403 * eval.c (call_debugger, Finteractive_p, interactive_p):
6404 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6405 (maybe_call_debugger, Fbacktrace):
6406 * process.c (read_process_output, exec_sentinel):
6407 Use bool for booleans.
6408 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6409 All callers changed.
6410 * eval.c (interactive_p): Omit always-true boolean argument
6411 EXCLUDE_SUBRS_P. All callers changed.
6412 * dispextern.h, lisp.h: Reflect above API changes.
6413 * firstfile.c (dummy): Use the address of 'main', whose signature
6414 won't change, instead of the address of 'initialize', whose
6415 signature just changed from int to bool.
6416 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6417 * msdos.c (fatal_error_in_progress): ... from here.
6418 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6419 of incrementing it.
6420 (redisplay_internal, unwind_redisplay): Simply clear
6421 REDISPLAYING_P when unwinding, instead of saving its previous,
6422 always-false value and then restoring it.
6423
a411ac43
PE
6424 Clean up some extern decls.
6425 Mostly, this hoists extern decls out of .c files and into .h files.
6426 That way, we're more likely to catch errors if the interfaces change.
6427 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6428 declare xg_mark_data.
6429 * dispextern.h (x_frame_parm_handlers):
6430 * font.h (Qxft):
6431 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6432 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6433 (Qultra_bold, Qoblique, Qitalic):
6434 Move extern decl here from .c file.
6435 * alloc.c (xg_mark_data) [USE_GTK]:
6436 * doc.c (Qclosure):
6437 * eval.c (Qlexical_binding):
6438 * fns.c (time) [!HAVE_UNISTD_H]:
6439 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6440 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6441 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6442 * lread.c (Qinternal_interpreter_environment):
6443 * minibuf.c (Qbuffer):
6444 * process.c (QCfamily, QCfilter):
6445 * widget.c (free_frame_faces):
6446 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6447 * xfont.c (x_clear_errors):
6448 * xterm.c (x_frame_parm_handlers):
6449 Remove now-redundant extern decls.
6450 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6451 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6452 Now static.
6453 * xfaces.c: Remove unnecessary static decls.
6454 * xterm.c (updating_frame): Remove decl of nonexistent object.
6455
c04889f8
PE
6456 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6457 when building globals.h, as the objects that are not built on
6458 this host are not needed to compile C files on this host.
6459
8b339673
JD
64602012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6461
6462 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6463
6464 * frame.h: Add missing prototype for x_wm_set_size_hint.
6465
a08d4ba7
PE
64662012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6467
6468 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6469 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6470 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6471 (Fsubstitute_command_keys):
6472 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6473 (save_excursion_save, save_excursion_restore)
6474 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6475 (format_time_string, general_insert_function)
6476 (make_buffer_string, make_buffer_string_both)
6477 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6478 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6479 (copy_text, insert_1, insert_1_both, insert_from_string)
6480 (insert_from_string_before_markers, insert_from_string_1)
6481 (insert_from_buffer, insert_from_buffer_1, replace_range)
6482 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6483 (del_range_2, modify_region):
6484 * intervals.c (intervals_equal, balance_possible_root_interval)
6485 (adjust_intervals_for_insertion, merge_properties_sticky)
6486 (graft_intervals_into_buffer, lookup_char_property)
6487 (adjust_for_invis_intang, set_point_both)
6488 (get_property_and_range, compare_string_intervals)
6489 (set_intervals_multibyte_1, set_intervals_multibyte):
6490 * keyboard.c (decode_timer):
6491 Use bool for boolean.
6492 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6493 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6494
48c948de
CY
64952012-09-02 Chong Yidong <cyd@gnu.org>
6496
6497 * keymap.c (push_key_description): Print M-TAB as C-M-i
6498 (Bug#11758).
6499
6c49a40b
JB
65002012-09-02 Juanma Barranquero <lekktu@gmail.com>
6501
6502 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6503 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6504 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6505 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6506 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6507 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6508 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6509
4dfbd238
EZ
65102012-09-01 Eli Zaretskii <eliz@gnu.org>
6511
7e510e28
EZ
6512 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6513 more than one grapheme cluster passed to the shaper: compute the
6514 offset adjustment values separately for each cluster. (Bug#11860)
6515
4dfbd238
EZ
6516 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6517 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6518 about implicit conversions from integer to pointer.
6519
86571ae0
DC
65202012-09-01 Daniel Colascione <dancol@dancol.org>
6521
6522 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6523 system used too early.
6524
0e23ef9d
PE
65252012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6526
6527 Better seed support for (random).
6528 * emacs.c (main): Call init_random.
6529 * fns.c (Frandom): Set the seed from a string argument, if given.
6530 Remove long-obsolete Gentzel cruft.
6531 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6532 (init_random): New function.
6533
17a2cbbd
DC
65342012-09-01 Daniel Colascione <dancol@dancol.org>
6535
6536 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6537 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6538 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6539 x_wm_set_size_hint, x_query_colors, x_real_positions,
6540 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6541 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6542 all of which have been moved to common code.
6543
6544 * xfaces.c: Include TERM_HEADER instead of listing all possible
6545 window-system headers.
6546
6547 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6548 to match header.
6549
6550 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6551 directly accessing frame internals.
6552
f18cbb28 6553 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
6554 globals_of_w32font.
6555
6556 * process.c: Include TERM_HEADER instead of listing all possible
6557 window-system headers.
6558
3a880af4
SM
6559 * nsterm.h: Remove declarations now in frame.h.
6560 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
6561
6562 * menu.c: Include TERM_HEADER instead of listing all possible
6563 window-system headers.
6564
6565 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6566 window system.
6567
6568 * keyboard.c: Include TERM_HEADER instead of listing all possible
6569 window-system headers.
6570
6571 * image.c: Include TERM_HEADER instead of listing all possible
6572 window-system headers. Declare Vlibrary_cache when compiling for
6573 Windows.
6574
6575 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6576 window system declarations.
6577
6578 * frame.h: Move common functions here: set_frame_menubar,
6579 x_set_window_size, x_sync, x_get_focus_frame,
6580 x_set_mouse_position, x_set_mouse_pixel_position,
6581 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6582 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6583 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6584 x_activate_menubar, x_real_positions, x_bitmap_icon,
6585 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6586 and x_query_colors.
6587
6588 * frame.c: Include TERM_HEADER instead of listing all possible
6589 window-system headers.
6590
6591 * font.c: Include TERM_HEADER instead of listing all possible
6592 window-system headers.
6593
6594 * emacs.c: Include TERM_HEADER.
6595
f18cbb28
EZ
6596 * dispnew.c: Include TERM_HEADER instead of listing all possible
6597 window-system headers.
17a2cbbd 6598
f18cbb28 6599 * ccl.h: Include character.h.
17a2cbbd
DC
6600
6601 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6602 the current window system; include in list of objects to link into
6603 Emacs.
6604
c650a5de
DA
66052012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6606
6607 Remove mark_ttys function and fix tty_display_info initialization.
6608 * lisp.h (mark_ttys): Remove prototype.
6609 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6610 to mark_ttys because all possible values of 'top_frame' slot are
6611 the frames which are reachable from Vframe_list.
6612 * term.c (mark_ttys): Remove.
6613 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6614
4e0f6479
DA
66152012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6616
6617 Change struct frame bitfields from unsigned char to unsigned.
6618 * frame.h (struct frame): Change type of 'display_preempted',
6619 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6620 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6621 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6622 bitfields from unsigned char to unsigned.
6623
8b96a52c
DA
66242012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6625
6626 Remove unused member of struct x_output and struct w32_output.
6627 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6628 * w32term.h (struct w32_output): Likewise.
6629
b4444c8a
JD
66302012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6631
6632 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6633 does not become zero (Bug#12234).
6634
b98521db
PE
66352012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6636
6637 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6638 for GCC 4.7.1 x86-64.
6639
31d02438
GM
66402012-08-30 Glenn Morris <rgm@gnu.org>
6641
6642 * lread.c (init_lread): For out-of-tree builds, only add the
6643 source directory's site-lisp dir to the load-path if it exists,
6644 consistent with in-tree builds. (Bug#12302)
6645
7f8941d8
JD
66462012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6647
6648 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 6649 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
6650 (windowShouldClose:): Set window_closed.
6651 (dealloc): New member, free button_values.
fc0c31f8
JB
6652 (process_dialog:): Make member function. Remove window argument,
6653 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
6654 in button_values.
6655 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 6656 with tag. Remove return self, declare return value as void.
7f8941d8
JD
6657 (addString:row:): Remove return self, declare return value as void.
6658 (addSplit): Remove return self, declare return value as void.
6659 (clicked:): Remove return self, declare return value as void.
fc0c31f8 6660 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
6661 (initFromContents:isQuestion:): Adjust call to process_dialog.
6662 Code formatting change.
6663 (timeout_handler:): Set timer_fired to YES.
6664 (runDialogAt:): Set timer_fired to NO.
6665 Handle click on close button as quit.
6666
6667 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6668 Add window_closed and button_values. Add void as return value for
6669 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6670 Add process_dialog as new member.
6671
eada0861 66722012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6673
eada0861
GM
6674 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6675 is not one of the heaps we manage. (Bug#12242)
6676
66772012-08-28 Glenn Morris <rgm@gnu.org>
6678
6679 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6680
457294dd
MR
66812012-08-28 Martin Rudalics <rudalics@gmx.at>
6682
6683 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6684 auto-buffer-name window parameter. Install revision of reverted
6685 fix.
457294dd 6686
4f2daf31
DA
66872012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6688
6689 Do not allow to set major mode for a dead buffer.
6690 * buffer.c (Fset_buffer_major_mode): Signal an error
6691 if the buffer is dead.
6692 (Fother_buffer, other_buffer_safely): Remove redundant
6693 nested declaration.
6694
66322887
DA
66952012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6696
6697 Always use set_buffer_if_live to restore original buffer at unwind.
6698 * buffer.h (record_unwind_current_buffer): New function.
6699 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6700 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6701 * undo.c, window.c: Adjust users.
6702 * buffer.c (set_buffer_if_live): Fix comment.
6703
a3d794a1
DA
67042012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6705
6706 Fix usage of set_buffer_internal.
6707 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6708 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6709 * coding.c (decode_coding): Omit redundant test.
6710 * fileio.c (decide_coding_unwind): Likewise.
6711 * fns.c (secure_hash): Likewise.
6712 * insdel.c (modify_region): Likewise.
6713 * keyboard.c (command_loop_1): Likewise.
6714 * print.c (PRINTFINISH): Likewise.
6715 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6716
59ea14cd
PE
67172012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6718
6719 * dispnew.c: Use bool for boolean.
6720 (frame_garbaged, display_completed, delayed_size_change)
6721 (fonts_changed_p, add_window_display_history)
6722 (add_frame_display_history, verify_row_hash)
6723 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6724 (row_equal_p, realloc_glyph_pool)
6725 (allocate_matrices_for_frame_redisplay)
6726 (showing_window_margins_p)
6727 (adjust_frame_glyphs_for_frame_redisplay)
6728 (build_frame_matrix_from_leaf_window, make_current)
6729 (mirrored_line_dance, mirror_line_dance, update_frame)
6730 (update_window_tree, update_single_window)
6731 (check_current_matrix_flags, update_window, update_text_area)
6732 (update_window_line, set_window_update_flags, scrolling_window)
6733 (update_frame_1, scrolling, buffer_posn_from_coords)
6734 (do_pending_window_change, change_frame_size)
6735 (change_frame_size_1, sit_for):
6736 Use bool for boolean.
6737 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6738 and remove last int (actually boolean) argument, which was always 0.
6739 All callers changed.
6740 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6741 * dispextern.h (struct composition_it): Use bool for boolean.
6742 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6743 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6744 * dired.c (file_name_completion):
6745 Use bool for boolean. (This was missed in an earlier change.)
6746
95072a94
MR
67472012-08-27 Martin Rudalics <rudalics@gmx.at>
6748
6749 * window.c (Fset_window_configuration): Revert first part of
6750 last change.
6751
0f19feff
JD
67522012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6753
6754 * nsterm.h (NSPanel): New class variable dialog_return.
6755
3a880af4
SM
6756 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6757 Initialize dialog_return.
0f19feff
JD
6758 (windowShouldClose:): Use stop instead of stopModalWithCode.
6759 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6760 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6761 event.
6762 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6763 modal loop returns.
6764
f10fe38f
PE
67652012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6766
de1339b0
PE
6767 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6768 * composite.c (find_composition, composition_gstring_p)
6769 (composition_reseat_it, find_automatic_composition):
6770 * data.c (let_shadows_buffer_binding_p)
6771 (let_shadows_global_binding_p, set_internal, make_blv)
6772 (Fmake_variable_buffer_local, Fmake_local_variable)
6773 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6774 (cons_to_signed, arith_driver):
6775 * dbusbind.c (xd_in_read_queued_messages):
6776 * dired.c (directory_files_internal, file_name_completion):
6777 Use bool for booleans.
6778 * dired.c (file_name_completion):
6779 * process.h (fd_callback):
6780 Omit int (actually boolean) argument. It wasn't being used.
6781 All uses changed.
6782 * composite.h, lisp.h: Reflect above API changes.
6783
f10fe38f
PE
6784 * cmds.c, coding.c: Use bool for booleans.
6785 * cmds.c (move_point, Fself_insert_command):
6786 * coding.h (struct composition status, struct coding_system):
6787 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6788 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6789 (emacs_mule_char, decode_coding_emacs_mule)
6790 (encode_coding_emacs_mule, detect_coding_iso_2022)
6791 (decode_coding_iso_2022, encode_invocation_designation)
6792 (encode_designation_at_bol, encode_coding_iso_2022)
6793 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6794 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6795 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6796 (encode_coding_raw_text, detect_coding_charset)
6797 (decode_coding_charset, encode_coding_charset, detect_eol)
6798 (detect_coding, get_translation_table, produce_chars)
6799 (consume_chars, reused_workbuf_in_use)
6800 (make_conversion_work_buffer, code_conversion_save)
6801 (decode_coding_object, encode_coding_object)
6802 (detect_coding_system, char_encodable_p)
6803 (Funencodable_char_position, code_convert_region)
6804 (code_convert_string, code_convert_string_norecord)
6805 (Fset_coding_system_priority):
6806 * fileio.c (Finsert_file_contents):
6807 Use bool for booleans.
6808 * coding.h, lisp.h: Reflect above API changes.
6809 * coding.c: Remove unnecessary static function decls.
6810 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6811 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6812 not a boolean 'int', since callers never look at the return value.
6813 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6814 * coding.h (decoding_buffer_size, encoding_buffer_size)
6815 (emacs_mule_string_char): Remove unused extern decls.
6816 (struct iso_2022_spec, struct coding_system):
6817 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6818 (struct emacs_mule_spec): Remove unused field 'full_support'.
6819 All initializations removed.
6820 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6821
5474c384
DA
68222012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6823
f10fe38f 6824 Fix spare memory change (Bug#12286).
5474c384
DA
6825 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6826 (valid_lisp_object_p): Likewise.
6827
c4b6914d
MR
68282012-08-27 Martin Rudalics <rudalics@gmx.at>
6829
6830 * window.c (Fset_window_configuration): Record any window's old
6831 buffer if it's replaced (see Bug#8789). If the new current
6832 buffer doesn't appear in the selected window, go to its old
6833 point (Bug#12208).
6834
35aaa1ea
DA
68352012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6836
6837 Special MEM_TYPE_SPARE to denote reserved memory.
6838 * alloc.c (enum mem_type): New memory type.
6839 (refill_memory_reserve): Use new type for spare memory.
6840 This prevents live_cons_p and live_string_p from incorrect
6841 detection of uninitialized objects from spare memory as live.
6842
6af64513
PE
68432012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6844
8b2e00a3
PE
6845 Spelling fixes.
6846 * Makefile.in (.PHONY): versioclean -> versionclean.
6847
b52d6985
PE
6848 Remove unused external symbols.
6849 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6850 * window.c (Qwindow_valid_p, decode_valid_window):
6851 Now static, not extern.
6852 * data.c (Qinterval): Remove; unused.
6853 (syms_of_data): Do not define 'interval'.
6854 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6855 * window.h (decode_valid_window):
6856 Remove decls.
6857
d5172d4f
PE
6858 * character.c, charset.c, chartab.c: Use bool for booleans.
6859 * character.c (lisp_string_width, string_count_byte8)
6860 (string_escape_byte8):
6861 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6862 (load_charset_map_from_file, map_charset_chars)
6863 (Fdefine_charset_internal, define_charset_internal)
6864 (Fdeclare_equiv_charset, find_charsets_in_text)
6865 (Ffind_charset_region, char_charset, Fiso_charset):
6866 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6867 (sub_char_table_set, sub_char_table_set_range)
6868 (char_table_set_range, optimize_sub_char_table)
6869 (map_sub_char_table):
6870 Use bool for boolean.
6871 * character.c (str_to_unibyte): Omit last boolean argument; it was
6872 always 0. All callers changed.
6873 * character.h, charset.h: Adjust to match previous changes.
6874 * character.h (char_printable_p): Remove decl of nonexistent function.
6875 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6876 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6877 are all boolean, so make them single-bit bitfields.
6878
6af64513
PE
6879 * lisp.h (ASET): Remove attempt to detect side effects.
6880 It was meant to be temporary and it often doesn't work,
6881 because when IDX has side effects the behavior of IDX==IDX
6882 is undefined. See Stefan Monnier in
6883 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6884
e1f29348
BR
68852012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6886
6887 * lisp.h (functionp): New function (extracted from Ffunctionp).
6888 (FUNCTIONP): Use it.
6889 * eval.c (Ffunctionp): Use it.
6890
17c05d74
PE
68912012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6892
0f46bc75
PE
6893 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6894 as that's faster and simpler than static storage. Don't bother
6895 with the g_main_context_query overhead if g_main_context_pending
6896 says no events are pending.
6897 (gfds, gfds_size): Remove these static vars.
6898 (xgselect_initialize): Remove; no longer needed.
6899 All uses and decls removed.
6900
ee4c0f69
PE
6901 * emacs.c (fatal_error_signal_hook): Remove.
6902 All uses removed. This leftover from old code was always 0.
6903
17c05d74
PE
6904 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6905 * casefiddle.c (casify_object, casify_region):
6906 * casetab.c (set_case_table):
6907 * category.c, category.h (word_boundary_p):
6908 * category.h (CHAR_HAS_CATEGORY):
6909 Use bool for booleans, instead of int.
6910
391ceac5
EZ
69112012-08-25 Eli Zaretskii <eliz@gnu.org>
6912
6913 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6914
2f221583
PE
69152012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6916
f4a681b0
PE
6917 On assertion failure, print backtrace if available.
6918 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6919 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6920 * Makefile.in (LIB_EXECINFO): New macro.
6921 (LIBES): Use it.
6922
2f221583
PE
6923 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6924 * bytecode.c (exec_byte_code):
6925 * callint.c (check_mark, Fcall_interactively):
6926 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6927 (getenv_internal, sync_process_alive, call_process_exited):
6928 * lisp.h (USE_SAFE_ALLOCA):
6929 Use bool for booleans, instead of int.
6930 * lisp.h, process.h: Adjust prototypes to match above changes.
6931 * callint.c (Fcall_interactively): Don't assume the mark's
6932 offset fits in 'int'.
6933
37ef52bb
PE
69342012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6935
6936 * buffer.c, buffer.h: Use bool for boolean.
6937 * buffer.c (reset_buffer_local_variables)
6938 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6939 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6940 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6941 (overlay_touches_p, overlay_strings, Foverlay_put)
6942 (report_overlay_modification, call_overlay_mod_hooks):
6943 (mmap_enlarge, mmap_set_vars):
6944 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6945 Use bool for booleans, instead of int.
6946 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
6947 since the 1-or-0 return value is always ignored anyway.
6948 (mmap_initialized_p):
6949 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
6950 * buffer.h, lisp.h: Adjust prototypes to match above changes.
6951
2cc21167
PE
69522012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6953
6954 * bidi.c: Use bool for boolean.
6955 This is a bit more readable, and makes the text segment of bidi.o
6956 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
6957 Presumably it's faster too.
6958 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
6959 Now bool.
6960 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6961 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
6962 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
6963 (bidi_explicit_dir_char, bidi_level_of_next_char)
6964 (bidi_find_other_level_edge, bidi_move_to_visually_next):
6965 Use bool for booleans, instead of int.
6966 * dispextern.h (bidi_init_it, bidi_paragraph_init)
6967 (bidi_unshelve_cache): Adjust decls to match code.
6968
7db4ddf4
MR
69692012-08-23 Martin Rudalics <rudalics@gmx.at>
6970
6971 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
6972 argument.
6973
b1bb8011
PE
69742012-08-23 Paul Eggert <eggert@cs.ucla.edu>
6975
6976 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
6977 * atimer.h: Include <stdbool.h>.
6978
ff687885
DN
69792012-08-22 Dan Nicolaescu <dann@gnu.org>
6980
6981 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
6982 compile time tests instead of run time tests on systems that do
6983 not use them.
6984 (FRAME_MAC_P): Remove leftover from deleted code.
6985 * frame.c (syms_of_frame): Remove leftover from deleted code.
6986
4ce7a138
JD
69872012-08-22 Jan Djärv <jan.h.d@swipnet.se>
6988
6989 * nsterm.m (insertText:): Don't clear modifiers if code is space.
6990
d733ec6d
PE
69912012-08-22 Paul Eggert <eggert@cs.ucla.edu>
6992
6993 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
6994 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 6995 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
6996 (fontset_add): Return void, for FONTSET_ADD.
6997
d0d2d26f
PE
69982012-08-21 Paul Eggert <eggert@cs.ucla.edu>
6999
fce31d69
PE
7000 * alloc.c: Use bool for booleans.
7001 (gc_in_progress, abort_on_gc)
7002 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7003 (dont_register_blocks) [GC_MALLOC_CHECK]:
7004 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7005 (check_string_bytes, make_specified_string, memory_full)
7006 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7007 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7008 (mark_stack, valid_pointer_p, make_pure_string)
7009 (Fgarbage_collect, survives_gc_p, gc_sweep):
7010 Use bool for booleans, instead of int.
7011 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7012 Remove unused local.
7013 * alloc.c (PURE_POINTER_P):
7014 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7015 * editfns.c (Fformat):
7016 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7017 (Fdo_auto_save):
7018 * fns.c (sweep_weak_table):
7019 * lisp.h (suppress_checking, push_message, survives_gc_p)
7020 (make_pure_string, gc_in_progress, abort_on_gc):
7021 * lread.c (readchar, read1):
7022 * print.c (Fprin1_to_string):
7023 * xdisp.c (push_message):
7024 Use bool for booleans affected directly or indirectly by
7025 alloc.c's changes.
7026
d0d2d26f
PE
7027 Make recently-introduced setters macros.
7028 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7029 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7030 (set_fontset_default, set_fontset_fallback): Rename from their
7031 upper-case counterparts, and make them functions rather than macros.
7032 This is more consistent with the other recently-introduced setters.
7033 These don't need to be inline, since they're local.
7034
d18e2bb6
JD
70352012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7036
7037 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7038 the loop (Bug#12247).
7039
1b9d9d16
PE
70402012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 * lisp.h (vcopy): Use memcpy rather than our own loop.
7043 This fixes a performance regression introduced by the recent
7044 addition of vcopy. This means 'vcopy' will need to be modified
7045 for a copying collector, but that's OK. Also, tighten the
7046 checking in the assertion.
7047
b2f09701
EZ
70482012-08-21 Eli Zaretskii <eliz@gnu.org>
7049
7050 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7051 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7052 non-base glyph for the width of the base character, according to
e1f29348
BR
7053 what x_draw_composite_glyph_string_foreground expects.
7054 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
7055 expectations, to produce correct width of the composed character.
7056 Reverse the sign of the DU offset produced by ScriptPlace.
7057
9b994fed
PE
70582012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7059
7060 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7061
086ca913
DA
70622012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7063
7064 Avoid direct writes to contents member of struct Lisp_Vector.
7065 * lisp.h (vcopy): New function to copy data into vector.
7066 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7067 * fns.c (Ffillarray): Use ASET.
7068 * keyboard.c (timer_check_2): Use AREF and ASET.
7069 (append_tool_bar_item, Frecent_keys): Use vcopy.
7070 * lread.c (read_vector): Use ASET.
7071 * msdos.c (Frecent_doskeys): Use vcopy.
7072 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7073 (Finternal_merge_in_global_face): Use ASET and vcopy.
7074 * xfont.c (xfont_list_pattern): Likewise.
7075
5481664a
MR
70762012-08-21 Martin Rudalics <rudalics@gmx.at>
7077
7078 * window.c (Fwindow_point): For the selected window always return
7079 the position of its buffer's point.
7080 (Fset_window_point): For the selected window always go in its
7081 buffer to the specified position.
7082
6d470bdd
DA
70832012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7084
7085 Setter macros for fontsets.
7086 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7087 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7088 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7089 Adjust users.
7090
24564fe1
GM
70912012-08-20 Glenn Morris <rgm@gnu.org>
7092
7093 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7094 Don't assume that `ln -f' works.
7095
0a05a035
EZ
70962012-08-20 Eli Zaretskii <eliz@gnu.org>
7097
7098 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7099 and later about non-assignments with no effect. See discussion at
7100 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7101 details.
7102
e46f2325
DA
71032012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 Inline setter functions for Lisp_Objects slots of struct specbinding.
7106 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7107 Adjust users.
7108
734fbd86
MR
71092012-08-20 Martin Rudalics <rudalics@gmx.at>
7110
7111 * window.c (select_window): Always make selected window's buffer
7112 current.
7113
f1a95992
DA
71142012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7115
7116 Use AREF and ASET for docstrings of category tables.
7117 * category.h (CATEGORY_DOCSTRING): Use AREF.
7118 (SET_CATEGORY_DOCSTRING): Use ASET.
7119 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7120
e83064be
DA
71212012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7122
7123 Inline setter functions for hash table members.
7124 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7125 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7126 (set_hash_key_and_value, set_hash_index, set_hash_next)
7127 (set_hash_hash): New functions.
7128 * charset.c, fns.c: Adjust users.
7129
4ce60d2e
DA
71302012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7131
7132 Inline getter and setter functions for per-buffer values.
7133 * buffer.h (per_buffer_default, set_per_buffer_default)
7134 (per_buffer_value, set_per_buffer_value): New functions.
7135 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7136 * buffer.c, data.c: Adjust users.
7137
c06c9690
JB
71382012-08-20 Juanma Barranquero <lekktu@gmail.com>
7139
7140 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7141
32bd4250
PE
71422012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7143
bad03192 7144 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
7145 as gnulib does this if the system doesn't.
7146 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
7147 Remove declaration. MS-Windows declares it on stdlib.h which is
7148 included by conf_post.h.
b69a6d22
PE
7149 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7150 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7151 * vm-limit.c: Include <unistd.h>, for 'environ'.
7152
22d7feb2
PE
7153 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7154 (start_of_data): Remove decl; mem-limits.h provides it.
7155
32bd4250
PE
7156 * xdisp.c (handle_invisible_prop): Make it a bit faster
7157 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7158
450809af
CY
71592012-08-19 Chong Yidong <cyd@gnu.org>
7160
7161 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7162 ends (Bug#3874).
7163
9e677988
AS
71642012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7165
6b1319ce
AS
7166 * .gdbinit: Use call instead of set when calling a function in the
7167 inferior.
7168
9e677988
AS
7169 * data.c (set_internal): Don't use set_blv_found.
7170 (Fkill_local_variable): Likewise.
7171
d7191076
AA
71722012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7173
7174 * nsfont.m (ns_ascii_average_width): Ensure the string
7175 ascii_printable is initialized with a null-terminated character
7176 array. Otherwise, it can contain undesired extra characters.
7177
e757f1c6
PE
71782012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 port new setting code to Sun C 5.8 2005/10/13
7181 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7182 Return void, not Lisp_Object. Otherwise, the compiler
7183 complains about (A?B:C) where B is void and C is Lisp_Object
7184 when compiling CHAR_TABLE_SET, due to the recent change to
7185 the API of sub_char_table_set_contents.
7186
a999ce26
CY
71872012-08-18 Chong Yidong <cyd@gnu.org>
7188
7189 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7190 for the string case (Bug#3874).
7191
3f22b86f
PE
71922012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7193
39eb03f1
PE
7194 * buffer.h (BSET): Remove (Bug#12215).
7195 Replace all uses with calls to new setter functions.
7196 (bset_bidi_paragraph_direction, bset_case_canon_table)
7197 (bset_case_eqv_table, bset_directory, bset_display_count)
7198 (bset_display_time, bset_downcase_table)
7199 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7200 (bset_last_selected_window, bset_local_var_alist)
7201 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7202 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7203 (bset_width_table):
7204 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7205 (bset_auto_fill_function, bset_auto_save_file_format)
7206 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7207 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7208 (bset_cache_long_line_scans, bset_case_fold_search)
7209 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7210 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7211 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7212 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7213 (bset_header_line_format, bset_indicate_buffer_boundaries)
7214 (bset_indicate_empty_lines, bset_invisibility_spec)
7215 (bset_left_fringe_width, bset_major_mode, bset_mark)
7216 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7217 (bset_name, bset_overwrite_mode, bset_pt_marker)
7218 (bset_right_fringe_width, bset_save_length)
7219 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7220 (bset_scroll_up_aggressively, bset_selective_display)
7221 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7222 (bset_word_wrap, bset_zv_marker):
7223 * category.c (bset_category_table):
7224 * syntax.c (bset_syntax_table):
7225 New setter functions.
7226
6a09a33b
PE
7227 * process.h (PSET): Remove (Bug#12215).
7228 Replace all uses with calls to new setter functions.
7229 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7230 (PROCESS_INLINE): New macro.
7231 (pset_childp): New setter function.
7232 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7233 * process.c (PROCESS_INLINE):
7234 Define to EXTERN_INLINE, so that the corresponding functions
7235 are compiled into code.
7236 (pset_buffer, pset_command, pset_decode_coding_system)
7237 (pset_decoding_buf, pset_encode_coding_system)
7238 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7239 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7240 (pset_type, pset_write_queue): New setter functions.
7241
e8c17b81
PE
7242 * window.h (WSET): Remove (Bug#12215).
7243 Replace all uses with calls to new setter functions.
7244 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7245 (WINDOW_INLINE): New macro.
7246 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7247 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7248 (wset_total_lines, wset_vertical_scroll_bar)
7249 (wset_window_end_pos, wset_window_end_valid)
7250 (wset_window_end_vpos): New setter functions.
7251 * window.c (WINDOW_INLINE):
7252 Define to EXTERN_INLINE, so that the corresponding functions
7253 are compiled into code.
7254 (wset_combination_limit, wset_dedicated, wset_display_table)
7255 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7256 (wset_new_normal, wset_new_total, wset_next_buffers)
7257 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7258 (wset_prev_buffers, wset_right_fringe_width)
7259 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7260 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7261 (wset_window_parameters):
7262 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7263 (wset_column_number_displayed, wset_region_showing):
7264 New setter functions.
7265
3f22b86f
PE
7266 * termhooks.h (TSET): Remove (Bug#12215).
7267 Replace all uses with calls to new setter functions.
7268 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7269 (TERMHOOKS_INLINE): New macro.
7270 (tset_charset_list, tset_selection_alist): New setter functions.
7271 * terminal.c (TERMHOOKS_INLINE):
7272 Define to EXTERN_INLINE, so that the corresponding functions
7273 are compiled into code.
7274 (tset_param_alist): New setter function.
7275
742af32f
PE
72762012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7277
15dbb4d6
PE
7278 * keyboard.h (KSET): Remove (Bug#12215).
7279 Replace all uses with calls to new setter functions.
7280 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7281 (KEYBOARD_INLINE): New macro.
7282 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7283 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7284 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7285 New setter functions.
7286 * keyboard.c (KEYBOARD_INLINE):
7287 Define to EXTERN_INLINE, so that the corresponding functions
7288 are compiled into code.
7289 (kset_echo_string, kset_kbd_queue)
7290 (kset_keyboard_translate_table, kset_last_prefix_arg)
7291 (kset_last_repeatable_command, kset_local_function_key_map)
7292 (kset_overriding_terminal_local_map, kset_real_last_command)
7293 (kset_system_key_syms): New setter functions.
7294
f00af5b1
PE
7295 * frame.h (FSET): Remove (Bug#12215).
7296 Replace all uses with calls to new setter functions.
7297 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7298 (FRAME_INLINE): New macro.
7299 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7300 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7301 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7302 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7303 (fset_param_alist, fset_root_window, fset_scroll_bars)
7304 (fset_selected_window, fset_title, fset_tool_bar_items)
7305 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7306 * frame.c (FRAME_INLINE):
7307 Define to EXTERN_INLINE, so that the corresponding functions
7308 are compiled into code.
7309 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7310
0c94c8d6
PE
7311 A few more naming-convention fixes for getters and setters.
7312 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7313 and rename from buffer_overlays_set_before.
7314 (set_buffer_overlays_after): Move here from buffer.h, and rename
7315 from buffer_overlays_set_after.
7316 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7317 All uses changed.
7318 (set_buffer_intervals): Rename from buffer_set_intervals.
7319 * intervals.c (set_interval_object): Move here from intervals.h,
7320 and rename from interval_set_object.
7321 (set_interval_left): Move here from intervals.h, and rename from
7322 interval_set_left.
7323 (set_interval_right): Move here from intervals.h, and rename from
7324 interval_set_right.
7325 (copy_interval_parent): Move here from intervals.h, and rename from
7326 interval_copy_parent.
7327 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7328 (set_interval_plist): Rename from interval_set_plist.
7329 Return void, not Lisp_Object, since no caller uses the result.
7330 * lisp.h (string_intervals): Rename from string_get_intervals.
7331 (set_string_intervals): Rename from string_set_intervals.
7332
34dabdb7
PE
7333 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7334 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7335 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7336 All uses changed. See the end of
7337 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7338
742af32f
PE
7339 * lisp.h (CSET): Remove (Bug#12215).
7340 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7341 (set_char_table_purpose): New functions,
7342 replacing CSET. All uses changed. For example, replace
7343 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7344 "set_char_table_parent (char_table, parent);".
742af32f
PE
7345 The old version was confusing because it used the same name
7346 'parent' for two different things.
7347
a04e2c62
DA
73482012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7349
7350 Functions to get and set Lisp_Object fields of buffer-local variables.
7351 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7352 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7353 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7354 * data.c, eval.c, frame.c: Adjust users.
7355
383dcbf9
CY
73562012-08-17 Chong Yidong <cyd@gnu.org>
7357
7358 * xfaces.c (merge_face_vectors): If the target font specfies a
7359 font spec, make the font's attributes take precedence over
7360 directly-specified attributes.
7361 (merge_face_ref): Recognize :font.
7362
44386687
DA
73632012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7364
7365 Do not use memcpy for copying intervals.
7366 * intervals.c (reproduce_interval): New function.
7367 (reproduce_tree, reproduce_tree_obj): Use it.
7368 (reproduce_tree_obj): Remove prototype.
7369
927c7216
PE
73702012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7371
7372 * lisp.h (duration_to_sec_usec): Remove unused decl.
7373
93044f7b
AA
73742012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7375
7376 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7377 to an allocated instance of NSString, not to the class itself.
7378
9851e4a5
JB
73792012-08-17 Juanma Barranquero <lekktu@gmail.com>
7380
7381 * makefile.w32-in (C_CTYPE_H): New macro.
7382 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7383 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7384 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7385
620f13b0
PE
73862012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7387
7388 Use ASCII tests for character types.
7389 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7390 * xfns.c, xterm.c:
7391 Don't include <ctype.h>; was not needed.
7392 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7393 * sysdep.c, xfaces.c:
7394 Include <c-ctype.h> instead of <ctype.h>.
7395 * nsterm.m: Include <c-ctype.h>.
7396 * charset.c (read_hex):
7397 * doc.c (Fsnarf_documentation):
7398 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7399 (DRIVE_LETTER) [DOS_NT]:
7400 (Ffile_name_directory, Fexpand_file_name)
7401 (Fsubstitute_in_file_name):
7402 * font.c (font_parse_xlfd, font_parse_fcname):
7403 * frame.c (x_set_font_backend):
7404 * gtkutil.c (xg_get_font):
7405 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7406 * nsimage.m (hexchar):
7407 * nsterm.m (ns_xlfd_to_fontname):
7408 * sysdep.c (system_process_attributes):
7409 * xfaces.c (hash_string_case_insensitive):
7410 Use C-locale tests instead of locale-specific tests for character
7411 types, since we want the ASCII interpretation here, not the
7412 interpretation suitable for whatever happens to be the current locale.
7413
52162052
MR
74142012-08-16 Martin Rudalics <rudalics@gmx.at>
7415
7416 Consistently check windows for validity/liveness
7417 (Bug#11984, Bug#12025, Bug#12026).
7418 * lisp.h (CHECK_VALID_WINDOW): New macro.
7419 * window.c (decode_window): Rename to decode_live_window.
7420 (decode_valid_window, Fwindow_valid_p): New functions.
7421 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7422 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7423 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7424 (Fwindow_prev_sibling, Fwindow_combination_limit)
7425 (Fset_window_combination_limit, Fwindow_use_time)
7426 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7427 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7428 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7429 (Fwindow_hscroll, Fset_window_hscroll)
7430 (Fwindow_redisplay_end_trigger)
7431 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7432 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7433 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7434 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7435 (Fwindow_end, Fset_window_point, Fset_window_start)
7436 (Fpos_visible_in_window_p, Fwindow_line_height)
7437 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7438 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7439 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7440 (Fset_window_parameter, Fwindow_display_table)
7441 (Fset_window_display_table, Fdelete_other_windows_internal)
7442 (Fset_window_buffer, Fset_window_new_total)
7443 (Fset_window_new_normal, Fdelete_window_internal)
7444 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7445 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7446 (Fwindow_scroll_bars): Check whether argument window is a valid or
7447 live window. Update doc-strings.
7448 (syms_of_window): New symbol Qwindow_valid_p.
7449 * keyboard.c (Fposn_at_x_y): Check whether argument
7450 frame_or_window denotes a valid window.
7451
2751c80f
DA
74522012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7453
7454 Fix previous char table change.
7455 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7456 * chartab.c (optimize_sub_char_table): Likewise.
7457
032a42c8
CY
74582012-08-16 Chong Yidong <cyd@gnu.org>
7459
a2d19368
CY
7460 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7461
032a42c8
CY
7462 * xfont.c (xfont_open):
7463 * xftfont.c (xftfont_open): Set the font's max_width field.
7464
7465 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7466 min_width to space_width and average_width to the average over
7467 printable ASCII characters.
7468 (ns_char_width): Code cleanup.
7469 (ns_ascii_average_width): New utility function.
7470
7471 * font.h (struct font): Update comments.
7472
a098c930
DA
74732012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7474
032a42c8 7475 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
7476 * lisp.h (CSET): New macro.
7477 (char_table_set_extras, char_table_set_contents)
7478 (sub_char_table_set_contents): New function.
7479 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7480 * syntax.c: Adjust users.
7481
8be3a09c
SM
74822012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7483
7484 * eval.c (eval_sub): Bind lexical-binding.
7485 * lread.c (Qlexical_binding): Make non-static.
7486
ac4845a6
JD
74872012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7488
ddee6515
JD
7489 * nsmenu.m (popupSession): Remove.
7490 (pop_down_menu): Remove endModalSession.
7491 (timeout_handler:): New method.
7492 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7493 Call runModalForWindow. Check timer_fired when it returns.
7494 If not set, cancel timer and break out of loop.
7495 Otherwise loop again, with a new timeout.
7496
7497 * nsterm.m: Include fcntl.h if present.
7498 (fd_entry, t_readfds, inNsSelect): Remove.
7499 (select_writefds, select_valid, select_timeout, selfds)
7500 (select_mutex, apploopnr): Add.
7501 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7502 Otherwise call kbd_buffer_store_event.
7503 (ns_send_appdefined): Remove release of fd_entry.
7504 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7505 Increment and decrement apploopnr.
7506 (ns_select): If no file descriptors, just do a NSTimer.
7507 Otherwise copy read/write masks and start select thread (fd_handler).
7508 Start main loop and wait for application defined event.
7509 Inform select thread to stop selecting after main loop is exited.
7510 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 7511 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
7512 (fd_handler:): Loop forever, wait for info from the main thread
7513 to either start or stop selecting. When select returns, send
7514 and appdefined event.
7515 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7516 If not call kbd_buffer_store_event.
7517
7518 * nsterm.h (EmacsApp): fd_handler takes id argument.
7519 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7520
ac4845a6
JD
7521 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7522
eb424fe3
EZ
75232012-08-15 Eli Zaretskii <eliz@gnu.org>
7524
7525 * region-cache.c (move_cache_gap): Update gap_len using the actual
7526 growth of the boundaries array. Do not change cache_len.
7527 (Bug#12196)
7528
4e6a86c6
DA
75292012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7530
7531 Generalize and cleanup font subsystem checks.
7532 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
7533 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7534 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 7535
5bf192ca
DA
75362012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7537
7538 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7539
f2045622
CY
75402012-08-15 Chong Yidong <cyd@gnu.org>
7541
8be3a09c
SM
7542 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7543 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7544 extract the font descriptor instead of just the font name.
7545 In that case, return a font spec instead of a string.
f2045622
CY
7546 (x_last_font_name): Move to this file from xfns.c.
7547
7548 * xfns.c (Fx_select_font): The return value can also be a font
7549 spec. Move x_last_font_name management to gtkutil.c.
7550
7551 * xfaces.c: Make font weight and style symbols non-static.
7552
7f6feb56
SM
75532012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7554
7555 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7556 (bug#12117).
7557
fecbd8ff
SM
75582012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7559
7560 * alloc.c (Fgarbage_collect): Use plural form consistently.
7561
9b8d5165
EZ
75622012-08-14 Eli Zaretskii <eliz@gnu.org>
7563
7564 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7565 iteration through the command loop. Fixes a problem whereby mouse
7566 movements are ignored until the first mouse click.
7567
f5d9e83a
PE
75682012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7569
7570 Use bool, not int, for Lisp booleans.
7571 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7572 makes Emacs a bit smaller and presumably a bit faster.
7573 * lisp.h: Include <stdbool.h>.
7574 (struct Lisp_Boolfwd, defvar_bool):
7575 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7576 * regex.c [!emacs]: Include <stdbool.h>.
7577 (false, true): Remove; <stdbool.h> does this for us now.
7578
55802e4a
CY
75792012-08-14 Chong Yidong <cyd@gnu.org>
7580
4abcdac8
CY
7581 * character.c (Fcharacterp): Doc fix (Bug#12076).
7582
7583 * data.c (Findirect_variable): Doc fix (Bug#11040).
7584
55802e4a
CY
7585 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7586
7587 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 7588 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 7589
8e99d072
BR
75902012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7591
7592 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7593 (bug#12022).
7594
08908aca
MR
75952012-08-14 Martin Rudalics <rudalics@gmx.at>
7596
7597 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7598 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7599 * minibuf.c (choose_minibuf_frame, read_minibuf):
7600 * w32fns.c (x_create_tip_frame):
7601 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7602 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7603
56120d6f
PE
76042012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7605
7606 * intervals.c (offset_intervals): Remove obsolete comment.
7607
67b77c0b
AS
76082012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7609
7610 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7611
f48b82fd
GR
76122012-08-14 Gergely Risko <gergely@risko.hu>
7613
7614 * coding.c (decode_coding): Record buffer modification before
7615 disabling undo_list (Bug#11773).
7616
fd318b54
DA
76172012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7618
7619 Revert and cleanup some recent overlay changes.
7620 * buffer.h (enum overlay_type): Remove.
7621 (buffer_get_overlays, buffer_set_overlays): Likewise.
7622 (buffer_set_overlays_before, buffer_set_overlays_after):
7623 New function. Adjust users.
7624 (unchain_both): Add eassert.
7625
41a62dd9
DA
76262012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7627
7628 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7629
5884c324
PE
76302012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7631
7632 * gtkutil.c (xg_mark_data): Don't assume C99.
7633
ca06f160
JD
76342012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7635
7636 * gtkutil.c (xg_frame_tb_info): New struct.
7637 (TB_INFO_KEY): New define.
7638 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7639 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7640 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7641 if not present.
7642 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 7643 is up to date. Otherwise store new data.
ca06f160
JD
7644 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7645
7864a3f7
DA
76462012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7647
7648 Use KSET for write access to Lisp_Object members of struct kboard.
7649 * keyboard.h (KSET): New macro.
7650 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7651 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7652 * xterm.c: Adjust users.
7653
4c31be61
DA
76542012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7655
7656 Use BSET for write access to Lisp_Object members of struct buffer.
7657 * buffer.h (BSET): New macro.
7658 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7659 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7660 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7661 * window.c, xdisp.c, xfns.c: Adjust users.
7662
14ae4239
BT
76632012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7664
7665 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7666
32bcadb4
JD
76672012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7668
3d29b2ce 7669 * nsterm.m (not_in_argv): New function.
fc0c31f8 7670 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7671 (application:openFileWithoutUI:, application:openFiles:): Open file
7672 if not_in_argv returns non-zero (bug#12171).
7673
32bcadb4 7674 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7675 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7676 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7677 (xg_get_font_name): Use those functions/macros here.
7678 Reported by Frans Oilinki <moilinki@gmail.com>.
7679
9ff9402d 76802012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7681
7682 * unexmacosx.c (copy_data_segment): Copy initialized data in
7683 statically linked libraries from input file rather than memory.
7684
db74a5fc
YM
7685 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7686 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7687 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7688
25e65510
GM
76892012-08-10 Glenn Morris <rgm@gnu.org>
7690
7691 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7692 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7693
7961135c
DA
76942012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7695
7696 Fix last change to allow compilation with low optimization levels.
7697 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7698 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7699
42b3a444
DA
77002012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7701
7702 Use common inline syntax in intervals.h.
7703 * intervals.h (INTERVALS_INLINE): New macro.
7704 Change all users from LISP_INLINE.
7705
9fb0c957
DA
77062012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7707
7708 Define Qnone once for all platforms.
7709 * frame.c (Qnone): Define here.
7710 (syms_of_frame): DEFSYM it.
7711 * lisp.h (Qnone): New declaration.
7712 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7713 * xfns.c: Remove duplication. Adjust users.
7714
65e8ee52
DA
77152012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7716
7717 Remove unused macros from intervals.h.
7718 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7719 * intervals.c: Adjust comment.
7720
9b855fd6
EZ
77212012-08-10 Eli Zaretskii <eliz@gnu.org>
7722
7723 * w32fns.c <w32_unicode_gui>: New static variable.
7724 (globals_of_w32fns): Initialize it according to os_subtype.
7725 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7726 testing os_subtype.
7727
39cb9e56 77282012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7729 Eli Zaretskii <eliz@gnu.org>
7730
7731 Fix bug #10299 with Unicode characters sent by customized
7732 keyboards created by MSKLC.
7733 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7734 (w32_init_class): Use it to initialize the Emacs class with either
7735 ANSI or Unicode API calls.
7736 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7737 later.
7738 (w32_wnd_proc): If the character code sent by WM_CHAR or
7739 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7740 original message. Call DefWindowProcW on NT and later.
7741
9374581a
GM
77422012-08-10 Glenn Morris <rgm@gnu.org>
7743
4b94e8cf
GM
7744 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7745
9374581a
GM
7746 * lisp.h (DIRECTORY_SEP): Let configure set it.
7747
a2752828
DA
77482012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7749
7750 Use TSET for write access to Lisp_Object slots of struct terminal.
7751 * termhooks.h (TSET): New macro.
7752 * coding.c, terminal.c, xselect.c: Adjust users.
7753
cc92c454
SM
77542012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7755
7756 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7757 the failing expression, include them in the error message.
7758 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7759 * lisp.h (internal_condition_case_n): Update declaration.
7760
4cb3e6b3
DA
77612012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7762
7763 Inline functions to examine and change buffer overlays.
7764 * buffer.c (unchain_both): New function.
7765 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7766 (buffer_has_overlays): New function.
7767 (enum overlay_type): New enum.
7768 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7769 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7770
8707c1e5
DA
77712012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7772
7773 Inline functions to examine and change buffer intervals.
7774 * alloc.c (mark_interval_tree): Remove.
7775 (MARK_INTERVAL_TREE): Simplify.
7776 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7777 * intervals.c (buffer_balance_intervals): New function.
7778 (graft_intervals_into_buffer): Adjust indentation.
7779 (set_intervals_multibyte): Simplify.
7780 * buffer.h (BUF_INTERVALS): Remove.
7781 (buffer_get_intervals, buffer_set_intervals): New function.
7782 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7783 * intervals.c, textprop.c: Adjust users.
7784
ad8c997f
DA
77852012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7786
7787 Inline functions to examine and change string intervals.
7788 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7789 (string_get_intervals, string_set_intervals): New function.
7790 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7791 * lread.c, print.c, textprop.c: Adjust users.
7792
32ac3a6b
GM
77932012-08-08 Glenn Morris <rgm@gnu.org>
7794
7795 * lisp.mk (lisp): Remove language/persian.elc.
7796
77c7bcb1
DA
77972012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7798
7799 Cleanup intervals.
7800 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7801 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
7802 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7803 Adjust comment. Move under #if 0.
77c7bcb1
DA
7804 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7805 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7806
9c08a8d4
DA
78072012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7808
7809 Check total length of intervals with eassert.
7810 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7811 * intervals.c: Change all users to eassert.
7812
26d16b35
EZ
78132012-08-07 Eli Zaretskii <eliz@gnu.org>
7814
14ae4239
BT
7815 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7816 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
7817 INTERNAL_FIELD in Lisp_Cons.
7818
c644523b
DA
78192012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7820
7821 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7822 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7823 name since all xname users are fixed long time ago. Do not
7824 use INTERNAL_FIELD.
7825 (set_symbol_name, set_symbol_function, set_symbol_plist):
7826 (set_symbol_next, set_overlay_plist): New function.
7827 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7828 (struct Lisp_Overlay): Likewise.
7829 (CVAR, MVAR, SVAR): Remove.
7830 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7831 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7832 * xterm.c: Adjust users.
7833 * .gdbinit: Change to use name field of struct Lisp_Symbol
7834 where appropriate.
7835
6a3d20cc
DA
78362012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7837
7838 Basic functions to set Lisp_Object and pointer slots of intervals.
7839 * intervals.h (interval_set_parent, interval_set_object):
7840 (interval_set_left, interval_set_right, interval_set_plist):
7841 (interval_copy_parent): New function.
7842 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
7843 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7844 Adjust indentation.
6a3d20cc
DA
7845 (INTERVAL_SIZE): Remove. Adjust users.
7846 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7847
4d2b044c
DA
78482012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7849
7850 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7851 * process.h (PGET): Remove.
7852 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7853 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7854
d3d50620
DA
78552012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7856
7857 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7858 * window.h (WGET): Remove.
7859 (struct window): Do not use INTERNAL_FIELD.
7860 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7861 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7862 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7863 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7864 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7865 Adjust users.
7866
d10a51dc
CY
78672012-08-07 Chong Yidong <cyd@gnu.org>
7868
7869 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7870 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7871 (Fdelete_window_internal): Signal an error if the window is not on
7872 a live frame (Bug#12025).
7873
e69b0960
DA
78742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7875
7876 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7877 * frame.h (FGET): Remove.
7878 (struct frame): Do not use INTERNAL_FIELD.
7879 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7880 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7881 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7882 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7883
25a20a3a
JB
78842012-08-06 Juanma Barranquero <lekktu@gmail.com>
7885
7886 * w32.c: Silence compiler warnings.
7887 (map_w32_filename): Remove unused variable `is_fat'.
7888 (chase_symlinks): Add parentheses around expression.
7889
1c6f11f4
GM
78902012-08-06 Glenn Morris <rgm@gnu.org>
7891
1db4583a
GM
7892 * sysdep.c: Respect BROKEN_GETWD.
7893
1c6f11f4
GM
7894 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7895 Let configure handle it.
7896 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7897
2b90362b
DA
78982012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7899
7900 Use GCALIGNMENT where appropriate.
7901 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7902 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7903 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7904
5f50daf2
EZ
79052012-08-06 Eli Zaretskii <eliz@gnu.org>
7906
14ae4239
BT
7907 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7908 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 7909
cbcc7007
SM
79102012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7911
7912 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7913 that should be sufficient for everyone.
7914
4d365fa4
JD
79152012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7916
7917 * keyboard.c (timer_check_2): Add break so timer_check returns next
7918 timeout.
7919
dd86bd82
DA
79202012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7921
7922 Fix Windows build errors introduced after converting to WGET and WSET.
7923 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7924 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7925
054e1668
JD
79262012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7927
7928 * nsterm.m (ns_frame_rehighlight): Use FSET.
7929
7930 * nsmenu.m (ns_update_menubar): Use FSET.
7931
21238f11
DA
79322012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7933
7934 Separate read and write access to Lisp_Object slots of Lisp_Process.
7935 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7936 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7937
077288cf
DA
79382012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7939
7940 Separate read and write access to Lisp_Object slots of struct window.
7941 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7942 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7943 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7944 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7945 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7946 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7947 Adjust users.
7948
71688bd7
DA
79492012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7950
7951 Fix Windows build errors introduced after converting to FGET and FSET.
7952 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
7953 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
7954 (w32_judge_scroll_bars): Change to use FSET.
7955 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7956
f99bac93
DA
79572012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7958
7959 Fix replacement typo.
7960 * window.c (replace_window): Set root_window instead of
7961 selected_window. This fixes a total window subsystem
7962 malfunction reported by Bastien Guerry <bzg@gnu.org>.
7963
8c2a0f2d
GM
79642012-08-06 Glenn Morris <rgm@gnu.org>
7965
7966 * lisp.mk (lisp): Add language/persian.elc.
7967
edd74c35
DA
79682012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7969
7970 Separate read and write access to Lisp_Object slots of struct frame.
7971 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
7972 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7973 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7974 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7975 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7976
8671676c
AS
79772012-08-05 Andreas Schwab <schwab@linux-m68k.org>
7978
7979 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
7980
663e2b3f
DA
79812012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
7982
7983 Generalize common compile-time constants.
7984 * lisp.h (header_size, bool_header_size, word_size): Now here.
7985 (struct Lisp_Vector): Add comment.
7986 (struct Lisp_Bool_Vector): Move up to define handy constants.
7987 (VECSIZE, PSEUDOVECSIZE): Simplify.
7988 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
7989 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
7990 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
7991 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
7992 * xfont.c, xmenu.c: Use word_size where appropriate.
7993
d32e47af
LM
79942012-08-05 Lawrence Mitchell <wence@gmx.li>
7995
7996 * search.c (Freplace_match): Treat \? in the replacement text
7997 literally (Bug#8161).
7998
e5d9c0d1
CY
79992012-08-05 Chong Yidong <cyd@gnu.org>
8000
8001 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8002 * frame.c (Vdelete_frame_functions):
8003 * emacs.c (Vkill_emacs_hook): Doc fix.
8004
8da0576b
EZ
80052012-08-04 Eli Zaretskii <eliz@gnu.org>
8006
8007 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8008 --with-x-toolkit=no builds.
8009 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8010
02676e5d
CY
80112012-08-04 Chong Yidong <cyd@gnu.org>
8012
8013 * syntax.c (Fmodify_syntax_entry): Doc fix.
8014
97147da9
EZ
80152012-08-04 Eli Zaretskii <eliz@gnu.org>
8016
76151e2c
EZ
8017 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8018 * w32.c (init_environment): Change the default values of many
8019 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8020 them into environment when they were not already defined.
8021 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8022 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8023 (check_windows_init_file): Now external, not static.
8024 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8025 called when Vload_path is already set up.
8026
8027 * w32.h (check_windows_init_file): Add prototype.
8028
8029 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8030 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8031 compatibility with Posix platforms.
8032 (main): Move the call to check_windows_init_file to here from
8033 w32.c.
8034 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8035 any, in the DEFALT argument into the root of the Emacs build or
8036 installation tree, as appropriate.
8037
8038 * callproc.c (init_callproc_1): Call decode_env_path instead of
8039 doing its equivalent by hand.
8040 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8041 the code that sets Vexec_path run on MS-Windows.
8042
8043 * lread.c (init_lread): Add comments to #ifdef's.
8044
97147da9
EZ
8045 * msdos.c (dos_set_window_size, IT_update_begin)
8046 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8047 instead of direct references.
8048
185ee146
PE
80492012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 Export DEFAULT_REHASH_* to GDB.
8052 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8053 Now constants, not macros.
8054
8834c57a
PE
80552012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8056
98c6f1e3
PE
8057 Remove unnecessary casts involving pointers.
8058 These casts are no longer needed now that we assume C89 or later,
8059 since they involve casting to or from void *.
8060 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8061 (make_pure_float, make_pure_vector):
8062 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8063 * macros.c (Fstart_kbd_macro):
8064 * menu.c (find_and_return_menu_selection):
8065 * minibuf.c (read_minibuf_noninteractive):
8066 * sysdep.c (closedir):
8067 * xdisp.c (x_produce_glyphs):
8068 * xfaces.c (compare_fonts_by_sort_order):
8069 * xfns.c (x_real_positions, select_visual):
8070 * xselect.c (x_stop_queuing_selection_requests)
8071 (x_get_window_property, x_get_window_property_as_lisp_data):
8072 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8073 Remove unnecessary pointer casts.
8074 * alloc.c (record_xmalloc): New function.
8075 * lisp.h (record_xmalloc): New decl.
8076 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8077 more like a function. This is because the pointer cast is not
8078 needed. All uses changed.
8079 * print.c (print_string, print_error_message): Avoid length recalc.
8080
8834c57a
PE
8081 Improve fix for macroexp crash with debugging (Bug#12118).
8082 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8083 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8084 not supposed to be invoked from the garbage collector.
8085 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8086 (gc_aset): New function, which is like ASET but can be
8087 used in the garbage collector.
8088 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8089 (set_hash_index): Use it instead of ASET.
8090
6dad7178
EZ
80912012-08-03 Eli Zaretskii <eliz@gnu.org>
8092
8093 Support symlinks on latest versions of MS-Windows.
8094 * w32.c: Include winioctl.h and aclapi.h.
8095 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8096 (revert_to_self): Forward declarations of static functions.
8097 <static BOOL g_b_init_get_security_info>:
8098 <g_b_init_create_symbolic_link>: New static flags.
8099 (globals_of_w32): Initialize them to zero.
8100 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8101 (map_w32_filename): Improve commentary. Simplify switch.
8102 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8103 headers (most versions of MinGW w32api don't).
8104 (get_security_info, create_symbolic_link)
8105 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8106 New functions.
8107 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8108 in the argument file name.
8109 (sys_access): Call unc_volume_file_attributes only if
8110 GetFileAttributes fails with network-related error codes.
8111 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8112 have the required privileges.
14ae4239 8113 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
8114 get_file_security_desc.
8115 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
8116 with addition of handling of symlinks and support for 'lstat'.
8117 If possible, get file's attributes and security information by
6dad7178
EZ
8118 handle, not by name. Produce S_IFLNK bit for symlinks, when
8119 called from 'lstat'.
8120 (stat, lstat): New functions, call 'stat_worker'.
8121 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8122 symlinks when the underlying filesystem supports them.
8123
f162bcc3
PE
81242012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8125
79ea6c20
PE
8126 Fix macroexp crash on Windows with debugging (Bug#12118).
8127 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8128 checking subscripts; problem introduced with the recent
8129 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8130 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8131 since it's used in non-static inline functions now.
8132
c0ce93fd
PE
8133 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8134 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 8135
f162bcc3
PE
8136 Use C99-style 'extern inline' if available.
8137 * buffer.h (BUFFER_INLINE):
8138 * category.h (CATEGORY_INLINE):
8139 * character.h (CHARACTER_INLINE):
8140 * charset.h (CHARSET_INLINE):
8141 * composite.h (COMPOSITE_INLINE):
8142 * dispextern.h (DISPEXTERN_INLINE):
8143 * lisp.h (LISP_INLINE):
8144 * systime.h (SYSTIME_INLINE):
8145 New macro, replacing 'static inline' in this header.
8146 * buffer.h, category.h, character.h, charset.h, composite.h:
8147 * dispextern.h, lisp.h, systime.h:
8148 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8149 * alloc.c (LISP_INLINE):
8150 * buffer.c (BUFFER_INLINE):
8151 * category.c (CATEGORY_INLINE):
8152 * character.c (CHARACTER_INLINE):
8153 * charset.c (CHARSET_INLINE):
8154 * composite.c (COMPOSITE_INLINE):
8155 * dispnew.c (DISPEXTERN_INLINE):
8156 * sysdep.c (SYSTIME_INLINE):
8157 Define to EXTERN_INLINE, so that the corresponding functions
8158 are compiled into code.
8159 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8160 (INLINE_HEADER_END): New macros.
8161 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8162 since it's used in non-static inline functions now.
a8333d03 8163 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 8164
837b365b
GM
81652012-08-02 Glenn Morris <rgm@gnu.org>
8166
d66b744d
GM
8167 * s/: Remove empty directory.
8168
837b365b
GM
8169 * s/ms-w32.h: Move to ../nt/inc.
8170 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8171 Update for new ms-w32.h location.
8172
13294f95
PE
81732012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8174
8175 Port to Solaris 8.
8176 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8177
90df0db3
GM
81782012-08-02 Glenn Morris <rgm@gnu.org>
8179
8180 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8181 hard-coding the path separator.
8182
4939150c
PE
81832012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8184
8185 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8186 This how ASET and AREF are supposed to work, and makes
8187 it easier to think about future improvements. See
8188 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8189 * charset.h (set_charset_attr): New function.
8190 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8191 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8192 (aref_addr): New function. All uses of &AREF(...) changed.
8193 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8194 (set_hash_index): New functions. All lvalue-style uses of
8195 HASH_KEY etc. changed.
8196 * keyboard.c (set_prop): New function. All lvalue-style uses
8197 of PROP changed.
8198
947b2afd
AA
81992012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8200
8201 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8202 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 8203 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
8204 * nsfns.m (ns_set_name_as_filename): Likewise.
8205 * nsmenu.m (ns_update_menubar): Likewise.
8206 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8207
4f5d0325
EZ
82082012-08-01 Eli Zaretskii <eliz@gnu.org>
8209
2008beae
EZ
8210 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8211 Adapt to latest changes in field names of the corresponding Lisp
288479f6 8212 objects.
2008beae 8213
4f5d0325
EZ
8214 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8215
fe3cc771
GM
82162012-08-01 Glenn Morris <rgm@gnu.org>
8217
8218 * s/msdos.h: Remove file.
8219 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8220 * Makefile.in (S_FILE): Remove.
8221 (config_h): Remove S_FILE.
8222
c90acc54
JB
82232012-08-01 Juanma Barranquero <lekktu@gmail.com>
8224
8225 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8226 Remove; moved to nt/config.nt.
8227
d8a05828
DA
82282012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8229
8230 Use INTERNAL_FIELD for conses and overlays.
8231 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8232 Remove obsolete comment.
8233 (MVAR): New macro.
8234 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8235 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8236
8271d590
DA
82372012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8238
8239 Use INTERNAL_FIELD for symbols.
8240 * lisp.h (SVAR): New macro. Adjust users.
8241 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8242 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8243
3193acd2
DA
82442012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8245
8246 Use INTERNAL_FIELD for processes.
8247 * process.h (PVAR): New macro. Adjust style.
8248 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8249 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8250
3a45383a
DA
82512012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8252
8253 Use INTERNAL_FIELD for windows.
8254 * window.h (WVAR): New macro.
8255 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8256 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8257 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8258 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8259 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8260 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8261
c1dbc63c
PE
82622012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8263
8264 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8265
5c0c0e8a
GM
82662012-08-01 Glenn Morris <rgm@gnu.org>
8267
8268 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8269 Move to configure.ac.
8270
552a99b4
JB
82712012-08-01 Juanma Barranquero <lekktu@gmail.com>
8272
8273 * makefile.w32-in (CONFIG_H): Update dependencies.
8274 (CONF_POST_H): New macro.
8275
8276 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8277
8d8e2dfe
GM
82782012-07-31 Glenn Morris <rgm@gnu.org>
8279
bc96620a
GM
8280 * Makefile.in (S_FILE): No longer set by configure.
8281
476b1b2d
GM
8282 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8283 is available.
8284 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8285
b2c7a106
GM
8286 * process.h (NULL_DEVICE):
8287 * emacs.c (SEPCHAR):
8288 * editfns.c (USER_FULL_NAME): Let configure set them.
8289
d53d062a
GM
8290 * s/README, s/template.h: Remove files.
8291
4515017f
GM
8292 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8293
8d8e2dfe
GM
8294 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8295 Move to configure.ac.
8296
5b20b3cc
EZ
82972012-07-31 Eli Zaretskii <eliz@gnu.org>
8298
1e0afd9a
EZ
8299 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8300 resulting renaming of 'struct frame' members.
8301
5b20b3cc
EZ
8302 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8303
8304 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8305 after introduction of FVAR.
8306
f1310128
JD
83072012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8308
79e721e0
JD
8309 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8310
8311 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8312 instead of compositeToPoint.
8313 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8314
8d7c7eed 8315 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8316
e34f7f79
DA
83172012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8318
8319 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8320 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8321 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8322 (BVAR): Change to use INTERNAL_FIELD.
8323 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8324 (KVAR): Change to use INTERNAL_FIELD.
8325 * frame.h (FVAR): New macro.
8326 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8327 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8328 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8329 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8330 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8331
c09bfb2f
DA
83322012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8333
8334 Miscellaneous fixes for non-default X toolkits.
8335 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8336 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8337 Move under #ifdef USE_LUCID.
8338 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8339 definition and usage to avoid warnings.
8340
14c114ae
JD
83412012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8342
8343 * nsterm.m (openFiles): Fix previous checkin.
8344
3bd21e82
PE
83452012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8346
8347 * indent.c (compute_motion): Remove unused local.
8348
c1529ded
GM
83492012-07-31 Glenn Morris <rgm@gnu.org>
8350
400d5621
GM
8351 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8352
268e2432
GM
8353 * conf_post.h [USG5_4]:
8354 Move remaining contents of s/usg5-4-common.h here.
8355 * s/usg5-4-common.h: Remove file.
8356
7552f3ee
GM
8357 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8358 * s/irix6-5.h: Remove file.
8359
6a381852
GM
8360 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8361 * s/darwin.h: Remove file.
8362
c1529ded
GM
8363 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8364 * s/hpux10-20.h: Remove file, which is now empty.
8365
b429a4ee
GM
83662012-07-30 Glenn Morris <rgm@gnu.org>
8367
8368 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8369 * Makefile.in (config_h): Add conf_post.h.
8370 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8371
adff3182
JD
83722012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8373
8374 * nsterm.m (ns_do_open_file): New variable.
b9031d69 8375 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
8376 (openFile, openTempFile, openFileWithoutUI, openFiles):
8377 Open files only if ns_do_open_file.
adff3182 8378
c32af1e4
PE
83792012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8380
7393bcbb
PE
8381 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8382 This no-op macro hasn't been needed for many years.
8383 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8384
c32af1e4
PE
8385 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8386 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8387 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8388 gdb_make_enums_visible.
8389 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8390 (DIRECTORY_SEP): Now a constant, not a macro.
8391
302fc036
EZ
83922012-07-30 Eli Zaretskii <eliz@gnu.org>
8393
8394 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8395 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8396
8397 * w32term.c <w32_keyboard_codepage>: Renamed from
8398 keyboard_codepage and now external. All users changed.
8399
8400 * w32term.h: Add declaration of w32_keyboard_codepage.
8401
8402 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8403 the codepage to translate keys to Unicode. If this argument is
8404 -1, use the value returned by GetConsoleCP. All callers changed.
8405
88fb40b4
PE
84062012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8407
0aee6912
PE
8408 Update .PHONY listings in makefiles.
8409 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8410 bootstrap-clean, distclean, maintainer-clean, versioclean,
8411 extraclean, frc.
8412
88fb40b4
PE
8413 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8414 This is a bit clearer. Fix some commentary typos.
8415
0a763bd1
GM
84162012-07-30 Glenn Morris <rgm@gnu.org>
8417
32bac6d6
GM
8418 * s/netbsd.h: Let configure include signal.h if needed.
8419 Remove file, which is now empty.
8420
b65e7c46
GM
8421 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8422 Let configure set them.
8423 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8424 No more need to undefine.
0a763bd1 8425
169304bd
AS
84262012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8427
8428 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8429 non-single-byte char when adding meta modifier. (Bug#12090)
8430
6cd7a139
DA
84312012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8432
8433 Convert safe_call to use variable number of arguments.
8434 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8435 (safe_call2): Fix comment.
8436 * lisp.h (safe_call): Adjust prototype.
8437 * coding.c (encode_coding_object): Change to use safe_call2.
8438 * xfaces.c (merge_face_heights): Change to use safe_call1.
8439
d34d6ffc
GM
84402012-07-30 Glenn Morris <rgm@gnu.org>
8441
7b8a48e4 8442 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 8443 does that unconditionally. Remove file, which is now empty.
7b8a48e4 8444
d34d6ffc
GM
8445 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8446 Remove empty files.
8447
03a660a6
PE
84482012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8449
8450 Export to GDB most of lisp.h's remaining object-like macros.
8451 * lisp.h (min, max): Move earlier, because they're used earlier now.
8452 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8453 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8454 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8455 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8456 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8457 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8458 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8459 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8460 Now constants, for GDB. They need not be macros.
8461 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8462 Now constants, for GDB, as well as macros, for static initializers.
8463 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8464 Move to after the definition of struct Lisp_Char_Table,
8465 since the former now needs that type defined.
8466 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8467 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8468 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8469 New enums, for gdb_make_enums_visible.
8470 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 8471 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
8472 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8473 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8474 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8475 enum maxargs, enum MAX_ALLOCA.
8476 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8477 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8478 no longer needed, now that they are done in lisp.h.
8479
e499d0ee
DA
84802012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8481
8482 Cleanup string bytes checking.
8483 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8484 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8485 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8486 (check_sblock, compact_small_strings): Simplify.
8487
d5040d2d
PE
84882012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8489
8490 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8491 These macros are confusing and no longer need to be defined, as
8492 the enum values now suffice. All uses replaced with definiens.
8493 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8494
7f259ae6
JB
84952012-07-29 Juanma Barranquero <lekktu@gmail.com>
8496
8497 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8498 ($(BLD)/w32console.$(O)): Update dependencies.
8499
7e63e0c3
DA
85002012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8501
8502 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8503 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8504 time. Adjust users.
8505 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8506
ffd817eb
JD
85072012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8508
8509 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8510 setting sitelisp (Bug#12010).
8511
417a7a0e
EZ
85122012-07-29 Eli Zaretskii <eliz@gnu.org>
8513
14ae4239 8514 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
8515
8516 * w32heap.c (cache_system_info):
8517 * w32.c (sys_rename):
8518 * w32proc.c (find_child_console, sys_kill): All users changed.
8519
387d4d92
PE
85202012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8521
8522 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8523
55a6cca6
EZ
85242012-07-29 Eli Zaretskii <eliz@gnu.org>
8525
8526 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8527
dbcf001c
DA
85282012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8529
8530 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
8531 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8532 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 8533
e2688e4a
DA
85342012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8535
8536 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8537 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8538 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8539 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8540 (replace_range, replace_range_2, del_range_2): Change to eassert.
8541 * marker.c (byte_char_debug_check): Adjust style.
8542
b46a6a83
PE
85432012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8546 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8547 long-ago-commented-out code that talks about "WIN32".
8548 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8549 All uses changed.
8550
e32a5799
PE
85512012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8552
8553 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8554 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8555 Simplify by using alignof.
8556 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8557 * lisp.h: Include <stdalign.h>.
8558 (GCALIGNMENT): New macro and constant.
8559 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8560 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8561 (stdalign): New macro, if not already defined.
8562
df81cd29
EZ
85632012-07-28 Eli Zaretskii <eliz@gnu.org>
8564
01bd1b0d
EZ
8565 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8566 * w32inevt.c: Include w32inevt.h.
8567 (w32_read_console_input): New inline function, calls either
8568 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8569 w32_console_unicode_input.
8570 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8571 (w32_kbd_patch_key, key_event): Use the codepage returned by
8572 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8573 (key_event): use uChar.UnicodeChar only if
8574 w32_console_unicode_input is non-zero.
8575
8576 * w32console.c: Include w32heap.h.
8577 <w32_console_unicode_input>: New global variable.
8578 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8579 family of Windows, zero otherwise.
8580
8581 * w32inevt.h: Declare w32_console_unicode_input.
8582
df81cd29
EZ
8583 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8584 --without-x. (Bug#11742)
8585
c20fdd9e
PE
85862012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 Adjust GDB to reflect pvec_type changes (Bug#12036).
8589 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
8590 2012-07-04 changes to pseudovector representation.
8591 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 8592
32770973 85932012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
8594
8595 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8596 bus address.
8597 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8598
3438fe21
EZ
85992012-07-27 Eli Zaretskii <eliz@gnu.org>
8600
bcfbc9de
EZ
8601 * alloc.c (listn): Fix the order the arguments are consed onto the
8602 list.
8603
3438fe21
EZ
8604 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8605 enumeration constants, as PURE and HEAP are too general, and clash
8606 with other headers and sources, such as gmalloc.c and the
8607 MS-Windows system headers. All users changed.
8608
eeaea515
DA
86092012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8610
8611 Revert last save_excursion_save and save_excursion_restore changes.
8612 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8613 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8614
073c88c2
DA
86152012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8616
8617 Fix recently-introduced typos in Windows port.
8618 Reported by Martin Rudalics <rudalics@gmx.at>.
8619 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 8620 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 8621
4706125e
PE
86222012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8623
8624 Improve GDB symbol export (Bug#12036).
8625 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8626 arms of an 'if', not using conditional expressions; otherwise GDB
8627 complains about the types in the unevaluated arm when the argument
8628 is an integer literal.
8629 (xgetint): Simplify expression.
8630 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8631 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8632 Zaretskii in <http://bugs.gnu.org/12036#13>.
8633 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8634 needed now that we have gdb_make_enums_visible.
8635 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8636 (enum enum_USE_LSB_TAG):
8637 New enum types, packaging up enums that need to be exported to GDB.
8638
694b6c97
DA
86392012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8640
8641 Utility function to make a list from specified amount of objects.
8642 * lisp.h (enum constype): New datatype.
8643 (listn): New prototype.
8644 * alloc.c (listn): New function.
8645 (Fmemory_use_count, syms_of_alloc): Use it.
8646 * buffer.c (syms_of_buffer): Likewise.
8647 * callint.c (syms_of_callint): Likewise.
8648 * charset.c (define_charset_internal): Likewise.
8649 * coding.c (syms_of_coding): Likewise.
8650 * keymap.c (syms_of_keymap): Likewise.
8651 * search.c (syms_of_search): Likewise.
8652 * syntax.c (syms_of_syntax): Likewise.
8653 * w32.c (init_environment): Likewise.
8654 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8655 * xdisp.c (syms_of_xdisp): Likewise.
8656 * xfns.c (syms_of_xfns): Likewise.
8657
6195f384
DA
86582012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8659
8660 Fast save_excursion_save and save_excursion_restore.
8661 * lisp.h (struct Lisp_Excursion): New data type.
8662 (PVEC_EXCURSION): New pseudovector type.
8663 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8664 to deal with it. Adjust comments.
8665 (init_marker, attach_marker): New prototype.
8666 (unchain_marker): Adjust prototype.
8667 * marker.c (attach_marker): Change to global.
8668 (init_marker): New function.
8669 * alloc.c (Fmake_marker, build_marker): Use it.
8670 (build_marker): More easserts.
8671 (mark_object): Handle struct Lisp_Excursion.
8672 * editfns.c (save_excursion_save, save_excursion_restore):
8673 Reimplement to use struct Lisp_Excursion. Add comments.
8674
5eceb8fb
PE
86752012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 Fix export of symbols to GDB (Bug#12036).
8678 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8679 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8680 emacs.c, as this is a more-suitable home. Had this been done earlier
8681 the fix for 12036 would have avoided some of the problems noted in
8682 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8683 would have been more obvious.
562157c8
PE
8684 * emacs.c: Do not include <verify.h>; no longer needed.
8685 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8686 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8687 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8688 Remove; now done in lisp.h.
8689 * lisp.h (PUBLISH_TO_GDB): New macro.
8690 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8691 (DATA_SEG_BITS): Use it.
8692 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8693 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8694 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8695 not be usable in #if. This simplifies things.
8696
d6749401
JB
86972012-07-26 Juanma Barranquero <lekktu@gmail.com>
8698
8699 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8700
1781b9e9
PE
87012012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8702
d89518db 8703 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8704 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8705 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8706 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8707 Adjust to changes in lisp.h and emacs.c, by using
8708 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8709 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8710 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8711 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8712 instead of gdb_valbits.
8713 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8714 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8715 instead of gdb_array_mark_flag.
8716 (xboolvector): Get size from $->size, not $->header.size.
8717 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8718 (xreload, hook-run, hookpost-run): Remove.
8719 * emacs.c: Include <verify.h>.
8720 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8721 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8722 Remove.
8723 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8724 (gdb_USE_LSB_TAG): New enum constants.
8725 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8726 Also define these as enum constants, so they're visible to GDB.
8727 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8728 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8729 as constants, so they're visible to GDB.
8730 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8731 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8732 Now enum constants, not macros, so they're visible to GDB.
8733 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8734 more convenient now. All uses changed.
8735 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8736 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8737
3628596a
DA
87382012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8739
8740 Explicitly free restriction data that are not needed anymore.
8741 * editfns.c (save_restriction_restore): Free restriction data.
8742
7abaf5cc
SM
87432012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8744
8745 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8746 add argument, tune behavior, and adjust all callers.
8747
71f88e00
PE
87482012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8749
8750 Use typedef for EMACS_INT, EMACS_UINT.
8751 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8752 than macros. This simplifies debugging in the usual case, since
8753 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8754 and it allows expressions involving EMACS_INT casts.
8755 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8756
57ec3034
JD
87572012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8758
8759 * nsterm.m (ns_read_socket): Return early if there is a modal
8760 window (Bug#12043).
8761
8137e7b3
MR
87622012-07-25 Martin Rudalics <rudalics@gmx.at>
8763
8764 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8765 that FOCUS-FRAME can be omitted.
8766
04e9897c
DA
87672012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 Adjust buffer text indirection counters at the end of Fkill_buffer.
8770 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8771 buffer is definitely dead. This should really fix an issue reported
8772 by Christoph Scholtes again. (Bug#12007).
8773 (init_buffer_once): Initialize indirection counters of
8774 buffer_defaults and buffer_local_symbols (for sanity and safety).
8775
8a0484e1
EZ
87762012-07-24 Eli Zaretskii <eliz@gnu.org>
8777
8778 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8779 and continuation glyphs on tooltip frames, leave them at zero.
8780 Avoids continued lines in tooltips. (Bug#11832)
8781
fa691a83
DA
87822012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8783
8784 Simplify copy_overlay.
04e9897c 8785 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
8786 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8787
436bc8e0
EZ
87882012-07-23 Eli Zaretskii <eliz@gnu.org>
8789
8790 * print.c (print_object): Don't crash when a frame's name is nil
8791 or invalid. (Bug#12025)
8792
8793 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8794 it signals an error when a tooltip frame is being created.
8795
d7a7fda3
DA
87962012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8797
8798 Cleanup miscellaneous objects allocation and initialization.
8799 * alloc.c (allocate_misc): Change to static. Add argument to
8800 specify the subtype. Adjust comment and users.
8801 (build_overlay): New function.
8802 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8803 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8804 (allocate_misc): Remove prototype.
8805 (build_overlay): Add prototype.
8806
88072012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
8808
8809 Swap buffer text indirection counters in Fbuffer_swap_text.
8810 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8811 This avoids crash reported by Christoph Scholtes at
8812 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8813
9d7fa573
JD
88142012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8815
8816 * nsmenu.m (Popdown_data): New struct.
8817 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8818 free Popdown_data.
8819 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8820 (initWithContentRect): Make imgView and contentView non-static
8821 and autorelease them. Also autorelease img and matrix (Bug#12005).
8822 (dealloc): Remove (Bug#12005).
8823
0dd6d66d
DA
88242012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8825
8826 Adjust consing_since_gc when objects are explicitly freed.
8827 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8828 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8829 (free_cons, free_misc): Subtract object size from consing_since_gc.
8830
d36d71df
DA
88312012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8832
8833 Simplify and cleanup markers positioning code.
8834 * marker.c (attach_marker): More useful eassert.
8835 (live_buffer, set_marker_internal): New function.
8836 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8837 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8838
fb9ea40f
PE
88392012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8840
8841 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8842 as it's limited by the amount of memory, not by INT_MAX.
8843
2d5c5f7d
EZ
88442012-07-21 Eli Zaretskii <eliz@gnu.org>
8845
07fb592e
EZ
8846 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8847 in special-event-map. See the discussion at
8848 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8849 for the reasons.
8850
37a9eac8 8851 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
8852 info.dwItemData. Fixes crashes on 64-bit Windows.
8853 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 8854
c4328746
JD
88552012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8856
fc0c31f8 8857 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 8858 (conversationIdentifier): Return value is NSInteger.
784051c4 8859 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 8860
6e5d1c12
CY
88612012-07-21 Chong Yidong <cyd@gnu.org>
8862
8863 * window.c (decode_any_window): Signal an error if the window is
8864 on a dead frame (Bug#11984).
8865
9928463d
DA
88662012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8867
8868 Add indirection counting to speed up Fkill_buffer.
8869 * buffer.h (struct buffer): New member.
8870 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8871 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8872 base buffer indirection counter.
8873 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8874 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8875 through buffer list if indirection counter is 0.
8876
f8643a6b
DA
88772012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8878
8879 Extend the value returned by Fgarbage_collect with heap statistics.
8880 * alloc.c (Qheap): New symbol.
8881 (syms_of_alloc): DEFSYM it.
8882 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8883 (Fmemory_free): Remove.
8884 (syms_of_alloc): Don't defsubr it.
8885 * buffer.c (Fcompact_buffer): Remove.
8886 (syms_of_buffer): Don't defsubr it.
8887
dac616ff
DA
88882012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8889
8890 Make maybe_gc inline.
8891 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8892 * lisp.h (consing_since_gc, gc_relative_threshold)
8893 (memory_full_cons_threshold): Revert declaration.
8894 (maybe_gc): Remove prototype, define as inline.
8895 * alloc.c: Remove old commented-out code.
8896 (consing_since_gc, gc_relative_threshold)
8897 (memory_full_cons_threshold): Revert to global.
8898 (maybe_gc): Remove.
8899
d7ea76b4
DA
89002012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8901
8902 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8903 * lisp.h (build_unibyte_string): New function.
8904 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8905 * sysdep.c, w32fns.c, xfns.c: Use it.
8906 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8907 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8908 Adjust users accordingly.
8909 * font.h (font_open_by_name): Adjust prototype.
8910
765e61e3
DA
89112012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8912
8913 Cleanup calls to Fgarbage_collect.
8914 * lisp.h (maybe_gc): New prototype.
8915 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8916 Remove declarations.
8917 * alloc.c (maybe_gc): New function.
8918 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8919 Make them static.
8920 * bytecode.c (MAYBE_GC): Use maybe_gc.
8921 * eval.c (eval_sub, Ffuncall): Likewise.
8922 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8923 to avoid dependency from auto-save feature.
8924
52b852c7
PE
89252012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8926
8927 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8928 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8929 'for_each_per_buffer_object_at'.
8930 All uses changed. It's better to use upper-case for macros that
8931 cannot be implemented as functions, to give the reader a clue
8932 that they're special.
8933
5db81e33
SM
89342012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8935
8936 * alloc.c (Fgarbage_collect): Tweak docstring.
8937
5b835e1d
DA
89382012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8939
8940 Tweak the value returned from Fgarbage_collect again.
8941 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8942 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8943 Adjust documentation.
8944 (total_vector_bytes): Rename to total_vector_slots, adjust
8945 accounting.
8946 (total_free_vector_bytes): Rename to total_free_vector_slots,
8947 adjust accounting.
8948 (Qstring_bytes, Qvector_slots): New symbols.
8949 (syms_of_alloc): DEFSYM them.
8950
9cd47b72
DA
89512012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8952
8953 Buffer compaction primitive which may be used from Lisp.
8954 * buffer.c (compact_buffer, Fcompact_buffer): New function.
8955 (syms_of_buffer): Register Fcompact_buffer.
8956 * alloc.c (Fgarbage_collect): Use compact_buffer.
8957 * buffer.h (compact_buffer): New prototype.
8958 (struct buffer_text): New member.
8959
d17337e5
DA
89602012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8961
8962 New macro to iterate over all buffers, miscellaneous cleanups.
8963 * lisp.h (all_buffers): Remove declaration.
8964 * buffer.h (all_buffers): Add declaration, with comment.
8965 (for_each_buffer): New macro.
8966 * alloc.c (Fgarbage_collect, mark_object): Use it.
8967 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
8968 (init_buffer): Likewise.
8969 * data.c (Fset_default): Likewise.
8970 * coding.c (code_conversion_restore): Remove redundant check
8971 for dead buffer.
8972 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
8973
60cfd278
AS
89742012-07-18 Andreas Schwab <schwab@linux-m68k.org>
8975
8976 Fix bug that created negative-length intervals.
8977 * intervals.c (merge_interval_right, merge_interval_left):
8978 Do not zero out this interval if it is absorbed by its children,
8979 as this interval's total length doesn't change in that case. See
8980 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
8981
d06714cb
PE
89822012-07-18 Paul Eggert <eggert@cs.ucla.edu>
8983
83713154
PE
8984 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
8985 when invoking (make-bool-vector N t) and N is a positive
8986 multiple of 8 -- the last 8 bits were mistakenly cleared.
8987
d06714cb
PE
8988 Remove some struct layout assumptions in bool vectors.
8989 * alloc.c (bool_header_size): New constant.
8990 (header_size, word_size): Move earlier, as they're now used earlier.
8991 Use 'word_size' in a few more places, where it's appropriate.
8992 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
8993 padding before the data member of a bool vector.
8994 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
8995 than doing the check by hand with an abort ().
8996
464d5a5e
SM
89972012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
8998
5fbc0409
SM
8999 * eval.c (Fdefvar): Don't check constants since we only set the var if
9000 it's not yet defined anyway (bug#11904).
9001
464d5a5e
SM
9002 * lisp.h (last_undo_boundary): Declare new var.
9003 * keyboard.c (command_loop_1): Set it.
9004 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9005 were auto-added by the command loop (bug#11774).
9006
8dc2e44a
AS
90072012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9008
9009 * w32font.c (Qsymbol): Remove local definition.
9010 (syms_of_w32font): Don't DEFSYM it.
9011
169925ec
DA
90122012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9013
9014 Fix sweep_vectors to handle large bool vectors correctly.
9015 * alloc.c (sweep_vectors): Account total_vector_bytes for
9016 bool vectors larger than VBLOCK_BYTES_MAX.
9017
5fbfb018
CY
90182012-07-18 Chong Yidong <cyd@gnu.org>
9019
9020 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9021 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9022
3ab6e069
DA
90232012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9024
9025 Return more descriptive data from Fgarbage_collect.
9026 Suggested by Stefan Monnier in
9027 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9028 * alloc.c (bounded_number): New function.
9029 (total_buffers, total_vectors): New variable.
9030 (total_string_size): Rename to total_string_bytes, adjust users.
9031 (total_vector_size): Rename to total_vector_bytes, adjust users.
9032 (sweep_vectors): Account total_vectors and total_vector_bytes.
9033 (Fgarbage_collect): New return value. Adjust documentation.
9034 (gc_sweep): Account total_buffers.
9035 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9036 (VECTOR_SIZE): Remove.
9037 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9038 (Qinterval, Qmisc): New symbols.
9039 (syms_of_data): Initialize them.
9040 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9041 (Qcons, Qbuffer): New declarations.
9042
6d02fe5b
PE
90432012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9044
9045 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9046 Round up, not down. Improve doc.
9047
b7ffe040
DA
90482012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9049
9050 Restore old code in allocate_string_data to avoid Faset breakage.
9051 Reported by Julien Danjou <julien@danjou.info> in
9052 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9053 * alloc.c (allocate_string_data): Restore old code with minor
9054 adjustments, fix comment to explain this subtle issue.
9055
4dc7c8d5
SM
90562012-07-17 Eli Zaretskii <eliz@gnu.org>
9057
9058 Remove FILE_SYSTEM_CASE.
9059 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9060
9061 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9062 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9063 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9064 call-process-region passes it through expand-file-name.
9065
9066 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9067
90682012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9069
9070 Fix crash when creating indirect buffer (Bug#11917)
9071 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9072 Don't handle unbound variables specially if non-zero.
9073 (Fbuffer_local_variables): Pass zero.
9074 (clone_per_buffer_values): Pass non-zero.
9075
90762012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9077
9078 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9079 to make the loop interruptible.
9080
90812012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9082
9083 * gnutls.c (emacs_gnutls_handshake): Only retry if
9084 GNUTLS_E_INTERRUPTED.
9085
cce7fefc
DA
90862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9087
9088 Cleanup and convert miscellaneous checks to eassert.
9089 * alloc.c (mark_interval): Fix comment, partially rephrase
9090 old comment from intervals.h (see below).
9091 * intervals.c (find_interval, adjust_intervals_for_insertion)
9092 (delete_interval, adjust_intervals_for_deletion)
9093 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9094 Convert to eassert.
9095 (adjust_intervals_for_insertion, make_new_interval):
9096 Remove obsolete and unused code.
9097 * intervals.h (struct interval): Remove obsolete comment.
9098 * textprotp.c (erase_properties): Remove unused code.
9099 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9100 (Fremove_list_of_text_properties): Convert to eassert.
9101
9ea10cc3
CY
91022012-07-17 Chong Yidong <cyd@gnu.org>
9103
9104 * editfns.c (Finsert_char): Doc fix.
9105
3900d5de
DA
91062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9107
9108 Fix previous change to make Fmemory_free always accurate.
9109 * alloc.c (make_interval): Update total_free_intervals.
9110 (make_float): Likewise for total_free_floats.
9111 (free_cons, Fcons): Likewise for total_free_conses.
9112 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9113 Likewise for total_free_vector_bytes.
9114 (Fmake_symbol): Likewise for total_free_symbols.
9115 (bytes_free): Remove.
9116
7098646f
DA
91172012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9118
9119 Simple free memory accounting feature.
9120 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9121 (sweep_vectors): Accumulate size of free vectors.
9122 (Fgarbage_collect): Setup bytes_free.
9123 (Fmemory_free): New function.
9124 (syms_of_alloc): Register it.
9125
22657b40
DA
91262012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9127
9128 Cleanup overlays checking.
9129 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9130 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9131 eassert and OVERLAYP.
9132 (sort_overlays): Change to use OVERLAYP.
9133
ddfc8813
RK
91342012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9135
9136 * editfns.c (Finsert_char): Make it interactive, and make the
9137 second arg optional. Copy interactive spec and docstring from
9138 ucs-insert.
9139
7c26cf3c
PE
91402012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9141
9142 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9143 Unlike the other wrapped functions, fabs has an unspecified
9144 effect on errno.
9145
5d127af9
JD
91462012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9147
9148 * nsterm.m (keyDown): Interpret flags without left/right bits
9149 as the left key (Bug#11670).
9150
6a0dd1d7
DA
91512012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9152
9153 Remove empty and useless init functions.
9154 * lisp.h (init_character_once, init_fns, init_image)
9155 (init_filelock, init_sound): Remove prototype.
9156 * character.c (init_character_once): Remove.
9157 * filelock.c (init_filelock): Likewise.
9158 * fns.c (init_fns): Likewise.
9159 * image.c (init_image): Likewise.
9160 * sound.c (init_sound): Likewise.
9161 * emacs.c (main): Adjust accordingly.
9162
7a6136fd
DA
91632012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9164
9165 * gtkutil.h: Tiny cleanups.
9166 (use_old_gtk_file_dialog): Remove useless declaration.
9167 (xg_uses_old_file_dialog): Add suggested const attribute.
9168
ce811ad9
EZ
91692012-07-15 Eli Zaretskii <eliz@gnu.org>
9170
9171 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9172 (bidi_paragraph_init): Use it to limit search forward for a strong
9173 directional character in abnormally large paragraphs full of
9174 neutral or weak characters. (Bug#11943)
9175
c9adfeaa
SF
91762012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9177
9178 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9179 the toolbar (Bug#9451).
9180 (xg_make_tool_item): Give the widget event box a transparent
9181 background.
9182
fff62aa9
DA
91832012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9184
9185 Cleanup basic allocation variables and functions.
9186 * alloc.c (ignore_warnings, init_intervals, init_float)
9187 (init_cons, init_symbol, init_marker): Remove.
9188 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9189 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9190 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9191 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9192 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9193 (staticidx, init_alloc_once, init_strings, free_ablock):
9194 Remove redundant initialization.
9195 * fns.c (init_weak_hash_tables): Remove.
9196 * lisp.h (init_weak_hash_tables): Remove prototype.
9197
9730daca
DA
91982012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9199
9200 Use zero_vector where appropriate.
9201 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9202 accordingly.
9203 * lisp.h (zero_vector): New declaration.
9204 * font.c (null_vector): Remove.
9205 (syms_of_font): Remove initialization and staticpro.
9206 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9207 * keymap.c (Faccessible_keymaps): Likewise.
9208
2e2d2a13
LL
92092012-07-15 Leo Liu <sdl.web@gmail.com>
9210
9211 * fringe.c: Fix typo in comments.
9212
cd276f6e
LL
92132012-07-14 Leo Liu <sdl.web@gmail.com>
9214
9215 * fringe.c: Add a new bitmap exclamation-mark.
9216
5a1131d9
EZ
92172012-07-14 Eli Zaretskii <eliz@gnu.org>
9218
9219 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9220
9221 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9222 (HAVE_MENUS): Don't define, defined by editing config.in with
9223 msdos/sed2v2.inp.
9224 (GMALLOC_INHIBIT_VALLOC): Don't define.
9225 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9226
22e983b7
JB
92272012-07-14 Juanma Barranquero <lekktu@gmail.com>
9228
9229 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9230
5b3f250f
GM
92312012-07-14 Glenn Morris <rgm@gnu.org>
9232
9233 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9234 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9235 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9236
33d63ff4
GM
92372012-07-13 Glenn Morris <rgm@gnu.org>
9238
5b633342
GM
9239 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9240
33d63ff4
GM
9241 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9242 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9243
b55b9f85
JD
92442012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9245
0dc8cf50
JD
9246 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9247 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9248 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9249 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9250 where appropriate.
9251 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9252 as boolean expression.
9253 (x_set_window_size): Remove unused variable toolbar.
9254 (ns_get_color_default, ns_mod_to_lisp): Remove.
9255 (ns_mouse_position): Remove unused variables xchar and ychar.
9256 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9257 (ns_set_vertical_scroll_bar): Remove unused variable count.
9258 (ns_delete_terminal): Remove unused variable i.
9259 (ns_term_init): Remove unused variables r, g and b.
9260 (mouseDown): Remove unused variable window.
9261 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9262 (initFrameFromEmacs): Remove unused variable vbextra.
9263 (mouseEntered): Remove unused variables p and dpyinfo.
9264 (mouseExited): Remove unused variables p and r.
9265 (ns_define_frame_cursor, ns_clear_frame_area)
9266 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9267 (menuDown): Assign [sender tag] to variable and cast the variable.
9268
9269 * nsterm.h (menuDown): Add id as type to argument sender.
9270 (ns_display_info_for_name): Add Lisp_Object argument.
9271 (ns_term_init): Add Lisp_Object argument.
9272 (ns_map_event_to_object): Add void argument.
9273 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9274 prototype with arguments and only declare if __OBJC__.
9275 (nxatoms_of_nsselect): Add void argument.
9276 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9277 (ns_alloc_autorelease_pool): Add void argument.
9278 (ns_release_autorelease_pool): Add void* argument.
9279 (ns_get_defaults_value): Add const char* argument.
9280
9281 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9282 (initFromContents): Use SSDATA where appropriate.
9283 (ns_update_menubar): Add braces to ambigous if-else.
9284 (initWithTitle): Put () around assignment in if statement.
9285 (ns_menu_show): Remove unused variables window and keymap.
9286 (update_frame_tool_bar): Remove unused variable selected_p.
9287 (initWithContentRect): Remove unused variable this_cmd_name.
9288
9289 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9290 appropriate.
9291 (setXBMColor): Remove unused variable len.
9292 (setPixmapData): Put () around assignment in loop statement.
9293
9294 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9295 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9296 where appropriate.
9297 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9298 around assignment in loop statement.
9299 (nsfont_open): Remove unused variable i.
9300 (nsfont_open): Remove unused variable len.
9301 (nsfont_draw): Remove unused variable cs.
9302
9303 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9304 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9305 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9306 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9307 (Fns_font_name, Fns_perform_service)
9308 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9309 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9310 (ns_set_name): Remove unused variable view.
9311 (x_set_menu_bar_lines): Remove unused variable olines.
9312 (x_set_tool_bar_lines): Remove unused variable root_window.
9313 (Fns_list_colors): Put () around assignment in while statement.
9314 (Fns_perform_service): Remove unused variable len.
9315 (Fns_display_usable_bounds): Remove unused variable top.
9316 (syms_of_nsfns): Remove unused variable i.
9317
b55b9f85
JD
9318 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9319 memcpy (Bug#11907).
9320
ed9265fc 93212012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9322
9323 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9324 and free it with DestroyExceptionInfo (Bug#11558).
9325
ef099b57
JB
93262012-07-13 Juanma Barranquero <lekktu@gmail.com>
9327
9328 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9329 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9330 Set here, not in nt/config.nt.
9331
ea814a5d
EZ
93322012-07-13 Eli Zaretskii <eliz@gnu.org>
9333
9334 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9335 cursor overflow into the last glyph on display line when the right
9336 fringe is off. (Bug#11832)
9337
1a952767
PE
93382012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9339
9340 * xdisp.c (produce_special_glyphs): Now static.
9341 * dispextern.h (produce_special_glyphs): Remove decl.
9342
983188fd
GM
93432012-07-13 Glenn Morris <rgm@gnu.org>
9344
8d7c7eed 9345 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9346 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9347
983188fd
GM
9348 * s/usg5-4-common.h (USG, USG5):
9349 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9350 * s/sol2-6.h (SOLARIS2):
9351 * s/irix6-5.h (IRIX6_5):
9352 * s/hpux10-20.h (USG, USG5, HPUX):
9353 * s/gnu-linux.h (USG, GNU_LINUX):
9354 * s/freebsd.h (BSD_SYSTEM):
9355 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9356 * s/cygwin.h (CYGWIN):
9357 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9358 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9359
d1e68667 93602012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9361
9362 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 9363
6de0e799
GM
93642012-07-13 Glenn Morris <rgm@gnu.org>
9365
739ae010
GM
9366 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9367
dbee5793
GM
9368 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9369
6de0e799
GM
9370 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9371 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9372
b82da769
GM
93732012-07-12 Glenn Morris <rgm@gnu.org>
9374
4fae5a7a 9375 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
9376
9377 * process.c (init_process_emacs): Rename from init_process.
9378 The old name is also the name of a Mach system call.
9379 * lisp.h, emacs.c: Update for this name change.
9380 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9381 longer needed.
9382
5a979817
EZ
93832012-07-12 Eli Zaretskii <eliz@gnu.org>
9384
9385 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9386 memmove call that removes glyphs covered by the left truncation
9387 glyph. Improve commentary.
9388 (display_line): Fix display of continuation glyphs on GUI frames
9389 when the right fringe is turned off and variable-size fonts are
9390 used in the window. Move the code that appends a stretch glyph to
9391 produce_special_glyphs, so that it could be used for truncation
9392 and continuation glyphs alike.
9393 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9394 glyph of a suitably computed width, to align the special glyphs at
9395 the window margin. Code moved from display_line. (Bug#11832)
9396
3e91a053
GM
93972012-07-12 Glenn Morris <rgm@gnu.org>
9398
ba9e4b84
GM
9399 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9400
9401 * s/gnu-linux.h, s/hpux10-20.h:
9402 Do not unconditionally define HAVE_XRMSETDATABASE.
9403
3e91a053
GM
9404 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9405
b300b1f4
PE
94062012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9407
9408 Fix typos that broke OS X build.
9409 Reported by Randal L. Schwartz in
9410 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9411 * nsterm.m (ns_timeout): Add missing local decl.
9412 (ns_get_color): snprintf -> sprintf, to fix typo.
9413
6e777848
GM
94142012-07-12 Glenn Morris <rgm@gnu.org>
9415
3f922c37
GM
9416 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9417 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9418 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9419 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9420
0ab7b23a
GM
9421 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9422 Move PTY_OPEN to configure.
9423
6e777848
GM
9424 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9425 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9426 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9427
4a7edc24
DA
94282012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9429
9430 Use empty_unibyte_string where applicable.
9431 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9432 * lread.c (read1): Likewise.
9433 * xsettings.c (syms_of_xsettings): Likewise.
9434
308aab79
GM
94352012-07-12 Glenn Morris <rgm@gnu.org>
9436
42bd1719
GM
9437 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9438 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
9439 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9440 * s/hpux10-20.h (RUN_TIME_REMAP):
9441 * s/bsd-common.h (TABDLY): Move to configure.
9442
9443 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9444
9445 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9446
ea0bbd17 9447 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 9448 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
9449
9450 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 9451
308aab79
GM
9452 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9453 * s/template.h: Move NARROWPROTO to configure.
9454
ee1cf5cf
GM
94552012-07-11 Glenn Morris <rgm@gnu.org>
9456
30fe9bf4
GM
9457 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9458 unused since 2011-01-17 change to systty.h.
9459
ee1cf5cf
GM
9460 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9461 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9462 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9463
63e47e07
PE
94642012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9467
c43fb4c3
GM
94682012-07-11 Glenn Morris <rgm@gnu.org>
9469
9470 * s/darwin.h, s/gnu-linux.h, s/template.h:
9471 Move INTERRUPT_INPUT to configure.
9472
e8df9267
DA
94732012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9474
9475 Minor adjustments to interning code.
9476 * lisp.h (intern, intern_c_string): Redefine as static inline
9477 wrappers for intern_1 and intern_c_string_1, respectively.
9478 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
9479 * lread.c (intern_1, intern_c_string_1, oblookup):
9480 Simplify Vobarray checking.
e8df9267
DA
9481 * font.c (font_intern_prop): Likewise. Adjust comment.
9482 * w32font.c (intern_font_name): Likewise.
9483
34348bd4
AS
94842012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9485
d96a1e0c
AS
9486 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9487
34348bd4
AS
9488 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9489 of Fcar/Fcdr if possible.
9490 * font.c (check_otf_features): Likewise.
9491 * fontset.c (Fnew_fontset): Likewise.
9492 * gnutls.c (Fgnutls_boot): Likewise.
9493 * minibuf.c (read_minibuf): Likewise.
9494 * msdos.c (IT_set_frame_parameters): Likewise.
9495 * xmenu.c (Fx_popup_dialog): Likewise.
9496 * w32menu.c (Fx_popup_dialog): Likewise.
9497
c8add24e
GM
94982012-07-11 Glenn Morris <rgm@gnu.org>
9499
4b575b3c
GM
9500 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9501 since nothing has defined it on these platforms.
9502
09f4e3b0
GM
9503 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9504 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9505
172bedef
GM
9506 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9507 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9508 Move CLASH_DETECTION to configure.
9509
249685df
GM
9510 * s/gnu.h: Remove file, which is now empty.
9511
c8add24e
GM
9512 * s/gnu.h, s/gnu-linux.h:
9513 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9514
b41253a3
JW
95152012-07-11 John Wiegley <johnw@newartisans.com>
9516
9517 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9518 function attribute, so we only use it if it exists in the
9519 compiler.
9520
d923b542
DA
95212012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9522
9523 Avoid call to strlen in fast_c_string_match_ignore_case.
9524 * search.c (fast_c_string_match_ignore_case): Change to use
9525 length argument. Adjust users accordingly.
9526 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9527
5ebbef1d
PE
95282012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9529
bb352260
PE
9530 Assume mkdir, rmdir.
9531 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9532 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9533
57054ddd
PE
9534 Assume rename.
9535 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9536
b747d3f7
PE
9537 Assume perror.
9538 * s/hpux10-20.h (HAVE_PERROR): Remove.
9539 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9540 Remove dummy definition, as this problem was obsolete long ago.
9541
5ebbef1d
PE
9542 Assume strerror.
9543 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9544
984e7f30
DA
95452012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9546
9547 Avoid calls to strlen in font processing functions.
9548 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
9549 (font_open_by_name): Change to use length argument.
9550 Adjust users accordingly.
d923b542
DA
9551 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9552 Adjust prototypes.
9553 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9554 Change to return ptrdiff_t.
984e7f30
DA
9555 (xfont_list_pattern, xfont_match): Use length returned by
9556 xfont_decode_coding_xlfd.
9557 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9558
20e94fdd
GM
95592012-07-11 Glenn Morris <rgm@gnu.org>
9560
9d596af3
GM
9561 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9562 Move DONT_REOPEN_PTY to configure.
9563
20e94fdd
GM
9564 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9565 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9566
e99a530f
PE
95672012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9568
22ffb973
PE
9569 Remove "#define unix" that is no longer needed (Bug#11905).
9570 * s/aix4-2.h (unix): Remove; no longer needed.
9571
e9a9ae03
PE
9572 EMACS_TIME simplification (Bug#11875).
9573 This replaces macros (which typically do not work in GDB)
9574 with functions, typedefs and enums, making the code easier to debug.
9575 The functional style also makes code easier to read and maintain.
9576 * systime.h: Include <sys/time.h> on all hosts, not just if
9577 WINDOWSNT, since 'struct timeval' is needed in general.
9578 (EMACS_TIME): Now a typedef, not a macro.
9579 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9580 not macros.
9581 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9582 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9583 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9584 (EMACS_TIME_LE): Now functions, not macros.
9585 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9586 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9587 which are not functions. All uses rewritten to use:
9588 (make_emacs_time): New function.
9589 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9590 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9591 not functions. All uses rewritten to use the following, respectively:
9592 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9593 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 9594 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
9595 * fileio.c (Fcopy_file):
9596 * xterm.c (XTflash): Get the current time closer to when it's used.
9597 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9598
ffacb126
PE
9599 * bytecode.c (targets): Suppress -Woverride-init warnings.
9600
e99a530f
PE
9601 Simplify by avoiding confusing use of strncpy etc.
9602 * doc.c (Fsnarf_documentation):
9603 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9604 * frame.c (Fmake_terminal_frame):
9605 * gtkutil.c (get_utf8_string):
9606 * lread.c (openp):
9607 * nsmenu.m (ns_update_menubar):
9608 * regex.c (regerror):
9609 Prefer memcpy to strncpy and strncat when either will do.
9610 * fileio.c (Fsubstitute_in_file_name):
9611 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9612 (menu_separator_name_p):
9613 * nsmenu.m (ns_update_menubar):
9614 Prefer memcmp to strncmp when either will do.
9615 * nsterm.m: Include <ftoastr.h>.
9616 (ns_get_color):
9617 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9618 Prefer snprintf to strncpy.
9619 * nsterm.m (ns_term_init):
9620 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9621 * nsterm.m (ns_term_init):
9622 Avoid the need for strncpy, by using build_string or
9623 make_unibyte_string directly. Use dtoastr, not snprintf.
9624 * process.c (Fmake_network_process): Diagnose service names that
9625 are too long, rather than silently truncating them or creating
9626 non-null-terminated names.
9627 (Fnetwork_interface_info): Likewise, for interface names.
9628 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9629 Prefer sprintf to strncat.
9630 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9631 Prefer vsnprintf to vsprintf + strncpy.
9632
c59592b3
GM
96332012-07-10 Glenn Morris <rgm@gnu.org>
9634
9635 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9636 Clarify fallback case.
9637
7d7bbefd
DA
96382012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9639
9640 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9641 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9642 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 9643 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
9644 where argument type is known to be a Lisp_Cons.
9645
3a4c8000
TT
96462012-07-10 Tom Tromey <tromey@redhat.com>
9647
9648 * bytecode.c (BYTE_CODE_THREADED): New macro.
9649 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9650 (enum byte_code_op): New type.
9651 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9652 (exec_byte_code): Use them. Use token threading when applicable.
9653
2a0213a6
DA
96542012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9655
9656 Optimize pure C strings initialization.
9657 * lisp.h (make_pure_string): Fix prototype.
9658 (build_pure_c_string): New function, defined as static inline. This
9659 provides a better opportunity to optimize away calls to strlen when
9660 the function is called with compile-time constant argument.
9661 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9662 argument, adjust users accordingly. Use build_pure_c_string where
9663 appropriate.
9664 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9665 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9666 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9667
cb1caeaf
DA
96682012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9669
9670 Avoid calls to strlen in miscellaneous functions.
9671 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9672 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9673 * lread.c (openp): Likewise.
9674
c293e30c
DA
96752012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9676
9677 Avoid calls to strlen in path processing functions.
9678 * fileio.c (file_name_as_directory): Add comment. Change to add
9679 srclen argument and return the length of result. Adjust users
9680 accordingly.
9681 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9682 swap 1st and 2nd arguments to obey the common convention.
9683 Adjust users accordingly.
c293e30c
DA
9684 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9685
9e059e3f
GM
96862012-07-10 Glenn Morris <rgm@gnu.org>
9687
d02eb359
GM
9688 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9689 Move PENDING_OUTPUT_COUNT definition to configure.
9690
882cf227
GM
9691 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9692 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9693 * s/gnu.h (DATA_START): Move definitions to configure.
9694
af6e839f
GM
9695 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9696 We include usg5-4-common.h, which defines them both.
9697
40289a12
GM
9698 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9699 O_RDONLY already includes it).
9700
9e059e3f
GM
9701 Stop ns builds setting the EMACSLOADPATH environment variable.
9702 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9703 Now it does not set EMACSLOADPATH, just returns the load-path string.
9704 * nsterm.h: Update accordingly.
9705 * lread.c [HAVE_NS]: Include nsterm.h.
9706 (init_lread) [HAVE_NS]: Use ns_load_path.
9707 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9708
7c4e8ec0
GM
97092012-07-09 Glenn Morris <rgm@gnu.org>
9710
d4f600ff
GM
9711 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9712 since the included bsd-common.h does so.
9713
cbb31951
GM
9714 Stop ns builds setting the EMACSPATH environment variable.
9715 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9716 (ns_init_paths): Do not set EMACSPATH.
9717 * nsterm.h (ns_exec_path): Add it.
9718 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9719 Use ns_exec_path.
9720
7c4e8ec0
GM
9721 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9722
26bccfae
PE
97232012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9724
a0bee46f
PE
9725 * process.c (wait_reading_process_output): 'waitchannels' was unset
9726 when read_kbd || !NILP (wait_for_cell); fix this.
9727
5994c183
PE
9728 Add GCC-style 'const' attribute to functions that can use it.
9729 * character.h (char_resolve_modifier_mask):
9730 * keyboard.h (make_ctrl_char):
9731 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9732 (init_character_once, next_almost_prime, init_fns, init_image)
9733 (flush_pending_output, init_sound):
9734 * mem-limits.h (start_of_data):
9735 * menu.h (finish_menu_items):
9736 Add ATTRIBUTE_CONST.
9737 * emacs.c (DEFINE_DUMMY_FUNCTION):
9738 Declare the dummy function with ATTRIBUTE_CONST.
9739 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9740 Add decls with ATTRIBUTE_CONST.
9741
26bccfae
PE
9742 Minor improvements to make_formatted_string.
9743 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9744 where int is good enough, as vsprintf returns an int.
9745 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9746
a8290ec3
DA
97472012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9748
9749 Use make_formatted_string to avoid double length calculation.
9750 * lisp.h (make_formatted_string): New prototype.
9751 * alloc.c (make_formatted_string): New function.
9752 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 9753 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
9754 * editfns.c (Fcurrent_time_zone): Likewise.
9755 * filelock.c (get_boot_time): Likewise.
9756 * frame.c (make_terminal_frame, set_term_frame_name)
9757 (x_report_frame_params): Likewise.
9758 * image.c (gs_load): Likewise.
9759 * minibuf.c (get_minibuffer): Likewise.
9760 * msdos.c (dos_set_window_size): Likewise.
9761 * process.c (make_process): Likewise.
9762 * xdisp.c (ensure_echo_area_buffers): Likewise.
9763 * xsettings.c (apply_xft_settings): Likewise.
9764
d01ba2f1
GM
97652012-07-09 Glenn Morris <rgm@gnu.org>
9766
9767 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9768 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9769 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9770 * nsterm.h (ns_etc_directory): Add it.
9771 * callproc.c [HAVE_NS]: Include nsterm.h.
9772 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9773
f1f924b6
DA
97742012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9775
9776 Move marker debugging code under MARKER_DEBUG.
9777 * marker.c (MARKER_DEBUG): Move marker debugging code under
9778 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9779 for bootstrap with --enable-checking (~3x slowdown reported
9780 by Juanma Barranquero <lekktu@gmail.com>).
9781 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9782
ab531b66
PE
97832012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9784
9785 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9786 See <http://bugs.gnu.org/11825#29>.
9787
c4b3bc8a
EZ
97882012-07-08 Eli Zaretskii <eliz@gnu.org>
9789
9790 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9791 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
9792 (display_line): Add commentary about displaying truncation glyphs
9793 on GUI frames.
9794 (produce_special_glyphs): Move here from term.c.
9795
9796 * term.c (produce_special_glyphs): Move to xdisp.c.
9797
9798 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9799 section.
c4b3bc8a 9800
b676b881
AS
98012012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9802
f17c5273
AS
9803 * xdisp.c (display_line): Avoid warning about implicit declaration
9804 of FRAME_FONT.
9805
298819b9
AS
9806 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9807
b676b881
AS
9808 * lisp.h: Remove empty conditional.
9809
6045c4fd
PE
98102012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9811
b3350bf9
PE
9812 * lread.c (load_path_check): Now static.
9813
6045c4fd
PE
9814 Fix some minor --with-ns problems found by static checking.
9815 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9816 (x_set_font) [!HAVE_X_WINDOWS]:
9817 * image.c (xpm_load_image) [HAVE_NS]:
9818 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9819 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9820 Remove unused local.
9821 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9822 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9823 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9824 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9825 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9826 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9827 Fix pointer signedness problem.
9828 * xfaces.c (FRAME_X_FONT_TABLE):
9829 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9830
929e7845
GM
98312012-07-07 Glenn Morris <rgm@gnu.org>
9832
9833 * lread.c (load_path_check): New function, split from init_lread.
9834 (init_lread): Reorganize. Motivation:
9835 If EMACSLOADPATH is set, check/warn about that rather than the
9836 defaults, which we are not going to use. Hence we can remove
9837 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9838 Don't warn if site-lisp directories are missing.
9839 If not installed, start from a blank load-path, since
9840 PATH_LOADSEARCH refers to the eventual installation directories.
9841
58dd0aa4
EZ
98422012-07-07 Eli Zaretskii <eliz@gnu.org>
9843
9844 Support truncation and continuation glyphs on GUI frames, when
9845 fringes are disabled. (Bug#11832)
9846 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
9847 continuation glyphs even if on GUI frames.
9848 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
9849 or both, are absent.
9850 (start_display, move_it_in_display_line_to): Handle the case of a
9851 GUI frame without a fringe to display continuation or truncation
9852 glyphs.
9853 (insert_left_trunc_glyphs): Support GUI frames: make sure
9854 truncation glyphs overwrite enough glyphs from the current line to
9855 have sufficient space in pixels.
9856 (display_line): Support truncation and continuation glyphs on GUI
9857 frames. If some spare pixels are left on the line after inserting
9858 the truncation glyphs, fill that space with a stretch glyph of a
9859 suitably computed width.
9860
9861 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9862 produce_glyphs, to support GUI sessions.
9863
31571fd7
PE
98642012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9865
5a16b9bc
PE
9866 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9867
f3047c75
PE
9868 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9869
31571fd7
PE
9870 Do not require float-time's arg to fit in time_t (Bug#11825).
9871 This works better on hosts where time_t is unsigned, and where
9872 float-time is applied to the (negative) difference between two times.
9873 * editfns.c (decode_time_components): Last arg is now double *,
9874 not int *, and means to store all the result as a double, without
9875 worrying about whether the seconds part fits in time_t.
9876 All callers changed.
9877 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9878 All callers changed.
9879 (Ffloat_time): Do not fail merely because the specified time falls
9880 outside of time_t range.
9881
4516fbef
GM
98822012-07-07 Glenn Morris <rgm@gnu.org>
9883
9884 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9885 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9886 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9887
07adc2c6
JB
98882012-07-07 Juanma Barranquero <lekktu@gmail.com>
9889
9890 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9891 Update dependencies.
9892
9893 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9894
fd573f31
PE
98952012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9896
fee5959d
PE
9897 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9898 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9899 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9900 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9901 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9902 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9903
fd573f31
PE
9904 * xfont.c (compare_font_names): Redo to omit the need for casts.
9905
ddadbc0e
AS
99062012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9907
fca8d6b6
AS
9908 * xfns.c (Fx_change_window_property): Doc fix.
9909 * w32fns.c (Fx_change_window_property): Doc fix.
9910
ddadbc0e
AS
9911 * w32fns.c (Fx_window_property): Accept the same arguments as the
9912 X Windows version. Doc fix.
9913 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9914
ed9265fc 99152012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
9916 Eli Zaretskii <eliz@gnu.org>
9917
9918 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9919 Windows-specific code from nt/config.nt moved here.
9920 Obsolete settings removed.
9921
216ee680
PE
99222012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 * process.c: Avoid unnecessary calls to gettime.
9925 (wait_reading_process_output): Don't get the time of day
9926 when gobbling data immediately and not waiting, as there's no need
9927 for it in that case. This removes a FIXME.
9928
bdd091e4
JD
99292012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9930
9931 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9932 is defined (Bug#11768).
9933
9d44f8ce
DA
99342012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9935
9936 Fix marker debugging code.
9937 * marker.c (byte_char_debug_check): Do not perform the check
9938 if buffer is not multibyte.
090bd7cb
JB
9939 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9940 Call byte_char_debug_check with correct arguments.
9d44f8ce 9941
90fc4786
DA
99422012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9943
9944 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
9945 * marker.c (byte_char_debug_check, count_markers):
9946 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
9947 (byte_debug_flag): Remove.
9948 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9949 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
9950
7b7ae965
DA
99512012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9952
4e57b342
DA
9953 Avoid code repetition in marker-related functions.
9954 * marker.c (attach_marker): New function.
9955 (Fset_marker, set_marker_restricted, set_marker_both)
9956 (set_marker_restricted_both): Use it.
9957 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
9958 Consistently rename charno to charpos.
9959 (marker_position): Add eassert.
9960 (marker_byte_position): Convert to eassert.
9961
99622012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9963
9964 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 9965 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 9966 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 9967
657924ff
DA
99682012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9969
9970 Introduce fast path for the widely used marker operation.
9971 * alloc.c (build_marker): New function.
9972 * lisp.h (build_marker): New prototype.
9973 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
9974 * composite.c (autocmp_chars): Likewise.
9975 * editfns.c (buildmark): Remove.
9976 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
9977 (save_restriction_save): Use build_marker.
9978 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
9979 * window.c (save_window_save): Likewise.
9980
041a49a6
DA
99812012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9982
9983 Do not use Fdelete_overlay in delete_all_overlays
9984 to avoid redundant calls to unchain_overlay.
9985 * buffer.c (drop_overlay): New function.
9986 (delete_all_overlays, Fdelete_overlay): Use it.
9987 * minibuf.c (get_minibuffer): Fix comment.
9988
7dca65a4
PE
99892012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9990
9991 Port to OpenBSD 5.1 amd64.
9992 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
9993 This is needed for OpenBSD, and should be harmless on all BSD systems.
9994 Also, include <sys/sysctl.h>, as it should be available on all
9995 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
9996 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
9997 use p_pid member, not kp_proc.pid.
9998
8eb876e2
GM
99992012-07-06 Glenn Morris <rgm@gnu.org>
10000
10001 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10002
38182d90
PE
100032012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10004
10005 More xmalloc and related cleanup.
10006 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10007 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10008 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10009 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10010 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10011 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10012 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10013 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10014 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10015 * xterm.c:
10016 Omit needless casts involving void * pointers and allocation.
10017 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10018 as the former is more robust if P's type is changed.
10019 Prefer xzalloc to xmalloc + memset 0.
10020 Simplify malloc-or-realloc to realloc.
10021 Don't worry about xmalloc returning a null pointer.
10022 Prefer xstrdup to xmalloc + strcpy.
10023 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10024 growing it.
10025 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10026 alloca of a constant.
10027
6dd5a677
EZ
100282012-07-05 Eli Zaretskii <eliz@gnu.org>
10029
10030 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10031 hscroll is larger than the line width. Fixes long and futile
10032 looping inside extend_face_to_end_of_line (on a TTY) producing
10033 glyphs that are not needed and thrown away.
10034
6b312f0f
DA
100352012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10036
10037 * marker.c (set_marker_restricted_both): Simplify by using
10038 clip_to_bounds.
10039
f520ef9b
PE
100402012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10041
10042 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10043
383b7c95
JD
100442012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10045
10046 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10047 not defined (Bug#11768).
10048 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10049 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10050 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10051 followed by gtk_box_set_homogeneous (Bug#11768).
10052 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
10053 (update_theme_scrollbar_width, xg_create_scroll_bar):
10054 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
10055 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10056 (is_box_type): New function (Bug#11768).
10057 (xg_tool_item_stale_p): Call is_box_type.
5293d758 10058 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
10059 with default display (Bug#11768).
10060
d6e7bf45
EZ
100612012-07-05 Eli Zaretskii <eliz@gnu.org>
10062
10063 * xdisp.c (window_hscroll_limited): New function.
10064 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10065 coordinates when window's hscroll is set to insanely large
10066 values. (Bug#11857)
10067
431391ec
JB
100682012-07-05 Juanma Barranquero <lekktu@gmail.com>
10069
10070 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10071 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10072
23f86fce
DA
100732012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10074
10075 Cleanup xmalloc.
10076 * lisp.h (xzalloc): New prototype. Omit needless casts.
10077 * alloc.c (xzalloc): New function. Omit needless casts.
10078 * charset.c: Omit needless casts. Convert all calls to
10079 xmalloc with following memset to xzalloc.
10080 * dispnew.c: Likewise.
10081 * fringe.c: Likewise.
10082 * image.c: Likewise.
10083 * sound.c: Likewise.
10084 * term.c: Likewise.
10085 * w32fns.c: Likewise.
10086 * w32font.c: Likewise.
10087 * w32term.c: Likewise.
10088 * xfaces.c: Likewise.
10089 * xfns.c: Likewise.
10090 * xterm.c: Likewise.
10091 * atimer.c: Omit needless casts.
10092 * buffer.c: Likewise.
10093 * callproc.c: Likewise.
10094 * ccl.c: Likewise.
10095 * coding.c: Likewise.
10096 * composite.c: Likewise.
10097 * doc.c: Likewise.
10098 * doprnt.c: Likewise.
10099 * editfns.c: Likewise.
10100 * emacs.c: Likewise.
10101 * eval.c: Likewise.
10102 * filelock.c: Likewise.
10103 * fns.c: Likewise.
10104 * gtkutil.c: Likewise.
10105 * keyboard.c: Likewise.
10106 * lisp.h: Likewise.
10107 * lread.c: Likewise.
10108 * minibuf.c: Likewise.
10109 * msdos.c: Likewise.
10110 * print.c: Likewise.
10111 * process.c: Likewise.
10112 * region-cache.c: Likewise.
10113 * search.c: Likewise.
10114 * sysdep.c: Likewise.
10115 * termcap.c: Likewise.
10116 * terminal.c: Likewise.
10117 * tparam.c: Likewise.
10118 * w16select.c: Likewise.
10119 * w32.c: Likewise.
10120 * w32reg.c: Likewise.
10121 * w32select.c: Likewise.
10122 * w32uniscribe.c: Likewise.
10123 * widget.c: Likewise.
10124 * xdisp.c: Likewise.
10125 * xmenu.c: Likewise.
10126 * xrdb.c: Likewise.
10127 * xselect.c: Likewise.
10128
0497dc44
PE
101292012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10130
10131 * fileio.c (time_error_value): Check the right error number.
10132 Problem reported by Troels Nielsen in
10133 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10134
356e7178
PE
101352012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10136
4e71fd89
PE
10137 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10138 This should be fixed in a better way; see Eli Zaretskii in
10139 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10140 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10141
f0941253
PE
10142 * fileio.c (time_error_value): Rename from special_mtime.
10143 The old name's problems were noted by Eli Zaretskii in
10144 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10145
065c9eb4
PE
10146 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10147 This variable's comment says Emacs needs at least one GDB-visible
10148 symbol of type enum pvec_type, to work around GDB problems.
10149 The symbol's value doesn't matter.
10150
356e7178
PE
10151 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10152 that causes compilation to fail on pre-C99 compilers.
10153
ed9265fc 101542012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
10155
10156 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10157 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10158
3884d954
DA
101592012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10160
d209e2fb 10161 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
10162 headers for buffer_defaults and buffer_local_symbols.
10163 Reported by Juanma Barranquero <lekktu@gmail.com>.
10164
ee28be33
SM
101652012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10166
10167 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10168 * lisp.h (enum pvec_type): Use fewer bits.
10169 (PSEUDOVECTOR_SIZE_BITS): New constant.
10170 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10171 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10172 change in pvec_type.
10173 (PSEUDOVECTOR_TYPEP): New macro.
10174 (TYPED_PSEUDOVECTORP): Use it.
10175 * fns.c (internal_equal): Adapt code to extract pvectype.
10176 * emacs.c (gdb_pvec_type): Update type.
10177 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10178 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10179 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10180 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10181 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10182 abusing vector->header.next.nbytes.
10183 (live_vector_p): Use PVEC_TYPE.
10184 (mark_object): Adapt code to extract pvectype. Use switch.
10185
c7f2cd7f
PE
101862012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10187
10188 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10189 Tighten new eassert a bit.
10190
8ce70ed2
DA
101912012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10192
10193 Fix compilation with --enable-gcc-warnings and -O1
10194 optimization level.
10195 * doprnt.c (doprnt): Change type of tem to int, initialize
10196 to avoid compiler warning. Add eassert.
10197 * search.c (simple_search): Initialize match_byte to avoid
10198 compiler warning. Add eassert.
10199
dea7f1e5
PE
102002012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10201
24a212eb
PE
10202 Avoid weird behavior with large horizontal scrolls.
10203 Without this change, for example, large hscroll values would
10204 mess up Emacs's display on Fedora 15 x86, presumably due to
10205 overflows in int calculations in the display code.
10206 Also, if buffers had long lines, Emacs would freeze.
10207 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10208 (set_window_hscroll): New function, containing the old guts of
10209 Fset_window_hscroll. Return the clipped value.
10210 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10211 This avoids the need to check against PTRDIFF_MAX.
10212
dea7f1e5
PE
10213 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10214
76046526
DA
102152012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10216
10217 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10218
39adff0d
PE
102192012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10220
63807d47
PE
10221 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10222 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10223 since GCC 4.4.6 issues a bogus warning for them.
10224
39adff0d
PE
10225 Fix bugs in file timestamp newness comparisons.
10226 * fileio.c (Ffile_newer_than_file_p):
10227 * lread.c (Fload): Use full timestamp resolution of files,
10228 not just the 1-second resolution, so that files that are only
10229 slightly newer still count as newer.
10230 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10231 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10232
dbeed9a6
PE
102332012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10234
10235 * fileio.c: Improve handling of file time marker. (Bug#11852)
10236 (special_mtime): New function.
10237 (Finsert_file_contents, Fverify_visited_file_modtime):
10238 Use it to set special mtime values consistently.
10239
636334d6
AS
102402012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10241
10242 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10243 marker for non-existing file. (Bug#11852)
10244
e2017fe2
GM
102452012-07-03 Glenn Morris <rgm@gnu.org>
10246
10247 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10248 and did not make it into globals.h).
10249
404dbd37
TT
102502012-07-03 Tom Tromey <tromey@redhat.com>
10251
10252 * window.c (Fset_window_margins, Fset_window_fringes)
10253 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10254 * textprop.c (Fprevious_property_change): No longer static.
10255 * syntax.c (Fsyntax_table_p): No longer static.
10256 * process.c (Fget_process, Fprocess_datagram_address): No longer
10257 static.
10258 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10259 * keyboard.c (Fcommand_execute): No longer static.
10260 Remove EXFUN.
10261 * insdel.c (Fcombine_after_change_execute): No longer static.
10262 * image.c (Finit_image_library): No longer static.
10263 * fileio.c (Fmake_symbolic_link): No longer static.
10264 * eval.c (Ffetch_bytecode): No longer static.
10265 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
10266 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10267 No longer static.
404dbd37
TT
10268 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10269 static.
10270 * dired.c (Ffile_attributes): No longer static.
10271 * composite.c (Fcomposition_get_gstring): No longer static.
10272 * callproc.c (Fgetenv_internal): No longer static.
10273
10274 * ccl.h: Remove EXFUNs.
10275 * buffer.h: Remove EXFUNs.
10276 * dispextern.h: Remove EXFUNs.
10277 * intervals.h: Remove EXFUNs.
10278 * fontset.h: Remove EXFUN.
10279 * font.h: Remove EXFUNs.
10280 * dosfns.c (system_process_attributes): Remove EXFUN.
10281 * keymap.h: Remove EXFUNs.
10282 * lisp.h: Remove EXFUNs.
10283 * w32term.h: Remove EXFUNs.
10284 * window.h: Remove EXFUNs.
10285 * xsettings.h: Remove EXFUN.
10286 * xterm.h: Remove EXFUN.
10287
8e4fd1e1
GM
102882012-07-03 Glenn Morris <rgm@gnu.org>
10289
10290 * lisp.h (Frandom): Make it visible to C.
10291 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10292 buffer for invisible buffers. (Bug#1229)
10293
ca95b3eb
DA
102942012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10295
10296 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10297 values which aren't power of 2.
14ae4239 10298 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 10299 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
10300 accordingly.
10301
7555c33f
SM
103022012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10303
10304 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10305
10306 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10307
d12e8f5a
DA
103082012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10309
10310 * alloc.c (allocate_vector_block): Remove redundant
10311 calls to mallopt if DOUG_LEA_MALLOC is defined.
10312 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10313 avoid calls to mallopt if zero_vector is returned.
10314
296094c3
DA
103152012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10316
10317 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10318 is enabled, avoid dereferencing NULL current_sblock if
10319 running undumped.
10320
36429c89
DA
103212012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10322
10323 Cleanup basic buffer management.
10324 * buffer.h (struct buffer): Change layout to use generic vector
10325 marking code. Fix some comments. Change type of 'clip_changed'
10326 to bitfield. Remove unused #ifndef old.
10327 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10328 (GET_OVERLAYS_AT): Fix indentation.
10329 (for_each_per_buffer_object_at): New macro.
10330 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10331 (Fbuffer_local_variables): Use it.
10332 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10333 * alloc.c (allocate_buffer): Adjust to match new layout of
10334 struct buffer. Fix comment.
10335 (mark_overlay): New function.
10336 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10337 Lisp area of struct buffer.
10338 (mark_object): Use it. Adjust marking of misc objects
10339 and related comments.
10340
3b3e4cac
PE
103412012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10342
10343 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10344 wrapper that is not needed because the wrapped code is a no-op (zero
10345 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10346 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10347
cf5c0175
DA
103482012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10349
10350 * alloc.c (mark_buffer): Simplify. Remove prototype.
10351 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10352 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10353 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10354 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10355
ca26824c
GM
103562012-06-30 Glenn Morris <rgm@gnu.org>
10357
2e4c5312
GM
10358 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10359
ca26824c
GM
10360 * epaths.in (PATH_SITELOADSEARCH): New.
10361 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10362 This is rather than relying on --enable-locallisppath elements
10363 having "site-lisp" in their names. (Bug#10208#25, 11658)
10364
0d23c240
EZ
103652012-06-30 Eli Zaretskii <eliz@gnu.org>
10366
c9240d7a
EZ
10367 * w32proc.c (sys_select): Accept and ignore one more argument.
10368
10369 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10370
0d23c240 10371 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 10372 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
10373
10374 * sysdep.c: Don't include dos.h and dosfns.h.
10375
10376 * process.c (sys_select):
10377 * msdos.c (sys_select): Accept one more argument and ignore it.
10378
10379 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10380 adapt data types and code to that.
10381
10382 * dosfns.c:
10383 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10384 which clashes with the gnulib function of the same name.
10385
af5a5a98
AS
103862012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10387
c5e4379c
AS
10388 * font.c (font_style_to_value, font_style_symbolic)
10389 (font_prop_validate_style): Add type checks for values in
10390 font_style_table.
10391
af5a5a98
AS
10392 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10393 argument.
10394 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10395 uses.
10396
8d38f461
EZ
103972012-06-29 Eli Zaretskii <eliz@gnu.org>
10398
2e5a6631
EZ
10399 * xdisp.c (try_window_id): Undo last change.
10400
8d38f461
EZ
10401 * w32.c (getwd): Adjust commentary about startup_dir.
10402 (init_environment): Always call sys_access, even in non-MSVC
10403 builds. Don't chdir to the directory of the Emacs executable.
10404 This undoes code from 1997 which was justified by the need to
10405 "avoid conflicts when removing and renaming directories". But its
10406 downside was that every relative file name was being interpreted
10407 relative to the directory of the Emacs executable, which can never
10408 be TRT. In particular, it broke sys_access when called with
10409 relative file names.
10410 (sys_access): Map GetLastError to errno.
10411
2af3565e
DA
104122012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10413
10414 * window.h (struct window): Change type of 'fringes_outside_margins'
10415 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 10416 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
10417 Adjust comment.
10418 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10419 to ptrdiff_t.
10420
c8d3a25c 104212012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 10422
c8d3a25c
GM
10423 * gnutls.c (emacs_gnutls_handshake):
10424 Add QUIT to make the loop interruptible.
57570cd3 10425
c8d3a25c 104262012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 10427
c8d3a25c
GM
10428 * charset.c (init_charset): Make lack of etc/charsets fatal.
10429
3e984ee8
DA
104302012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10431
10432 * editfns.c (region_limit): Fix type mismatch.
10433
ef884f23
DA
104342012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10435
10436 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10437 undefined. Convert from xassert to eassert.
10438 * nsmenu.m: Convert from xassert to eassert.
10439 * nsterm.m: Likewise.
10440
7d7e0027
SM
104412012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10442
10443 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10444
aa754e6a
PE
104452012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10446
10447 Avoid integer overflow on scroll-left and scroll-right.
10448 * window.c (HSCROLL_MAX): New macro.
10449 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10450 overflow when requested scroll falls outside ptrdiff_t range.
10451
80b00b08
DA
104522012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10453
10454 * window.h (struct window): Change type of 'hscroll',
10455 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10456 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10457 Adjust users accordingly.
10458 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10459 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10460 from EMACS_INT to ptrdiff_t.
10461 (make_window): Omit redundant initialization.
10462
62b2bcf6
JB
104632012-06-28 Juanma Barranquero <lekktu@gmail.com>
10464
10465 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10466
45942c7d
DA
104672012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10468
10469 * window.h (struct window): Change type of 'use_time' and
10470 'sequence_number' from Lisp_Object to int.
10471 * frame.c (make_frame): Adjust users accordingly.
10472 * print.c (print_object): Likewise.
10473 * window.c (select_window, Fwindow_use_time, make_parent_window)
10474 (make_window): Likewise.
10475
e509cfa6
DA
104762012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10477
10478 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10479 enabled with --enable-checking=[all,glyphs] configure option.
10480 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10481 adjust comments accordingly.
10482 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10483 undefined, adjust comments accordingly.
10484 * image.c: Likewise.
10485 * scroll.c: Likewise.
10486 * w32fns.c: Likewise.
10487 * w32term.c: Likewise.
10488 * xdisp.c: Likewise.
10489 * xfaces.c: Likewise.
10490 * xfns.c: Likewise.
10491 * xterm.c: Likewise.
10492
a54e2c05
DA
104932012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10494
10495 Generalize run-time debugging checks.
10496 * dispextern.h (XASSERTS): Remove.
10497 * fontset.c (xassert): Remove.
10498 Convert from xassert to eassert.
10499 * alloc.c: Convert from xassert to eassert.
10500 * bidi.c: Likewise.
10501 * dispnew.c: Likewise.
10502 * fns.c: Likewise.
10503 * fringe.c: Likewise.
10504 * ftfont.c: Likewise.
10505 * gtkutil.c: Likewise.
10506 * image.c: Likewise.
10507 * keyboard.c: Likewise.
10508 * menu.c: Likewise.
10509 * process.c: Likewise.
10510 * scroll.c: Likewise.
10511 * sound.c: Likewise.
10512 * term.c: Likewise.
10513 * w32console.c: Likewise.
10514 * w32fns.c: Likewise.
10515 * w32term.c: Likewise.
10516 * window.c: Likewise.
10517 * xdisp.c: Likewise.
10518 * xfaces.c: Likewise.
10519 * xfns.c: Likewise.
10520 * xselect.c: Likewise.
10521 * xterm.c: Likewise.
10522
1ec4b7b2
SM
105232012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10524
10525 * fns.c (maybe_resize_hash_table): Output message when growing the
10526 purify-hashtable.
10527
2014308a
DA
105282012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10529
10530 * alloc.c (allocate_string_data): Remove dead code.
10531 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10532 avoid GCC warning about unused macro.
10533
246155eb
DA
105342012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10535
10536 * alloc.c (allocate_string): Omit intervals initialization.
10537 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10538 as in make_pure_string and make_pure_c_string.
10539
43184b7b
DA
105402012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10541
d209e2fb 10542 * alloc.c (allocate_string): Fix last change.
43184b7b 10543
3fe6dd74
DA
105442012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10545
d209e2fb 10546 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
10547 to memset, add explicit initialization where appropriate.
10548
1ba6038a
GM
105492012-06-27 Glenn Morris <rgm@gnu.org>
10550
10551 * lisp.mk (lisp): Remove paths.elc.
10552
c89926a5
CY
105532012-06-27 Chong Yidong <cyd@gnu.org>
10554
10555 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10556
ed6b3510
JW
105572012-06-26 John Wiegley <johnw@newartisans.com>
10558
1ec4b7b2 10559 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
10560 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10561
ed6b3510
JW
10562 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10563 when building with Clang.
10564
8edd4a2b
SM
105652012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10566
10567 * eval.c (Fapply): Allow calling it with a single argument.
10568
f6f62d1b
EZ
105692012-06-26 Eli Zaretskii <eliz@gnu.org>
10570
10571 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10572 _stricmp and _strnicmp.
10573 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10574
62efea5e
DA
105752012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10576
10577 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10578 allocated window.
10579 (allocate_process): Likewise for new process.
8edd4a2b 10580 (allocate_terminal): Change to use offsetof.
62efea5e
DA
10581 (allocate_frame): Likewise.
10582 * frame.c (make_frame): Omit redundant initialization.
10583 * window.c (make_parent_window): Use memset.
10584 (make_window): Omit redundant initialization.
10585 * process.c (make_process): Omit redundant initialization.
10586 * terminal.c (create_terminal): Likewise.
10587
42997f4d
DA
105882012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10589
10590 * term.c (delete_tty): Remove redundant call to memset.
10591
1130ecfc
DA
105922012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10593
10594 * alloc.c: Remove build_string.
10595 * lisp.h: Define build_string as static inline. This provides
10596 a better opportunity to optimize away calls to strlen when the
10597 function is called with compile-time constant argument.
10598 * image.c (imagemagick_error): Convert to build_string.
10599 * w32proc.c (sys_spawnve): Likewise.
10600 * xterm.c (x_term_init): Likewise.
10601
cf38a720
PE
106022012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10603
99027bdd
PE
10604 Use sprintf return value instead of invoking strlen on result.
10605 In the old days this wasn't portable, since some sprintf
10606 implementations returned char *. But they died out years ago and
10607 Emacs already assumes sprintf returns int.
10608 Similarly for float_to_string.
10609 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10610 * ccl.c (ccl_driver):
10611 * character.c (string_escape_byte8):
10612 * data.c (Fnumber_to_string):
10613 * doprnt.c (doprnt):
10614 * print.c (print_object):
10615 * xdisp.c (message_dolog):
10616 * xfns.c (syms_of_xfns):
10617 Use sprintf or float_to_string result to avoid need to call strlen.
10618 * data.c (Fnumber_to_string):
10619 Use make_unibyte_string, since the string must be ASCII.
10620 * lisp.h, print.c (float_to_string): Now returns int length.
10621 * term.c (produce_glyphless_glyph):
10622 Use sprintf result rather than recomputing it.
10623
cf38a720
PE
10624 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10625 * Makefile.in (ALL_CFLAGS):
10626 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10627 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10628
3511c784
DA
106292012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10630
0a08eb21 10631 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
10632 strcasecmp if available.
10633 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10634
fb7da12e
AS
106352012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10636
10637 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10638 Avoid comma operator.
10639 * menu.c (push_submenu_start, push_submenu_end)
10640 (push_left_right_boundary, push_menu_pane): Likewise.
10641 * msdos.c (dos_rawgetc): Likewise.
10642
afa2ffd8
DA
106432012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10644
10645 * xfns.c (xic_create_fontsetname): Remove redundant calls
10646 to memset.
10647
b3b4476b
PE
106482012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10649
4495ff38
PE
10650 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10651 sprintf already null-terminates its output.
10652
b3b4476b
PE
10653 * xfns.c (x_window): Remove redundant cast.
10654
b00876c9
DA
106552012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10656
10657 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10658 `const char *' to `char *' to avoid compiler warning.
10659
d188e26b
PE
106602012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10661
885d1d74
PE
10662 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10663 instead of truncating it to 63 (admittedly a generous limit).
10664
d188e26b
PE
10665 * process.c: Fix spelling and caps in comments.
10666
e2f560b1
DN
106672012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10668
e86db54b 10669 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10670 * sysdep.c (setpgrp): Remove definition, not used in this file.
10671
7583a3a1
JB
106722012-06-24 Juanma Barranquero <lekktu@gmail.com>
10673
10674 * makefile.w32-in: Update dependencies.
10675
696056c2
EZ
106762012-06-24 Eli Zaretskii <eliz@gnu.org>
10677
10678 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10679 (SYSTIME_H): Add nt/inc/sys/time.h.
10680
10681 * systime.h [WINDOWSNT]: Include sys/time.h.
10682
10683 * s/ms-w32.h (struct timespec): Definition moved from
10684 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10685
845ca893
PE
106862012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10687
10688 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10689 * buffer.h (buffer_slot_type_mismatch):
10690 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10691 * eval.c (unwind_to_catch):
10692 * image.c (my_png_error, my_error_exit):
10693 * keyboard.c (quit_throw_to_read_char, user_error)
10694 (Fexit_recursive_edit, Fabort_recursive_edit):
10695 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10696 (wrong_type_argument, buffer_overflow, __executable_start)
10697 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10698 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10699 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10700 (fatal):
10701 (child_setup) [!DOS_NT]:
10702 * lread.c (end_of_file_error, invalid_syntax):
10703 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10704 * puresize.h (pure_write_error):
10705 * search.c (matcher_overflow):
10706 * sound.c (sound_perror, alsa_sound_perror):
10707 * sysdep.c, syssignal.h (croak):
10708 * term.c (maybe_fatal, vfatal):
10709 * textprop.c (text_read_only):
10710 * undo.c (user_error):
10711 * unexmacosx.c (unexec_error):
10712 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10713 Use _Noreturn rather than NO_RETURN.
10714 No need for separate decl merely because of _Noreturn.
10715 * sound.c (sound_warning, parse_sound):
10716 Remove unnecessary forward decls.
10717
f1dd8073
PE
107182012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10719
10720 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10721 * lisp.h (WAIT_READING_MAX): New macro.
10722 * dispnew.c (Fsleep_for, sit_for):
10723 * keyboard.c (kbd_buffer_get_event):
10724 * process.c (Faccept_process_output):
10725 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10726 This improves on the previous patch, which introduced a bug
10727 when time_t is unsigned and as wide as intmax_t.
10728 See <http://bugs.gnu.org/9000#51>.
10729
b82c1755
EZ
107302012-06-23 Eli Zaretskii <eliz@gnu.org>
10731
10732 * dispnew.c (sit_for, Fsleep_for):
10733 * keyboard.c (kbd_buffer_get_event):
10734 * process.c (Faccept_process_output): Avoid compiler warnings when
10735 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10736
ca300656
JB
107372012-06-23 Juanma Barranquero <lekktu@gmail.com>
10738
049ec95b
JB
10739 * makefile.w32-in: Update dependencies.
10740
ca300656
JB
10741 * w32.c (ltime): Add return type and declare static.
10742 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10743
db7b8d06
PE
107442012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10745
10746 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10747 Privately reported by Herbert J. Skuhra.
10748 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10749 All uses changed.
10750 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10751 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10752
0bd8297f
EZ
107532012-06-23 Eli Zaretskii <eliz@gnu.org>
10754
96512555
EZ
10755 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10756 last argument of make_unibyte_string.
10757
0bd8297f
EZ
10758 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10759 language ID in the event parameters.
10760
10761 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10762 event.code, not the obscure "character set ID".
10763
63def6b6
CY
107642012-06-23 Chong Yidong <cyd@gnu.org>
10765
10766 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10767
e8a02204
EZ
107682012-06-23 Eli Zaretskii <eliz@gnu.org>
10769
388cdec0
EZ
10770 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10771 * w32.c (fdutimens): New function.
10772
10773 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10774
10775 * s/ms-w32.h (pselect): Redirect to sys_select.
10776
10777 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10778
e8a02204
EZ
10779 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10780 in the logic of incrementing and decrementing the value of
10781 use_relocatable_buffers.
10782
d054f3fb
PE
107832012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10784
10785 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10786 Privately reported by Herbert J. Skuhra.
10787 [__FreeBSD__]: Remove "*/" typo after "#include".
10788 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10789 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10790 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10791 Don't assume EMACS_TIME and struct timeval are the same type.
10792
d35af63c
PE
107932012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10794
10795 Support higher-resolution time stamps (Bug#9000).
10796 The time stamps are only nanosecond-resolution at the C level,
10797 since that's the best that any real-world system supports now.
10798 But they are picosecond-resolution at the Lisp level, as that's
10799 easy, and leaves room for future OS improvements.
10800
10801 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10802 (LIBES): Use it.
10803
10804 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10805 Don't get current time unless it's needed.
10806
10807 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10808 now provides it if it's absent.
10809 (start_atimer): Port to higher-res time stamps.
10810 Check for time stamp overflow. Don't get current time more
10811 often than is needed.
10812
10813 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10814 Include systime.h, not time.h.
10815 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10816
10817 * dired.c: Include stat-time.h.
10818 (Ffile-attributes): File times now have higher resolution.
10819
10820 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10821 (struct image): Timestamp now has higher resolution.
10822
10823 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10824 has at least microseconds now. All uses removed.
10825 (update_frame, update_single_window, update_window, update_frame_1)
10826 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 10827 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
10828
10829 * editfns.c (time_overflow): Now extern.
10830 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10831 (float-time, Fformat_time_string, Fcurrent_time_string)
10832 (Fcurrent_time_zone): Accept and generate higher-resolution
10833 time stamps.
10834 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10835 (decode_time_components, lisp_seconds_argument): New functions.
10836 (make_time): Now static.
10837 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10838 Report an error if the time is invalid, rather than having the caller
10839 do that.
10840
10841 * fileio.c: Include <stat-time.h>
10842 (Fcopy_file): Copy higher-resolution time stamps.
10843 Prefer to set the time stamp via a file descriptor if that works.
10844 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10845 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10846 (Fvisited_file_modtime, Fset_visited_file_modtime):
10847 Support higher-resolution time stamps.
10848
10849 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10850
10851 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10852
10853 * image.c (prepare_image_for_display, clear_image_cache)
10854 (lookup_image): Port to higer-resolution time stamps.
10855
10856 * keyboard.c (start_polling, bind_polling_period):
10857 Check for time stamp overflow.
10858 (read_char, kbd_buffer_get_event, timer_start_idle)
10859 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10860 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10861 Port to higher-resolution time stamps. Do not assume time_t is signed.
10862 (decode_timer): New function. Timers are now vectors of length 9,
10863 not 8, to accommodate the picosecond component.
10864 (timer_check_2): Use it.
10865
10866 * nsterm.m (select_timeout, timeval_subtract): Remove.
10867 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10868 as they're a bit more accurate and handle overflow better.
10869 (ns_select): Change prototype to be compatible with pselect.
10870 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10871 * nsterm.h (ns_select): Adjust prototype.
10872
10873 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10874 us-resolution time stamps.
10875 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10876
10877 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10878
10879 * lisp.h (time_overflow): New decl.
10880 (wait_reading_process_output): First arg is now intmax_t, not int,
10881 to accommodate larger waits.
10882
10883 * process.h (struct Lisp_Process.read_output_delay):
10884 Now counts nanoseconds, not microseconds.
10885 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10886 EMACS_HAS_USECS.
10887 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10888 (wait_reading_process_output):
10889 Port to ns-resolution time stamps.
10890 (Faccept_process_output, wait_reading_process_output):
10891 Check for time stamp overflow. Do not assume time_t is signed.
10892 (select_wrapper): Remove; we now use pselect.
10893 (Fprocess_attributes): Now generates ns-resolution time stamps.
10894
10895 * sysdep.c: Include utimens.h. Don't include utime.h
10896 or worry about struct utimbuf; gnulib does that for us now.
10897 (gettimeofday): Remove; gnulib provides a substitute.
10898 (make_timeval): New function.
10899 (set_file_times): Now sets ns-resolution time stamps.
10900 New arg FD; all uses changed.
10901 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10902 (system_process_attributes):
10903 Now returns ns-resolution time stamp. All uses changed.
10904 Check for time stamp overflow.
10905
10906 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10907 provides a substitute now.
10908
10909 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10910 since it guarantees struct timespec.
10911 (EMACS_TIME): Now struct timespec, so that we can support
10912 ns-resolution time stamps.
10913 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10914 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10915 (EMACS_USECS): Remove.
10916 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10917 so multiply the arg by 1000 before storing it.
10918 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10919 New macros.
10920 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10921 Port to ns-resolution time stamps.
10922 (EMACS_TIME_NEG_P): Remove; replaced by....
10923 (EMACS_TIME_SIGN): New macro.
10924 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10925 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10926 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10927 (make_timeval, make_lisp_time, decode_time_components): New decls.
10928 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10929 that it mishandled time_t overflow. You can't compare by subtracting!
10930 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10931 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10932
10933 * term.c: Include <sys/time.h>.
10934 (timeval_to_Time): New function, for proper overflow wraparound.
10935 (term_mouse_position, term_mouse_click): Use it.
10936
10937 * undo.c (record_first_change): Support higher-resolution time stamps
10938 in the undo buffer.
10939 (Fprimitive_undo): Use them when restoring time stamps.
10940
10941 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10942 (w32_get_internal_run_time):
10943 Port to higher-resolution Emacs time stamps.
10944 (ltime): Now accepts single 64-bit integer, as that's more convenient
10945 for callers.
10946
10947 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
10948
10949 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
10950 for compatibility with pselect. Support ns-resolution time stamps.
10951
10952 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
10953
10954 * xselect.c (wait_for_property_change, x_get_foreign_selection):
10955 Check for time stamp overflow, and support ns-resolution time stamps.
10956
10957 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
10958 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
10959 (timeval_subtract): Remove; no longer needed.
10960 (XTflash, XTring_bell, x_wait_for_event):
10961 Port to ns-resolution time stamps. Don't assume time_t is signed.
10962
b6a92dfe
CY
109632012-06-22 Chong Yidong <cyd@gnu.org>
10964
10965 * xdisp.c (x_consider_frame_title): Revert last change.
10966
d251c37c
EZ
109672012-06-22 Eli Zaretskii <eliz@gnu.org>
10968
10969 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
10970 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
10971 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
10972 staticidx goes up to 1597 out of 1600 = 0x640.)
10973
f10deafb
PE
109742012-06-20 Paul Eggert <eggert@cs.ucla.edu>
10975
10976 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
10977 Otherwise, the umask might be mistakenly 0 while handling input signals.
10978
ec6de1e2
SM
109792012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
10980
10981 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
10982
28be1ada
DA
109832012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
10984
10985 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
10986 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
10987 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
10988 access to `contents' member of Lisp_Vector objects with AREF and ASET
10989 where appropriate.
10990
c6bf3022
CY
109912012-06-19 Chong Yidong <cyd@gnu.org>
10992
10993 * frame.c (delete_frame): When selecting a frame on a different
10994 text terminal, do not alter the terminal's top-frame.
10995
10996 * xdisp.c (format_mode_line_unwind_data): Record the target
10997 frame's selected window and its terminal's top-frame.
10998 (unwind_format_mode_line): Restore them.
10999 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11000 Callers changed.
11001 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11002 since tty frames can be explicitly named.
11003 (prepare_menu_bars): Likewise.
11004
11005 * term.c (Ftty_top_frame): New function.
11006
defd4196
PE
110072012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11008
11009 Port byte-code-meter to modern targets.
11010 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11011 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11012 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11013 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11014 (METER_1, METER_2): Simplify.
11015
1053a871
SM
110162012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11017
11018 * data.c (Fdefalias): Return `symbol' (bug#11686).
11019
b7e8d081
MR
110202012-06-18 Martin Rudalics <rudalics@gmx.at>
11021
11022 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11023 gets killed during executing of this function (Bug#11665).
11024 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11025 (Vkill_buffer_query_functions): In doc-string say that functions
11026 run by this hook should not change the current buffer.
11027
7ea2b339
PE
110282012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11029
11030 Fix recently-introduced process.c problems found by static checking.
11031 * process.c (write_queue_push, write_queue_pop, send_process):
11032 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11033 (write_queue_pop): Fix pointer signedness problem.
11034 (send_process): Remove unused local.
11035
96a313a1
CY
110362012-06-17 Chong Yidong <cyd@gnu.org>
11037
11038 * xdisp.c (redisplay_internal): No need to redisplay terminal
11039 frames that are not on top.
11040
20ca2e94
TN
110412012-06-17 Troels Nielsen <bn.troels@gmail.com>
11042
11043 * process.c (make_process): Initialize write_queue.
11044 (write_queue_push, write_queue_pop): New functions.
11045 (send_process): Use them to maintain correct ordering of process
11046 writes (Bug#10815).
11047
9a900ca9
PE
110482012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11049
310fbfa8
PE
11050 * lisp.h (eassert): Assume C89 or later.
11051 This removes the need for CHECK.
11052 (CHECK): Remove. Its comments about always evaluating its
11053 argument were confusing, as 'eassert' typically does not evaluate
11054 its argument.
11055
27bb1ca4
PE
11056 * coding.c (produce_chars): Use ptrdiff_t, not int.
11057
9a900ca9
PE
11058 * xterm.c (x_draw_underwave): Check for integer overflow.
11059 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11060
41b7f8bc 110612012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
11062
11063 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11064 referenced (Bug#11583).
11065
9b0e3eba
AA
110662012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11067
11068 Implement wave-style variant of underlining.
11069 * dispextern.h (face_underline_type): New enum.
11070 (face): Add field for underline type.
11071 * nsterm.m (ns_draw_underwave): New function.
11072 (ns_draw_text_decoration): Use it.
11073 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11074 New functions.
11075 (x_draw_glyph_string): Use them.
11076 * xfaces.c (Qline, Qwave): New Lisp objects.
11077 (check_lface_attrs, merge_face_ref)
1053a871
SM
11078 (Finternal_set_lisp_face_attribute, realize_x_face):
11079 Handle wave-style underline face attributes.
9b0e3eba
AA
11080 * xterm.c (x_draw_underwave): New function.
11081 (x_draw_glyph_string): Use it.
11082
0fb52f11
JB
110832012-06-16 Juanma Barranquero <lekktu@gmail.com>
11084
11085 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11086 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11087 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11088 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11089 ($(BLD)/w32select.$(O)): Update dependencies.
11090
e5560ff7
AS
110912012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11092
11093 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11094 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11095 * character.c (_fetch_multibyte_char_p): Remove.
11096 * alloc.c: Include "character.h" before "buffer.h".
11097 * bidi.c: Likewise.
11098 * buffer.c: Likewise.
11099 * bytecode.c: Likewise.
11100 * callint.c: Likewise.
11101 * callproc.c: Likewise.
11102 * casefiddle.c: Likewise.
11103 * casetab.c: Likewise.
11104 * category.c: Likewise.
11105 * cmds.c: Likewise.
11106 * coding.c: Likewise.
11107 * composite.c: Likewise.
11108 * dired.c: Likewise.
11109 * dispnew.c: Likewise.
11110 * doc.c: Likewise.
11111 * dosfns.c: Likewise.
11112 * editfns.c: Likewise.
11113 * emacs.c: Likewise.
11114 * fileio.c: Likewise.
11115 * filelock.c: Likewise.
11116 * font.c: Likewise.
11117 * fontset.c: Likewise.
11118 * fringe.c: Likewise.
11119 * indent.c: Likewise.
11120 * insdel.c: Likewise.
11121 * intervals.c: Likewise.
11122 * keyboard.c: Likewise.
11123 * keymap.c: Likewise.
11124 * lread.c: Likewise.
11125 * macros.c: Likewise.
11126 * marker.c: Likewise.
11127 * minibuf.c: Likewise.
11128 * nsfns.m: Likewise.
11129 * nsmenu.m: Likewise.
11130 * print.c: Likewise.
11131 * process.c: Likewise.
11132 * regex.c: Likewise.
11133 * region-cache.c: Likewise.
11134 * search.c: Likewise.
11135 * syntax.c: Likewise.
11136 * term.c: Likewise.
11137 * textprop.c: Likewise.
11138 * undo.c: Likewise.
11139 * unexsol.c: Likewise.
11140 * w16select.c: Likewise.
11141 * w32fns.c: Likewise.
11142 * w32menu.c: Likewise.
11143 * window.c: Likewise.
11144 * xdisp.c: Likewise.
11145 * xfns.c: Likewise.
11146 * xmenu.c: Likewise.
11147 * xml.c: Likewise.
11148 * xselect.c: Likewise.
11149
2f07e6af
EZ
111502012-06-16 Eli Zaretskii <eliz@gnu.org>
11151
1053a871
SM
11152 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11153 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 11154 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
11155 row.
11156 (handle_face_prop): Use chunk-relative overlay string index when
11157 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
11158 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11159 the rightmost. (Bug#11720)
2f07e6af 11160
29b83cec
AS
111612012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11162
11163 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11164 (CATEGORY_MEMBER): Enforce 1/0 value.
11165 * category.c (_temp_category_set): Remove.
11166
4c5501e9
EZ
111672012-06-16 Eli Zaretskii <eliz@gnu.org>
11168
11169 * window.c (Fdelete_other_windows_internal)
11170 (Fdelete_window_internal): Don't access frame's mouse highlight
11171 info of the initial frame. (Bug#11677)
11172
2b570124
PE
111732012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11174
e93864f9
PE
11175 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11176 Assume USE_2_TAGS_FOR_INTS.
11177 (xreload): Adjust $tagmask width to match recent lisp.h change.
11178
2b570124
PE
11179 Simplify lisp.h in minor ways that should not affect code.
11180 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11181 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11182 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11183 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11184 (INTTYPEBITS): New macro, for clarity.
11185 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
11186 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11187 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
11188 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11189 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11190
81755f69
JB
111912012-06-13 Juanma Barranquero <lekktu@gmail.com>
11192
11193 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11194
16192a57
GM
111952012-06-13 Glenn Morris <rgm@gnu.org>
11196
11197 * s/bsd-common.h (BSD4_3):
11198 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11199
646b5f55
AS
112002012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11201
11202 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11203 instead of union.
11204 (XLI, XIL): Define.
1053a871
SM
11205 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11206 Use them.
11207 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 11208 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 11209 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
11210 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11211 * frame.c (delete_frame): Remove outdated comment.
11212 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11213 USE_LISP_UNION_TYPE.
11214 (Fw32_unregister_hot_key): Likewise.
11215 (Fw32_toggle_lock_key): Likewise.
11216 * w32menu.c (add_menu_item): Likewise.
11217 (w32_menu_display_help): Use XIL instead of checking
11218 USE_LISP_UNION_TYPE.
11219 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11220 (init_heap): Likewise.
11221 * w32term.c (w32_read_socket): Update comment.
11222
1d3823c9
GM
112232012-06-13 Glenn Morris <rgm@gnu.org>
11224
c62ff706
GM
11225 * s/usg5-4-common.h, src/s/unixware.h:
11226 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11227
1d3823c9
GM
11228 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11229
bfe3e0a2
PE
112302012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11231
11232 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11233 * alloc.c (make_number) [!defined make_number]:
11234 Remove, as lisp.h always defines this now.
11235 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11236 (roundup_size): Verify that it is a power of 2.
11237 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11238 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11239 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11240 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11241 USE_LSB_TAG now is always defined to be either 0 or 1.
11242 All uses changed.
11243 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11244 code works fine either way, and efficiency is not a concern here,
11245 as the union type is for debugging, not for production.
11246 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11247 Use an inline function on all platforms when using the union type,
11248 since this is simpler and 'static inline' can be used portably
11249 within Emacs now.
11250 (LISP_INITIALLY_ZERO): New macro.
11251 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11252 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11253
45fa9c0f
GM
112542012-06-12 Glenn Morris <rgm@gnu.org>
11255
b4492cba
GM
11256 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11257
11258 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 11259
45fa9c0f
GM
11260 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11261 Move BROKEN_SIGIO to configure.
11262
11263 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11264 Move NO_TERMIO to configure.
11265
0e25d334
CY
112662012-06-12 Chong Yidong <cyd@gnu.org>
11267
11268 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11269 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11270 MagickExportImagePixels is undefined.
11271
43682bb6
PE
112722012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11273
11274 * image.c (imagemagick_load_image): Remove unused label.
11275
a9be7d2b
GM
112762012-06-11 Glenn Morris <rgm@gnu.org>
11277
11278 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11279 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11280 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11281 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11282
3017f87f
SM
112832012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11284
11285 * alloc.c (make_byte_code): New function.
11286 (Fmake_byte_code): Use it. Don't purify here.
11287 * lread.c (read1): Use it as well to avoid extra allocation.
11288
1b9b4cf4
CY
112892012-06-11 Chong Yidong <cyd@gnu.org>
11290
11291 * image.c (imagemagick_load_image): Implement transparency.
11292
95988fcf
AS
112932012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11294
11295 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11296 account for preceding backslashes. (Bug#11663)
11297
cd4eb164
CY
112982012-06-09 Chong Yidong <cyd@gnu.org>
11299
11300 * term.c: Support italics in capable terminals (Bug#9652).
11301 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11302 (turn_on_face): Output using TS_enter_italic_mode if available.
11303 Don't handle unused blinking and alt-charset cases.
11304 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11305 and tty_alt_charset_p cases.
11306 (tty_capable_p, init_tty): Support italics.
11307
11308 * termchar.h (struct tty_display_info): Add field for italics.
11309 Remove unused blink field.
11310
11311 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11312 Handle slant.
11313
11314 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11315 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11316 tty_alt_charset_p. Add tty_italic_p.
11317
ff88beb8
MA
113182012-06-09 Michael Albinus <michael.albinus@gmx.de>
11319
11320 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11321 dbus_type_is_basic if available.
11322 (xd_extract_signed, xd_extract_unsigned): Rename from
11323 extract_signed and extract_unsigned, respectively. Adapt callers.
11324
44286096
CY
113252012-06-09 Chong Yidong <cyd@gnu.org>
11326
1682701f
CY
11327 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11328
44286096
CY
11329 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11330 case (Bug#9752).
11331
d86feb17
PE
113322012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11333
11334 * xdisp.c (vmessage): Treat frame message as multibyte.
11335 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11336 would generate the diagnostic "Making \302\247 buffer-local while
11337 let-bound!".
11338
d5c20fe8
EZ
113392012-06-08 Eli Zaretskii <eliz@gnu.org>
11340
11341 * dispnew.c (showing_window_margins_p): Undo last change, which
11342 was done due to an inadvertent commit.
11343 (adjust_frame_glyphs_for_frame_redisplay): Do call
11344 showing_window_margins_p.
11345
513749ee
SM
113462012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11347
11348 * eval.c (Fmake_var_non_special): New primitive.
11349 (syms_of_eval): Defsubr it.
11350 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11351
d4a8f5c1
JB
113522012-06-08 Juanma Barranquero <lekktu@gmail.com>
11353
11354 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11355 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11356
8bbbc977
EZ
113572012-06-08 Eli Zaretskii <eliz@gnu.org>
11358
11359 * alloc.c (allocate_vectorlike): Fix last change.
11360
f3372c87
DA
113612012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11362
11363 Block-based vector allocation of small vectors.
11364 * lisp.h (struct vectorlike_header): New field `nbytes',
11365 adjust comment accordingly.
11366 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 11367 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
11368 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11369 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11370 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11371 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11372 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11373 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11374 (roundup_size): New constant.
11375 (struct vector_block): New data type.
11376 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 11377 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
11378 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11379 (sweep_vectors): New functions.
11380 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 11381 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
11382 or equal to VBLOCK_BYTES_MAX.
11383 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11384 (init_alloc_once): Add call to init_vectors.
11385
4f18a4ed
SM
113862012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11387
11388 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11389
86f158bc
PE
113902012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11391
11392 * doprnt.c (doprnt): Truncate multibyte char correctly.
11393 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11394 would mishandle a string argument "Xc" if X was a multibyte
11395 character of length 2: it would truncate after X's first byte
11396 rather than including all of X.
11397
c5cfcbe0
CY
113982012-06-06 Chong Yidong <cyd@gnu.org>
11399
11400 * buffer.c (word_wrap): Doc fix.
11401
c05cf390
PE
114022012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11403
11404 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11405
0c3461de
GM
114062012-06-03 Glenn Morris <rgm@gnu.org>
11407
11408 * xdisp.c (tool-bar-style): Doc fix.
11409
c71232db
UM
114102012-06-03 Ulrich Müller <ulm@gentoo.org>
11411
11412 * Makefile.in (PAXCTL): Define.
11413 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11414 binary via PaX flags if the paxctl utility is available.
11415 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11416 Restore PaX flags to their default. (Bug#11398)
11417
383f7350
CY
114182012-06-03 Chong Yidong <cyd@gnu.org>
11419
11420 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11421 buffer (Bug#11226).
11422
5f2c76c6
CY
114232012-06-03 Chong Yidong <cyd@gnu.org>
11424
11425 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11426 (note_mode_line_or_margin_highlight): If there is no help echo,
11427 use mode-line-default-help-echo. Handle the case where the mouse
11428 position is past the end of the mode line string.
11429
11430 * buffer.c (buffer_local_value_1): New function, split from
11431 Fbuffer_local_value; can return Qunbound.
11432 (Fbuffer_local_value): Use it.
11433 (Vmode_line_format): Docstring tweaks.
11434
773d47f6
PE
114352012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11436
11437 * sysdep.c (system_process_attributes): Improve comment.
11438
f2d6a3df
SM
114392012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11440
11441 * keyboard.c: Export real-this-command to Elisp.
11442 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11443 and DEFVAR it. Update all users.
11444
63810350
PE
114452012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11446
7bd5c1f4
PE
11447 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11448
63810350
PE
11449 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11450 Convert pctcpu and pctmem to Lisp float properly.
11451 Let the compiler fold better, as 100.0/0x8000 is exact.
11452
a2821611
AS
114532012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11454
11455 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11456 cons_block.
11457
5fceba1d
PE
114582012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11459
11460 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11461
c98ff5dd
DA
114622012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11463
11464 For a 'struct window', replace some Lisp_Object fields to
11465 bitfields where appropriate, remove unused fields.
11466 * window.h (struct window): Remove unused 'last_mark_x' and
11467 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 11468 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
11469 Change type of 'force_start', 'optional_new_start',
11470 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 11471 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 11472
ca34e0be
PE
114732012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11474
11475 Pacify gcc -Wdouble-precision when using Xaw.
11476 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11477 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11478 Use 'float' consistently, rather than 'float' in most places
11479 and 'double' in a couple of places.
11480
efc00ab1 114812012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
11482
11483 * xdisp.c (handle_stop): Detect whether we have overlay strings
11484 loaded by testing it->current.overlay_string_index to be
11485 non-negative, instead of checking whether n_overlay_strings is
11486 positive. (Bug#11587)
11487
efc00ab1 114882012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
11489
11490 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11491
11492 * doc.c (Fsubstitute_command_keys): Doc fix.
11493
efc00ab1 114942012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
11495
11496 * search.c (search_buffer): Remove calls to
11497 r_alloc_inhibit_buffer_relocation, as it is now called by
11498 maybe_unify_char, which was the cause of relocation of buffer text
11499 in bug#11519.
11500
efc00ab1 115012012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
11502
11503 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11504 for the duration of call to load_charset, to avoid problems with
11505 callers of maybe_unify_char that access buffer text through C
11506 pointers.
11507
11508 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11509 decrement the inhibition flag, instead of just setting or
11510 resetting it.
11511
ba93a187
PE
115122012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11513
11514 Remove obsolete '#define static' cruft.
11515 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11516 This #undef was "temporary" in 2000; it is no longer needed
11517 now that '#define static' has gone away.
11518 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11519 (gray_bitmap_bits): Remove; no longer needed.
11520 All uses replaced with definiens.
11521 * xterm.c: Include "bitmaps/gray.xbm".
11522
9e4bf381
PE
115232012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 Clean up __executable_start, monstartup when --enable-profiling.
11526 The following changes affect the code only when profiling.
11527 * dispnew.c (__executable_start): Rename from safe_bcopy.
11528 Define only on platforms that need it.
11529 * emacs.c: Include <sys/gmon.h> when profiling.
11530 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11531 (__executable_start): Remove decl, since lisp.h does it now.
11532 (safe_bcopy): Remove decl; no longer has that name.
11533 (main): Coalesce #if into single bit of code, for simplicity.
11534 Cast pointers to uintptr_t, since standard libraries want integers
11535 and not pointers.
11536 * lisp.h (__executable_start): New decl.
11537
32d72c2f
GM
115382012-05-31 Glenn Morris <rgm@gnu.org>
11539
11540 * image.c (Fimagemagick_types): Doc fix.
11541
baac5bc7
JM
115422012-05-30 Jim Meyering <meyering@redhat.com>
11543
11544 * callproc.c (Fcall_process_region): Include directory component
11545 in mkstemp error message (Bug#11586).
11546
72cb32cf
PE
115472012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11548
11549 * alloc.c, lisp.h (make_pure_vector): Now static.
11550
61b108cc
SM
115512012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11552
11553 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11554 Move to byte-run.el.
11555 (Fautoload): Do the hash-doc more carefully.
11556 * data.c (Fdefalias): Purify definition, except for keymaps.
11557 (Qdefun): Move from eval.c.
11558 * lisp.h (Qdefun): Remove.
11559 * lread.c (read1): Tiny simplification.
11560
471fe23d
TN
115612012-05-29 Troels Nielsen <bn.troels@gmail.com>
11562
934f3f58 11563 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
11564 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11565 Bug#9642, but explicitly check that the buffer the overlay would
11566 be moved to is live and rearrange lines to make sure that errors
11567 will not put the overlay in an inconsistent state.
11568 (Fdelete_overlay): Cosmetics.
11569
85d0efd1
EZ
115702012-05-28 Eli Zaretskii <eliz@gnu.org>
11571
11572 * w32term.c (my_bring_window_to_top): New function.
11573 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
11574 could be different from the original one.
11575 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
11576 (Bug#11513)
11577
11578 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11579 by calling BringWindowToTop.
11580
11581 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11582 (WM_EMACS_END): Increase by one.
11583
da92a98c
PE
115842012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11585
11586 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11587 This avoids undefined behavior that might cause the eassert
11588 to not catch an out-of-range value.
11589
74d1f848
JB
115902012-05-28 Juanma Barranquero <lekktu@gmail.com>
11591
11592 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11593 Update dependencies.
11594
9e1a06fc
EZ
115952012-05-27 Eli Zaretskii <eliz@gnu.org>
11596
11597 * bidi.c (bidi_mirror_char): Fix last change.
11598
f3dd7312
AS
115992012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11600
11601 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11602 when referring to sectname field in printf format.
11603
81899c91
PE
116042012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11605
57b81a9f
PE
11606 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11607 Only r_alloc_inhibit_buffer_relocation needed to be added;
11608 the others were already declared.
11609
81899c91
PE
11610 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11611 before checking whether it's out of range. Put the check inside
11612 eassert. See
11613 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11614
33017faf 116152012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
11616
11617 * callproc.c (Fcall_process): Restore a line that was accidentally
11618 commented out in the 2011-02-13 change (bug#11547).
11619
33017faf 116202012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
11621
11622 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11623 defined on ralloc.c.
11624
11625 * buffer.c [REL_ALLOC]: Remove prototypes of
11626 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11627 they are now on lisp.h.
11628
11629 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11630
11631 * search.c (search_buffer): Use it to inhibit relocation of buffer
11632 text while re_search_2 is doing its job, because re_search_2 is
11633 passed C pointers to buffer text. (Bug#11519)
11634
23415acf
EZ
11635 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11636 Update value to 24.
11637
44e27368
EZ
11638 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11639 state after an additional call to move_it_in_display_line_to, keep
11640 the values of it->max_ascent and it->max_descent found for the
11641 entire line.
11642 (pos_visible_p): Revert the comparison against bottom_y to what it
11643 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11644 (Bug#11464)
11645
c1892f11
PE
116462012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11647
11648 Fix coding-related core dumps with gcc -ftrapv.
11649 The code was computing A - B, where A and B are pointers, and B is
11650 random garbage. This can lead to core dumps on platforms that
11651 have special pointer registers, and it also leads to core dumps on
11652 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11653 A - B only when B is initialized properly.
11654 * coding.c (coding_set_source, coding_set_destination): Return void.
11655 (coding_change_source, coding_change_destinations): New functions,
11656 with the old behaviors of coding_set_source and coding_set_destination.
11657 All callers that need an offset changed to use these new functions.
11658
eb7afdad
GM
116592012-05-26 Glenn Morris <rgm@gnu.org>
11660
11661 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11662
f12fdf02
EZ
116632012-05-26 Eli Zaretskii <eliz@gnu.org>
11664
53a63be6 11665 Extend mouse support on W32 text-mode console.
61b108cc
SM
11666 * xdisp.c (draw_row_with_mouse_face):
11667 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11668
eb3f6f01 11669 * w32console.c: Include window.h.
61b108cc
SM
11670 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11671 New functions.
eb3f6f01
EZ
11672 (initialize_w32_display): Initialize mouse-highlight data.
11673
53a63be6
EZ
11674 * w32inevt.c: Include termchar.h and window.h.
11675 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11676 moves, call note_mouse_highlight. If help_echo changed, call
11677 gen_help_event to produce help-echo message in the echo area.
11678 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11679 highlight info.
11680
4cfd81f6
PE
116812012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11682
11683 * lread.c (read1): Simplify slightly to avoid an overflow warning
11684 with GCC 4.7.0 on x86-64.
11685
4446092a
EZ
116862012-05-26 Eli Zaretskii <eliz@gnu.org>
11687
11688 * bidi.c (bidi_mirror_char): Revert last change: an int is
11689 definitely wide enough here.
11690
42b2a986 116912012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11692
42b2a986 11693 Fix integer width and related bugs (Bug#9874).
eb106a49 11694 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11695 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11696 (string_bytes, check_sblock, allocate_string_data):
11697 (compact_small_strings, Fmake_bool_vector, make_string)
11698 (make_unibyte_string, make_multibyte_string)
11699 (make_string_from_bytes, make_specified_string)
11700 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11701 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11702 (mark_vectorlike):
11703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11704 (allocate_pseudovector):
11705 Use int, not EMACS_INT, where int is wide enough.
11706 (inhibit_garbage_collection, Fgarbage_collect):
11707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11708 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11709 int might not be wide enough.
11710 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11711 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11712 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11713 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11714 (bidi_level_of_next_char, bidi_move_to_visually_next):
11715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11716 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11717 (Fkill_buffer, Fset_buffer_major_mode)
11718 (advance_to_char_boundary, Fbuffer_swap_text)
11719 (Fset_buffer_multibyte, overlays_at, overlays_in)
11720 (overlay_touches_p, struct sortvec, record_overlay_string)
11721 (overlay_strings, recenter_overlay_lists)
11722 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11723 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11724 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11725 (Foverlay_recenter, last_overlay_modification_hooks_used)
11726 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11728 (validate_region): Omit unnecessary test for b <= e,
11729 since that's guaranteed by the previous test.
d311d28c
PE
11730 (adjust_overlays_for_delete): Avoid pos + length overflow.
11731 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11732 (report_overlay_modification):
11733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11734 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11735 Omit pointer cast, which isn't needed anyway, and doesn't work
11736 after the EMACS_INT -> ptrdiff_t change.
02481186 11737 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11738 * buffer.h: Adjust decls to match defn changes elsewhere.
11739 (struct buffer_text, struct buffer):
11740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11741 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
11742 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11743 not int, to avoid needless 32-bit limit on 64-bit hosts.
11744 (exec_byte_code): Use tighter memory-full test, one that checks
11745 for alloca overflow. Don't compute the address of the object just
11746 before an array, as that's not portable. Use EMACS_INT, not
11747 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
11748 * callint.c (Fcall_interactively):
11749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11750 * callproc.c (call_process_kill, Fcall_process):
11751 Don't assume pid_t fits into an Emacs fixnum.
11752 (call_process_cleanup, Fcall_process, child_setup):
11753 Don't assume pid_t fits into int.
11754 (call_process_cleanup, Fcall_process, delete_temp_file)
11755 (Fcall_process_region):
11756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11757 (Fcall_process): Simplify handling of volatile integers.
11758 Use int, not EMACS_INT, where int will do.
11759 * casefiddle.c (casify_object, casify_region, operate_on_word)
11760 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11762 (casify_object): Avoid integer overflow when overallocating buffer.
11763 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 11764 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
11765 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11766 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11767 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11768 integers are now checked earlier. All uses replaced with XINT.
11769 (ccl_driver):
11770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11771 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
11772 (ccl_driver, Fregister_code_conversion_map):
11773 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
11774 (resolve_symbol_ccl_program): Check that vector header is in range.
11775 Always copy the vector, so that we can check its contents reliably
11776 now rather than having to recheck each instruction as it's being
11777 executed. Check that vector words fit in 'int'.
11778 (ccl_get_compiled_code, Fregister_ccl_program)
11779 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11780 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11781 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11782 contents are in range.
11783 (Fccl_execute_on_string): Check that status is in range.
11784 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11785 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11786 Accept and return EMACS_INT, not int, because callers can pass values
11787 out of 'int' range.
11788 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11789 (multibyte_chars_in_text, parse_str_as_multibyte)
11790 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11791 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11792 (string_escape_byte8, Fget_byte):
11793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 11794 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
11795 avoid mishandling large integers.
11796 * character.h: Adjust decls to match defn changes elsewhere.
11797 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11798 (Ffind_charset_region):
11799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11800 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11801 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 11802 Don't assume fixnum fits in int.
d311d28c
PE
11803 (load_charset_map_from_vector, Fmap_charset_chars):
11804 Remove now-unnecessary CHECK_NATNUMs.
11805 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
11806 Don't rely on undefined behavior with signed left shift overflow.
11807 Don't assume unsigned int fits into fixnum, or that fixnum fits
11808 into unsigned int. Don't require max_code to be a valid fixnum;
11809 that's not true for gb10830 4-byte on a 32-bit host. Allow
11810 invalid_code to be a cons, for the same reason. Require code_offset
11811 to be a character. Avoid int overflow if max_char is close
11812 to INT_MAX.
11813 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11814 this is intended anyway and avoids some undefined behavior.
11815 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11816 INDEX_TO_CODE_POINT, as that's what it expects.
11817 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
11818 * charset.h (DECODE_CHAR): Return int, not unsigned;
11819 this is what was intended anyway, and it avoids undefined behavior.
11820 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11821 integer-overflow issues.
11822 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11823 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11824 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
11825 * chartab.c (Fmake_char_table, Fset_char_table_range)
11826 (uniprop_get_decoder, uniprop_get_encoder):
11827 Don't assume fixnum fits in int.
11828 * cmds.c (move_point): New function, that does the gist of
11829 Fforward_char and Fbackward_char, but does so while checking
11830 for integer overflow more accurately.
c96e5d6a 11831 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
11832 (Fforward_line, Fend_of_line, internal_self_insert)
11833 (internal_self_insert):
11834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11835 Fix a FIXME, by checking for integer overflow when calculating
11836 target_clm and actual_clm.
11837 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 11838 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
11839 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11840 (coding_alloc_by_making_gap, alloc_destination)
11841 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11842 (encode_coding_utf_16, detect_coding_emacs_mule)
11843 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11844 (detect_coding_iso_2022, decode_coding_iso_2022)
11845 (encode_invocation_designation, encode_designation_at_bol)
11846 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11847 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11848 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11849 (encode_coding_ccl, encode_coding_raw_text)
11850 (detect_coding_charset, decode_coding_charset)
11851 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11852 (produce_composition, produce_charset, produce_annotation)
11853 (decode_coding, handle_composition_annotation)
11854 (handle_charset_annotation, consume_chars, decode_coding_gap)
11855 (decode_coding_object, encode_coding_object, detect_coding_system)
11856 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11857 (code_convert_region, code_convert_string)
8f50130c
PE
11858 (Fdefine_coding_system_internal)
11859 (coding_set_source, coding_set_destination):
d311d28c
PE
11860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11861 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11862 (Fdefine_coding_system_internal):
11863 Don't assume fixnums fit in int.
11864 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 11865 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
11866 (Funencodable_char_position, Fcheck_coding_systems_region)
11867 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 11868 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 11869 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 11870 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 11871 Don't access memory outside of the args array.
d311d28c 11872 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
11873 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11874 result of ENCODE_CHAR.
d311d28c
PE
11875 * coding.h: Adjust decls to match defn changes elsewhere.
11876 (struct coding_system):
11877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11878 * composite.c (get_composition_id, find_composition)
11879 (run_composition_function, update_compositions)
11880 (compose_text, composition_gstring_put_cache)
11881 (composition_gstring_p, composition_gstring_width)
11882 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11883 (composition_compute_stop_pos, composition_reseat_it)
11884 (composition_update_it, struct position_record)
11885 (find_automatic_composition, composition_adjust_point)
11886 (Fcomposition_get_gstring, Ffind_composition_internal):
11887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11888 (update_compositions):
11889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11890 * composite.h: Adjust decls to match defn changes elsewhere.
11891 (struct composition):
11892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11893 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11894 Do not attempt to compute the address of the object just before a
11895 buffer; this is not portable.
11896 (Faref, Faset):
11897 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11898 (Faset): Use int, not EMACS_INT, where int is wide enough.
11899 (Fstring_to_number): Don't assume fixnums fit in int.
11900 (Frem): Don't assume arg is nonnegative.
11901 * dbusbind.c (xd_append_arg): Check for integers out of range.
11902 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 11903 (extract_signed, extract_unsigned): New functions.
243e0530
PE
11904 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11905 (xd_get_connection_references): Return ptrdiff_t, not int.
11906 All uses changed.
11907 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11908 (xd_read_message_1):
11909 Use int, not unsigned, where the dbus API uses int.
11910 (Fdbus_message_internal): Don't overflow mtype.
11911 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
11912 * dired.c (directory_files_internal, file_name_completion, scmp)
11913 (file_name_completion_stat):
11914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11915 (file_name_completion): Don't overflow matchcount.
11916 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11917 * dispextern.h: Adjust decls to match defn changes elsewhere.
11918 (struct text_pos, struct glyph, struct bidi_saved_info)
11919 (struct bidi_string_data, struct bidi_it, struct composition_it)
11920 (struct it):
11921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11922 (struct display_pos, struct composition_it, struct it):
11923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11924 * dispnew.c (increment_matrix_positions)
11925 (increment_row_positions, mode_line_string)
11926 (marginal_area_string):
11927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 11928 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
11929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11930 (duration_to_sec_usec): New function, to check for overflow better.
11931 (Fsleep_for, sit_for): Use it.
11932 * doc.c (get_doc_string, store_function_docstring):
11933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11934 (get_doc_string, Fsnarf_documentation):
11935 Use int, not EMACS_INT, where int is wide enough.
11936 (get_doc_string):
11937 Use SAFE_ALLOCA, not alloca.
11938 Check for overflow when converting EMACS_INT to off_t.
11939 * doprnt.c (doprnt):
11940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11941 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11942 Don't assume uid_t fits into fixnum.
11943 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11944 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11945 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11946 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
11947 (general_insert_function)
11948 (Finsert_char, make_buffer_string, make_buffer_string_both)
11949 (update_buffer_properties, Fbuffer_substring)
11950 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
11951 (Fsubst_char_in_region, check_translation)
11952 (Ftranslate_region_internal, save_restriction_restore, Fformat)
11953 (transpose_markers, Ftranspose_regions):
11954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11955 (clip_to_bounds): Move to lisp.h as an inline function).
11956 (Fconstrain_to_field): Don't assume integers are nonnegative.
11957 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
11958 (Fsubst_char_in_region, Fsave_restriction):
11959 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11960 (Femacs_pid): Don't assume pid_t fits into fixnum.
11961 (lo_time): Use int, not EMACS_INT, when int suffices.
11962 (lisp_time_argument): Check for usec out of range.
11963 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
11964 (Fuser_login_name, Fuser_full_name): Signal an error
11965 if a uid argument is out of range, rather than relying on
11966 undefined behavior.
c8d5c857
PE
11967 (Fformat_time_string): Remove now-unnecessary check.
11968 lisp_time_argument checks for out-of-range usec now.
243e0530 11969 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
11970 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
11971 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
11972 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
11973 (init_cmdargs, Fdump_emacs):
11974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11975 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
11976 the bottom (typically) 32 bits of the fixnum.
11977 * eval.c (specpdl_size, call_debugger):
11978 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11979 (when_entered_debugger, Fbacktrace_debug):
11980 Don't assume fixnum can fit in int.
11981 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
11982 the object just before a buffer; this is not portable.
11983 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
11984 (grow_specpdl, unbind_to):
11985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11986 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
11987 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 11988 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
11989 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
11990 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
11991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11992 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
11993 (a_write, e_write):
11994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11995 (Fcopy_file, non_regular_nbytes, read_non_regular)
11996 (Finsert_file_contents):
11997 Use int, not EMACS_INT, where int is wide enough.
11998 (READ_BUF_SIZE): Verify that it fits in int.
11999 (Finsert_file_contents): Check that counts are in proper range,
12000 rather than assuming fixnums fit into ptrdiff_t etc.
12001 Don't assume fixnums fit into int.
125b3835 12002 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12003 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12004 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12005 (string_char_to_byte, string_byte_to_char)
12006 (string_make_multibyte, string_to_multibyte)
12007 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12008 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12009 (substring_both, Fdelete, internal_equal, Ffillarray)
12010 (Fclear_string, mapcar1)
12011 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12012 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12013 (larger_vector, make_hash_table, maybe_resize_hash_table)
12014 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12015 (Fmaphash, secure_hash):
12016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12017 (concat): Check for string index and length overflow.
12018 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12019 (Frequire):
12020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12021 (larger_vector): New API (vec, incr_min, size_max) replaces old
12022 one (vec, new_size, init). This catches size overflow.
12023 INIT was removed because it was always Qnil.
12024 All callers changed.
12025 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12026 the upper bound on a hash table index size.
12027 (make_hash_table, maybe_resize_hash_table): Use it.
12028 (secure_hash): Computer start_byte and end_byte only after
12029 they're known to be in ptrdiff_t range.
12030 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12031 (Ffont_get_glyphs, Ffont_at):
12032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12033 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12034 (Flist_fonts, Fopen_font):
12035 Don't assume fixnum can fit in int.
12036 (check_gstring): Don't assume index can fit in int.
12037 (font_match_p): Check that fixnum is a character, not a nonnegative
12038 fixnum, since the later code needs to stuff it into an int.
12039 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12040 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12041 conversion overflow issues.
12042 (Fopen_font): Check for integer out of range.
12043 (Ffont_get_glyphs): Don't assume index can fit in int.
12044 * font.h: Adjust decls to match defn changes elsewhere.
12045 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12046 integer overflow.
12047 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12048 printmax_t, where ptrdiff_t is wide enough.
12049 (Finternal_char_font):
12050 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12051 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12052 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12053 (Fset_frame_position, x_set_frame_parameters)
12054 (x_set_line_spacing, x_set_border_width)
12055 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12056 Check that fixnums are in proper range for system types.
12057 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12059 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12060 Use SAFE_ALLOCA_LISP, not alloca.
12061 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12062 intptr_t is wide enough.
12063 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12064 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12065 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12066 Check for fixnum out of range.
12067 * ftfont.c (ftfont_list): Don't assume index fits in int.
12068 Check that fixnums are in proper range for system types.
12069 (ftfont_shape_by_flt):
12070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
12071 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12073 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12074 Check that fixnums are in proper range for system types.
12075 * gnutls.h: Adjust decls to match defn changes elsewhere.
12076 * gtkutil.c (xg_dialog_run):
12077 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12078 (update_frame_tool_bar):
12079 Check that fixnums are in proper range for system types.
12080 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 12081 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
12082 * indent.c (last_known_column, last_known_column_point):
12083 (current_column_bol_cache):
12084 (skip_invisible, current_column, check_display_width):
12085 (check_display_width, scan_for_column, current_column_1)
12086 (Findent_to, Fcurrent_indentation, position_indentation)
12087 (indented_beyond_p, Fmove_to_column, compute_motion):
12088 (Fcompute_motion, Fvertical_motion):
12089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12090 (last_known_column_modified): Use EMACS_INT, not int.
12091 (check_display_width):
12092 (Fcompute_motion):
12093 Check that fixnums and floats are in proper range for system types.
12094 (compute_motion): Don't assume index or fixnum fits in int.
12095 (compute_motion, Fcompute_motion):
12096 Use int, not EMACS_INT, when it is wide enough.
12097 (vmotion): Omit local var start_hpos that is always 0; that way
12098 we don't need to worry about overflow in expressions involving it.
12099 * indent.h: Adjust decls to match defn changes elsewhere.
12100 (struct position):
12101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12102 Use int, not EMACS_INT, where int is wide enough.
12103 Remove unused members ovstring_chars_done and tab_offset;
12104 all uses removed.
12105 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12106 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12107 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12108 (make_gap, copy_text, insert, insert_and_inherit)
12109 (insert_before_markers, insert_before_markers_and_inherit)
12110 (insert_1, count_combining_before, count_combining_after)
12111 (insert_1_both, insert_from_string)
12112 (insert_from_string_before_markers, insert_from_string_1)
12113 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12114 (adjust_after_replace, adjust_after_insert, replace_range)
12115 (replace_range_2, del_range, del_range_1, del_range_byte)
12116 (del_range_both, del_range_2, modify_region)
12117 (prepare_to_modify_buffer, signal_before_change)
12118 (signal_after_change, Fcombine_after_change_execute):
12119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12120 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12121 (balance_an_interval, split_interval_right, split_interval_left)
12122 (find_interval, next_interval, update_interval)
12123 (adjust_intervals_for_insertion, delete_node, delete_interval)
12124 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12125 (static_offset_intervals, offset_intervals)
12126 (merge_interval_right, merge_interval_left, make_new_interval)
12127 (graft_intervals_into_buffer, temp_set_point_both)
12128 (temp_set_point, set_point, adjust_for_invis_intang)
12129 (set_point_both, move_if_not_intangible, get_property_and_range)
12130 (get_local_map, copy_intervals, copy_intervals_to_string)
12131 (compare_string_intervals, set_intervals_multibyte_1):
12132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12133 * intervals.h: Adjust decls to match defn changes elsewhere.
12134 (struct interval):
12135 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12136 * keyboard.c (this_command_key_count, this_single_command_key_start)
12137 (before_command_key_count, before_command_echo_length, echo_now)
12138 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12139 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12140 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12141 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12143 (last_non_minibuf_size, last_point_position, echo_truncate)
12144 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12145 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12146 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12147 (stuff_buffered_input):
12148 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12149 (last_auto_save, command_loop_1, read_char):
12150 Use EMACS_INT, not int, to avoid integer overflow.
12151 (record_char): Avoid overflow in total_keys computation.
12152 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12153 * keyboard.h: Adjust decls to match defn changes elsewhere.
12154 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12155 (Fkey_description, Fdescribe_vector, Flookup_key):
12156 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12157 (click_position): New function, to check that positions are in range.
12158 (Fcurrent_active_maps):
12159 (describe_command):
12160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12161 (Faccessible_keymaps, Fkey_description):
12162 (preferred_sequence_p):
12163 Don't assume fixnum can fit into int.
12164 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12165 Check for integer overflow in size calculations.
12166 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12167 avoid mishandling large integers.
12168 * lisp.h: Adjust decls to match defn changes elsewhere.
12169 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12170 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12171 (struct Lisp_Marker):
12172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12173 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
12174 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12175 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12176 All callers changed.
12177 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12178 Assume the arg has valid form, since it always does.
12179 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12180 unsigned integer system type.
12181 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12182 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12184 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12185 (duration_to_sec_usec): New decl.
12186 * lread.c (read_from_string_index, read_from_string_index_byte)
12187 (read_from_string_limit, readchar, unreadchar, openp)
12188 (read_internal_start, read1, oblookup):
12189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12190 (Fload, readevalloop, Feval_buffer, Feval_region):
12191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12192 (openp): Check for out-of-range argument to 'access'.
12193 (read1): Use int, not EMACS_INT, where int is wide enough.
12194 Don't assume fixnum fits into int.
6efdadfd 12195 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
12196 (read_filtered_event): Use duration_to_sec_usec
12197 to do proper overflow checking on durations.
d311d28c
PE
12198 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12199 in size calculation.
12200 (Fexecute_kbd_macro):
12201 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12202 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12203 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12204 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12205 (set_marker_both, set_marker_restricted_both, marker_position)
12206 (marker_byte_position, Fbuffer_has_markers_at):
12207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12208 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 12209 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
12210 It now merely ensures that the menu is large enough, without
12211 necessarily growing it, as this avoids some integer overflow issues.
12212 All callers changed.
12213 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12214 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12215 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12216 Use SAFE_ALLOCA_LISP, not alloca.
12217 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12218 to EMACS_INT. Check that fixnums are in proper range for system types.
12219 * minibuf.c (minibuf_prompt_width, string_to_object)
12220 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12221 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12223 (get_minibuffer, read_minibuf_unwind):
12224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12225 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12226 this simplifies overflow checking. All callers changed.
12227 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12228 (Ftest_completion):
12229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12230 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12231 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12232 Check that fixnums are in proper range for system types.
12233 (Fx_create_frame, Fx_show_tip):
12234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12235 * nsfont.m (ns_findfonts, nsfont_list_family):
12236 Don't assume fixnum fits in long.
12237 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12238 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12239 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12240 wide enough.
17fdb222 12241 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
12242 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12243 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12244 (PRINTDECLARE, PRINTPREPARE):
12245 (strout, print_string):
12246 (print, print_preprocess, print_check_string_charset_prop)
12247 (print_object):
12248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12249 (PRINTDECLARE):
12250 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12252 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 12253 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 12254 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
12255 (print_error_message): Use SAFE_ALLOCA, not alloca.
12256 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
12257 (print_depth, new_backquote_output, print_number_index):
12258 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
12259 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12260 (Fset_process_window_size, Fformat_network_address)
12261 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 12262 (sigchld_handler):
d311d28c 12263 Check that fixnums are in proper range for system types.
d44287d4 12264 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
12265 Check for process-ids out of pid_t range rather than relying on
12266 undefined behavior.
e4d81efc 12267 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
12268 (Fformat_network_address, read_process_output, send_process)
12269 (Fprocess_send_region, status_notify):
12270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12271 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12272 (wait_reading_process_output, read_process_output, exec_sentinel):
12273 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12274 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12275 (Faccept_process_output): Use duration_to_sec_usec to do proper
12276 overflow checking on durations.
dde14581
PE
12277 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12278 Don't assume pid_t fits in int.
02481186
PE
12279 * process.h (struct Lisp_Process): Members tick and update_tick
12280 are now of type EMACS_INT, not int.
b62b53e8
PE
12281 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12282 configured --with-wide-int.
d311d28c
PE
12283 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12284 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12285 * search.c (looking_at_1, string_match_1):
12286 (fast_string_match, fast_c_string_match_ignore_case)
12287 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12288 (scan_newline, find_before_next_newline, search_command)
12289 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12290 (set_search_regs, wordify):
12291 (Freplace_match):
12292 (Fmatch_data):
12293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12294 (string_match_1, search_buffer, set_search_regs):
12295 (Fmatch_data):
12296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12297 (wordify): Check for overflow in size calculation.
12298 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12299 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12300 Check that fixnums are in proper range for system types.
12301 * sound.c (struct sound_device)
12302 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12304 (Fplay_sound_internal):
12305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 12306 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
12307 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12308 (Fparse_partial_sexp):
12309 Don't assume fixnums can fit in int.
12310 (struct lisp_parse_state, find_start_pos, find_start_value)
12311 (find_start_value_byte, find_start_begv)
12312 (update_syntax_table, char_quoted, dec_bytepos)
12313 (find_defun_start, prev_char_comend_first, back_comment):
12314 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12315 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12317 (Finternal_describe_syntax_value): Check that match_lisp is a
12318 character, not an integer, since the code stuffs it into int.
12319 (scan_words, scan_sexps_forward):
12320 Check that fixnums are in proper range for system types.
12321 (Fforward_word):
12322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12323 (scan_sexps_forward):
12324 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12325 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12326 * syntax.h: Adjust decls to match defn changes elsewhere.
12327 (struct gl_state_s):
12328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12329 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12330 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12331 * sysdep.c (wait_for_termination_1, wait_for_termination)
12332 (interruptible_wait_for_termination, mkdir):
12333 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12334 (emacs_read, emacs_write):
12335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12336 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12337 and double all fit in int.
d311d28c
PE
12338 * term.c (set_tty_color_mode):
12339 Check that fixnums are in proper range for system types.
12340 * termhooks.h (struct input_event):
12341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12342 * textprop.c (validate_interval_range, interval_of)
12343 (Fadd_text_properties, set_text_properties_1)
12344 (Fremove_text_properties, Fremove_list_of_text_properties)
12345 (Ftext_property_any, Ftext_property_not_all)
12346 (copy_text_properties, text_property_list, extend_property_ranges)
12347 (verify_interval_modification):
12348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12349 (Fnext_single_char_property_change)
12350 (Fprevious_single_char_property_change):
12351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12352 (copy_text_properties):
12353 Check for integer overflow in index calculation.
d311d28c
PE
12354 * undo.c (last_boundary_position, record_point, record_insert)
12355 (record_delete, record_marker_adjustment, record_change)
12356 (record_property_change):
12357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12358 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12359 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12360 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12361 (Fx_hide_tip, Fx_file_dialog):
12362 * w32menu.c (set_frame_menubar):
12363 Use ptrdiff_t, not int, for consistency with rest of code.
12364 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12365 (select_window, Fdelete_other_windows_internal)
12366 (window_scroll_pixel_based, window_scroll_line_based)
12367 (Frecenter, Fset_window_configuration):
12368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12369 (Fset_window_hscroll, run_window_configuration_change_hook)
12370 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 12371 (Fscroll_other_window, Frecenter):
d311d28c
PE
12372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12373 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12374 Don't assume fixnum fits in int.
12375 (Fset_window_scroll_bars):
12376 Check that fixnums are in proper range for system types.
12377 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12378 (string_pos, c_string_pos, number_of_chars, init_iterator)
12379 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12380 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12381 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
12382 (face_before_or_after_it_pos, handle_invisible_prop)
12383 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
12384 (display_prop_intangible_p, string_buffer_position_lim)
12385 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12386 (get_overlay_strings_1, get_overlay_strings)
12387 (iterate_out_of_display_property, forward_to_next_line_start)
12388 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12389 (get_next_display_element, set_iterator_to_next)
12390 (get_visually_first_element, compute_stop_pos_backwards)
12391 (handle_stop_backwards, next_element_from_buffer)
12392 (move_it_in_display_line_to, move_it_in_display_line)
12393 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12394 (add_to_log, message_dolog, message_log_check_duplicate)
12395 (message2, message2_nolog, message3, message3_nolog
12396 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12397 (current_message_1, truncate_echo_area, truncate_message_1)
12398 (set_message, set_message_1, store_mode_line_noprop)
12399 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12400 (text_outside_line_unchanged_p, check_point_in_composition)
12401 (reconsider_clip_changes)
12402 (redisplay_internal, set_cursor_from_row, try_scrolling)
12403 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12404 (redisplay_window, find_last_unchanged_at_beg_row)
12405 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12406 (trailing_whitespace_p, find_row_edges, display_line)
12407 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12408 (display_mode_element, store_mode_line_string)
12409 (pint2str, pint2hrstr, decode_mode_spec)
12410 (display_count_lines, display_string, draw_glyphs)
12411 (x_produce_glyphs, x_insert_glyphs)
12412 (rows_from_pos_range, mouse_face_from_buffer_pos)
12413 (fast_find_string_pos, mouse_face_from_string_pos)
12414 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12416 (safe_call, init_from_display_pos, handle_fontified_prop)
12417 (handle_single_display_spec, load_overlay_strings)
12418 (with_echo_area_buffer, setup_echo_area_for_printing)
12419 (display_echo_area, echo_area_display)
12420 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12421 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
12422 (redisplay_window, dump_glyph_row, display_mode_line)
12423 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 12424 (handle_display_spec, display_prop_string_p):
d311d28c
PE
12425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12426 (handle_single_display_spec, build_desired_tool_bar_string)
12427 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12428 (get_specified_cursor_type):
12429 Check that fixnums are in proper range for system types.
12430 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12431 (Flookup_image_map):
12432 Don't assume fixnums fit in int.
12433 (compare_overlay_entries):
12434 Avoid mishandling comparisons due to subtraction overflow.
12435 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12436 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12437 (handle_tool_bar_click):
12438 Use int, not unsigned, since we prefer signed and the signedness
12439 doesn't matter here.
12440 (get_next_display_element, next_element_from_display_vector):
12441 Use int, not EMACS_INT, when int is wide enough.
12442 (start_hourglass): Use duration_to_sec_usec to do proper
12443 overflow checking on durations.
12444 * xfaces.c (Fbitmap_spec_p):
12445 Check that fixnums are in proper range for system types.
12446 (compare_fonts_by_sort_order):
12447 Avoid mishandling comparisons due to subtraction overflow.
12448 (Fx_family_fonts, realize_basic_faces):
12449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12450 (Fx_family_fonts):
12451 Don't assume fixnum fits in int.
12452 Use SAFE_ALLOCA_LISP, not alloca.
12453 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12454 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12455 (face_at_buffer_position, face_for_overlay_string)
12456 (face_at_string_position):
12457 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12458 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12459 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12460 (Fx_show_tip):
12461 Check that fixnums are in proper range for system types.
12462 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12463 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12464 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12465 (Fx_change_window_property): Don't assume fixnums fit in int.
12466 * xfont.c (xfont_chars_supported):
12467 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12468 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12469 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12471 * xml.c (parse_region):
12472 * xrdb.c (magic_file_p):
12473 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12474 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12475 (x_get_local_selection, x_reply_selection_request)
12476 (x_handle_selection_request, wait_for_property_change):
12477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12478 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12479 short is wide enough.
12480 (x_send_client_event): Don't assume fixnum fits in int.
12481 * xterm.c (x_x_to_emacs_modifiers):
12482 Don't assume EMACS_INT overflows nicely into int.
12483 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12484 may come from Lisp.
12485 (handle_one_xevent): NATNUMP can eval its arg twice.
12486 (x_connection_closed):
12487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12488 * xterm.h: Adjust decls to match defn changes elsewhere.
12489 (struct scroll_bar): Use struct vectorlike_header
12490 rather than rolling our own approximation.
12491 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12492
c6574eb5
GM
124932012-05-25 Glenn Morris <rgm@gnu.org>
12494
12495 * lisp.mk (lisp): Update for more files being compiled now.
12496
e8d32c7e
SM
124972012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12498
48def666
SM
12499 * lread.c: Remove `read_pure' which makes no difference.
12500 (read_pure): Remove var.
12501 (unreadpure): Remove function.
12502 (readevalloop): Don't call read_list with -1 flag.
12503 (read1, read_vector): Don't test read_pure any more.
12504 (read_list): Simplify.
12505
e8d32c7e
SM
12506 * fileio.c, character.h: Minor style tweaks.
12507
4b2addb7
DA
125082012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12509
12510 * window.h (clip_changed): Remove useless declaration.
12511
584461b2
JB
125122012-05-22 Juanma Barranquero <lekktu@gmail.com>
12513
12514 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12515 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12516
34374650
PE
125172012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12518
12519 Remove src/m/*.
12520 This directory predates autoconf and is no longer needed nowadays.
12521 Move its few remaining bits of functionality to where they're needed.
12522 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12523 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12524 * m/template.h: Remove.
12525 * Makefile.in (M_FILE): Remove. All uses removed.
12526 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12527 * lisp.h (USE_LSB_TAG):
12528 * mem-limits.h (EXCEEDS_LISP_PTR):
12529 Use VAL_MAX, not VALBITS, in #if.
12530 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12531 (EMACS_UINT): Define unconditionally now.
12532 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12533 (BITS_PER_EMACS_INT): New constants, replacing
12534 what used to be in config.h, but not useful in #if.
12535 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12536 define them any more.
12537 (VAL_MAX): New macro.
12538 (VALMASK): Use it.
12539 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12540 BITS_PER_EMACS_INT, in #if.
12541 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12542 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12543 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12544 * s/ms-w32.h (DATA_START):
12545 Move here from removed file m/intel386.h.
12546 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12547 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12548
261cb4bb
PE
125492012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12550
12551 Assume C89 or later.
12552 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12553 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12554 (xrealloc):
12555 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12556 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12557 * textprop.c, tparam.c (NULL): Remove.
12558 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12559 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12560 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12561 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12562 * xterm.c (input_signal_count): Assume volatile works.
12563
ff23cd9f
KB
125642012-05-21 Ken Brown <kbrown@cornell.edu>
12565
12566 * xgselect.c (xg_select): Fix first argument in call to 'select'
12567 (bug#11508).
12568
1b170bc6
KB
125692012-05-20 Ken Brown <kbrown@cornell.edu>
12570
12571 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 12572 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 12573
b2f4d39f
KB
125742012-05-19 Ken Brown <kbrown@cornell.edu>
12575
12576 * xfns.c (x_in_use): Remove `static' qualifier.
12577 * xterm.h (x_in_use): Declare.
12578 * xgselect.c: Include xterm.h.
12579 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12580 and `display_arg' (bug#9754).
12581
003fdae2
PE
125822012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12583
9232a6d9
PE
12584 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12585
003fdae2
PE
12586 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12587 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12588
784b56e2
EZ
125892012-05-18 Eli Zaretskii <eliz@gnu.org>
12590
12591 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12592
12593 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 12594 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
12595
12596 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12597 reference to image_cache->refcount.
12598 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12599
a0a79cde
JL
126002012-05-17 Juri Linkov <juri@jurta.org>
12601
12602 * search.c (Fword_search_regexp, Fword_search_backward)
12603 (Fword_search_forward, Fword_search_backward_lax)
12604 (Fword_search_forward_lax): Move functions to isearch.el
12605 (bug#10145, bug#11381).
12606
b0572523
PE
126072012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12608
12609 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12610
9660f5fc
SM
126112012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12612
12613 * lread.c (init_obarray): Declare Qt and Qnil as special.
12614
4374de83
GM
126152012-05-14 Glenn Morris <rgm@gnu.org>
12616
12617 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 12618 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 12619
dc44c39a
PE
126202012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12621
078c97cb
PE
12622 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12623
dc44c39a
PE
12624 * unexaix.c: Port to more-recent AIX compilers.
12625 (report_error, report_error_1, make_hdr, copy_sym)
12626 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12627 Make arguments const char *, not char *, to avoid violations of C
12628 standard and to fix some AIX warnings reported by Gilles Pion.
12629
e18afed7 126302012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
12631
12632 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12633 already have overlays loaded.
12634 (handle_single_display_spec): Before returning without displaying
12635 fringe bitmap, synchronize the bidi iterator with the main display
12636 iterator, by calling iterate_out_of_display_property.
12637 (iterate_out_of_display_property): Detect buffer iteration by
12638 testing that it->string is a Lisp string.
12639 (get_next_display_element): When the current object is exhausted,
12640 and there's something on it->stack, call set_iterator_to_next to
12641 proceed with what's on the stack, instead of returning zero.
12642 (set_iterator_to_next): If called at the end of a Lisp string,
12643 proceed to consider_string_end without incrementing string
12644 position. Don't increment display vector index past the end of
12645 the display vector. (Bug#11417)
c8fb9dc6
EZ
12646 (pos_visible_p): Don't report a position visible when move_it_to
12647 stopped at the last line of window, which happens to be scanned
12648 backwards by the bidi iteration. (Bug#11464)
ac268e67 12649
e18afed7 126502012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
12651
12652 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12653 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
12654 are on a TTY, and thus unable to display on the fringes.
12655 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
12656 so we need to signal to the caller that this is a "replacing"
12657 display spec. This fixes display when the spec is invalid or we
12658 are on a TTY.
12659
e18afed7 126602012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
12661
12662 * unexaix.c (make_hdr): Fix typo in prototype.
12663 This bug broke the build on AIX. Problem reported by Gilles Pion.
12664
9d0a235a
MA
126652012-05-14 Michael Albinus <michael.albinus@gmx.de>
12666
12667 * keyboard.c (kbd_buffer_get_event): Read special events also in
12668 batch mode. (Bug#11415)
12669
9e6b06ed
GM
126702012-05-12 Glenn Morris <rgm@gnu.org>
12671
12672 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12673
c1a1d7a3
EZ
126742012-05-12 Eli Zaretskii <eliz@gnu.org>
12675
12676 * lisp.mk (lisp): Add newcomment.elc.
12677
3fe7cdc8
GM
126782012-05-12 Glenn Morris <rgm@gnu.org>
12679
12680 * Makefile.in (MKDIR_P): New, set by configure.
12681 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12682
53f7d2c0
PE
126832012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12684
12685 Remove unused function hourglass_started.
12686 * dispextern.h (hourglass_started):
12687 * w32fns.c (hourglass_started):
12688 * xdisp.c (hourglass_started): Remove.
12689
75aafb17
JB
126902012-05-10 Juanma Barranquero <lekktu@gmail.com>
12691
12692 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12693 Update dependencies.
12694
12959e8e
PE
126952012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12696
97107e2e
PE
12697 * xgselect.c (xg_select): Put maxfds+1 into a var.
12698 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12699
12959e8e
PE
12700 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12701
836d29b3
DA
127022012-05-10 Dave Abrahams <dave@boostpro.com>
12703
12704 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12705 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12706
5cb67954
MA
127072012-05-09 Michael Albinus <michael.albinus@gmx.de>
12708
12709 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12710 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12711 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12712 Initialize xd_registered_buses.
12713
3478ec45
PE
127142012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12715
b263a6b0
PE
12716 Untag more efficiently if USE_LSB_TAG.
12717 This is based on a proposal by YAMAMOTO Mitsuharu in
12718 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12719 For an admittedly artificial (nth 8000 longlist) benchmark on
12720 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12721 Emacs's overall text size by 1%.
12722 * lisp.h (XUNTAG): New macro.
12723 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12724 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12725 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12726 * eval.c (Fautoload):
12727 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12728 * frame.h (XFRAME): Use XUNTAG.
12729
3478ec45
PE
12730 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12731 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12732 Remove unportable assumptions about print widths of types like
12733 dbus_uint32_t.
12734 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12735 intptr_t when converting between pointer and integer, to avoid GCC
12736 warnings about wrong width.
12737
666b903b 127382012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12739
12740 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12741 stack for each reader_thread, instead of defaulting to 8MB
12742 determined by the linker. This avoids failures in creating
12743 subprocesses on Windows 7, see the discussion in this thread:
12744 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12745
b120cc17
JC
127462012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12747
12748 Fix up display of the *Minibuf-0* buffer in the mini window.
12749 * keyboard.c (read_char): Don't clear the echo area if there's no
12750 message to clear.
12751 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 12752 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 12753
9a4b36f8
MA
127542012-05-07 Michael Albinus <michael.albinus@gmx.de>
12755
12756 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12757 batch mode.
12758
e5f9458f
CY
127592012-05-06 Chong Yidong <cyd@gnu.org>
12760
12761 * lisp.mk (lisp): Update.
12762
eceeb5fc 127632012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
12764
12765 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12766
71873e2b
SM
127672012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12768
12769 * data.c (PUT_ERROR): New macro.
12770 (syms_of_data): Use it. Add new error type `user-error'.
12771 * undo.c (user_error): New function.
12772 (Fprimitive_undo): Use it.
12773 * print.c (print_error_message): Adjust print style for `user-error'.
12774 * keyboard.c (user_error): New function.
12775 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12776
ab0fa4e4
PE
127772012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12778
12779 Do not limit current-time-string to years 1000..9999.
12780 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12781 (Fcurrent_time_string): Support any year that is supported by the
12782 underlying localtime representation. Don't use asctime, as it
12783 has undefined behavior for years outside the range -999..9999.
12784
7ed806a7
PE
127852012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12786
12787 Fix race conditions involving setenv, gmtime, localtime, asctime.
12788 Without this fix, interrupts could mess up code that uses these
12789 nonreentrant functions, since setting TZ invalidates existing
12790 tm_zone or tzname values, and since most of these functions return
12791 pointers to static storage.
12792 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12793 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12794 Grow the critical sections to include not just invoking
12795 localtime/gmtime, but also accessing these functions' results
12796 including their tm_zone values if any, and any related TZ setting.
12797 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
12798 so that the struct tm is saved in the critical section.
12799 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
12800 motivated by the fact that memory allocation needs to be outside
12801 the critical section.
12802
0c16dfed
DA
128032012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12804
12805 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12806 with RESET_INTERVAL.
12807
12808 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12809 Remove duplicated buffer name initialization.
12810
3f83ace8
JM
128112012-05-02 Jim Meyering <jim@meyering.net>
12812
12813 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12814
c7b8541e
JM
12815 * xfns.c (x_window): Use xstrdup (Bug#11375).
12816
90207a15 128172012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
12818
12819 * xdisp.c (pos_visible_p): If already at a newline from the
12820 display string before the 'while' loop, don't walk back the glyphs
12821 from it3.glyph_row. Solves assertion violation when the display
12822 string begins with a newline (egg.el). (Bug#11367)
12823
b593d6a9
AH
128242012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12825
12826 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12827 Move to simple.el.
12828
4737362e
GM
128292012-05-01 Glenn Morris <rgm@gnu.org>
12830
99cf43f9
GM
12831 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12832 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12833 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12834 All were removed before 23.1.
12835
9311dcff
GM
12836 * dispnew.c: Remove HAVE_LIBNCURSES test;
12837 it is always true on relevant platforms.
12838
4d5c6349
GM
12839 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12840 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12841
4737362e
GM
12842 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12843
74dd3a6b
AS
128442012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12845
12846 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12847 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12848 Remove.
12849
13c379ee
PE
128502012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12851
12852 Do not avoid creating empty evaporating overlays (Bug#9642).
12853 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12854 That is, do not delete an evaporating overlay if it becomes
12855 empty after its bounds are adjusted to fit within its buffer.
12856 This fix caused other problems, and I'm reverting it until we get
12857 to the bottom of them.
12858
a8e7d6d7 128592012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
12860
12861 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12862
a8e7d6d7 128632012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
12864
12865 * xdisp.c (pos_visible_p): If the window start position is beyond
12866 ZV, start the display from buffer beginning. Prevents assertion
12867 violation in init_iterator when the minibuffer window is scrolled
12868 via the scroll bar.
12869
12870 * window.c (window_scroll_pixel_based): Likewise.
12871
a8e7d6d7 128722012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
12873
12874 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12875
a8e7d6d7 128762012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
12877
12878 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12879 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12880
a8e7d6d7 128812012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 12882
b593d6a9
AH
12883 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12884 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 12885
1c6900d9
EZ
128862012-04-26 Eli Zaretskii <eliz@gnu.org>
12887
4c3fa1d9
EZ
12888 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12889 display element, check also the underlying string or buffer
12890 character. (Bug#11341)
12891
1c6900d9
EZ
12892 * w32menu.c: Include w32heap.h.
12893 (add_menu_item): If the call to AppendMenuW (via
12894 unicode_append_menu) fails, disable Unicode menus only if we are
12895 running on Windows 9X/Me.
12896
42bf8205
AS
128972012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12898
12899 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12900 (xgetint): Add missing shift for LSB tags.
12901
b1bac16e
MR
129022012-04-24 Martin Rudalics <rudalics@gmx.at>
12903
12904 * keyboard.c (read_char): Don't wipe echo area for select window
12905 events: These might get delayed via `mouse-autoselect-window'
12906 (Bug#11304).
12907
d69621cc
JB
129082012-04-24 Juanma Barranquero <lekktu@gmail.com>
12909
12910 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12911 manipulation of :loaded-from data.
12912
02fd101b
JB
129132012-04-23 Juanma Barranquero <lekktu@gmail.com>
12914
12915 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12916 now a cons (bug#11311).
12917
888bec30
PE
129182012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12919
89a438bd
PE
12920 Do not create empty overlays with the evaporate property (Bug#9642).
12921 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12922 if it becomes empty after its bounds are adjusted to fit within
12923 its buffer. Without this fix, in a nonempty buffer (let ((o
12924 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12925 yields an empty overlay that has the evaporate property, which is
12926 not supposed to happen.
12927
1068fe4d
PE
12928 Fix minor GTK3 problems found by static checking.
12929 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12930 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12931 (struct _EmacsFixedClass, emacs_fixed_get_type):
12932 Move decls here from emacsgtkfixed.h, since they needn't be public.
12933 (emacs_fixed_get_type): Now static.
12934 (emacs_fixed_class_init): Omit unused local.
12935 (emacs_fixed_child_type): Remove; unused.
12936 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12937 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12938 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12939 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12940 (EMACS_FIXED_GET_CLASS): Remove; unused.
12941 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12942
888bec30
PE
12943 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12944 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12945
de85e130
PE
129462012-04-22 Paul Eggert <eggert@cs.ucla.edu>
12947
d0baac98 12948 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 12949 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
12950 (__malloc_size_t, __malloc_ptrdiff_t):
12951 Remove. All uses removed, replaced by the definiens if needed,
12952 since we can assume C89 or better now.
12953 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
12954 (protect_malloc_state, align, get_contiguous_space)
12955 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
12956 (malloc_atfork_handler_child, malloc_enable_thread)
12957 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
12958 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
12959 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
12960 (special_realloc, _realloc_internal_nolock, _realloc_internal)
12961 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
12962 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
12963 Define using prototypes, not old style.
12964 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
12965 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
12966 (align): Don't assume that signed integer overflow wraps around.
12967 Omit unused local var.
12968 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
12969 (_free_internal_nolock, memalign, mallochook, reallochook):
12970 Omit no-longer-needed casts.
12971 (valloc): Use getpagesize, not __getpagesize.
12972 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
12973 (struct hdr): The 'magic' member is now size_t, not unsigned long.
12974
de85e130
PE
12975 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
12976
dcbf5805
MA
129772012-04-22 Michael Albinus <michael.albinus@gmx.de>
12978
12979 Move functions from C to Lisp. Make non-blocking method calls
12980 the default. Implement further D-Bus standard interfaces.
12981
12982 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
12983 (QCdbus_request_name_allow_replacement)
12984 (QCdbus_request_name_replace_existing)
12985 (QCdbus_request_name_do_not_queue)
12986 (QCdbus_request_name_reply_primary_owner)
12987 (QCdbus_request_name_reply_in_queue)
12988 (QCdbus_request_name_reply_exists)
12989 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
12990 (QCdbus_registered_serial, QCdbus_registered_method)
12991 (QCdbus_registered_signal): New Lisp objects.
12992 (XD_DEBUG_MESSAGE): Use sizeof.
12993 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
12994 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
12995 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
12996 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
12997 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
12998 (xd_signature, xd_append_arg): Allow float for integer types.
12999 (xd_get_connection_references): New function.
b593d6a9
AH
13000 (xd_get_connection_address): Rename from xd_initialize.
13001 Return cached address.
dcbf5805
MA
13002 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13003 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13004 level.
13005 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13006 Return number of refcounts.
dcbf5805
MA
13007 (Fdbus_get_unique_name): Make stronger parameter check.
13008 (Fdbus_message_internal): New defun.
13009 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13010 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13011 (Fdbus_send_signal, Fdbus_register_service)
13012 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13013 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13014 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13015 (Vdbus_compiled_version, Vdbus_runtime_version)
13016 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13017 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13018 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13019 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13020 Adapt docstring.
dcbf5805 13021
52828e02
PE
130222012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13023
da05bc4c
PE
13024 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13025 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13026 Do not assume ptrdiff_t is the same width as 'int'.
13027
52828e02
PE
13028 * alloc.c: Handle unusual debugging option combinations.
13029 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13030 since the two debugging options are incompatible.
13031 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13032 is defined.
13033 (mem_init, mem_insert, mem_insert_fixup):
13034 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13035 (NEED_MEM_INSERT): Remove; no longer needed.
13036
f01769f9
LL
130372012-04-22 Leo Liu <sdl.web@gmail.com>
13038
13039 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13040
5790543d
PE
130412012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13042
13043 * sysdep.c [__FreeBSD__]: Minor cleanups.
13044 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13045 Use Emacs indenting style more consistently. Avoid some casts.
13046 Use 'double' consistently rather than mixing 'float' and 'double'.
13047
b91b7e4d
EW
130482012-04-21 Eduard Wiebe <usenet@pusto.de>
13049
b593d6a9
AH
13050 * sysdep.c (list_system_processes, system_process_attributes):
13051 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 13052
6114eb15
AS
130532012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13054
13055 * lisp.mk (lisp): Update.
13056
2f38dff7
PE
130572012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13058
13059 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13060 It is never used otherwise.
13061
4ae29f89
SM
130622012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13063
13064 * print.c (print_preprocess): Only check print_depth if print-circle
13065 is nil.
13066 (print_object): Check for cycles even when print-circle is nil and
13067 print-gensym is t, but only check print_depth if print-circle is nil.
13068
f30d612a
CY
130692012-04-20 Chong Yidong <cyd@gnu.org>
13070
13071 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13072 set the status to "failed" and ensure that sentinel is run.
13073
c07a4c0b 130742012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
13075
13076 * process.c (Fset_process_inherit_coding_system_flag)
13077 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 13078 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 13079
c07a4c0b 130802012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
13081
13082 * xdisp.c (string_buffer_position_lim): Limit starting position to
13083 BEGV.
13084 (set_cursor_from_row): If called for a mode-line or header-line
13085 row, return zero immediately.
13086 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
13087 farther than the first row after the header line, if any.
13088 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
13089 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13090
c07a4c0b 130912012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13092
4ae29f89
SM
13093 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13094 (bug#11238).
ad3a2b41 13095
c07a4c0b 130962012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 130972012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
13098
13099 configure: new option --enable-gcc-warnings (Bug#11207)
13100 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13101 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13102 (ALL_CFLAGS): Use new macros rather than old.
13103 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13104 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13105 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13106 -Wunused-result, -Wunused-variable. This should go away once
13107 the Emacs and Gnulib regex code is merged.
13108 (xmalloc, xrealloc): Now static.
13109
aba027e8
PE
131102012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13111
13112 * dired.c (Fsystem_groups): Remove unused local.
13113
e5a36063
GM
131142012-04-17 Glenn Morris <rgm@gnu.org>
13115
13116 * dired.c (Fsystem_users): Doc fix.
13117
316411f0
DA
131182012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13119
13120 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13121 (syms_of_dired): Add them.
13122
9426aba4
PE
131232012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13124
b62a57be
PE
13125 Fix minor alloc.c problems found by static checking.
13126 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13127 New extern decls, to avoid calling undeclared functions.
13128 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13129 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13130 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13131 (NEED_MEM_INSERT): New macro.
13132 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 13133 Remove one incorrect comment and fix another.
b62a57be 13134
3539f31f
PE
13135 Fix minor ralloc.c problems found by static checking.
13136 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13137 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13138 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13139 (r_alloc_sbrk): Now static.
13140
a041960a
PE
13141 Improve ralloc.c interface checking.
13142 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13143 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13144 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13145 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13146 [REL_ALLOC]: ... to here, to check interface.
13147 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13148 Remove decls. This fixes an "It stinks!".
13149
9426aba4
PE
13150 * alloc.c (which_symbols): Fix alignment issue / type clash.
13151
d55c12ed
AS
131522012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13153
13154 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13155 (struct Lisp_Misc_Any): Likewise.
13156 (struct Lisp_Free): Likewise.
13157 * alloc.c (union aligned_Lisp_Symbol): Define.
13158 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13159 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13160 (union aligned_Lisp_Misc): Define.
13161 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13162 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 13163 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 13164
b948ce8b
PE
131652012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13166
13167 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13168 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13169 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13170 * s/netbsd.h, s/sol2-6.h:
13171 Remove definition of GC_MARK_STACK, since the default now works.
13172 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13173 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13174 no longer the default.
13175 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13176
35dc09a1 131772012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13178
35dc09a1
GM
13179 * lread.c (lisp_file_lexically_bound_p):
13180 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 13181
35dc09a1
GM
131822012-04-14 Eli Zaretskii <eliz@gnu.org>
13183
13184 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13185 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13186
131872012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13188
13189 * nsterm.m (constrainFrameRect): Always constrain when there is only
13190 one screen (Bug#10962).
13191
bcd86815
KB
131922012-04-13 Ken Brown <kbrown@cornell.edu>
13193
13194 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13195
c25df26e
RT
131962012-04-13 Reuben Thomas <rrt@sc3d.org>
13197
13198 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13199
0fc59f1e
DC
132002012-04-11 Daniel Colascione <dancol@dancol.org>
13201
13202 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13203 against is gone. It's better to use vfork now so that when Cygwin
13204 gains a new, working vfork, we use it automatically (bug#10398).
13205
de8c03dc
SM
132062012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13207
13208 * window.c (save_window_save): Obey window-point-insertion-type.
13209
2f097256
GM
132102012-04-11 Glenn Morris <rgm@gnu.org>
13211
13212 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13213
453b951e
SM
132142012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13215
13216 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13217
75f1671a 132182012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
13219
13220 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13221 (force_quit_count): New var.
13222 (handle_interrupt): Use it.
13223
2a8ce227
JB
132242012-04-10 Juanma Barranquero <lekktu@gmail.com>
13225
13226 * w32.c (w32_delayed_load): Record the full path of the library
13227 being loaded (bug#10424).
13228
935396c0
GM
132292012-04-09 Glenn Morris <rgm@gnu.org>
13230
05920a43
GM
13231 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13232 not just in the obarray, before snarfing them. (Bug#11036)
13233
935396c0
GM
13234 * Makefile.in ($(leimdir)/leim-list.el):
13235 Pass EMACS rather than BUILT_EMACS.
13236
a18ecafa
TZ
132372012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13238
13239 * process.c (make_process):
13240 * process.h: Add integer `gnutls_handshakes_tried' member to
13241 process struct.
13242
6bbef4e5
JC
13243 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13244 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
13245
13246 * gnutls.c (gnutls_log_function2i): Convenience log function.
13247 (emacs_gnutls_read): Use new log functions,
13248 `gnutls_handshakes_tried' process member, and
13249 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13250 attempts per process (connection).
13251
b4d3bc10
CY
132522012-04-09 Chong Yidong <cyd@gnu.org>
13253
13254 * eval.c (Fuser_variable_p, user_variable_p_eh)
13255 (lisp_indirect_variable): Functions deleted.
13256 (Fdefvar): Caller changed.
13257
13258 * callint.c (Finteractive, Fcall_interactively):
13259 * minibuf.c (Fread_variable): Callers changed.
13260
70f4d973
EZ
132612012-04-09 Eli Zaretskii <eliz@gnu.org>
13262
13263 * xdisp.c (set_cursor_from_row): If the display string appears in
13264 the buffer at position that is closer to point than the position
13265 after the display string, display the cursor on the first glyph of
13266 the display string. Fixes cursor display when a 'display' text
13267 property immediately follows invisible text. (Bug#11094)
13268
cb3c2e3e
PE
132692012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13270
13271 composite.c: use 'double' consistently
13272 * composite.c (get_composition_id): Use 'double' consistently
13273 instead of converting 'float' to 'double' and vice versa; this is
13274 easier to understand and avoids a GCC warning.
13275
fd06db5d
GM
132762012-04-09 Glenn Morris <rgm@gnu.org>
13277
50fe702a
GM
13278 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13279 preparation for dumping it with emacs. (Bug#4789)
13280 (leimdir): New variable.
13281 ($(leimdir)/leim-list.el): New rule.
13282 (emacs$(EXEEXT)): Depend on leim-list.el.
13283
fd06db5d
GM
13284 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13285 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13286 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13287
55c131ee
AS
132882012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13289
13290 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13291 proper alignment.
13292
9209588f
JB
132932012-04-07 Juanma Barranquero <lekktu@gmail.com>
13294
13295 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13296 Remove unused local variable.
13297
e3fb2efb
PE
132982012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13299
13300 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13301 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13302 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13303 objects, as mark_maybe_pointer will catch them otherwise.
13304 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13305 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13306
b5385551
PE
133072012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13308
13309 Fix typo that broke non-Windows builds.
13310 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13311
9078ead6
EZ
133122012-04-07 Eli Zaretskii <eliz@gnu.org>
13313
13314 Support building on MS-Windows with libxml2.
13315
13316 * makefile.w32-in (OBJ2): Add xml.$(O).
13317 (GLOBAL_SOURCES): Add xml.c.
13318 ($(BLD)/xml.$(O)): New dependency list.
13319
13320 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13321 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13322 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13323 [!WINDOWSNT]: New macros.
13324 (init_libxml2_functions, libxml2_loaded_p): New functions.
13325 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13326 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13327 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13328 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13329 linked in).
6bbef4e5
JC
13330 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13331 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13332 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13333
13334 * emacs.c: Don't include libxml/parser.h.
13335 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13336 xmlCleanupParser directly.
13337
13338 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13339
3811fdf3
EZ
133402012-04-07 Eli Zaretskii <eliz@gnu.org>
13341
13342 * indent.c (Fvertical_motion): If there is a display string at
13343 point, use it.vpos to compute how many lines to backtrack after
13344 move_it_to point. (Bug#11133)
13345
2f8e16b2
EZ
133462012-04-06 Eli Zaretskii <eliz@gnu.org>
13347
13348 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13349 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13350 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13351 macros related to unification of CJK characters. For the details,
13352 see the discussion following the message here:
13353 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13354
3d439cd1
CY
133552012-04-04 Chong Yidong <cyd@gnu.org>
13356
13357 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13358
8bc53d00
EZ
133592012-04-01 Eli Zaretskii <eliz@gnu.org>
13360
13361 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13362 instead of alloca. (Bug#11138)
13363
3b0512a3
AS
133642012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13365
13366 * w32menu.c (is_simple_dialog): Properly check lisp types.
13367 (Bug#11141)
13368
8427ddd2
EZ
133692012-03-31 Eli Zaretskii <eliz@gnu.org>
13370
979022ef
EZ
13371 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13372 position we get to after a call to move_it_to fails the
13373 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13374 only if we wind up in a string from display property. (Bug#11063)
13375
a6b1c7cc
EZ
13376 * window.c (Fdelete_other_windows_internal): Invalidate the row
13377 and column information about mouse highlight, so that redisplay
13378 restores it after reallocating the glyph matrices. (Bug#7464)
13379
8427ddd2
EZ
13380 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13381 string comes from a `display' text property, use the buffer
13382 position of that property as if we actually saw that position in
13383 the row's glyphs.
697ba24b
EZ
13384 (move_it_by_lines): Remove the assertion that
13385 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13386 violated when there's a before-string at the beginning of a line.
13387 (Bug#11063)
8427ddd2 13388
65a0a738
EZ
133892012-03-30 Eli Zaretskii <eliz@gnu.org>
13390
13391 * xdisp.c (append_space_for_newline): If the default face was
13392 remapped, use the remapped face for the appended newline.
13393 (extend_face_to_end_of_line): Use the remapped default face for
13394 extending the face to the end of the line.
13395 (display_line): Call extend_face_to_end_of_line when the default
13396 face was remapped. (Bug#11068)
13397
581355cc
EZ
133982012-03-29 Eli Zaretskii <eliz@gnu.org>
13399
13400 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13401
e8fc049f
SM
134022012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13403
13404 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13405
4fb9a543
GM
134062012-03-27 Glenn Morris <rgm@gnu.org>
13407
13408 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13409 Doc fixes.
13410
679910f1
KH
134112012-03-26 Kenichi Handa <handa@m17n.org>
13412
13413 * dispextern.h (struct glyph): Fix previous change. Change the
13414 bit length of glyphless.ch to 25 (Bug#11082).
13415
90d49b7f
CY
134162012-03-26 Chong Yidong <cyd@gnu.org>
13417
13418 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13419 (command_loop_1): Use it; inhibit selection update for
13420 handle-select-window too (Bug#8996).
13421
f514f6f0
FP
134222012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13423
e8fc049f 13424 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 13425
bf43fa51
KH
134262012-03-25 Kenichi Handa <handa@m17n.org>
13427
13428 * dispextern.h (struct glyph): Change the bit length of
13429 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13430
8a0c01dd
EZ
134312012-03-24 Eli Zaretskii <eliz@gnu.org>
13432
13433 * s/ms-w32.h (tzname): Include time.h before redirecting to
13434 _tzname. Fixes the MSVC build. (Bug#9960)
13435
7d1c3a76
AS
134362012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13437
8ed79523
AS
13438 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13439 characters.
13440
7d1c3a76
AS
13441 * xterm.c (XTread_socket): Only modify handling_signal if
13442 !SYNC_INPUT. (Bug#11080)
13443
e99a9b8b
EZ
134442012-03-23 Eli Zaretskii <eliz@gnu.org>
13445
13446 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13447 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13448 when fetching a multibyte character consumes more bytes than
13449 CHAR_BYTES returns, due to unification of CJK characters in
13450 string_char. (Bug#11073)
13451
5063c0e1
TN
134522012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13453
13454 * process.c (wait_reading_process_output): Handle pty disconnect
13455 by refraining from sending oneself a SIGCHLD (bug#10933).
13456
9f851fbd
CY
134572012-03-22 Chong Yidong <cyd@gnu.org>
13458
13459 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13460
5063c0e1 13461 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
13462 Mark string as coming from a prefix property.
13463 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13464 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13465
fb5b8aca
CY
134662012-03-21 Chong Yidong <cyd@gnu.org>
13467
13468 * xfaces.c (Vface_remapping_alist): Doc fix.
13469
62356a1b
EZ
134702012-03-20 Eli Zaretskii <eliz@gnu.org>
13471
13472 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
13473 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13474 Doc fixes.
62356a1b 13475
025de85b
CY
134762012-03-20 Chong Yidong <cyd@gnu.org>
13477
13478 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13479 to reflect default non-nil value of redisplay-dont-pause.
13480
4827f94e
KH
134812012-03-19 Kenichi Handa <handa@m17n.org>
13482
13483 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13484 it fit in a valid range (Bug#11003).
13485
e50a24a2
EZ
134862012-03-18 Eli Zaretskii <eliz@gnu.org>
13487
13488 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13489 that is not from display property, accept the row as a "cursor
13490 row" if one of the string's character has a non-nil `cursor'
13491 property. Fixes cursor positioning when there are newlines in
13492 overlay strings, e.g. in icomplete.el. (Bug#11035)
13493
9af5ed87
PE
134942012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13495
13496 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13497
d1f55f16
CY
134982012-03-12 Chong Yidong <cyd@gnu.org>
13499
13500 * eval.c (inhibit_lisp_code): Rename from
13501 inhibit_window_configuration_change_hook; move from window.c.
13502
13503 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13504 * window.c (run_window_configuration_change_hook)
13505 (syms_of_window): Callers changed.
13506
66c5eebd
CY
135072012-03-11 Chong Yidong <cyd@gnu.org>
13508
413df973
CY
13509 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13510
66c5eebd
CY
13511 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13512
1de11f56
CY
135132012-03-10 Chong Yidong <cyd@gnu.org>
13514
13515 * frame.c (other_visible_frames): Don't assume the selected frame
13516 is visible (Bug#10955).
13517
cae07000
SM
135182012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13519
13520 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13521
89c94350
JD
135222012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13523
13524 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13525 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13526 zero (Bug#10954).
13527
999dd333
GM
135282012-03-03 Glenn Morris <rgm@gnu.org>
13529
01a6dcc8 13530 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 13531
de0100f2
EZ
135322012-03-02 Eli Zaretskii <eliz@gnu.org>
13533
13534 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13535 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
13536 (redisplay_window, next_element_from_string): Fix typos in
13537 comments.
3e441275
EZ
13538 (redisplay_window): Pass to move_it_vertically the margin in
13539 pixels, not in screen lines.
de0100f2 13540
96a72ee9
GM
135412012-03-02 Glenn Morris <rgm@gnu.org>
13542
13543 * buffer.c (buffer-list-update-hook): Doc fix.
13544
312508d7
EZ
135452012-02-29 Eli Zaretskii <eliz@gnu.org>
13546
13547 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13548 push_it before setting up the iterator for the first overlay
13549 string, even if we have an empty string loaded.
13550 (next_overlay_string): If there's an empty string on the iterator
13551 stack, pop the stack. (Bug#10903)
13552
27f3c637
PE
135532012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13554
13555 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13556 Suggested by Stefan Monnier in
13557 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13558 * alloc.c (widen_to_Lisp_Object): New static function.
13559 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13560 and widening them to Lisp_Objects. This would work even if
13561 USE_LSB_TAG is defined and wide integers are used, which might
13562 happen in a future version of Emacs.
13563
3c9dfce6
CY
135642012-02-25 Chong Yidong <cyd@gnu.org>
13565
fa74b241
CY
13566 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13567 Doc fix.
13568
3c9dfce6
CY
13569 * xselect.c (Fx_selection_exists_p): Doc fix.
13570 (x_clipboard_manager_save_all): Print an informative message
13571 before saving to clipboard manager.
13572
9486df08
CY
135732012-02-24 Chong Yidong <cyd@gnu.org>
13574
13575 * keyboard.c (process_special_events): Handle all X selection
13576 requests in kbd_buffer, not just the next one (Bug#8869).
13577
f01d3321
CY
135782012-02-23 Chong Yidong <cyd@gnu.org>
13579
13580 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13581 call when setting menu-bar-lines and tool-bar-lines parameters.
13582 (unwind_create_frame_1): New helper function.
13583
13584 * window.c (inhibit_window_configuration_change_hook): New var.
13585 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 13586 (syms_of_window): Initialize it.
f01d3321 13587
86b847b6
CY
135882012-02-22 Chong Yidong <cyd@gnu.org>
13589
13590 * xterm.c (x_draw_image_relief): Add missing type check for
13591 Vtool_bar_button_margin (Bug#10743).
13592
a59225b1
CY
135932012-02-21 Chong Yidong <cyd@gnu.org>
13594
13595 * fileio.c (Vfile_name_handler_alist): Doc fix.
13596
13597 * buffer.c (Fget_file_buffer): Protect against invalid file
13598 handler return value.
13599
310f5bd4
PE
136002012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13601
cb3a28cc
PE
13602 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13603 when computing $valmask.
13604
310f5bd4
PE
13605 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13606 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13607 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13608 It's useless in that case, and it can cause problems on hosts
13609 that allocate halves of EMACS_INT values separately.
13610 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13611 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13612 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13613 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13614 it avoids undefined behavior on hosts where shifting right by more
13615 than the word width has undefined behavior.
13616
2375c96a
CY
136172012-02-19 Chong Yidong <cyd@gnu.org>
13618
13619 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13620 (Funhandled_file_name_directory, Ffile_name_as_directory)
13621 (Fdirectory_file_name, Fexpand_file_name)
13622 (Fsubstitute_in_file_name): Protect against invalid file handler
13623 return values (Bug#10845).
13624
3eb49e71
EZ
136252012-02-18 Eli Zaretskii <eliz@gnu.org>
13626
13627 * .gdbinit (pitx): Fix incorrect references to fields of the
13628 iterator stack.
13629
7b926f3f
CY
136302012-02-17 Chong Yidong <cyd@gnu.org>
13631
13632 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13633
11273115
PE
136342012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13635
13636 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13637 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13638
c3a70e2b
CY
136392012-02-15 Chong Yidong <cyd@gnu.org>
13640
13641 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13642 marked as special. Also, starting docstrings with * is obsolete.
13643
0ca43699
AS
136442012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13645
13646 * gnutls.c (emacs_gnutls_write): Fix last change.
13647
2e8f3c56
LI
136482012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13649
13650 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13651 send_process.
13652
af70074f
SM
136532012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13654
13655 * keymap.c (Fsingle_key_description): Handle char ranges.
13656
95986d52
CY
136572012-02-12 Chong Yidong <cyd@gnu.org>
13658
afd83bd1
CY
13659 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13660 as that creates a dangerous corner case.
13661
95986d52
CY
13662 * window.c (Fdelete_window_internal): Invalidate the mouse
13663 highlight (Bug#9904).
13664
bd7da63e
GM
136652012-02-12 Glenn Morris <rgm@gnu.org>
13666
13667 * xselect.c (Fx_own_selection_internal)
13668 (Fx_get_selection_internal, Fx_disown_selection_internal)
13669 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13670 * nsselect.m (Fx_own_selection_internal)
13671 (Fx_disown_selection_internal, Fx_selection_exists_p)
13672 (Fx_selection_owner_p, Fx_get_selection_internal):
13673 Sync docs and argument specs with the xselect.c versions.
13674
77abcbc2
LI
136752012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13676
13677 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13678
90b671e2
EZ
136792012-02-11 Eli Zaretskii <eliz@gnu.org>
13680
1c0ca0b7
EZ
13681 * w32select.c (Fx_selection_exists_p): Sync doc string and
13682 argument list with xselect.c. (Bug#10783)
13683
13684 * w16select.c (Fx_selection_exists_p): Sync doc string and
13685 argument list with xselect.c. (Bug#10783)
90b671e2 13686
49241268
GM
136872012-02-10 Glenn Morris <rgm@gnu.org>
13688
13689 * fns.c (Fsecure_hash): Doc fix.
13690
f998bbe7 136912012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13692
13693 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13694
0992bd9c
CY
136952012-02-07 Chong Yidong <cyd@gnu.org>
13696
13697 * buffer.c (Fbuffer_local_variables)
13698 (buffer_lisp_local_variables): Handle unbound vars correctly;
13699 don't let Qunbound leak into Lisp.
13700
af008560
GM
137012012-02-07 Glenn Morris <rgm@gnu.org>
13702
dd605cc4
GM
13703 * image.c (Fimagemagick_types): Doc fix.
13704
af008560
GM
13705 * image.c (imagemagick-render-type): Change it from a lisp object
13706 to an integer. Move the doc here from the lisp manual.
13707 Treat all values not equal to 0 the same.
13708
1449fa1d
CY
137092012-02-06 Chong Yidong <cyd@gnu.org>
13710
13711 * doc.c (store_function_docstring): Avoid applying docstring of
13712 alias to base function (Bug#2603).
13713
3723ec07
AS
137142012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13715
13716 * .gdbinit (pp1, pv1): Remove redundant defines.
13717 (pr): Use pp.
13718
79c1cc1e
CY
137192012-02-04 Chong Yidong <cyd@gnu.org>
13720
13721 * nsterm.m: Declare a global (Bug#10694).
13722
d7f29f8e
EZ
137232012-02-04 Eli Zaretskii <eliz@gnu.org>
13724
cae07000
SM
13725 * w32.c (get_emacs_configuration_options):
13726 Include --enable-checking, if specified, in the return value.
d7f29f8e 13727
3b95a6f9
MR
137282012-02-04 Martin Rudalics <rudalics@gmx.at>
13729
13730 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13731 after rounding frame sizes. (Bug#9723)
13732
d6fa96a6
EZ
137332012-02-04 Eli Zaretskii <eliz@gnu.org>
13734
13735 * keyboard.c (adjust_point_for_property): Don't position point
13736 before BEGV. (Bug#10696)
13737
df0b2940
PE
137382012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13739
13740 Handle overflow when computing char display width (Bug#9496).
13741 * character.c (char_width): Return EMACS_INT, not int.
13742 (char_width, c_string_width): Check for overflow when
13743 computing the width; this is possible now that individual
13744 characters can have unbounded width. Problem introduced
13745 by merge from Emacs 23 on 2012-01-19.
13746
6bee44d6
MA
137472012-02-02 Michael Albinus <michael.albinus@gmx.de>
13748
13749 * dbusbind.c (Fdbus_register_method): Mention the return value
13750 :ignore in the docstring.
13751
44f92739
GM
137522012-02-02 Glenn Morris <rgm@gnu.org>
13753
1b9f60cc
GM
13754 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13755
44f92739
GM
13756 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13757 Unconditionally set to t. (Bug#10673)
13758 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13759 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13760 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13761
c5d3843c
KH
137622012-02-02 Kenichi Handa <handa@m17n.org>
13763
13764 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13765 0, do not call append_composite_glyph.
13766
159462d4 137672012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
13768
13769 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13770 NULL (Bug#6988).
13771 (x_produce_glyphs): If the component of a composition is a null
13772 string, set it->pixel_width to 1 to avoid zero-width glyph.
13773
78cef877
EZ
137742012-02-01 Eli Zaretskii <eliz@gnu.org>
13775
13776 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13777 first 2 arguments are identical. This makes inserting large
13778 output from a subprocess an order of magnitude faster on
13779 MS-Windows, where all sbrk'ed memory is always contiguous.
13780
97897668
GM
137812012-01-31 Glenn Morris <rgm@gnu.org>
13782
13783 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 13784 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
13785 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13786
31fd3586
GM
137872012-01-29 Glenn Morris <rgm@gnu.org>
13788
13789 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13790
0e24a8b2
CY
137912012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13792
13793 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13794
cc0adcb0
CY
137952012-01-28 Chong Yidong <cyd@gnu.org>
13796
13797 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13798
acc28cb9
CY
137992012-01-26 Chong Yidong <cyd@gnu.org>
13800
9c69cfb7
CY
13801 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13802
acc28cb9
CY
13803 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13804 repeat counts (Bug#10507).
13805
48da7392
GM
138062012-01-26 Glenn Morris <rgm@gnu.org>
13807
13808 * lread.c (syms_of_lread): Doc fix.
13809
14af5f7f
CY
138102012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13811
13812 * coding.c (encode_designation_at_bol): Change return value to
13813 EMACS_INT.
13814
0b21c100
CY
138152012-01-25 Chong Yidong <cyd@gnu.org>
13816
13817 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13818
3c2907f7
CY
138192012-01-21 Chong Yidong <cyd@gnu.org>
13820
13821 * floatfns.c (Fcopysign): Make the second argument non-optional,
13822 since nil is not allowed anyway.
13823
959ad23f
AS
138242012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13825
13826 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13827 (send_process): Likewise.
13828
34a02f46
MR
138292012-01-19 Martin Rudalics <rudalics@gmx.at>
13830
13831 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
13832 (Vwindow_persistent_parameters): Do not use Qstate.
13833 Rewrite doc-strings.
34a02f46 13834
1259009a 138352012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
13836
13837 * character.c (char_width): New function.
70d4fdf6
GM
13838 (Fchar_width, c_string_width, lisp_string_width):
13839 Use char_width (Bug#9496).
25ed9e61 13840
6a6ee00d
MR
138412012-01-16 Martin Rudalics <rudalics@gmx.at>
13842
13843 * window.c (Vwindow_persistent_parameters): New variable.
13844 (Fset_window_configuration, save_window_save): Handle persistent
13845 window parameters.
13846
c85efaf7
EZ
138472012-01-14 Eli Zaretskii <eliz@gnu.org>
13848
13849 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13850 thrashing the stack of the thread. (Bug#9087)
13851
5944709e
PE
138522012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13853
13854 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13855
e71f5d99
EZ
138562012-01-11 Eli Zaretskii <eliz@gnu.org>
13857
13858 * xdisp.c (rows_from_pos_range): Handle the case where the
13859 highlight ends on a newline. (Bug#10464)
13860 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13861 he end column for display of highlight that ends on a newline
13862 before a R2L line.
13863
ce316182
GM
138642012-01-11 Glenn Morris <rgm@gnu.org>
13865
13866 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13867 from load-path also when installation-directory is nil. (Bug#10208)
13868
5b43da69
GM
138692012-01-10 Glenn Morris <rgm@gnu.org>
13870
74cc8ff9
GM
13871 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13872
7d8d6e4e
GM
13873 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13874 Update template values to be closer to their typical values these days.
5b43da69 13875
a0db8d43
EZ
138762012-01-09 Eli Zaretskii <eliz@gnu.org>
13877
13878 * xdisp.c (rows_from_pos_range): Accept additional argument
13879 DISP_STRING, and accept any glyph in a row whose object is that
13880 string as eligible for mouse highlight. Fixes mouse highlight of
13881 display strings from overlays. (Bug#10464)
13882
9a0115ab 138832012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 13884
b9110d6a 13885 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
13886 * fileio.c (auto_saving_dir_umask): New static var.
13887 (Fmake_directory_internal): Use it.
13888 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13889 creating the directory. The old code temporarily assigns
13890 too-generous permissions to the directory.
13891 (do_auto_save_eh): Clear it.
b9110d6a 13892 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
13893 that the var is always cleared.
13894
6c1bd3f3
EZ
138952012-01-07 Eli Zaretskii <eliz@gnu.org>
13896
13897 * search.c (scan_buffer): Pass character positions to
13898 know_region_cache, not byte positions. (Bug#6540)
13899
069d2b50
L
139002012-01-07 LynX <_LynX@bk.ru> (tiny change)
13901
13902 * w32.c (sys_rename): Report EXDEV when rename of a directory
13903 fails because the target is on another logical disk. (Bug#10284)
13904
75bf0d33
DB
139052012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13906
13907 * xterm.c (x_embed_request_focus): New function.
13908
13909 * xterm.h: Add prototype.
13910
13911 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13912
1c6e5a32
GM
139132012-01-05 Glenn Morris <rgm@gnu.org>
13914
13915 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13916
651e947e
EZ
139172012-01-01 Eli Zaretskii <eliz@gnu.org>
13918
13919 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13920 Load gnutls_transport_set_lowat only if GnuTLS version is below
13921 2.11.1.
13922 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13923 GnuTLS versions below 2.11.1.
13924
3778cdd8
AL
139252011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13926
13927 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13928 to the doc string advising against its use for altering the way
13929 windows are scrolled.
13930
0e5317f7
KH
139312011-12-28 Kenichi Handa <handa@m17n.org>
13932
13933 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13934 coding-system ASCII compatible only when it does not produce BOM
13935 on encoding (Bug#10383).
13936
93d5ca1f
JD
139372011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13938
13939 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13940 can scroll.
13941 (create_and_show_popup_menu): Always use menu_position_func for
13942 Gtk3 (Bug#10361).
13943
ca22b785
AS
139442011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13945
13946 * callint.c (Fcall_interactively): Don't truncate prompt string.
13947
d048e1e6
EZ
139482011-12-23 Eli Zaretskii <eliz@gnu.org>
13949
13950 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
13951 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 13952 resumed from there (after widening). (Bug#10360)
d048e1e6 13953
5ccaba1f
JD
139542011-12-22 Jan Djärv <jan.h.d@swipnet.se>
13955
13956 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
13957
204ee57f
JD
139582011-12-21 Jan Djärv <jan.h.d@swipnet.se>
13959
b81d40f0
JB
13960 * nsterm.m (x_free_frame_resources):
13961 Release f->output_data.ns->miniimage.
204ee57f
JD
13962 (ns_index_color): Fix indentation. Do not retain
13963 color_table->colors[i].
13964
13965 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
13966 before returning.
13967
13968 * nsfns.m (x_set_background_color): Assign return value from
13969 ns_index_color to face-background instead of NSColor*.
13970 (ns_implicitly_set_icon_type): Fix indentation.
13971 Change assignment in for loop to comparison.
13972
13973 * emacs.c (ns_pool): New variable.
13974 (main): Assign ns_pool.
13975 (Fkill_emacs): Call ns_release_autorelease_pool.
13976
13977 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
13978 autorelease fdesc, release fdAttrs and tdict.
13979 (ns_get_covering_families): Release charset.
13980 (ns_findfonts): Release NSFontDescriptor created with new.
13981 (ns_uni_to_glyphs): Fix indentation.
13982 (setString): Release attrStr before assigning new value.
13983
c803b2b7
JD
139842011-12-18 Jan Djärv <jan.h.d@swipnet.se>
13985
678f4426
JD
13986 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
13987 and NS_IMPL_COCOA.
13988 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
13989 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
13990
cd394be1 139912011-12-18 David Reitter <reitter@cmu.edu>
678f4426 13992
5fecd5fc
JD
13993 * nsterm.m (ns_term_init): Subscribe for notifications
13994 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
13995 to method trackingNotification in EmacsMenu.
13996
13997 * nsmenu.m (trackingMenu): New variable.
3771cb17 13998 (trackingNotification): New method (from Aquamacs).
5fecd5fc 13999 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14000 from Aquamacs (Bug#7030).
678f4426
JD
14001
140022011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14003
c803b2b7
JD
14004 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14005 (symbol_to_nsstring): Fix indentation.
14006 (ns_symbol_to_pb): New function.
cae07000
SM
14007 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14008 (Fns_rotate_cut_buffers_internal): Remove.
14009 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14010 Fns_store_cut_buffer_internal.
14011 (ns_get_foreign_selection, Fx_own_selection_internal)
14012 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14013 (Fns_get_selection_internal, Fns_store_selection_internal):
14014 Use ns_symbol_to_pb and check if return value is nil.
14015 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14016 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14017 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14018 renamed to Sns_store_selection_internal.
14019 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14020 and remove this function.
14021 (ns_handle_selection_clear): Remove, never used.
14022 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14023 here.
14024
e1b01a3a
KB
140252011-12-17 Ken Brown <kbrown@cornell.edu>
14026
14027 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14028 GID is unknown (Bug#10257).
14029
2adb6e85
PE
140302011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14031
14032 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14033 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14034 which caused a build failure on GNU/Linux IA-64. This problem was
14035 introduced by my 2011-10-07 patch.
14036
d1d7b339
JL
140372011-12-15 Juri Linkov <juri@jurta.org>
14038
14039 * image.c (imagemagick_error): New function. (Bug#10112)
14040 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14041 Use `imagemagick_error' where ImageMagick functions return
14042 `MagickFalse'.
14043 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14044 proper order.
14045
100d5755
KH
140462011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14047
14048 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14049 fill background (Bug#8992).
14050
454592a6
MR
140512011-12-13 Martin Rudalics <rudalics@gmx.at>
14052
14053 * window.c (Vwindow_combination_resize)
14054 (Vwindow_combination_limit): Use t instead of non-nil in
14055 doc-strings.
61d4b438
MR
14056 (Vrecenter_redisplay): Add first sentence of doc-string on
14057 separate line.
53524d93 14058 (Frecenter): Fix doc-string typo.
454592a6 14059
3633e3aa
KH
140602011-12-11 Kenichi Handa <handa@m17n.org>
14061
14062 * coding.c (Funencodable_char_position): Pay attention to the
14063 buffer text relocation (Bug#9389).
14064
7b9d523a 140652011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 14066
7b9d523a
JD
14067 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14068 gtk_init (Bug#10100).
14069
b73189c6
EZ
140702011-12-10 Eli Zaretskii <eliz@gnu.org>
14071
14072 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14073 IT->string is nil. (Bug#10263)
14074
f7dfe5d6
JD
140752011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14076
83faebb4
JD
14077 * nsterm.h (x_free_frame_resources): Declare.
14078
f7dfe5d6
JD
14079 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14080 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14081
14082 * nsterm.h (ns_get_defaults_value): Declare.
14083
14084 * nsterm.m (ns_default): Call ns_get_defaults_value.
14085
7cd4e72c
EZ
140862011-12-09 Eli Zaretskii <eliz@gnu.org>
14087
14088 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14089 (Bug#10170)
14090
b34d7317
YM
140912011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14092
14093 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14094 that where the value of an _OBJC_* symbol points to is in the .bss
14095 section (Bug#10240).
14096
76470ad1
KH
140972011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14098
14099 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 14100 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 14101
745fff94
KH
141022011-12-08 Kenichi Handa <handa@m17n.org>
14103
14104 * ftfont.c (get_adstyle_property): Fix previous change
14105 (Bug#10233).
14106
6e44397c
JB
141072011-12-07 Juanma Barranquero <lekktu@gmail.com>
14108
14109 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14110 dirs from the default value of EMACSLOADPATH (bug#10208).
14111
7efa6272
GM
141122011-12-07 Glenn Morris <rgm@gnu.org>
14113
14114 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14115 installation and source directories as well. (Bug#10208)
14116
f6fc4d87
CY
141172011-12-06 Chong Yidong <cyd@gnu.org>
14118
14119 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14120
2bf26180
GM
141212011-12-06 Glenn Morris <rgm@gnu.org>
14122
14123 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14124 as an error, not just -1. (Bug#10217)
14125
3a6ad4f0
CY
141262011-12-05 Chong Yidong <cyd@gnu.org>
14127
14128 * keyboard.c (process_special_events): New function.
14129 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14130
75a3b399
PE
141312011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14132
14133 * coding.c (encode_designation_at_bol): Don't use uninitialized
14134 local variable (Bug#9318).
14135
c3c9e25e
KH
141362011-12-05 Kenichi Handa <handa@m17n.org>
14137
14138 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14139 return Qnil (Bug#8046, Bug#10193).
14140
5eb05ea3
KH
141412011-12-05 Kenichi Handa <handa@m17n.org>
14142
14143 * coding.c (encode_designation_at_bol): New args charbuf_end and
14144 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
14145 (coding_set_source): Return how many bytes coding->source was
14146 relocated.
14147 (coding_set_destination): Return how many bytes
14148 coding->destination was relocated.
14149 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 14150 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
14151
141522011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14153
14154 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14155 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14156 macro (Bug#9318).
14157
141582011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14159
14160 The following changes are to fix Bug#9318.
14161
a79703f5 14162 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
14163 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14164 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 14165 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 14166
7dbda6df
JB
141672011-12-05 Juanma Barranquero <lekktu@gmail.com>
14168
14169 * lisp.h (process_quit_flag): Fix external declaration.
14170
6d5eb5b0
SM
141712011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14172
14173 Don't macro-inline non-performance-critical code.
14174 * eval.c (process_quit_flag): New function.
14175 * lisp.h (QUIT): Use it.
14176
a0c3fad0
JD
141772011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14178
14179 * nsfns.m (get_geometry_from_preferences): New function.
14180 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14181
6c07aac2
AS
141822011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14183
14184 * emacs.c (Qkill_emacs): Define.
14185 (syms_of_emacs): Initialize it.
14186 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14187 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
14188 (quit_throw_to_read_char): Add parameter `from_signal'.
14189 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
14190 * lisp.h (QUIT): Call Fkill_emacs if requested.
14191
c052ead4
JD
141922011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14193
14194 * widget.c (update_wm_hints): Return if wmshell is null.
14195 (widget_update_wm_size_hints): New function.
14196
14197 * widget.h (widget_update_wm_size_hints): Declare.
14198
14199 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14200 widget_update_wm_size_hints (Bug#10104).
14201
9e49252b
EZ
142022011-12-03 Eli Zaretskii <eliz@gnu.org>
14203
14204 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14205 before a newline, prepare the bidi iterator for consuming the
14206 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 14207 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 14208
02b16839
JL
142092011-12-02 Juri Linkov <juri@jurta.org>
14210
14211 * search.c (Fword_search_regexp): New Lisp function created from
14212 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14213 (Fword_search_backward, Fword_search_forward)
14214 (Fword_search_backward_lax, Fword_search_forward_lax):
14215 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14216 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14217
0068070e
SM
142182011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14219
14220 * fileio.c (Finsert_file_contents): Move after-change-function call
14221 to before the "handled:" label, since all "goto handled" appear in
14222 cases where the *-change-functions have already been properly called
14223 (bug#10117).
14224
3360a3fc
AS
142252011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14226
14227 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14228 waiting for input. (Bug#10169)
14229
73d6c093
EZ
142302011-11-30 Eli Zaretskii <eliz@gnu.org>
14231
14232 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14233 verifies glyph row's hash code--we have just reallocated the
14234 glyphs, so their contents can be complete garbage. (Bug#10164)
14235
febe6bea
JB
142362011-11-30 Juanma Barranquero <lekktu@gmail.com>
14237
14238 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14239
801a4313
EZ
142402011-11-30 Eli Zaretskii <eliz@gnu.org>
14241
14242 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14243 attributes are tested _before_ calling verify_row_hash, to protect
14244 against GCC re-ordering of the tests. (Bug#10164)
14245
2b56b87e
JD
142462011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14247
14248 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14249
14250 * xterm.c (handle_one_xevent): Only set async_visible and friends
14251 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 14252 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
14253 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14254
dbf31225
PE
142552011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14256
14257 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14258 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14259 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14260 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14261 All uses changed to use GCPRO1 etc.
14262 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14263 Revert to old implementation (i.e., before 2011-03-11).
14264
1305621b
YM
142652011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14266
14267 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14268 of scroll runs so as to avoid assigning disabled bogus rows and
14269 unnecessary graphics copy operations.
14270
8c9afb46
EZ
142712011-11-27 Eli Zaretskii <eliz@gnu.org>
14272
14273 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14274 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14275 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14276 (malloc, free, realloc, calloc): Redirect to e_* only when
14277 compiling Emacs.
14278
14279 * lisp.h (GCTYPEBITS): Move before first use.
14280 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14281 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14282 this macro definition.
14283
14284 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14285 _MSC_VER.
14286
54e9e3bf
JD
142872011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14288
6d5eb5b0
SM
14289 * gtkutil.c (xg_create_frame_widgets):
14290 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
14291 present with Gtk+ 2.0.
14292
83aca1cb
PE
142932011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14294
14295 * fileio.c (Finsert_file_contents): Undo previous change; see
14296 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14297
5b76caa4
PE
142982011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14299
14300 Rename locals to avoid shadowing.
14301 * fileio.c (Finsert_file_contents):
14302 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14303 * process.c (wait_reading_process_output):
14304 Rename inner 'proc' to 'p' to avoid shadowing.
14305 Indent for consistency with usual Emacs style.
14306
8c535114
EZ
143072011-11-25 Eli Zaretskii <eliz@gnu.org>
14308
14309 * xdisp.c (redisplay_window): If cursor row is not fully visible
14310 after recentering, and scroll-conservatively is set to a large
14311 number, scroll window by a few more lines to make the cursor fully
14312 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14313 (start_display): Don't move to the next line if the display should
14314 start at a newline that is part of a display vector or an overlay
14315 string. (Bug#10119)
8c535114 14316
fa4fdb5c
JL
143172011-11-24 Juri Linkov <juri@jurta.org>
14318
14319 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14320 after the `MagickPingImage' call. (Bug#10112)
14321
90ec88df
CY
143222011-11-23 Chong Yidong <cyd@gnu.org>
14323
14324 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14325
56e2e794
MR
143262011-11-23 Martin Rudalics <rudalics@gmx.at>
14327
14328 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14329 making another buffer current. (Bug#10114)
14330
b6e64c41
GM
143312011-11-23 Glenn Morris <rgm@gnu.org>
14332
14333 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14334
6b21de18
CY
143352011-11-23 Chong Yidong <cyd@gnu.org>
14336
14337 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14338 using it (Bug#5984).
14339
b12cd789
EZ
143402011-11-22 Eli Zaretskii <eliz@gnu.org>
14341
14342 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14343 and header-lines, as they don't have one computed for them.
14344 (Bug#10098)
14345
14346 * .gdbinit (prow): Make displayed values more self-explaining.
14347 Add row's hash code.
14348
261b6fd4
LMI
143492011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14350
14351 * process.c (wait_reading_process_output): Fix asynchrounous
14352 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14353 (wait_reading_process_output): Add comment and URL.
261b6fd4 14354
e7cfd277
JD
143552011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14356
14357 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14358
a9b9b7f5
CY
143592011-11-21 Chong Yidong <cyd@gnu.org>
14360
14361 * window.c (Fnext_window, Fprevious_window): Doc fix.
14362
b0d15b4f
SM
143632011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14364
14365 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14366
fe7a3057
JB
143672011-11-20 Juanma Barranquero <lekktu@gmail.com>
14368
14369 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14370
d2999b1a
MR
143712011-11-20 Martin Rudalics <rudalics@gmx.at>
14372
14373 * window.c (Fset_window_combination_limit): Rename argument
14374 STATUS to LIMIT.
14375 (Vwindow_combination_limit): Remove "status" from doc-string.
14376
d5ff9cd0
AS
143772011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14378
14379 * m/ibms390.h: Remove.
14380 * m/ibms390x.h: Don't include "ibms390.h".
14381
a5bb9bd3
SM
143822011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14383
14384 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14385 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14386
cd1181db
JB
143872011-11-20 Juanma Barranquero <lekktu@gmail.com>
14388
14389 * casetab.c (Fset_case_table):
14390 * charset.c (Fcharset_after): Fix typos.
14391
615a3b8d 143922011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 14393
17e845af
PE
14394 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14395 Otherwise, valgrind does not work on some platforms.
14396 Problem reported by Andreas Schwab in
6a0bf43d
PE
14397 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14398 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14399 is set, removing the need for VIRT_ADDRESS_VARIES.
14400 (PURE_P): Use a more-efficient implementation that needs just one
14401 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14402 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14403 to 4 (xorl, subq, cmpq, setbe).
14404 * alloc.c (pure): Always extern now, since that's the
14405 VIRT_ADDR_VARIES behavior.
14406 (PURE_POINTER_P): Use a single comparison, not two, for
14407 consistency with the new puresize.h.
14408 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14409 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14410 Remove VIRT_ADDR_VARIES no longer needed.
14411
f8fe6f96
EZ
144122011-11-19 Eli Zaretskii <eliz@gnu.org>
14413
14414 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14415 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14416 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14417 behave as if the cursor position were at the window margin.
14418
14419 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14420 and the cursor position is out of bounds, behave as if the cursor
14421 position were at the window margin. (Bug#10075)
14422
df05a53c
CY
144232011-11-18 Chong Yidong <cyd@gnu.org>
14424
14425 * window.c (Fwindow_combination_limit): Make first argument
14426 non-optional, since it is meaningless for live windows like the
14427 selected window.
61ccba97 14428
2071918e
DA
144292011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14430
14431 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14432
b50a28de
SM
144332011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14434
14435 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14436 (graft_intervals_into_buffer): Simplify.
14437
015137db
EZ
144382011-11-18 Eli Zaretskii <eliz@gnu.org>
14439
14440 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14441 hash values of the two rows.
14442 (copy_row_except_pointers): Preserve the used[] arrays and the
14443 hash values of the two rows. (Bug#10035)
68c95424 14444 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
14445
14446 * xdisp.c (row_hash): New function, body extracted from
14447 compute_line_metrics.
14448 (compute_line_metrics): Call row_hash, instead of computing the
14449 hash code inline.
14450
14451 * dispnew.c (verify_row_hash): Call row_hash for computing the
14452 hash code of a row, instead of duplicating code from xdisp.c.
14453
14454 * dispextern.h (row_hash): Add prototype.
14455
a2addb04
TH
144562011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14457
14458 * frame.c (delete_frame): Don't delete the terminal when the last
14459 X frame is closed if emacs is built with GTK toolkit.
14460
df85d315
JB
144612011-11-17 Juanma Barranquero <lekktu@gmail.com>
14462
14463 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14464
a0c2d0ae
MR
144652011-11-17 Martin Rudalics <rudalics@gmx.at>
14466
14467 * window.c (Vwindow_splits): Rename to
14468 Vwindow_combination_resize. Suggested by Juri Linkov.
14469 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14470 of Vwindow_splits.
14471
58179cce
JB
144722011-11-16 Juanma Barranquero <lekktu@gmail.com>
14473
7877f373
JB
14474 * nsfns.m (Fns_font_name):
14475 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 14476
b6f67890
MR
144772011-11-16 Martin Rudalics <rudalics@gmx.at>
14478
14479 * window.h (window): Rename slot "nest" to "combination_limit".
14480 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14481 (Fset_window_nest): Rename to Fset_window_combination_limit.
14482 (Vwindow_nest): Rename to Vwindow_combination_limit.
14483 (recombine_windows, make_parent_window, make_window)
14484 (Fsplit_window_internal, saved_window)
14485 (Fset_window_configuration, save_window_save): Rename all
14486 occurrences of window_nest to window_combination_limit.
14487
c7015153
JB
144882011-11-15 Juanma Barranquero <lekktu@gmail.com>
14489
14490 * image.c (imagemagick_load_image): Fix typo.
14491
322ad6ec
EZ
144922011-11-14 Eli Zaretskii <eliz@gnu.org>
14493
14494 * xdisp.c (display_line): Move the call to
14495 highlight_trailing_whitespace before the call to
14496 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
14497 faces of all the glyphs to compute ROW's hash value.
14498 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 14499
f067b8ec
JB
145002011-11-14 Juanma Barranquero <lekktu@gmail.com>
14501
14502 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14503 just return (bug#10044).
14504
1e5b2111
EZ
145052011-11-12 Eli Zaretskii <eliz@gnu.org>
14506
7ef3cbd5
EZ
14507 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14508 with user-defined heap size. Bump the default size of the temacs
14509 heap to 27MB, to avoid memory warning when running temacs.
14510 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14511
1e5b2111
EZ
14512 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14513 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
14514 (verify_row_hash) [XASSERTS]: New function.
14515 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14516 that the hash value of glyph rows is correct.
1e5b2111 14517
89d61221
MR
145182011-11-12 Martin Rudalics <rudalics@gmx.at>
14519
14520 * window.h (window): Remove splits slot.
14521 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14522 (Fdelete_other_windows_internal, make_parent_window)
14523 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14524 (Fset_window_configuration, save_window_save): Don't deal with
14525 split status of windows.
14526 (saved_window): Remove splits slot.
14527 (Vwindow_splits): Rewrite doc-string.
14528
97f18cc8
JD
145292011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14530
14531 * xfns.c (unwind_create_frame):
14532 * nsfns.m (unwind_create_frame):
14533 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14534 Vframe_list (Bug#9999).
14535
22a648b4
DA
145362011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14537
0b381c7e 14538 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 14539
659afede
KH
145402011-11-11 Kenichi Handa <handa@m17n.org>
14541
14542 * callproc.c (Fcall_process): Set the member dst_multibyte of
14543 process_coding.
14544
9ac0394b
KH
145452011-11-11 Johan Bockgård <bojohan@gnu.org>
14546
14547 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14548 avoid a crash (bug#9496).
14549
2fbdc249
CY
145502011-11-09 Chong Yidong <cyd@gnu.org>
14551
14552 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14553 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14554
ac6b1f81
PE
145552011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14556
14557 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14558
09db192c
PE
145592011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14560
14561 Avoid some portability problems by eschewing 'extern inline' functions.
14562 The trivial performance wins aren't worth the portability hassles; see
14563 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14564 et seq.
14565 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14566 (window_box_width, window_box_left, window_box_left_offset)
14567 (window_box_right, window_box_right_offset): Undo previous change,
14568 by removing the "extern"s.
14569 * intervals.c (adjust_intervals_for_insertion)
14570 (adjust_intervals_for_deletion): Undo previous change,
14571 making these static again.
14572 (offset_intervals, temp_set_point_both, temp_set_point)
14573 (copy_intervals_to_string): No longer inline.
14574 * xdisp.c (window_text_bottom_y, window_box_width)
14575 (window_box_height, window_box_left_offset)
14576 (window_box_right_offset, window_box_left, window_box_right)
14577 (window_box): No longer inline.
14578
105216ed
CY
145792011-11-08 Chong Yidong <cyd@gnu.org>
14580
14581 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
14582 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14583 Signal an error if not a live window.
105216ed
CY
14584 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14585 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14586
ae9e237f
JB
145872011-11-07 Juanma Barranquero <lekktu@gmail.com>
14588
14589 * lisp.h (syms_of_abbrev): Remove declaration.
14590 Reported by CHENG Gao <chenggao@royau.me>.
14591
c7aa8333
EZ
145922011-11-07 Eli Zaretskii <eliz@gnu.org>
14593
14594 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14595 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14596 of temacs in GUI mode.
14597
be7f5545
MR
145982011-11-07 Martin Rudalics <rudalics@gmx.at>
14599
14600 * window.h: Declare delete_all_child_windows instead of
14601 delete_all_subwindows.
14602 * window.c (Fwindow_nest, Fset_window_nest)
14603 (Fset_window_new_total, Fset_window_new_normal)
14604 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14605 (delete_all_subwindows): Rename to delete_all_child_windows.
14606 (Fdelete_other_windows_internal, Fset_window_configuration):
14607 Call delete_all_child_windows instead of delete_all_subwindows.
14608 * frame.c (delete_frame): Call delete_all_child_windows instead
14609 of delete_all_subwindows.
14610
ca78dc43
PE
146112011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14612
14613 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14614 This is also needed for porting to any host where GC_MARK_STACK is
14615 not GC_MAKE_GCPROS_NOOPS.
14616 (which_symbols): Use it.
14617
a0241d01
KH
146182011-11-07 Kenichi Handa <handa@m17n.org>
14619
14620 * coding.c (coding_set_destination): Check coding->src_pos only
14621 when coding->src_object is a buffer (bug#9910).
14622
14623 * process.c (send_process): Set the member src_multibyte of coding
14624 to 0 (bug#9911) when sending a unibyte text.
14625
14626 * callproc.c (Fcall_process): Set the member src_multibyte of
14627 process_coding to 0 (bug#9912).
14628
a64bfdfa 146292011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
14630
14631 * xmenu.c (cleanup_widget_value_tree): New function.
14632 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14633 calling free_menubar_widget_value_tree directly (Bug#9830).
14634
cb41b32a
PE
146352011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14636
14637 Fix some portability problems with 'inline'.
14638 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14639 (window_box_width, window_box_left, window_box_left_offset)
14640 (window_box_right, window_box_right_offset): Declare extern.
14641 Otherwise, these inline functions do not conform to C99 and
14642 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14643 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14644 * intervals.c (adjust_intervals_for_insertion)
14645 (adjust_intervals_for_deletion): Now extern, because otherwise the
14646 extern inline functions 'offset_intervals' couldn't refer to it.
14647 (static_offset_intervals): Remove.
14648 (offset_intervals): Rewrite using the old contents of
14649 static_offset_intervals. The old version didn't conform to C99
14650 because an extern inline function contained a reference to an
14651 identifier with static linkage.
14652
b7041366
AS
146532011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14654
14655 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14656 GC.
14657
88a37c4d
EZ
146582011-11-06 Eli Zaretskii <eliz@gnu.org>
14659
14660 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14661 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14662 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14663 return Qleft_to_right.
14664
49745b39
CY
146652011-11-06 Chong Yidong <cyd@gnu.org>
14666
14667 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14668 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14669 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14670 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14671 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14672 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14673 (Fwindow_vscroll): Doc fix.
14674 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14675 argument, since it makes no sense to pass a live window and for
14676 consistency with window-child.
14677
1f05cd82
CS
146782011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14679
14680 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14681 support MSVC.
14682
22610910
JR
146832011-11-05 Jason Rumney <jasonr@gnu.org>
14684
14685 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14686 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14687 fonts (Bug#6029).
14688 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14689 bitwise arithmetic preventing use of unicode-sip and non-truetype
14690 opentype fonts.
14691
a06776b2
EZ
146922011-11-05 Eli Zaretskii <eliz@gnu.org>
14693
3ad924ba
EZ
14694 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14695 "emacs"-only part.
14696
a06776b2
EZ
14697 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14698 initialization code to keep similarity to xfns.c after changes
14699 from 2011-11-05.
14700
c9e7db78
JD
147012011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14702
a97f8f3f
JD
14703 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14704 (unwind_create_frame): New function (Bug#9943).
14705 (Fx_create_frame): Restructure code to be more similar to the one in
14706 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14707 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14708 Move terminal->reference_count++ just before making the frame official
14709 (Bug#9943).
14710
14711 * nsterm.m (x_free_frame_resources): New function.
14712 (x_destroy_window): Move code to x_free_frame_resources.
14713
c9e7db78 14714 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14715 (Fx_create_frame, x_create_tip_frame):
14716 Move terminal->reference_count++ just before making the frame
75f1671a 14717 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14718 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14719
a6fc3b5c
EZ
147202011-11-05 Eli Zaretskii <eliz@gnu.org>
14721
14722 Support MSVC build with newer versions of Visual Studio.
14723 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14724 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14725 nt/gmake.defs.
14726
14727 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14728 which are not supported by MSVC.
14729 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14730 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14731 bitfields.
14732 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14733 types in bitfields.
14734 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14735
14736 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14737
58179cce 147382011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14739
14740 Support MSVC build with newer versions of Visual Studio.
14741 * w32.c: Don't include w32api.h for MSVC.
14742 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14743
14744 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14745 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14746 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14747 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14748 e_* cousins.
14749 (alloca) [_MSC_VER]: Define to _alloca.
14750
14751 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14752
14753 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14754
a58c13ed
EZ
147552011-11-04 Eli Zaretskii <eliz@gnu.org>
14756
14757 * xdisp.c (note_mouse_highlight): If either of
14758 previous/next-single-property-change returns nil, treat that as
14759 the beginning or the end of the buffer. (Bug#9955)
14760
fe0b6370
JD
147612011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14762
a58c13ed 14763 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
14764 label is not null (Bug#9951).
14765 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14766 may be NULL.
14767
89bd5ee1
EZ
147682011-11-04 Eli Zaretskii <eliz@gnu.org>
14769
14770 * window.c (Fwindow_body_size): Mention in the doc string that the
14771 return value is in frame's canonical units. (Bug#9949)
14772
84c3edb9
EZ
147732011-11-03 Eli Zaretskii <eliz@gnu.org>
14774
4e2fb5c7
EZ
14775 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14776
84c3edb9 14777 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 14778 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 14779 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 14780
bc17a887
EZ
147812011-11-01 Eli Zaretskii <eliz@gnu.org>
14782
14783 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14784 Don't stop backward scan on the continuation glyph, even though
14785 its CHARPOS is positive.
6d5eb5b0
SM
14786 (mouse_face_from_buffer_pos, note_mouse_highlight):
14787 Rename cover_string to disp_string.
bc17a887 14788
4ee88440
MR
147892011-11-01 Martin Rudalics <rudalics@gmx.at>
14790
14791 * window.c (temp_output_buffer_show): Don't use
14792 Vtemp_buffer_show_specifiers.
14793 (Vtemp_buffer_show_specifiers): Remove unused variable.
14794
c2ff3c02
EZ
147952011-10-30 Eli Zaretskii <eliz@gnu.org>
14796
14797 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14798 past the beginning of the current glyph matrix.
14799
58179cce 148002011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
14801
14802 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14803 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14804 HAVE_GTK3 (Bug#9869).
b77a6a7f 14805
3b574623
JD
14806 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14807 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14808
b77a6a7f
JD
14809 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14810
14811 * xterm.c: Declare x_handle_net_wm_state to return int.
14812 (handle_one_xevent): Check if we are iconified but don't have
14813 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14814 (get_current_wm_state): Return non-zero if not hidden,
14815 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14816 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14817 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14818 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14819
196e41e4
PE
148202011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14821
14822 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14823 so that this new function doesn't get optimized away by a
14824 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14825
021f2e1a
AS
148262011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14827
14828 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14829
8b058d44
EZ
148302011-10-29 Eli Zaretskii <eliz@gnu.org>
14831
14832 Fix the `xbytecode' command.
14833 * .gdbinit (xprintbytestr): New command.
b50a28de 14834 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
14835 (xbytecode): Print the byte-code string as well.
14836
4452fb80
EZ
148372011-10-29 Kim Storm <storm@cua.dk>
14838
8b058d44
EZ
14839 * alloc.c (which_symbols): New function.
14840
21b72067
AS
148412011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14842
14843 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14844 line. (Bug#9903)
14845
83ed7b5c
GM
148462011-10-29 Glenn Morris <rgm@gnu.org>
14847
14848 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14849 Not clear what it was for, and it causes various bugs. (Bug#9839)
14850
5a7a728b
EZ
148512011-10-28 Eli Zaretskii <eliz@gnu.org>
14852
14853 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14854 possible random value that matches one of those tested as
14855 condition to clear the mouse face.
14856
d3d0842f
CY
148572011-10-28 Chong Yidong <cyd@gnu.org>
14858
14859 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14860
31b39d13
DN
148612011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14862
14863 * window.c (make_window): Initialize phys_cursor_on_p.
14864
9aba6043
SM
148652011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14866
14867 * lisp.h (struct Lisp_Symbol): Update comments.
14868
c20992f4
JB
148692011-10-28 Juanma Barranquero <lekktu@gmail.com>
14870
14871 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14872
db4f02f2
EZ
148732011-10-28 Eli Zaretskii <eliz@gnu.org>
14874
14875 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14876 <oslsachem@gmail.com> for helping to debug this.
14877
14878 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14879 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14880 (g_b_init_get_glyph_outline_w): New static variables.
14881 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14882 (GetGlyphOutlineW_Proc): New typedefs.
14883 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
14884 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14885 New functions.
14886 (w32font_open_internal, compute_metrics):
14887 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
14888 instead of calling the "wide" APIs directly.
14889
14890 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14891
14892 * w32.h (syms_of_w32font): Add prototype.
14893
87e68db4
JB
148942011-10-27 Juanma Barranquero <lekktu@gmail.com>
14895
14896 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14897 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14898 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14899 (Fmove_to_window_line): Doc fix.
14900
435c1d67
CY
149012011-10-27 Chong Yidong <cyd@gnu.org>
14902
14903 * process.c (make_process): Set gnutls_state to NULL.
14904
14905 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14906 non-NULL, regardless of GNUTLS_INITSTAGE.
14907 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14908 an error. Set process slots as soon as we allocate them.
14909
14910 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14911
9c6c6f49
CY
149122011-10-27 Chong Yidong <cyd@gnu.org>
14913
9aba6043
SM
14914 * gnutls.c (emacs_gnutls_deinit): New function.
14915 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
14916 (Fgnutls_deinit, Fgnutls_boot): Use it.
14917
14918 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14919 (deactivate_process): Call emacs_gnutls_deinit.
14920
657d08d3
JB
149212011-10-27 Juanma Barranquero <lekktu@gmail.com>
14922
14923 * image.c (x_create_x_image_and_pixmap):
14924 * w32.c (sys_rename, w32_delayed_load):
14925 * w32font.c (fill_in_logfont):
14926 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14927
5430d399
JB
149282011-10-26 Juanma Barranquero <lekktu@gmail.com>
14929
14930 * w32fns.c (w32_default_color_map): New function,
14931 extracted from Fw32_default_color_map.
a7ef684b 14932 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 14933
fe0055fa
PE
149342011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14935
14936 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14937
e6346438
SM
149382011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14939
14940 * keyboard.c (test_undefined): New function (bug#9751).
14941 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14942
e112cc37
ET
149432011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14944
14945 * sysdep.c (init_sys_modes): Fix the check for the controlling
14946 terminal (Bug#6649).
14947
7b5d6677
EZ
149482011-10-20 Eli Zaretskii <eliz@gnu.org>
14949
14950 * dispextern.h (struct bidi_it): New member next_en_type.
14951
14952 * bidi.c (bidi_line_init): Initialize the next_en_type member.
14953 (bidi_resolve_explicit_1): When next_en_pos is valid for the
14954 current character, check also for next_en_type being WEAK_EN.
14955 (bidi_resolve_weak): Don't enter the expensive loop if the current
14956 position is before next_en_pos. Record the bidi type of the first
14957 non-ET, non-BN character we find, in addition to its position.
14958 (bidi_level_of_next_char): Invalidate next_en_type when
14959 next_en_pos is over-stepped.
14960
7da0b018
PE
149612011-10-20 Paul Eggert <eggert@cs.ucla.edu>
14962
14963 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
14964 * editfns.c: Rewrite current-time-zone so that it invokes
14965 the equivalent of (format-time-string "%Z") to get the time zone name.
14966 This fixes a bug when the time zone name contains characters that
14967 need converting from the system time locale to Emacs internal format.
14968 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
14969 that patch fixed format-time-string to do the conversion, but
14970 I forgot to fix current-time-zone.
14971 (format_time_string): New function, containing most of
14972 what Fformat_time_string used to contain.
14973 (Fformat_time_string): Rewrite in terms of format_time_string.
14974 This doesn't change this function's behavior.
14975 (current-time-zone): Rewrite to use format_time_string.
14976 This fixes the bug reported by Michael Schierl in
14977 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
14978 Jason Rumney's 2007-06-07 change worked around this bug, but
14979 didn't fix it.
14980 * systime.h (tzname, timezone): Remove no-longer-used declarations.
14981
8547b010
EZ
149822011-10-19 Eli Zaretskii <eliz@gnu.org>
14983
14984 * xdisp.c (start_display): If the character at POS is displayed
14985 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
14986 (try_window_reusing_current_matrix): If a line ends in a display
14987 vector or the next line starts in a display vector, continue
14988 redrawing the window even though the character position of
14989 start_row was reached.
8547b010
EZ
14990 (Bug#9771, part 2)
14991
4e948d15
CY
149922011-10-18 Chong Yidong <cyd@gnu.org>
14993
14994 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
14995 with nobreak-char-display too.
14996
4787455f
EZ
149972011-10-18 Eli Zaretskii <eliz@gnu.org>
14998
14999 Fix part 3 of bug#9771.
15000 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15001 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15002 non-neutral characters if the current character is a paragraph
15003 separator (a.k.a. Newline). This avoids running the same
15004 expensive loop twice, once when we consume the preceding newline
15005 and the other time when the line actually needs to be displayed.
15006 Avoid the loop when we see neutrals on the base embedding level
15007 following a character whose directionality is the same as the
15008 paragraph's. This avoids running the expensive loop when a line
15009 ends in a long sequence of neutrals, like control characters.
15010 Add assertion against STRONG_AL type. Slightly rearrange code
15011 that determines the type of a neutral given the first non-neutral
15012 that follows it.
15013 (bidi_level_of_next_char): Set next_en_pos to zero when
15014 invalidating its info.
15015
2c91f553
EZ
150162011-10-17 Eli Zaretskii <eliz@gnu.org>
15017
15018 * xdisp.c (push_display_prop): Determine whether to record string
15019 or buffer position by IT->string, not by IT->method. Allow
15020 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15021 (move_it_vertically_backward): Don't look for character position
15022 immediately after the newline when in a continuation line.
15023 (Bug#9771, part 1)
2c91f553 15024
c7b08b0d
MR
150252011-10-15 Martin Rudalics <rudalics@gmx.at>
15026
15027 * window.c (coordinates_in_window): Rewrite and delabelize
15028 vertical border check. (Bug#5357) (Bug#9618)
15029
6b02f655
SM
150302011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15031
15032 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15033 errors in XSetWindowBorder (bug#9310).
15034
81d40c92
DA
150352011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15036
15037 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15038 avoid crash when xmalloc overrun checking is enabled.
15039
d4172c3b
EZ
150402011-10-13 Eli Zaretskii <eliz@gnu.org>
15041
15042 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15043 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15044 cursor motion with <left> and <right> arrow keys.
15045
15046 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15047 some callers set that themselves.
15048
b00eea75
EZ
150492011-10-12 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15052 display string and the previous row comes from the same string and
15053 is empty. (Bug#9739) (Bug#9738)
15054
8fe012c4
SM
150552011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15056
15057 * doc.c (get_doc_string): Encode file name (bug#9735).
15058
0074aef2
EZ
150592011-10-12 Eli Zaretskii <eliz@gnu.org>
15060
79beb178
EZ
15061 * bidi.c (bidi_level_of_next_char):
15062 * xdisp.c (get_visually_first_element): Remove old incorrect
15063 comments regarding the Unicode Line Separator character.
15064
0074aef2
EZ
15065 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15066
6e4b3fbe
DA
150672011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15068
15069 * alloc.c (Fgc_status): Do not access beyond zombies array
15070 boundary if nzombies > MAX_ZOMBIES.
15071 * alloc.c (dump_zombies): Add missing format specifier.
15072
0324f3af
PE
150732011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15074
b5525cac
PE
15075 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15076 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15077
0324f3af
PE
15078 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15079 Some packages use them to denote characters with modifiers.
15080
e9b5f888
AS
150812011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15082
15083 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15084 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15085 matching a pp-number. Rename parameter var to var1.
15086
127827c0
SM
150872011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15088
15089 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15090
c8fd3bd0
GM
150912011-10-08 Glenn Morris <rgm@gnu.org>
15092
15093 * callint.c (Fcall_interactively): Give a more explicit error for the
15094 'c' case with a non-character input. (Bug#8479)
15095
352ec8ff
EZ
150962011-10-08 Eli Zaretskii <eliz@gnu.org>
15097
03669ccb
EZ
15098 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15099 lines.
7061c986
EZ
15100 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15101 lines that are hscrolled on the left.
03669ccb 15102
352ec8ff
EZ
15103 * dispnew.c (buffer_posn_from_coords): Account for a possible
15104 presence of header-line. (Bug#4426)
15105
a66cfb1c
SM
151062011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15107
6b02f655
SM
15108 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15109 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 15110
7c5ee88e
PE
151112011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15112
15113 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15114 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15115 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15116 this makes Emacs dump core during garbage collection on rare
15117 occasions. sizeof is obviously inferior to offsetof here, so
15118 stick with offsetof.
15119 (GC_POINTER_ALIGNMENT): New macro.
15120 (mark_memory): Omit 3rd (offset) arg; caller changed.
15121 Don't assume EMACS_INT alignment is the same as pointer alignment.
15122
df1bbe5b
SM
151232011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15124
15125 * keyboard.c (read_key_sequence_remapped): New var.
15126 (read_key_sequence): Compute remapping in the right buffer.
15127 (command_loop_1): Use read_key_sequence's remapping directly.
15128
51553db6
SM
151292011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15130
32c1fffd
SM
15131 * dired.c (file_name_completion): Don't expand file name.
15132 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15133 before checking file name handler.
15134
51553db6
SM
15135 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15136 they've been requested explicitly (bug#9591).
15137
b6bd1599 151382011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
15139
15140 * keymap.c (Fsingle_key_description): Use make_specified_string
15141 instead of build_string to build string from push_key_description.
15142 (Bug#5193)
15143
f701dc2a
PE
151442011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15145
4222c55d
PE
15146 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15147 This fixes a Y2038 bug on 64-bit hosts.
15148 * buffer.c (reset_buffer):
15149 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15150 (Fclear_buffer_auto_save_failure):
15151 Use 0, not -1, to represent an unset failure time, since time_t
15152 might not be signed.
15153
f701dc2a
PE
15154 Remove dependency on glibc malloc internals.
15155 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15156 Move back here from lisp.h, but with their new implementations.
15157 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15158 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15159 * charset.c (charset_table_init): New static var.
15160 (syms_of_charset): Use it instead of xmalloc. This removes a
15161 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15162 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15163 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15164 Move back to alloc.c.
15165 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15166 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15167
9ceebf39
JD
151682011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15169
15170 * nsterm.m (windowDidResize): Call x_set_window_size only when
15171 ns_in_resize is true. Otherwise set pixelwidth/height and
15172 call change_frame_size (Bug#9628).
15173
cb993c58
PE
151742011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15175
3930c88b
PE
15176 Port --enable-checking=all to Fedora 14 x86-64.
15177 * charset.c (syms_of_charset): Also account for glibc malloc's
15178 internal overhead when calculating the initial malloc maximum.
15179
cb993c58
PE
15180 Port --enable-checking=all to Fedora 14 x86.
15181 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15182 Move to lisp.h.
15183 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15184 (overrun_check_realloc, overrun_check_free):
15185 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15186 That way, xmalloc returns a properly-aligned pointer even if
15187 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15188 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15189 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15190 into account when calculating the initial malloc maximum.
15191 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15192 Move here from alloc.c, so that charset.c can use it too.
15193 Properly align; the old code wasn't right for common 32-bit hosts
15194 when configured with --enable-checking=all.
15195 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15196 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15197
31bed486
EZ
151982011-09-29 Eli Zaretskii <eliz@gnu.org>
15199
04c70788 15200 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
15201 use EDOM.
15202
fbcaa2f3
EZ
152032011-09-28 Eli Zaretskii <eliz@gnu.org>
15204
15205 * xdisp.c (compute_display_string_end): If there's no display
15206 string at CHARPOS, return -1.
15207
15208 * bidi.c (bidi_fetch_char): When compute_display_string_end
15209 returns a negative value, treat the character as a normal
15210 character not covered by a display string. (Bug#9624)
15211
a239d4e9
JB
152122011-09-28 Juanma Barranquero <lekktu@gmail.com>
15213
15214 * lread.c (Fread_from_string): Fix typo in docstring.
15215
88652fd5
EZ
152162011-09-27 Eli Zaretskii <eliz@gnu.org>
15217
15218 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15219 newline, reseat the iterator instead of bidi-iterating there one
15220 character at a time. (Bug#9610)
32c1fffd
SM
15221 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15222 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 15223
ed497dd4
AS
152242011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15225
15226 * lread.c (readevalloop): Use correct code for NBSP.
15227 (read1): Likewise. (Bug#9608)
15228
b2bf61aa
MA
152292011-09-25 Michael Albinus <michael.albinus@gmx.de>
15230
15231 * dbusbind.c (Fdbus_register_signal): When service is not
15232 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15233
32bbb17c
GM
152342011-09-25 Glenn Morris <rgm@gnu.org>
15235
15236 * buffer.c (truncate-lines): Doc fix.
15237
94e0933e
CY
152382011-09-24 Chong Yidong <cyd@stupidchicken.com>
15239
15240 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15241 (Fset_window_next_buffers): Doc fix.
15242
cddde921
GM
152432011-09-24 Glenn Morris <rgm@gnu.org>
15244
15245 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15246
1260aef1
PE
152472011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15248
25b4bfa0
PE
15249 Fix minor problems found by static checking.
15250 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
15251 * indent.c (Fvertical_motion): Fix == vs = typo.
15252
e3cbd34b
EZ
152532011-09-24 Eli Zaretskii <eliz@gnu.org>
15254
a66cfb1c
SM
15255 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15256 Default value is now t. Doc fix.
6bf7006f 15257
e3cbd34b 15258 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 15259 logic when moving up, not only when moving down. Fix the
e3cbd34b 15260 confusing name and values of the it_overshoot_expected variable;
32c1fffd 15261 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
15262
15263 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15264 CHARPOS is covered by a display string which includes newlines.
15265 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15266 is covered by a display string with embedded newlines.
15267
a3de0cbd
MA
152682011-09-24 Michael Albinus <michael.albinus@gmx.de>
15269
15270 * dbusbind.c (Fdbus_register_signal): Add match rule to
15271 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
15272 (Fdbus_register_method, Vdbus_registered_objects_table):
15273 Fix docstring.
a3de0cbd 15274
b260039d
JM
152752011-09-24 Jim Meyering <meyering@redhat.com>
15276
32c1fffd 15277 do not ignore write error for any output size
b260039d
JM
15278 The previous change was incomplete.
15279 While it makes emacs --batch detect the vast majority of stdout
15280 write failures, errors were still ignored whenever the output size is
15281 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15282 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15283 && echo FAIL: ignored write error
15284 FAIL: ignored write error
15285 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15286 && echo FAIL: ignored write error
15287 FAIL: ignored write error
15288 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15289
8eca8a7c
AS
152902011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15291
15292 * emacs.c (Fkill_emacs): In noninteractive mode exit
15293 non-successfully if a write error occurred on stdout. (Bug#9574)
15294
3341db62
EZ
152952011-09-21 Eli Zaretskii <eliz@gnu.org>
15296
15297 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15298 the xassert test.
15299
15300 * dispextern.h (struct it): Update the comment documenting what
15301 can it->OBJECT be.
15302
8c203dbf
EZ
153032011-09-20 Eli Zaretskii <eliz@gnu.org>
15304
15305 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15306 a display string, extend search for cursor position to end of row.
15307 (find_row_edges): If the row ends in a newline from a display
15308 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15309 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
15310 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15311 non-empty line. Fixes confusing cursor motion with arrow keys at
15312 the beginning of a line that starts with whitespace.
8c203dbf 15313
a4824228
LMI
153142011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15315
15316 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15317 (bug#9493).
15318
33ed493b
CY
153192011-09-18 Chong Yidong <cyd@stupidchicken.com>
15320
15321 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15322 boolean (Bug#9154).
15323
56cd55c8
EZ
153242011-09-18 Eli Zaretskii <eliz@gnu.org>
15325
15326 * xdisp.c (display_line): Record maximum and minimum buffer
15327 positions even if no glyphs were produced (e.g., by a zero-width
15328 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15329 buffer positions that will be removed from the glyph row because
15330 they don't fit.
c02dcedf
EZ
15331 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15332 column is beyond frame width: don't subtract 1 "pixel" when
15333 computing width of the stretch.
3e62b7e0
EZ
15334 (reseat_at_next_visible_line_start): Undo the change made on
15335 2011-09-17 that saved paragraph information and restored it after
15336 the call to `reseat'. (Bug#9545)
56cd55c8 15337
5ed99d36 153382011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15339
15340 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15341 and turn window cursor on if cleared (Bug#9415).
15342
5ed99d36 153432011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15344
15345 * search.c (boyer_moore): Take unibyte characters from pattern
15346 literally. (Bug#9458)
15347
9bade7b2
EZ
153482011-09-18 Eli Zaretskii <eliz@gnu.org>
15349
15350 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15351
e5e9d610
PE
153522011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15353
87e4427a
PE
15354 Fix minor problem found by static checking.
15355 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15356 initialized, to pacify gcc -Wuninitialized.
15357
e5e9d610
PE
15358 * fileio.c: Report proper errno when syscall falls.
15359 (Finsert_file_contents): Save and restore errno,
15360 so that report_file_error outputs the correct diagnostic.
15361 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15362
a1674f0b
EZ
153632011-09-18 Eli Zaretskii <eliz@gnu.org>
15364
15365 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15366
fbfb6dd4
EZ
153672011-09-17 Eli Zaretskii <eliz@gnu.org>
15368
15369 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15370 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15371
bb187662
EZ
153722011-09-17 Eli Zaretskii <eliz@gnu.org>
15373
1137e8b8 15374 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 15375 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
15376
15377 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15378 (bidi_find_paragraph_start): Search back for paragraph beginning
15379 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15380 (bidi_move_to_visually_next): Only trigger paragraph-related
15381 computations when the last character is a newline or at EOB, not
15382 just any NEUTRAL_B. (Bug#9470)
15383
bb187662
EZ
15384 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15385 truncated lines if point is covered by a display string. (Bug#9524)
15386
2e621251
PE
153872011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15388
15389 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15390 (cons_to_x_long): New function.
15391 (lisp_data_to_selection_data): Use it. Correct the test for
15392 short-versus-long data; it was negated. Break out of vector
15393 loop, for efficiency, when a long datum is discovered.
15394
91a15bc6
SM
153952011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15396
15397 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15398
b41c3a35
EZ
153992011-09-16 Eli Zaretskii <eliz@gnu.org>
15400
15401 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15402 GCC PR/17406) by declaring this function with external scope.
15403
7812ba2d
PE
154042011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15405
15406 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15407 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15408
cf7edc2a
AS
154092011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15410
15411 * editfns.c (Fformat): Correctly handle text properties on "%%".
15412
bd01620e
EZ
154132011-09-15 Eli Zaretskii <eliz@gnu.org>
15414
15415 * xterm.c (x_draw_composite_glyph_string_foreground):
15416 * w32term.c (x_draw_composite_glyph_string_foreground):
15417 * term.c (encode_terminal_code):
15418 * composite.c (composition_update_it, get_composition_id):
15419 * xdisp.c (get_next_display_element)
15420 (fill_composite_glyph_string): Add comments about special meaning
15421 of TAB characters in a composition.
15422
a02719a3
PE
154232011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15424
15425 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
15426 This occurs when processing a multibyte format.
15427 Problem reported by Wolfgang Jenker.
a02719a3 15428
72589a3c
JB
154292011-09-15 Johan Bockgård <bojohan@gnu.org>
15430
15431 * xdisp.c (try_cursor_movement): Only check for exact match if
15432 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15433
1c14176c
PE
154342011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15435
15436 Remove unused external symbols.
15437 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15438 * xdisp.c (calc_pixel_width_or_height): Now static.
15439 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15440 * indent.c (check_display_width):
15441 * w32term.c: Fix comment to match code.
15442 * xterm.c, xterm.h (x_catching_errors): Remove.
15443
d2eea5b5
PE
154442011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15445
15446 * xselect.c: Use signed conversions more consistently (Bug#9498).
15447 (selection_data_to_lisp_data): Assume incoming selection data are
15448 signed integers, not unsigned. This is to be consistent with
15449 outgoing selection data, which was modified to use signed integers
15450 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15451 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15452 expects long, not unsigned long.
15453
46888499
EZ
154542011-09-14 Eli Zaretskii <eliz@gnu.org>
15455
15456 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15457 computation of loop end. Reported by Johan Bockgård
15458 <bojohan@gnu.org>.
15459
ef8ef9fb
CY
154602011-09-13 Chong Yidong <cyd@stupidchicken.com>
15461
15462 * frame.c (Fother_visible_frames_p): Function deleted.
15463
fa819fed
EZ
154642011-09-12 Eli Zaretskii <eliz@gnu.org>
15465
15466 * indent.c (compute_motion): Process display vector front to back
15467 rather than the other way around. (Bug#2496)
15468
2ba8e008
SM
154692011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15470
15471 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15472
20f53c69
CY
154732011-09-11 Chong Yidong <cyd@stupidchicken.com>
15474
15475 * minibuf.c (Fread_from_minibuffer): Doc fix.
15476
d562d7a4
EZ
154772011-09-11 Eli Zaretskii <eliz@gnu.org>
15478
15479 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15480 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15481
1c4d7f3d
LMI
154822011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15483
15484 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15485 value for non-existent files.
15486
b885bf36
EZ
154872011-09-11 Eli Zaretskii <eliz@gnu.org>
15488
15489 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15490 set its "size" to -1. This will set the modtime_size field of
15491 the corresponding buffer to -1, which is what
15492 verify-visited-file-modtime expects for files that do not exist.
15493 (Bug#9139)
15494
6612f0bf
PE
154952011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15496
15497 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15498 here ...
15499 * lisp.h: ... from here. push_key_description is no longer
15500 defined in keyboard.c, so its declaration should not be in
15501 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15502 logically belongs with push_key_description.
15503
dfb3f755
PE
155042011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15505
15506 * buffer.h: Include <sys/types.h> instead of <time.h>.
15507 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15508 Problem reported by Herbert J. Skuhra.
15509
3134906c
LMI
155102011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15511
15512 * xml.c (parse_region): Make the parsing work for
15513 non-comment-starting XML files again (bug#9144).
15514
8d903f4e
AS
155152011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15516
15517 * image.c (gif_load): Fix calculation of bottom and right corner.
15518 (Bug#9468)
15519
80ad64f4
EZ
155202011-09-10 Eli Zaretskii <eliz@gnu.org>
15521
15522 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15523 redisplay in small windows.
15524
208a048d
EZ
155252011-09-09 Eli Zaretskii <eliz@gnu.org>
15526
15527 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15528
9b1c252e
MR
155292011-09-08 Martin Rudalics <rudalics@gmx.at>
15530
15531 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15532 Operate on live windows only.
15533
2949f33b
JB
155342011-09-08 Juanma Barranquero <lekktu@gmail.com>
15535
15536 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15537
e08dcafd
EZ
155382011-09-07 Eli Zaretskii <eliz@gnu.org>
15539
15540 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15541 only under bidi iteration.
15542
115b96bd
JD
155432011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15544
15545 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15546
c8199d0f
PE
155472011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15548
15549 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15550 Without this fix, the command to link temacs failed due to an
15551 undefined symbol __builtin_isnan. This is because
15552 /usr/include/iso/math_c99.h #defines isnan(x) to
15553 __builtin_isnan(x), but the bundled gcc, which identifies itself
15554 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15555 a __builtin_isnan.
15556 * floatfns.c (isnan): #undef, and then #define to a clone of
15557 what's in data.c.
15558 (Fisnan): Always define, since it's always available now.
15559 (syms_of_floatfns): Always define isnan at the Lisp level.
15560
e39b275c 155612011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
15562
15563 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15564
b2db44d9 155652011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 15566
f4af5137 15567 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
15568 The previous code assumed that file offsets (off_t values) fit in
15569 EMACS_INT variables, which is not true on typical 32-bit hosts.
15570 The code messed up by falsely reporting buffer overflow in cases
15571 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15572 when "big" contains more than 2**29 bytes, even though this
15573 inserts just one byte and does not overflow the buffer.
15574 (Finsert_file_contents): Store file offsets as off_t
15575 values, not as EMACS_INT values. Check for overflow when
15576 converting between EMACS_INT and off_t. When checking for
15577 buffer overflow or for overlap, take the offsets into account.
15578 Don't use EMACS_INT for small values where int suffices.
15579 When checking for overlap, fix a typo: ZV was used where
15580 ZV_BYTE was intended.
15581 (Fwrite_region): Don't assume off_t fits into 'long'.
15582 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15583
ecfc0a49
MA
155842011-09-05 Michael Albinus <michael.albinus@gmx.de>
15585
15586 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15587
6511acf2 155882011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 15589
0999621a 15590 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
15591
15592 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 15593 (esprintf, exprintf, evxprintf): New functions.
62f19c19 15594 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 15595 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
15596 (modify_event_symbol): Do not assume that the length of
15597 name_alist_or_stem is safe to alloca and fits in int.
15598 (Fexecute_extended_command): Likewise for function name and binding.
15599 (Frecursion_depth): Wrap around reliably on integer overflow.
15600 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15601 since some callers pass EMACS_INT values.
15602 (Fsingle_key_description): Don't crash if symbol name contains more
15603 than MAX_ALLOCA bytes.
15604 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15605 (get_minibuffer): Arg is now EMACS_INT, not int.
15606 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 15607 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
15608 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15609
2be7d702
PE
15610 * dbusbind.c (signature_cat): New function.
15611 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
15612 Do not overrun buffer; instead, report string overflow.
15613
9d1df220
PE
15614 * dispnew.c (add_window_display_history): Don't overrun buffer.
15615 Truncate instead; this is OK since it's just a log.
15616
33ef5c64
PE
15617 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15618 even if the time zone offset is outlandishly large.
15619 Don't mishandle offset == INT_MIN.
15620
66c6fdd5
PE
15621 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15622 when creating daemon; the previous buffer-overflow check was incorrect.
15623
d749b01b
PE
15624 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15625 which has the guts of the old verror function.
15626
b5cd1905
PE
15627 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15628 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15629
6e1a67fb
PE
15630 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15631 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 15632 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 15633 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
15634 length of string rather than counting it via multiple sprintfs;
15635 that's simpler and more reliable.
c21721cc
PE
15636 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15637 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15638 sprintf, in case result does not fit in int.
15639
c57b67fc
PE
15640 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15641 (fontset_from_font): Print it.
15642
8a401434
PE
15643 * frame.c (tty_frame_count): Now printmax_t, not int.
15644 (make_terminal_frame, set_term_frame_name): Print it.
15645 (x_report_frame_params): In X, window IDs are unsigned long,
15646 not signed long, so print them as unsigned.
15647 (validate_x_resource_name): Check for implausibly long names,
15648 and don't assume name length fits in 'int'.
15649 (x_get_resource_string): Don't blindly alloca invocation name;
15650 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15651 not fit in int.
15652
6e1a67fb
PE
15653 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15654 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
15655 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15656
0df02bf3
PE
15657 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15658 Use esprintf, not sprintf, in case result does not fit in int.
15659
48e30793
PE
15660 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15661 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15662 it as a large positive number.
15663 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15664 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15665
a66ff6d8
PE
15666 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15667 in case result does not fit in int.
15668
aca216ff
PE
15669 * print.c (float_to_string): Detect width overflow more reliably.
15670 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15671 buffer overrun. Don't assume list length fits in 'int'. Treat
15672 print length of 0 as 0, not as infinity; to be consistent with other
15673 uses of print length in this function. Don't overflow print length
15674 index. Don't assume hash table size fits in 'long', or that
15675 vectorlike size fits in 'unsigned long'.
15676
31c286f7
PE
15677 * process.c (make_process): Use printmax_t, not int, to format
15678 process-name gensyms.
15679
55e5faa1
PE
15680 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15681
80f2e268
PE
15682 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15683 to avoid potential buffer overrun.
15684
670741ab
PE
15685 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15686 if X resource line is longer than 512 bytes.
15687
b7163a50
PE
15688 * xfns.c (x_window): Make sprintf buffer a bit bigger
15689 to avoid potential buffer overrun.
15690
ae58ff1f
PE
15691 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15692
c43c8a6a
PE
15693 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15694
3f8236f4
PE
156952011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15696
53e9fe90 15697 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15698 Without these, Emacs silently mishandles large integers sometimes.
15699 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15700 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15701
6511acf2
PE
15702 * xdisp.c (try_window_id): Check Emacs fixnum range before
15703 converting to 'int'.
806add1d 15704
6511acf2 15705 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15706 Check that an Emacs fixnum is in range before assigning it to 'int'.
15707 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15708 values converted from Emacs fixnums.
15709 (Frecenter): Don't wrap around a line count if it is out of 'int'
15710 range; instead, treat it as an extreme value.
15711 (Fset_window_configuration, compare_window_configurations):
15712 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15713
6511acf2
PE
15714 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15715 that can exceed INT_MAX. Check that EMACS_INT value is in range
15716 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15717 (match_limit): Don't assume that a fixnum can fit in 'int'.
15718
6511acf2 15719 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15720 exceed INT_MAX.
15721
6511acf2 15722 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15723 (Fvertical_motion): Don't wrap around LINES values that don't fit
15724 in 'int'. Instead, treat them as extreme values. This is good
15725 enough for windows, which can't have more than INT_MAX lines anyway.
15726
fcb901a7
LMI
157272011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15728
0f2f6b6d
LMI
15729 * Require libxml/parser.h to avoid compilation warning.
15730
fcb901a7
LMI
15731 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15732
15733 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15734 since this reportedly can destroy thread storage.
15735
6e20a0d4
CY
157362011-08-30 Chong Yidong <cyd@stupidchicken.com>
15737
15738 * syntax.c (find_defun_start): Update all cache variables if
15739 exiting early (Bug#9401).
15740
148ae00e
EZ
157412011-08-30 Eli Zaretskii <eliz@gnu.org>
15742
f6cfbd8f
EZ
15743 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15744
148ae00e
EZ
15745 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15746 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15747 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15748
15749 * term.c (tty_append_glyph): New function.
15750 (produce_stretch_glyph): Static function and its prototype deleted.
15751
a66cfb1c
SM
15752 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15753 Add prototypes.
148ae00e 15754
c4a07a4c
PE
157552011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15756
15757 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15758 when checking :margin (Bug#9390).
15759 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 15760 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
15761 so that the name doesn't mislead. All uses changed.
15762
6bc8cd65
JB
157632011-08-28 Johan Bockgård <bojohan@gnu.org>
15764
15765 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15766 set_tty_hooks.
15767
dca4927e
EZ
157682011-08-27 Eli Zaretskii <eliz@gnu.org>
15769
15770 * xdisp.c (move_it_to): Don't bail out early when reaching
15771 position beyond to_charpos, if we are scanning backwards.
15772 (move_it_vertically_backward): When DY == 0, make sure we get to
15773 the first character in the line after the newline.
15774
f2cad773
PE
157752011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15776
15777 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15778 (ccl_driver): Do not generate an out-of-range pointer.
15779 (Fccl_execute_on_string): Remove unnecessary check for
15780 integer overflow, noted by Stefan Monnier in
15781 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15782 Remove a FIXME that didn't need fixing.
15783 Simplify the newly-introduced buffer reallocation code.
15784
0cae2cdb
JB
157852011-08-27 Juanma Barranquero <lekktu@gmail.com>
15786
15787 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15788
5fc295a4 157892011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 15790
70c60eb2 15791 Integer and memory overflow issues (Bug#9196).
726e0ab1 15792
d31850da
PE
15793 * doc.c (get_doc_string): Rework so that
15794 get_doc_string_buffer_size is the actual buffer size, rather than
15795 being 1 less than the actual buffer size; this makes xpalloc more
15796 convenient.
15797
a69fbedb
PE
15798 * image.c (x_allocate_bitmap_record, cache_image):
15799 * xselect.c (Fx_register_dnd_atom):
15800 Simplify previous changes by using xpalloc.
15801
fe5c5d37
PE
15802 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15803 since either will do and ptrdiff_t is convenient with xpalloc.
15804
0065d054
PE
15805 * charset.c (charset_table_size)
15806 (struct charset_sort_data.priority): Now ptrdiff_t.
15807 (charset_compare): Don't overflow if priorities differ greatly.
15808 (Fsort_charsets): Don't assume list length fits in int.
15809 Check for size-calculation overflow when allocating sort data.
15810 (syms_of_charset): Allocate an initial charset table that is
15811 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15812
15813 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15814
15815 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15816 The actual value is always <= INT_MAX, and leaving it unsigned made
15817 overflow checking harder.
15818
15819 * dispextern.h (struct glyph_matrix.rows_allocated)
15820 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15821 with xpalloc. The values are still always <= INT_MAX.
15822
15823 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15824
15825 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15826 (SAFE_NALLOCA): New macro.
15827
15828 * region-cache.c (struct boundary.pos, find_cache_boundary)
15829 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15830 (set_cache_region, invalidate_region_cache)
15831 (revalidate_region_cache, know_region_cache, region_cache_forward)
15832 (region_cache_backward, pp_cache):
15833 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15834 so that ptrdiff_t * can be passed to xpalloc.
15835 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15836 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15837 (pp_cache): Don't assume cache_len fits in int.
15838 * region-cache.h: Adjust extern decls to match.
15839
15840 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15841 EMACS_INT, since either will do, for xpalloc.
15842
15843 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15844 (xnmalloc, xnrealloc, xpalloc): New functions.
15845
726e0ab1
PE
15846 * bidi.c (bidi_shelve_header_size): New constant.
15847 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15848 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15849
51f30bc5 15850 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
15851 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15852 (overlay_strings):
15853 Don't update size of array until after memory allocation succeeds,
15854 because xmalloc/xrealloc may not return.
0065d054
PE
15855 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15856 now that we have proper integer overflow checking.
15857 (record_overlay_string, overlay_strings): Catch overflows when
15858 calculating size of overlay_str_buf.
726e0ab1 15859
0065d054
PE
15860 * callproc.c (Fcall_process): Check for size overflow when
15861 calculating size of args2.
15862 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15863 Normally we prefer signed values, but sticking with ptrdiff_t would
15864 require adding more-complicated checks.
726e0ab1
PE
15865
15866 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15867 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15868 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 15869 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
15870
15871 * character.c (Fstring): Check for size-calculation overflow.
15872
15873 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15874 unnecessary integer overflow. Check for size overflow.
15875 (encode_coding_object): Don't update size until xmalloc succeeds.
15876
15877 * composite.c (get_composition_id): Check for overflow in glyph
15878 length calculations.
15879
15880 Integer and memory overflow fixes for display code.
15881 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15882 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15883 (scrolling_window): Check for overflow in size calculations.
15884 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15885 Don't assume glyph table len fits in int.
15886 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15887 (row_table_size): Now ptrdiff_t, not int.
15888 (scrolling_window): Avoid overflow in size calculations.
15889 Don't update size until allocation succeeds.
15890 * fns.c (concat): Check for overflow in size calculations.
15891 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15892 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15893 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15894
15895 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15896 (get_doc_string): Check for size calculation overflow.
15897 Don't update size until allocation succeeds.
15898 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15899 EMACS_INT, where ptrdiff_t will do.
15900 (Fsubstitute_command_keys): Check for string overflow.
15901
15902 * editfns.c (set_time_zone_rule): Don't assume environment length
15903 fits in int.
15904 (message_length): Now ptrdiff_t, not int.
15905 (Fmessage_box): Don't update size until allocation succeeds.
15906 Don't assume message length fits in int.
15907 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15908
0065d054
PE
15909 * emacs.c (main): Do not reallocate argv, since there is a null at
15910 the end that can be overwritten, and this way there's no need to
15911 worry about size-calculation overflow.
15912 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
15913
15914 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15915 alloc succeeds.
15916 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15917
15918 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15919 (x_set_scroll_bar_width, x_figure_window_size):
15920 Check for integer overflow.
15921 (x_set_alpha): Do not assume XINT fits in int.
15922
15923 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15924 This is for the members text_lines, text_cols, total_lines, total_cols,
15925 where the system imposes an 'int' limit.
15926
15927 * fringe.c (Fdefine_fringe_bitmap):
15928 Don't update size until alloc works.
15929
15930 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15931 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15932
15933 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15934 Check for size-calculation overflow.
15935 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15936 do, as we prefer signed integers.
15937 (id_to_widget.max_size, id_to_widget.used)
15938 (xg_store_widget_in_map, xg_remove_widget_from_map)
15939 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15940 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15941 Use and return ptrdiff_t, not int.
15942 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15943 * gtkutil.h: Change prototypes to match the above.
15944
15945 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15946 are duplicate now that they've been promoted to lisp.h.
15947 (x_allocate_bitmap_record, x_alloc_image_color)
15948 (make_image_cache, cache_image, xpm_load):
15949 Don't update size until alloc is done.
15950 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
15951 (x_detect_edges):
3256efce 15952 Check for size calculation overflow.
726e0ab1
PE
15953 (ct_colors_allocated_max): New constant.
15954 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
15955 overflow.
3256efce 15956
726e0ab1
PE
15957 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
15958 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
15959 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
15960 Use ptrdiff_t, not int, to count maps.
15961 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
15962 calculations. Don't update size until allocation succeeds.
15963 Redo calculations to avoid overflow.
726e0ab1
PE
15964 * keyboard.h: Change prototypes to match the above.
15965
15966 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
15967 to count maps.
15968 (current_minor_maps): Check for size calculation overflow.
15969 * keymap.h: Change prototypes to match the above.
15970
15971 * lread.c (read1, init_obarray): Don't update size until alloc done.
15972
15973 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
15974 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
15975
726e0ab1
PE
15976 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
15977 Now ptrdiff_t, not int.
15978 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
15979 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
15980
15981 * process.c (Fnetwork_interface_list): Check for overflow
15982 in size calculation.
15983
15984 * region-cache.c (move_cache_gap): Check for size calculation overflow.
15985
15986 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
15987 overflow. Don't bother calling xmalloc when xrealloc will do.
15988
15989 * search.c (Freplace_match): Check for size calculation overflow.
15990 (Fset_match_data): Don't assume list lengths fit in 'int'.
15991
15992 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
15993 for command line length. Do not attempt to address one before the
15994 beginning of an array, as that's not portable.
15995
15996 * term.c (max_frame_lines): Remove; unused.
15997 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
15998 not int.
15999 (encode_terminal_code, calculate_costs): Check for size
16000 calculation overflow.
16001 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16002 table lengths and related sizes. Don't update size until alloc
16003 done. Redo calculations to avoid overflow.
16004 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16005
16006 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16007 subtracting pointers.
16008 (gobble_line): Check for overflow more carefully. Don't update size
16009 until alloc done.
16010
16011 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16012 Don't update size until alloc done.
16013 Redo size calculations to avoid overflow.
16014 Check for size calculation overflow.
0065d054 16015 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16016
16017 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16018 Use ptrdiff_t, not int, for sizes.
16019 (store_mode_line_noprop_char): Don't update size until alloc done.
16020
0065d054
PE
16021 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16022 Use ptrdiff_t, not int, for sizes.
16023 (Finternal_make_lisp_face, cache_face):
16024 Check for size calculation overflow.
16025 (cache_face): Treat size calculation overflows as if they were
16026 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16027
16028 * xfns.c (x_encode_text, x_set_name_internal)
16029 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16030 sizes, since they can exceed INT_MAX in size. Check for size
16031 calculation overflow.
16032
0065d054
PE
16033 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16034 (xg_select): Check for size calculation overflow.
726e0ab1
PE
16035 Don't update size until alloc done.
16036
0065d054 16037 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 16038 as sprintf is limited to int lengths.
1d526e2f 16039
252c5ee1
PE
16040 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16041 (X_LONG_MIN): New macros.
864d7ce7
PE
16042 Use them to make the following changes clearer.
16043 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16044 This change doesn't affect the value now, but it may help remind
16045 future maintainers not to raise the value too much later.
16046 (SELECTION_QUANTUM): Remove, replacing with ...
16047 (selection_quantum): ... new function, which avoids overflow.
16048 All uses changed.
16049 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16050 assumption that selection length fits in 'int'.
16051 (x_reply_selection_request, x_handle_selection_request)
16052 (x_get_window_property, receive_incremental_selection)
16053 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16054 (lisp_data_to_selection_data, clean_local_selection_data):
16055 Use ptrdiff_t, not int, to record length of selection.
16056 (x_reply_selection_request, x_get_window_property)
16057 (receive_incremental_selection, x_property_data_to_lisp):
16058 Redo calculations to avoid overflow.
16059 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 16060 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
16061 something.
16062 (x_get_window_property, receive_incremental_selection)
16063 (lisp_data_to_selection_data, x_property_data_to_lisp):
16064 Check for size-calculation overflow.
16065 (x_get_window_property, receive_incremental_selection)
16066 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16067 Don't store size until memory allocation succeeds.
16068 (x_get_window_property): Plug memory leak on memory exhaustion.
16069 Don't double-block input; malloc is safe here. Don't assume 2**34
16070 - 4 fits in unsigned long. Add an xassert to check
16071 XGetWindowProperty overflow. Be more careful about overflow
16072 calculations, and distinguish size from memory overflow better.
16073 (receive_incremental_selection): When tracing, don't assume
16074 unsigned int is less than INT_MAX.
16075 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16076 harmful) conversions of unsigned short to int.
16077 (lisp_data_to_selection_data): Don't assume that integers
16078 in the range -65535 through -1 fit in an X unsigned short.
16079 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16080 result parameters unless successful. Rely on cons_to_unsigned
16081 to report problems with elements; the old code wasn't right anyway.
16082 (x_check_property_data): Check for int overflow; we cannot use
16083 a wider type due to X limits.
16084 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16085
726e0ab1 16086 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 16087
0065d054
PE
16088 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16089 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
16090 (x_color_cells): Don't store size until memory allocation succeeds.
16091 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 16092 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
16093 (x_term_init): Don't assume length fits in int (sprintf is limited
16094 to int size).
bc18e09d 16095
ebfa62c0
PE
16096 Use ptrdiff_t for composition IDs.
16097 * character.c (lisp_string_width):
16098 * composite.c (composition_table_size, n_compositions)
16099 (get_composition_id, composition_gstring_from_id):
16100 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16101 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16102 * window.c (Frecenter):
16103 Use ptrdiff_t, not int, for composition IDs.
16104 * composite.c (get_composition_id): Check for integer overflow.
16105 * composite.h: Adjust prototypes to match the above changes.
16106
d3411f89
PE
16107 Use ptrdiff_t for hash table indexes.
16108 * category.c (hash_get_category_set):
16109 * ccl.c (ccl_driver):
16110 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16111 * coding.c (coding_system_charset_list, detect_coding_system):
16112 * coding.h (struct coding_system.id):
16113 * composite.c (get_composition_id, gstring_lookup_cache):
16114 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16115 * image.c (xpm_get_color_table_h):
16116 * lisp.h (hash_lookup, hash_put):
16117 * minibuf.c (Ftest_completion):
16118 Use ptrdiff_t for hash table indexes, not int (which is too
16119 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16120 32-bit --with-wide-int hosts).
16121
e097a6fa
PE
16122 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16123 Add a FIXME comment about memory leaks.
16124 (syms_of_charset): Don't assume xmalloc returns.
16125
5637687f
PE
16126 Don't assume that stated character widths fit in int.
16127 * character.c (Fchar_width, c_string_width, lisp_string_width):
16128 * character.h (CHAR_WIDTH):
16129 * indent.c (MULTIBYTE_BYTES_WIDTH):
16130 Use sanitize_char_width to avoid undefined and/or bad behavior
16131 with outlandish widths.
a66cfb1c 16132 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
16133 now that we have two such functions. All uses changed.
16134 (sanitize_char_width): New inline function.
16135
a2271ba2
PE
16136 Don't assume that tab-width fits in int.
16137 * character.h (sanitize_width): New inline function.
16138 (SANE_TAB_WIDTH): New macro.
16139 (ASCII_CHAR_WIDTH): Use it.
16140 * indent.c (sane_tab_width): Remove. All uses replaced by
16141 SANE_TAB_WIDTH (current_buffer).
16142 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16143
18c52557
PE
16144 * fileio.c: Integer overflow issues with file modes.
16145 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16146
caeeedc1
PE
16147 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16148 Remove unreachable code.
16149 (read_hex, load_charset_map_from_file): Check for integer overflow.
16150
6df6ae42 16151 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
16152 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16153 (x_send_scroll_bar_event): Likewise. Check that the size does not
16154 exceed limits imposed by XClientMessageEvent, as well as the usual
16155 ptrdiff_t and size_t limits.
16156
b13995db
PE
16157 * keyboard.c: Overflow, signedness and related fixes.
16158 (make_lispy_movement): Use same integer type in forward decl
16159 that is used in the definition.
16160 (read_key_sequence, keyremap_step):
16161 Change bufsize argument back to int, undoing my 2011-03-30 change.
16162 We prefer signed types, and int is wide enough here.
16163 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16164 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16165 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16166 length, not size_t. Use ptrdiff_t for index, not int.
16167 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16168 possibility of integer overflow.
16169
13464394
PE
16170 Overflow, signedness and related fixes for images.
16171
16172 * dispextern.h (struct it.stack[0].u.image.image_id)
16173 (struct_it.image_id, struct image.id, struct image_cache.size)
16174 (struct image_cache.used, struct image_cache.ref_count):
16175 * gtkutil.c (update_frame_tool_bar):
16176 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16177 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16178 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16179 * nsmenu.m (update_frame_tool_bar):
16180 * xdisp.c (calc_pixel_width_or_height):
16181 * xfns.c (image_cache_refcount):
16182 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16183 on typical 64-bit hosts.
16184
16185 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16186 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16187 Omit unnecessary casts to int.
16188 (parse_image_spec): Check that integers fall into 'int' range
16189 when the callers expect that.
16190 (image_ascent): Redo ascent calculation to avoid int overflow.
16191 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16192 (lookup_image): Remove unnecessary tests.
16193 (xbm_image_p): Locals are now of int, not EMACS_INT,
16194 since parse_image_check makes sure they fit into int.
16195 (png_load, gif_load, svg_load_image):
16196 Prefer int to unsigned where either will do.
16197 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
16198 old tiff_error_handler and tiff_warning_handler.
16199 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
16200 stack buffer overflows. It uses only the features of vsnprintf
16201 that are common to both POSIX and native Microsoft.
16202 (tiff_error_handler, tiff_warning_handler): Use it.
16203 (tiff_load, gif_load, imagemagick_load_image):
16204 Don't assume :index value fits in 'int'.
16205 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16206 (imagemagick_load_image): Check that crop parameters fit into
16207 the integer types that MagickCropImage accepts. Don't assume
16208 Vimagemagick_render_type has a nonnegative value. Don't assume
16209 size_t fits in 'long'.
16210 (gs_load): Use printmax_t to print the widest integers possible.
16211 Check for integer overflow when computing image height and width.
16212
c11821d4
EZ
162132011-08-26 Eli Zaretskii <eliz@gnu.org>
16214
16215 * xdisp.c (redisplay_window): Don't force window start if point
16216 will be invisible in the resulting window. (Bug#9324)
16217
0c95fcf7
EZ
162182011-08-25 Eli Zaretskii <eliz@gnu.org>
16219
16220 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16221 the display spec is of the form `(space ...)'.
16222 (handle_display_spec): Return the value returned by
16223 handle_single_display_spec, not just 1 or zero.
16224 (handle_single_display_spec): If the display spec is of the form
16225 `(space ...)', and specifies display in the text area, return 2
16226 rather than 1.
fee65a97 16227 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
16228 accurately, and prefer exact match for point under bidi.
16229 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
16230
16231 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16232 into disp_prop; all users changed.
16233
16234 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16235 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16236 for the text covered by the display property.
16237
e4ed06f1
CY
162382011-08-25 Chong Yidong <cyd@stupidchicken.com>
16239
16240 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16241 Change return value to nil.
16242 (Frecord_buffer): Delete unused function.
16243
f67cdd7f
EZ
162442011-08-24 Eli Zaretskii <eliz@gnu.org>
16245
5980d4c6
EZ
16246 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16247 buffers, return left-to-right.
8610fe8b
EZ
16248 (set_cursor_from_row): Consider candidate row a win if its glyph
16249 represents a newline and point is on that newline. Fixes cursor
16250 positioning on the newline at EOL of R2L text within L2R
16251 paragraph, and vice versa.
16252 (try_cursor_movement): Check continued rows, in addition to
16253 continuation rows. Fixes unwarranted scroll when point enters a
16254 continued line of R2L text within an L2R paragraph, or vice versa.
16255 (cursor_row_p): Consider the case of point being equal to
16256 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16257 from the end of a short line to the beginning of a continued line
16258 of R2L text within L2R paragraph.
16259 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16260 composed characters.
5980d4c6 16261
f67cdd7f
EZ
16262 * bidi.c (bidi_check_type): Use xassert.
16263 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16264 members.
16265
bca633fb
EZ
162662011-08-23 Eli Zaretskii <eliz@gnu.org>
16267
16268 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16269 a character.
16270
4a5885a7
CY
162712011-08-23 Chong Yidong <cyd@stupidchicken.com>
16272
16273 * nsfont.m (ns_otf_to_script): Fix typo.
16274
0902a04e
KH
162752011-08-22 Kenichi Handa <handa@m17n.org>
16276
16277 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16278 extra slot even if the purpose is char-code-property-table.
16279
1a2e6670
EZ
162802011-08-23 Eli Zaretskii <eliz@gnu.org>
16281
8ddde651
EZ
16282 * xdisp.c (redisplay_window): When computing centering_position,
16283 account for the height of the header line. (Bug#8874)
16284
425cc014
EZ
16285 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16286 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16287 candidate is selected by the mouse, and that candidate has a
16288 composed character under the mouse.
16289
1a2e6670
EZ
16290 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16291 coordinates reported by pos-visible-in-window-p for a composed
16292 character in column zero.
16293
8b76d6f8
SM
162942011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16295
16296 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16297
dac347dd
EZ
162982011-08-22 Eli Zaretskii <eliz@gnu.org>
16299
16300 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16301 consider it a hit if to_charpos is anywhere in the range of the
16302 composed buffer positions.
16303
e013fb34
CY
163042011-08-22 Chong Yidong <cyd@stupidchicken.com>
16305
16306 * image.c (gif_load): Don't assume that each subimage has the same
16307 dimensions as the base image. Handle disposal method that is
16308 "undefined" by the gif spec (Bug#9335).
16309
bd1ba3e8
CY
163102011-08-20 Chong Yidong <cyd@stupidchicken.com>
16311
16312 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16313 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16314
54a1215b
EZ
163152011-08-19 Eli Zaretskii <eliz@gnu.org>
16316
823564e5
EZ
16317 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16318 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16319 from an Org mode buffer to a Speedbar frame.
16320
54a1215b
EZ
16321 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16322 a composition, take its buffer position from IT->cmp_it.charpos.
16323 Fixes cursor positioning at the beginning of a line that begins
16324 with a composed character.
16325
9778ebcc
EZ
163262011-08-18 Eli Zaretskii <eliz@gnu.org>
16327
0be6ee06
EZ
16328 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16329 character bidirectional type, use STRONG_L instead. Fixes crashes
16330 in a buffer produced by `describe-categories'.
16331
9778ebcc
EZ
16332 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16333 members before the level stack, so they would be saved and
16334 restored when copying iterator state. Fixes incorrect reordering
16335 around TABs covered by display properties.
16336
156bffbe
AS
163372011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16338
6b02f655 16339 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16340
72ad093b
CY
163412011-08-17 Chong Yidong <cyd@stupidchicken.com>
16342
16343 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16344 (internal_condition_case_2, internal_condition_case_n):
16345 Remove unnecessary aborts (Bug#9081).
72ad093b 16346
35774242
EZ
163472011-08-17 Eli Zaretskii <eliz@gnu.org>
16348
16349 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16350 has no `load' handler, try opening the file locally. (Bug#9311)
16351
db76dd85
KB
163522011-08-16 Ken Brown <kbrown@cornell.edu>
16353
16354 * gmalloc.c: Expand comment.
16355
b215eee5
EZ
163562011-08-16 Eli Zaretskii <eliz@gnu.org>
16357
16358 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16359 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16360
a4579d33
KB
163612011-08-16 Ken Brown <kbrown@cornell.edu>
16362
16363 Fix memory allocation problems in Cygwin build (Bug#9273).
16364
16365 * unexcw.c ( __malloc_initialized): Declare external variable.
16366 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16367
8b76d6f8
SM
16368 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16369 New variables.
a4579d33
KB
16370 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16371 dumped emacs.
16372 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16373 in the static heap.
16374 [CYGWIN] (special_realloc): New function.
16375 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16376 requests to realloc storage in the static heap.
16377
3ebec551
PE
163782011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16379
16380 * bidi.c (bidi_initialize): Remove unused local.
16381
9fd8be00
EZ
163822011-08-15 Eli Zaretskii <eliz@gnu.org>
16383
6b02f655
SM
16384 * bidimirror.h:
16385 * biditype.h: Remove file.
16386 * makefile.w32-in ($(BLD)/bidi.$(O)):
16387 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
16388
16389 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16390
16391 * chartab.c: Improve commentary for the uniprop_table API.
16392
32413314
EZ
16393 * bidi.c (bidi_paragraph_init): Support zero value of
16394 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
16395 (bidi_initialize): Use uniprop_table instead of including
16396 biditype.h and bidimirror.h.
32413314 16397
9fd8be00
EZ
16398 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16399 coordinates of the iterator when restoring from ppos_it.
16400 (Bug#9296)
16401
5cf2b69b
KH
164022011-08-14 Kenichi Handa <handa@m17n.org>
16403
16404 * process.c (create_process): Call setup_process_coding_systems
72ad093b 16405 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 16406
daf17d00
EZ
164072011-08-14 Eli Zaretskii <eliz@gnu.org>
16408
16409 * xdisp.c (move_it_in_display_line_to): Don't invoke
16410 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16411 ppos_it. Fixes vertical cursor motion when line beginning is
16412 covered by an image. (Bug#9296)
16413
08e3161a
JD
164142011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16415
16416 * nsterm.h (ns_run_ascript): Declare.
16417 (NSAPP_DATA2_RUNASSCRIPT): Define.
16418
16419 * nsfns.m (as_script, as_result, as_status): New static variables.
16420 (ns_run_ascript): New function.
5e617bc2 16421 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
16422 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16423 the event loop. Get status from as_status (Bug#7276).
16424
16425 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16426 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16427 the event loop (Bug#7276).
16428
a3720aa2
AS
164292011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16430
16431 * gnutls.c (QCgnutls_bootprop_priority)
16432 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16433 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16434 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16435 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16436 (QCgnutls_bootprop_verify_hostname_error)
16437 (QCgnutls_bootprop_callbacks_verify): Rename from
16438 Qgnutls_bootprop_..., all uses changed.
16439
16440 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16441 uses changed.
16442
0a0d27fb
PE
164432011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16444
19d5c50c
PE
16445 * xfaces.c (Qframe_set_background_mode): Now static.
16446 * dispextern.h (Qframe_set_background_mode): Remove decl.
16447
0a0d27fb
PE
16448 * process.c (Fnetwork_interface_info): Declare local only if needed.
16449
377538cb
JD
164502011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16451
16452 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16453 (Fnetwork_interface_list): Allocate in increments of bytes instead
16454 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16455 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16456 sockaddr.
16457 (struct ifflag_def): notrailers is smart on OSX.
16458 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16459 Get hardware address with getifaddrs if available.
16460
08fff70c
EZ
164612011-08-12 Eli Zaretskii <eliz@gnu.org>
16462
16463 * xdisp.c (iterate_out_of_display_property): xassert that
16464 IT->position is set to within IT->object's boundaries. Break from
16465 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
16466 when IT->position is set up wrongly due to some bug.
16467 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
16468 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16469 entry. Force push_it to save on the stack the current
16470 buffer/string position, to be restored by pop_it. Fix flags in
16471 the iterator structure wrt the object coming from a display
16472 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16473 properties. (Bug#9284)
16474
7be1c708 164752011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 16476
7be1c708
CY
16477 * fontset.c (fontset_get_font_group): Add proper type checks.
16478 (Bug#9172)
aac0c6e3 16479
7be1c708 164802011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 16481
7be1c708
CY
16482 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16483 and LC_VERSION_MIN_MACOSX.
16484 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16485 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 16486
97bb72a6
EZ
164872011-08-08 Eli Zaretskii <eliz@gnu.org>
16488
16489 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
16490 no-display-properties-and-no-overlays under bidi display.
16491 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 16492 properties and overlays.
97bb72a6 16493
d5617611
CY
164942011-08-08 Chong Yidong <cyd@stupidchicken.com>
16495
37e11a63
CY
16496 * editfns.c (Fset_time_zone_rule): Document relationship with the
16497 setenv function.
16498
d5617611
CY
16499 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16500 the font entity extracted from the cache (Bug#8109).
16501
58872834
CY
165022011-08-07 Chong Yidong <cyd@stupidchicken.com>
16503
16504 * composite.c (autocmp_chars): Don't reset point. That is done by
16505 restore_point_unwind (Bug#5984).
16506
75bfc667
JL
165072011-08-07 Juri Linkov <juri@jurta.org>
16508
16509 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16510 to show the arg `TIME' instead of `TIMEVAL'.
16511
d1410150
EZ
165122011-08-06 Eli Zaretskii <eliz@gnu.org>
16513
16514 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16515 display property strides EOL and includes a newline, as in
16516 longlines-mode. (Bug#9254)
75b771e4
EZ
16517 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16518 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
16519
16520 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16521 is non-zero, even if the data buffer is NULL. Fixes a crash in
16522 vertical-motion with longlines-mode. (Bug#9254)
16523
35928349
EZ
165242011-08-05 Eli Zaretskii <eliz@gnu.org>
16525
ec7cc85b
EZ
16526 * bidi.c <bidi_cache_total_alloc>: Now static.
16527 (bidi_initialize): Initialize bidi_cache_total_alloc.
16528
8b76d6f8 16529 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
16530 cache. (Bug#9221)
16531
16532 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16533 amount allocated this far in `bidi_cache_total_alloc'.
16534 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16535 non-zero, only free the data buffer without restoring the cache
16536 contents. All callers changed.
16537
16538 * dispextern.h (bidi_unshelve_cache): Update prototype.
16539
16540 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16541 (move_it_in_display_line, move_it_to)
16542 (move_it_vertically_backward, move_it_by_lines): Replace the call
16543 to xfree to an equivalent call to bidi_unshelve_cache.
16544 (move_it_in_display_line_to): Fix logic of returning
412b6358 16545 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 16546
e2e2423b
EZ
165472011-08-05 Eli Zaretskii <eliz@gnu.org>
16548
16549 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16550 came from a string character with a `cursor' property. (Bug#9229)
16551
ae9e757a
JD
165522011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16553
16554 * Makefile.in (LIB_PTHREAD): New variable.
16555 (LIBES): Add LIB_PTHREAD (Bug#9216).
16556
16557 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16558 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16559
213bd7f2
AS
165602011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16561
6b02f655 16562 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 16563
99aaf75f
JD
165642011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16565
16566 * xterm.c (x_find_topmost_parent): New function.
16567 (x_set_frame_alpha): Find topmost parent window with
16568 x_find_topmost_parent and set the property there also (bug#9181).
16569 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16570
c74e9d86
PE
165712011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16572
16573 * callproc.c (Fcall_process): Avoid vfork clobbering
16574 the local vars buffer, coding_systems, current_dir.
16575
640c8776
SM
165762011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16577
16578 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16579
f26d0e4c
PE
165802011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16581
8a10d76c
PE
16582 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16583 so that it is not optimized away.
16584
f26d0e4c
PE
16585 * xdisp.c (compute_display_string_pos): Remove unused local.
16586
55439c61
EZ
165872011-08-02 Eli Zaretskii <eliz@gnu.org>
16588
16589 Fix slow cursor motion and scrolling in large buffers with
16590 selective display, like Org Mode buffers. (Bug#9218)
16591
16592 * dispextern.h (struct bidi_it): New member disp_prop_p.
16593
16594 * xdisp.c: Remove one-slot cache of display string positions.
16595 (compute_display_string_pos): Accept an additional argument
5e617bc2 16596 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
16597 for a display string or property. If found, set DISP_PROP_P
16598 non-zero.
16599
16600 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
16601 DISP_PROP_P, and pass it to compute_display_string_pos.
16602 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
16603 non-zero. All callers of bidi_fetch_char changed.
16604
fb33fa43
SM
166052011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16606
16607 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16608
b099e063
DM
166092010-12-03 Don March <don@ohspite.net>
16610
16611 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16612 last character M-[char] is translated to ESC [char] (bug#7541).
16613
5cc7f7af
KH
166142011-08-02 Kenichi Handa <handa@m17n.org>
16615
d0fffa3f 16616 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
16617
16618 * chartab.c (uniprop_table): Make it non-static.
16619
525d5e6e
EZ
166202011-08-01 Eli Zaretskii <eliz@gnu.org>
16621
16622 * xdisp.c (forward_to_next_line_start): Accept additional argument
16623 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16624 on the newline.
16625 (reseat_at_next_visible_line_start): Use the bidi iterator state
16626 returned by forward_to_next_line_start to restore the state of
16627 it->bidi_it after backing up to previous newline. (Bug#9212)
16628
31011111
AS
166292011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16630
16631 * regex.c (re_comp): Protoize.
16632 (re_exec): Fix return type.
16633 (regexec): Fix type of `ret'. (Bug#9203)
16634
476371c4
PE
166352011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16636
e5d76069
PE
16637 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16638 This is needed if max-image-size is a floating-point number.
16639
9a79b20c
AS
166402011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16641
16642 * print.c (print_object): Print empty symbol as ##.
16643
16644 * lread.c (read1): Read ## as empty symbol.
16645
d8c2fa78
AA
166462011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16647
16648 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16649 setting frame foreground color (Bug#9175).
16650 (x_set_background_color): Likewise.
16651
ffe57a7a
AA
16652 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16653 contents (Bug#9176).
16654 (EmacsTooltip -init): Remove bezels and add shadows to
16655 tooltip windows.
16656
bf3492a5
AA
16657 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16658 or scroll bar (Bug#8470).
16659
d55e9c53
AA
16660 * nsfont.m (nsfont_open): Remove assignment to voffset and
16661 unnecessary vars hshink, expand, hd, full_height, min_height.
16662 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16663
16664 * nsterm.h (nsfont_info): Remove voffset field.
16665
d8c2fa78 166662011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
16667
16668 Implement strike-through and overline on NextStep (Bug#8863).
16669
16670 * nsfont.m (nsfont_open): Use underline position provided by font,
16671 instead of hard-coded value of 2.
16672 (nsfont_draw): Call ns_draw_text_decoration instead.
16673
16674 * nsterm.h: Add declaration for ns_draw_text_decoration.
16675
16676 * nsterm.m (ns_draw_text_decoration): New function for drawing
16677 underline, overline, and strike-through.
16678 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16679 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16680 accommodate underlining, etc.
4843aac3 16681
4cc60b9b
EZ
166822011-07-28 Eli Zaretskii <eliz@gnu.org>
16683
bc7ece87
EZ
16684 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16685 default.
4cc60b9b 16686
476371c4
PE
166872011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16688
66606eea
PE
16689 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16690 Without this fix, if a signal arrives just after memory fills up,
16691 'malloc' might be invoked reentrantly.
16692
476371c4
PE
16693 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16694 In other words, assume that every image size is allowed, on non-X
16695 hosts. This assumption is probably wrong, but it lets Emacs compile.
16696
f3fcc40d
AS
166972011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16698
16699 * regex.c (re_iswctype): Convert return values to boolean.
16700
350c992f
EZ
167012011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16702
16703 * xdisp.c (compute_display_string_pos): Don't use cached display
16704 string position if the buffer had its restriction changed.
16705 (Bug#9184)
16706
5266b4bb
PE
167072011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16708
16709 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16710
2573a837 167112011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16712
41f55ccd 16713 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16714
39e378da
PE
16715 * bidi.c: Integer size and overflow fixes.
16716 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16717 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16718 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16719 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16720 (bidi_find_other_level_edge):
16721 Use ptrdiff_t instead of EMACS_INT where either will do.
16722 This works better on 32-bit hosts configured --with-wide-int.
16723 (bidi_cache_ensure_space): Check for size-calculation overflow.
16724 Use % rather than repeated addition, for better worst-case speed.
16725 Don't set bidi_cache_size until after xrealloc returns, because it
16726 might not return.
16727 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16728 (bidi_cache_ensure_space): Also check that the bidi cache size
16729 does not exceed that of the largest Lisp string or buffer. See Eli
16730 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16731
5e927815
PE
16732 * alloc.c (__malloc_size_t): Remove.
16733 All uses replaced by size_t. See Andreas Schwab's note
16734 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16735
ca4aa935
PE
16736 * image.c: Improve checking for integer overflow.
16737 (check_image_size): Assume that f is nonnull, since
16738 it is always nonnull in practice. This is one less thing to
16739 worry about when checking for integer overflow later.
16740 (x_check_image_size): New function, which checks for integer
16741 overflow issues inside X.
16742 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16743 This removes the need for a memory_full check.
16744 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16745 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16746 (xbm_read_bitmap_data): Change locals back to 'int', since
16747 their values must fit in 'int'.
16748 (xpm_load_image, png_load, tiff_load):
16749 Invoke x_create_x_image_and_pixmap earlier,
16750 to avoid much needless work if the image is too large.
16751 (tiff_load): Treat overly large images as if
16752 x_create_x_image_and_pixmap failed, not as malloc failures.
16753 (gs_load): Use x_check_image_size.
16754
5f8f9cc2
PE
16755 * gtkutil.c: Omit integer casts.
16756 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16757 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16758
5adf60bc
PE
16759 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16760
c8907a93
PE
16761 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16762 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16763 would wrongly return t on a 64-bit host.
16764
e3c25c68
PE
16765 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16766 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16767 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16768 and therefore cause GCC to emit a bogus diagnostic in some cases.
16769
3f791afe
PE
16770 * image.c: Integer signedness and overflow and related fixes.
16771 This is not an exhaustive set of fixes, but it's time to
16772 record what I've got.
16773 (lookup_pixel_color, check_image_size): Remove redundant decls.
16774 (check_image_size): Don't assume that arbitrary EMACS_INT values
16775 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16776 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16777 (tiff_load, imagemagick_load_image):
16778 Check for overflow in size calculations.
16779 (x_create_x_image_and_pixmap): Remove unnecessary test for
16780 xmalloc returning NULL; that can't happen.
16781 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16782 (xpm_color_bucket): Use better integer hashing function.
16783 (xpm_cache_color): Don't possibly over-allocate memory.
16784 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16785 (gif_memory_source):
16786 Use ptrdiff_t, not int or size_t, to record sizes.
16787 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16788 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16789 either works, as we prefer signed integers.
16790 (tiff_read_from_memory, tiff_write_from_memory):
16791 Return tsize_t, not size_t, since that's what the TIFF API wants.
16792 (tiff_read_from_memory): Don't fail simply because the read would
16793 go past EOF; instead, return a short read.
16794 (tiff_load): Omit no-longer-needed casts.
16795 (Fimagemagick_types): Don't assume size fits into 'int'.
16796
3cc5a532
PE
16797 Improve hashing quality when configured --with-wide-int.
16798 * fns.c (hash_string): New function, taken from sxhash_string.
16799 Do not discard information about ASCII character case; this
16800 discarding is no longer needed.
16801 (sxhash-string): Use it. Change sig to match it. Caller changed.
16802 * lisp.h: Declare it.
16803 * lread.c (hash_string): Remove, since we now use fns.c's version.
16804 The fns.c version returns a wider integer if --with-wide-int is
16805 specified, so this should help the quality of the hashing a bit.
16806
b312a492
PE
16807 * emacs.c: Integer overflow minor fix.
16808 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16809 Define only if GNU_LINUX.
16810 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16811
dfd153ae
PE
16812 * dispnew.c: Integer signedness and overflow fixes.
16813 Remove unnecessary forward decls, that were a maintenance hassle.
16814 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16815 All uses changed.
16816 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16817 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16818 (prepare_desired_row, line_draw_cost):
16819 Use int, not unsigned, where either works.
16820 (save_current_matrix, restore_current_matrix):
16821 Use ptrdiff_t, not size_t, where either works.
16822 (init_display): Check for overflow more accurately, and without
16823 relying on undefined behavior.
16824
a81d11a3
PE
16825 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16826 Remove, replacing with the new symbols in lisp.h. All uses changed.
16827 * fileio.c (make_temp_name):
16828 * filelock.c (lock_file_1, lock_file):
16829 * xdisp.c (message_dolog):
16830 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16831 Use pMd etc. instead.
16832 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16833 replacing the pWIDE etc. symbols removed from editfns.c.
16834
3300e6fd
PE
16835 * keyboard.h (num_input_events): Now uintmax_t.
16836 This is (very slightly) less likely to mess up due to wraparound.
16837 All uses changed.
16838
fd05c7e9
PE
16839 * buffer.c: Integer signedness fixes.
16840 (alloc_buffer_text, enlarge_buffer_text):
16841 Use ptrdiff_t rather than size_t when either will do, as we prefer
16842 signed integers.
16843
903fe15d
PE
16844 * alloc.c: Integer signedness and overflow fixes.
16845 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16846 (__malloc_size_t): Default to size_t, not to int.
16847 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16848 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16849 Prefer ptrdiff_t to size_t when either would do, as we prefer
16850 signed integers.
16851 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16852 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16853 Now const. Initialize with values that are in range even if char
16854 is signed.
16855 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16856 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16857 These functions do the right thing with sizes > 2**32.
16858 (check_depth): Now ptrdiff_t, not int.
16859 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16860 Adjust to new way of storing sizes. Check for size overflow bugs
16861 in rest of code.
16862 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16863 slightly wrong anyway, as it missed one instance of
16864 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16865 (refill_memory_reserve): Omit needless cast to size_t.
16866 (mark_object_loop_halt): Mark as externally visible.
16867
ac82cc6a
PE
16868 * xselect.c: Integer signedness and overflow fixes.
16869 (Fx_register_dnd_atom, x_handle_dnd_message):
16870 Use ptrdiff_t, not size_t, since we prefer signed.
16871 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16872 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16873 x_dnd_atoms_size and x_dnd_atoms_length.
16874
c2d1e36d
PE
16875 * doprnt.c: Prefer signed to unsigned when either works.
16876 * eval.c (verror):
16877 * doprnt.c (doprnt):
16878 * lisp.h (doprnt):
16879 * xdisp.c (vmessage):
16880 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16881 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16882 prefer signed arithmetic to avoid comparison confusion.
16883 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16884 but is a bit tricky.
16885
0e926e56
PE
16886 Assume freestanding C89 headers, string.h, stdlib.h.
16887 * data.c, doprnt.c, floatfns.c, print.c:
16888 Include float.h unconditionally.
16889 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16890 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16891 * regex.c: Likewise for stddef.h, string.h.
16892 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16893 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16894 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16895 (STDC_HEADERS): Remove obsolete defines.
16896 * sysdep.c: Include limits.h unconditionally.
16897
9cfdb3ec
PE
16898 Assume support for memcmp, memcpy, memmove, memset.
16899 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16900 * regex.c (memcmp, memcpy):
16901 Remove; we assume C89 now.
16902
16903 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16904 (__malloc_safe_bcopy): Remove; no longer needed.
16905
cf950e6b 16906 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
16907 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16908 well either way, and we prefer signed to unsigned.
16909
dbf38e02
LMI
169102011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16911
16912 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16913 closes the connection while we're reading (bug#9182).
16914
d6f0886c 169152011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 16916
d6f0886c
JD
16917 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16918 are specified (Bug#9168).
24e0f6b1 16919
2eb1f9e6
PE
169202011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16921
16922 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16923 Found by GCC static checking and --with-wide-int on a 32-bit host.
16924
22381272 169252011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
16926
16927 * xdisp.c (compute_display_string_pos): Fix logic of caching
16928 previous display string position. Initialize cached_prev_pos to
16929 -1. Fixes slow-down at the beginning of a buffer.
16930
f25e39b4
EZ
169312011-07-24 Eli Zaretskii <eliz@gnu.org>
16932
16933 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16934 for attrs[LFACE_FONTSET_INDEX].
16935
04c4b52e
PE
169362011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16937
16938 * xml.c (parse_region): Remove unused local
16939 that was recently introduced.
16940
c1734fbd
EZ
169412011-07-23 Eli Zaretskii <eliz@gnu.org>
16942
be18c5a5
EZ
16943 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16944 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16945
c1734fbd
EZ
16946 * xdisp.c (move_it_in_display_line_to): Record the best matching
16947 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
16948 exit if none of the characters scanned was an exact match.
16949 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
16950 when exact match is impossible due to invisible text, and the
16951 lines are truncated.
16952
a258d627
JD
169532011-07-23 Jan Djärv <jan.h.d@swipnet.se>
16954
16955 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
16956 for OSX >= 10.7.
16957
b6d5a689
EZ
169582011-07-22 Eli Zaretskii <eliz@gnu.org>
16959
0f74f785
EZ
16960 Fix a significant slow-down of cursor motion with C-n, C-p,
16961 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
16962 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 16963 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
16964 (next_element_from_buffer): Call compute_stop_pos_backwards to
16965 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
16966 base_level_stop.
16967 (reseat): Don't look for prev_stop, as that could mean a very long
16968 run.
16969 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
16970 <cached_disp_overlay_modiff>: Cache for last found display string
16971 position.
551918c1 16972 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
16973 about the same buffer in the same area of character positions, and
16974 the buffer wasn't changed since the time the display string
16975 position was cached.
551918c1 16976
b2d0c91a
EZ
169772011-07-22 Eli Zaretskii <eliz@gnu.org>
16978
16979 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
16980 is an integer, which is important for empty lines. (Bug#9149)
16981
043604ee
CY
169822011-07-22 Chong Yidong <cyd@stupidchicken.com>
16983
16984 * frame.c (Fmodify_frame_parameters): In tty case, update the
16985 default face if necessary (Bug#4238).
16986
da4adb04
CY
169872011-07-21 Chong Yidong <cyd@stupidchicken.com>
16988
16989 * editfns.c (Fstring_to_char): No need to explain what a character
16990 is in the docstring (Bug#6576).
16991
9abd0532
LMI
169922011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
16993
16994 * xml.c (parse_region): Make sure we always return a tree.
16995
36881d16
HK
169962011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
16997
16998 * xml.c (parse_region): If a document contains only comments,
16999 return that, too.
17000
1e98674d
LMI
170012011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17002
17003 * xml.c (make_dom): Return comments, too.
17004
590bd467
PE
170052011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17006
17007 Port to OpenBSD.
17008 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17009 and the surrounding thread.
17010 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17011 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17012 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17013 timer goes off.
17014 * s/openbsd.h (BROKEN_SIGIO): Define.
17015 * unexelf.c (unexec) [__OpenBSD__]:
17016 Don't update the .mdebug section of the Alpha COFF symbol table.
17017
f41628b2
LMI
170182011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17019
17020 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17021 (bug#8460).
17022
b59b67c5
PE
170232011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17024
15e3a074
PE
17025 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17026 This fixes some race conditions on the permissions of any newly
17027 created file.
17028
41bed37d
PE
17029 * alloc.c (valid_pointer_p): Use pipe, not open.
17030 This fixes some permissions issues when debugging.
17031
b59b67c5
PE
17032 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17033 If fchown fails to set both uid and gid, try to set just gid,
17034 as that is sometimes allowed. Adjust the file's mode to eliminate
17035 setuid or setgid bits that are inappropriate if fchown fails.
17036
925a6be7
SM
170372011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17038
17039 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17040 to compare Lisp_Objects.
17041 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17042 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17043 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17044
52968808
AS
170452011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17046
0a6a104b
AS
17047 * lread.c (read_integer): Unread even EOF character.
17048 (read1): Likewise. Properly record start position of symbol.
17049
52968808
AS
17050 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17051 symbol character follows.
17052
9e381cdd
PE
170532011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17054
17055 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17056 This works around a problem with the previous change to Fcopy_file.
17057 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17058 and without this change, GCC might complain about discarding
17059 fchown's return value.
17060
b5641435
JB
170612011-07-16 Juanma Barranquero <lekktu@gmail.com>
17062
17063 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17064
a8031457
PE
170652011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17066
17067 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17068
dd889327
LMI
170692011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17070
750c33f7
LMI
17071 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17072 it's used from the C level.
17073
dd889327
LMI
17074 * process.c: Use the same condition for POLL_FOR_INPUT in both
17075 keyboard.c and process.c (bug#1858).
17076
87e86684
LM
170772011-07-09 Lawrence Mitchell <wence@gmx.li>
17078
17079 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17080 (Fgnutls_boot): Use it.
17081
64348f40
AS
170822011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17083
17084 * doc.c (Fsubstitute_command_keys): Revert last change.
17085
1d698799
LMI
170862011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17087
f863868c
LMI
17088 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17089 quotes the next character, and doesn't affect other longer
17090 sequences (bug#8935).
17091
1d698799
LMI
17092 * lread.c (syms_of_lread): Clarify that is isn't only
17093 `eval-buffer' and `eval-defun' that's affected by
17094 `lexical-binding' (bug#8460).
17095
aa4b6df6
EZ
170962011-07-15 Eli Zaretskii <eliz@gnu.org>
17097
17098 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 17099 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 17100
5d856da6
PE
171012011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17102
ad6042bb
PE
17103 Fix minor problems found by static checking.
17104 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17105 (elsz): Now a signed constant, not a size_t var. We prefer signed
17106 types to unsigned, to avoid integer comparison confusion. Without
17107 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17108 "cannot optimize loop, the loop counter may overflow", a symptom
17109 of the confusion.
f00bbb22 17110 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
17111 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17112
6468f31c
LMI
171132011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17114
49080b10
LMI
17115 * search.c (Fre_search_backward): Mention `case-fold-search' in
17116 all the re_search_* functions (bug#8138).
17117
6468f31c
LMI
17118 * keyboard.c (Fopen_dribble_file): Document when the file is
17119 closed (bug#8056).
17120
c965adc5
EZ
171212011-07-14 Eli Zaretskii <eliz@gnu.org>
17122
df9733bf
EZ
17123 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17124 bidi_cache_idx.
17125
0bb23927
EZ
17126 Support bidi reordering of display and overlay strings.
17127 * xdisp.c (compute_display_string_pos)
17128 (compute_display_string_end): Accept additional argument STRING.
17129 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17130 (reseat_to_string): Initialize bidi_it->string.s and
17131 bidi_it->string.schars.
17132 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
17133 NULL (avoids a crash in bidi_paragraph_init).
17134 Initialize itb.string.lstring.
0bb23927
EZ
17135 (init_iterator): Call bidi_init_it only of a valid
17136 buffer position was specified. Initialize paragraph_embedding to
17137 L2R.
17138 (reseat_to_string): Initialize the bidi iterator.
17139 (display_string): If we need to ignore text properties of
17140 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17141 original value of -1 will not work with bidi.)
17142 (compute_display_string_pos): First arg is now struct
17143 `text_pos *'; all callers changed. Support display properties on
17144 Lisp strings.
17145 (compute_display_string_end): Support display properties on Lisp
17146 strings.
17147 (init_iterator, reseat_1, reseat_to_string): Initialize the
17148 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17149 when iterating on a string not from display properties).
640c8776
SM
17150 (compute_display_string_pos, compute_display_string_end):
17151 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
17152 arrow keys.
17153 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
17154 base_level_stop; instead, set base_level_stop to BEGV.
17155 Fixes crashes in vertical-motion.
0bb23927
EZ
17156 (next_element_from_buffer): Improve commentary for when
17157 the iterator is before prev_stop.
17158 (init_iterator): Initialize bidi_p from the default value of
17159 bidi-display-reordering, not from buffer-local value. Use the
17160 buffer-local value only if initializing for buffer iteration.
17161 (handle_invisible_prop): Support invisible properties on strings
17162 that are being bidi-reordered.
17163 (set_iterator_to_next): Support bidi reordering of C strings and
17164 Lisp strings.
17165 (next_element_from_string): Support bidi reordering of Lisp
17166 strings.
17167 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
17168 (display_string): Support display of R2L glyph rows.
17169 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
17170 (init_iterator): Don't initialize it->bidi_p for strings
17171 here.
17172 (reseat_to_string): Initialize it->bidi_p for strings here.
17173 (next_element_from_string, next_element_from_c_string)
17174 (next_element_from_buffer): Add xassert's for correspondence
17175 between IT's object being iterated and it->bidi_it.string
17176 structure.
17177 (face_before_or_after_it_pos): Support bidi iteration.
17178 (next_element_from_c_string): Handle the case of the first string
17179 character that is not the first one in the visual order.
17180 (get_visually_first_element): New function, refactored from common
17181 parts of next_element_from_buffer, next_element_from_string, and
17182 next_element_from_c_string.
17183 (tool_bar_lines_needed, redisplay_tool_bar)
17184 (display_menu_bar): Force left-to-right direction. Add a FIXME
17185 comment for making that be controlled by a user option.
17186 (push_it, pop_it): Save and restore the state of the
17187 bidi iterator. Save and restore the bidi_p flag.
17188 (pop_it): Iterate out of display property for string iteration as
17189 well.
17190 (iterate_out_of_display_property): Support iteration over strings.
17191 (handle_single_display_spec): Set up it->bidi_it for iteration
17192 over a display string, and call bidi_init_it.
17193 (handle_single_display_spec, next_overlay_string)
17194 (get_overlay_strings_1, push_display_prop): Set up the bidi
17195 iterator for displaying display or overlay strings.
17196 (forward_to_next_line_start): Don't use the shortcut if
17197 bidi-iterating.
17198 (back_to_previous_visible_line_start): If handle_display_prop
17199 pushed the iterator stack, restore the internal state of the bidi
17200 iterator by calling bidi_pop_it same number of times.
17201 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17202 and we are bidi-iterating, don't decrement the iterator position;
17203 instead, set the first_elt flag in the bidi iterator, to produce
17204 the same effect.
17205 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17206 (push_display_prop): xassert that we are iterating a buffer.
17207 (push_it, pop_it): Save and restore paragraph_embedding member.
17208 (handle_single_display_spec, next_overlay_string)
17209 (get_overlay_strings_1, reseat_1, reseat_to_string)
17210 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17211 correctly. Don't assume unibyte strings are not bidi-reordered.
17212 (compute_display_string_pos)
17213 (compute_display_string_end): Fix handling the case of C string.
17214 (push_it, pop_it): Save and restore from_disp_prop_p.
17215 (handle_single_display_spec, push_display_prop): Set the
17216 from_disp_prop_p flag.
17217 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17218 (pop_it): Call iterate_out_of_display_property only if we are
17219 popping after iteration over a string that came from a display
17220 property. Fix a typo in popping stretch info. Add an assertion
17221 for verifying that the iterator position is in sync with the bidi
17222 iterator.
17223 (handle_single_display_spec, get_overlay_strings_1)
17224 (push_display_prop): Fix initialization of paragraph direction for
17225 string when that of the parent object is not yet determined.
17226 (reseat_1): Call bidi_init_it to resync the bidi
17227 iterator with IT's position. (Bug#7616)
17228 (find_row_edges): If ROW->start.pos gives position
17229 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17230 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17231 Reset the from_disp_prop_p flag.
17232 (SAVE_IT, RESTORE_IT): New macros.
17233 (pos_visible_p, face_before_or_after_it_pos)
17234 (back_to_previous_visible_line_start)
17235 (move_it_in_display_line_to, move_it_in_display_line)
17236 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17237 (try_scrolling, redisplay_window, display_line): Use them when
17238 saving a temporary copy of the iterator and restoring it back.
17239 (back_to_previous_visible_line_start, reseat_1)
17240 (init_iterator): Empty the bidi cache "stack".
17241 (move_it_in_display_line_to): If iterator ended up at
17242 EOL, but we never saw any buffer positions smaller than
17243 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17244 motion in bidi-reordered lines.
17245 (move_it_in_display_line_to): Record prev_method and prev_pos
17246 immediately before the call to set_iterator_to_next. Fixes cursor
17247 motion in bidi-reordered lines with stretch glyphs and strings
17248 displayed in margins. (Bug#8133) (Bug#8867)
17249 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17250 TO_CHARPOS.
640c8776
SM
17251 (pos_visible_p): Support positions in bidi-reordered lines.
17252 Save and restore bidi cache.
0bb23927
EZ
17253
17254 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17255 (bidi_paragraph_info): Delete unused struct.
17256 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17257 (bidi_cache_start): New variable.
17258 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17259 to zero.
17260 (bidi_cache_fetch_state, bidi_cache_search)
17261 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17262 (bidi_cache_find, bidi_peek_at_next_level)
17263 (bidi_level_of_next_char, bidi_find_other_level_edge)
17264 (bidi_move_to_visually_next): Compare cache index with
17265 bidi_cache_start rather than with zero.
17266 (bidi_fetch_char): Accept new argument STRING; all callers
17267 changed. Support iteration over a string. Support strings with
17268 display properties. Support unibyte strings. Fix the type of
17269 `len' according to what STRING_CHAR_AND_LENGTH expects.
17270 (bidi_paragraph_init, bidi_resolve_explicit_1)
17271 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
17272 (bidi_level_of_next_char, bidi_move_to_visually_next):
17273 Support iteration over a string.
0bb23927
EZ
17274 (bidi_set_sor_type, bidi_resolve_explicit_1)
17275 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17276 can now be zero (for strings); special values 0 and -1 were
17277 changed to -1 and -2, respectively.
17278 (bidi_char_at_pos): New function.
17279 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17280 Call it instead of FETCH_MULTIBYTE_CHAR.
17281 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17282 initialized to valid values.
17283 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17284 values.
17285 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17286 the test for valid cached positions. Fix the logic for looking up
17287 the sentinel state in the cache. GCPRO the Lisp string we are
17288 iterating.
17289 (bidi_push_it, bidi_pop_it): New functions.
17290 (bidi_initialize): Initialize the bidi cache start stack pointer.
17291 (bidi_cache_ensure_space): New function, refactored from part of
17292 bidi_cache_iterator_state. Don't assume the required size is just
17293 one BIDI_CACHE_CHUNK away.
17294 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17295 (bidi_count_bytes, bidi_char_at_pos): New functions.
17296 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17297 always valid if bidi_cache_idx is valid.
17298 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17299 is valid if it's going to be used.
17300 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17301 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
17302 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17303 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
17304 (bidi_find_other_level_edge, bidi_cache_start_stack):
17305 All variables related to cache indices are now EMACS_INT.
c965adc5 17306
0bb23927
EZ
17307 * dispextern.h (struct bidi_string_data): New structure.
17308 (struct bidi_it): New member `string'. Make flag members be 1-bit
17309 fields, and put them last in the struct.
640c8776
SM
17310 (compute_display_string_pos, compute_display_string_end):
17311 Update prototypes.
0bb23927
EZ
17312 (bidi_push_it, bidi_pop_it): Add prototypes.
17313 (struct iterator_stack_entry): New members bidi_p,
17314 paragraph_embedding, and from_disp_prop_p.
17315 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17316 (bidi_shelve_cache, bidi_unshelve_cache):
17317 Declare prototypes.
0bb23927
EZ
17318
17319 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17320 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17321 and vector-like objects.
17322
17323 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17324 cache around display iteration.
17325
17326 * window.c (Fwindow_end, window_scroll_pixel_based)
17327 (displayed_window_lines, Frecenter): Save and restore the bidi
17328 cache around display iteration.
17329
3bbd2265
LMI
173302011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17331
17332 * editfns.c (Fdelete_region): Clarify the use of the named
17333 parameters (bug#6788).
17334
adc47434
MR
173352011-07-14 Martin Rudalics <rudalics@gmx.at>
17336
17337 * indent.c (Fvertical_motion): Set and restore w->pointm when
17338 saving and restoring the window's buffer (Bug#9006).
17339
837c31f8
LMI
173402011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17341
17342 * editfns.c (Fstring_to_char): Clarify just what is returned
17343 (bug#6576). Text by Eli Zaretskii.
17344
ac389d0c
JB
173452011-07-13 Juanma Barranquero <lekktu@gmail.com>
17346
17347 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17348
0be0ce47
EZ
173492011-07-13 Eli Zaretskii <eliz@gnu.org>
17350
17351 * buffer.c (mmap_find): Fix a typo.
17352
cd18e7e3
JB
173532011-07-13 Johan Bockgård <bojohan@gnu.org>
17354
17355 Fix execution of x selection hooks.
17356 * xselect.c (Qx_lost_selection_functions)
17357 (Qx_sent_selection_functions): New vars.
17358 (syms_of_xselect): DEFSYM them.
17359 (x_handle_selection_request): Pass Qx_sent_selection_functions
17360 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17361 (x_handle_selection_clear,x_clear_frame_selections):
17362 Pass Qx_lost_selection_functions rather than
17363 Vx_lost_selection_functions to Frun_hook_with_args.
17364
47ea7f44
PE
173652011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17366
ac389d0c 17367 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
17368 The old code sometimes used this field without initializing it.
17369
47ea7f44
PE
17370 * alloc.c (gc_sweep): Don't read past end of array.
17371 In theory, the old code could also have corrupted Emacs internals,
17372 though it'd be very unlikely.
17373
bc985c87
AS
173742011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17375
17376 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 17377 argument. (Bug#4026)
bc985c87 17378
0cf34688
LMI
173792011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17380
b3dadd76
LMI
17381 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17382 key" (bug#4257).
17383
0cf34688
LMI
17384 * window.c (Fset_window_start): Doc fix (bug#4199).
17385 (Fset_window_hscroll): Ditto.
17386
270768cd
PE
173872011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17388
077e3dda 17389 Fix minor new problems caught by GCC 4.6.1.
270768cd 17390 * term.c (init_tty): Remove unused local.
490011a6 17391 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 17392 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 17393 not used otherwise.
270768cd 17394
b1f58454
CY
173952011-07-12 Chong Yidong <cyd@stupidchicken.com>
17396
17397 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17398
22b9578d
LMI
173992011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17400
6e70ab07
LMI
17401 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17402 are the mini-buffer and the echo area (bug#3320).
17403
22b9578d
LMI
17404 * term.c (init_tty): Remove support for supdup, c10 and perq
17405 terminals, which are no longer supported (bug#1482).
17406
8974cc9f
JB
174072011-07-10 Johan Bockgård <bojohan@gnu.org>
17408
17409 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17410
a560d974
JD
174112011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17412
17413 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17414 for non-popups (Bug#3642).
17415
1dae0f0a
AS
174162011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17417
268c2c36 17418 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 17419 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
17420 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17421 * cm.c (losecursor): Likewise.
1dae0f0a
AS
17422 * data.c (fmod): Likewise.
17423 * dispnew.c (swap_glyphs_in_rows): Likewise.
17424 * emacs.c (memory_warning_signal): Likewise.
17425 * floatfns.c (float_error): Likewise.
17426 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17427 (otf_open, font_otf_capability, generate_otf_features)
17428 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17429 Likewise.
17430 * image.c (pbm_read_file): Likewise.
17431 * indent.c (string_display_width): Likewise.
17432 * intervals.c (check_for_interval, search_for_interval)
17433 (inc_interval_count, count_intervals, root_interval)
17434 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17435 * lread.c (defalias): Likewise.
268c2c36 17436 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
17437 * regex.c (set_image_of_range_1, set_image_of_range)
17438 (regex_grow_registers): Likewise.
17439 * sysdep.c (strerror): Likewise.
17440 * termcap.c (valid_filename_p, tprint, main): Likewise.
17441 * tparam.c (main): Likewise.
17442 * unexhp9k800.c (run_time_remap, save_data_space)
17443 (update_file_ptrs, read_header, write_header, calculate_checksum)
17444 (copy_file, copy_rest, display_header): Likewise.
17445 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17446 Likewise.
17447 * xdisp.c (check_it): Likewise.
17448 * xfaces.c (register_color, unregister_color, unregister_colors):
17449 Likewise.
17450 * xfns.c (print_fontset_result): Likewise.
17451 * xrdb.c (member, fatal, main): Likewise.
17452
99033785
PE
174532011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17454
17455 Fix minor problems found by static checking (Bug#9031).
17456 * chartab.c (char_table_set_range, map_sub_char_table):
17457 Remove unused locals.
17458 (uniprop_table): Now static.
17459 * composite.c (_work_char): Remove unused static var.
17460
9cb2ac56
JB
174612011-07-09 Juanma Barranquero <lekktu@gmail.com>
17462
17463 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17464
f25661f0
JD
174652011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17466
17467 * gtkutil.c (qttip_cb): Remove code without function.
17468
8278c4fe
EZ
174692011-07-09 Eli Zaretskii <eliz@gnu.org>
17470
17471 * w32.c (pthread_sigmask): New stub.
17472
1692ae2d 174732011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 17474
8a6ebd58 17475 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
17476 sigprocmask is portable only for single-threaded applications, and
17477 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
17478 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17479 (LIBES): Use it.
17480 * callproc.c (Fcall_process):
17481 * process.c (create_process):
17482 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17483 Use pthread_sigmask, not sigprocmask.
123403e4 17484
1b854618
JD
174852011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17486
17487 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17488 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17489 wrong (Bug#8591).
17490
3fe4b549
JD
174912011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17492
0ce7e563
JD
17493 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17494 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17495 (xg_hide_tooltip): Fix comment.
17496
3fe4b549
JD
17497 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17498 in registerServicesMenuSendTypes.
17499 (validRequestorForSendType): Don't check ns_return_types.
17500
17501 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17502 ns_return_type.
17503
5df75e47
JR
175042011-07-08 Jason Rumney <jasonr@gnu.org>
17505
22610910
JR
17506 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17507 SH_SHOW for hidden windows (Bug#5482).
17508
5df75e47
JR
17509 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17510 frame struct members of non-existent frames (Bug#6284).
17511
699c10bd
JD
175122011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17513
4393663b
JD
17514 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17515 variable firstTime not needed on OSX >= 10.6.
17516 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17517 >= 10.5. Use setKnobProportion, setDoubleValue.
17518
17519 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17520 (MAC_OS_X_VERSION_10_5): Define if not defined.
17521 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17522 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17523 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17524
17525 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 17526 cString and lossyCString on OSX >= 10.4.
4393663b 17527
58179cce 17528 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
17529 sizeToFit on OSX >= 10.2.
17530
17531 * nsimage.m (allocInitFromFile): Don't use deprecated method
17532 bestRepresentationForDevice on OSX >= 10.6.
17533
17534 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17535 to avoid warning.
17536
17537 * emacs.c: Declare unexec_init_emacs_zone.
17538
a63e0781
JD
17539 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17540
699c10bd
JD
17541 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17542
17543 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17544 on svcsMenu (Bug#8842).
17545
17546 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17547 ns_return_types.
17548 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17549
17550 * nsterm.m (QUTF8_STRING): Declare.
17551 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17552 (validRequestorForSendType): Return type is (id).
17553 Change indexOfObjectIdenticalTo to indexOfObject.
17554 Check if we have local selection before returning self (Bug#8842).
17555 (writeSelectionToPasteboard): Put local selection into paste board
17556 if we have a local selection (Bug#8842).
17557 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17558
17559 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17560 (ns_get_local_selection): Declare.
17561
54e10184
LMI
175622011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17563
9888ff71
LMI
17564 * keymap.c (describe_map_tree): Don't insert a double newline at
17565 the end of the buffer (bug#1169) and return whether we inserted
17566 something.
17567
54e10184
LMI
17568 * callint.c (Fcall_interactively): Change "reading args" to
17569 "providing args" to try to clarify what it does (bug#1010).
17570
15fa4783
KH
175712011-07-07 Kenichi Handa <handa@m17n.org>
17572
17573 * composite.c (composition_compute_stop_pos): Ignore a static
17574 composition starting before CHARPOS (Bug#8915).
17575
17576 * xdisp.c (handle_composition_prop): Likewise.
17577
a8815b00
EZ
175782011-07-07 Eli Zaretskii <eliz@gnu.org>
17579
17580 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17581 (Bug#9015)
17582
ef7b981d 175832011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
17584
17585 * character.h (unicode_category_t): New enum type.
17586
17587 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17588 (Qchar_code_property_table): New variable.
17589 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17590 (UNIPROP_COMPRESSED_FORM_P): New macros.
17591 (char_table_ascii): Uncompress the compressed values.
17592 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17593 Uncompress the compressed values.
ac389d0c 17594 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
17595 (char_table_ref_and_range): Uncompress the compressed values.
17596 (sub_char_table_set): New arg is_uniprop. Callers changed.
17597 Uncompress the compressed values.
17598 (sub_char_table_set_range): Args changed. Callers changed.
17599 (char_table_set_range): Adjuted for the above change.
17600 (map_sub_char_table): Delete args default_val and parent. Add arg
17601 top. Give decoded values to a Lisp function.
640c8776 17602 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
17603 values to a Lisp function. Gcpro more variables.
17604 (uniprop_table_uncompress)
17605 (uniprop_decode_value_run_length): New functions.
17606 (uniprop_decoder, uniprop_decoder_count): New variables.
17607 (uniprop_get_decoder, uniprop_encode_value_character)
17608 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17609 New functions.
17610 (uniprop_encoder, uniprop_encoder_count): New variables.
17611 (uniprop_get_encoder, uniprop_table)
17612 (Funicode_property_table_internal, Fget_unicode_property_internal)
17613 (Fput_unicode_property_internal): New functions.
17614 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17615 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 17616 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
17617 char-code-property-alist.
17618
640c8776 17619 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
17620 Vunicode_category_table.
17621
640c8776 17622 * font.c (font_range): Adjust for the change of
c805dec0
KH
17623 Vunicode_category_table.
17624
76b397fb
DN
176252011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17626
17627 * m/iris4d.h: Remove file, move contents ...
17628 * s/irix6-5.h: ... here.
17629
22b4128e
PE
176302011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17631
17632 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
17633 * alloc.c (mark_buffer):
17634 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17635 (clone_per_buffer_values): Don't assume that
22b4128e
PE
17636 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17637 This isn't true in general, and it's particularly not true
17638 if Emacs is configured with --with-wide-int.
17639 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17640 New macros, used in the buffer.c change.
17641
869795d6
JD
176422011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17643
17644 * xsettings.c: Use both GConf and GSettings if both are available.
17645 (store_config_changed_event): Add comment.
17646 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17647 (store_tool_bar_style_changed): New functions.
5e617bc2 17648 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
17649 (struct xsettings): Move font inside HAVE_XFT.
17650 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 17651 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 17652 Move inside HAVE_XFT.
640c8776 17653 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
17654 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17655 also.
17656 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 17657 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 17658 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
17659 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17660 (parse_settings): Move check for font inside HAVE_XFT.
17661 (read_settings, apply_xft_settings): Add comment.
17662 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17663 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17664 call store_font_name_changed.
17665 (xft_settings_event): Add comment.
17666 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17667 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17668 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17669 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17670 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17671 (xsettings_get_system_font, xsettings_get_system_normal_font):
17672 Add comment.
869795d6 17673
d8ed26bd
PE
176742011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17675
17676 Random fixes. E.g., (random) never returned negative values.
17677 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17678 subseconds part to the entropy, as that's a bit more random.
17679 Prefer signed to unsigned, since the signedness doesn't matter and
17680 in general we prefer signed. When given a limit, use a
17681 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17682 latter isn't right if USE_2_TAGS_FOR_INTS.
17683 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17684 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17685
cabf1cac
SM
176862011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17687
17688 * textprop.c (text_property_stickiness):
17689 Obey Vtext_property_default_nonsticky.
17690 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17691 * w32fns.c (syms_of_w32fns):
17692 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17693
6e9b2be9
PE
176942011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17695
17696 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17697 This is more efficient than Ffile_directory_p and avoids a minor race.
17698
90186c68
LMI
176992011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17700
7c301272
LMI
17701 * buffer.c (Foverlay_put): Say what the return value is
17702 (bug#7835).
17703
c4f2d8d4
LMI
17704 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17705 is a directory before asking whether to use the file name
17706 (bug#7564).
ad637907
LMI
17707 (barf_or_query_if_file_exists): Make the "File is a directory"
17708 error be more correct.
c4f2d8d4 17709
90186c68
LMI
17710 * fns.c (Frequire): Remove the mention of the .gz files, since
17711 that's installation-specific, but keep the mention of
17712 `get-load-suffixes'.
17713
da64016e
PE
177142011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17715
17716 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17717 Report string overflow if the output is too long.
17718
7d47b580
JB
177192011-07-04 Juanma Barranquero <lekktu@gmail.com>
17720
a555cb87
JB
17721 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17722 (syms_of_gnutls): Remove duplicate DEFSYM for
17723 Qgnutls_bootprop_verify_hostname_error, an error for
17724 Qgnutls_bootprop_verify_error (which is no longer used).
17725
7d47b580
JB
17726 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17727 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17728 Also (re)move comments that are misplaced or no longer relevant.
17729
1e49bfab
LMI
177302011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17731
17732 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17733
1485f4c0
CY
177342011-07-03 Chong Yidong <cyd@stupidchicken.com>
17735
17736 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17737 and background color parameters if they have been changed.
17738
a9ab721e
LMI
177392011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17740
17741 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17742
cf7cff57
PE
177432011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17744
2e13213d
PE
17745 * xsettings.c (SYSTEM_FONT): Define only when used.
17746 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17747
cf7cff57
PE
17748 * keymap.c (access_keymap_1): Now static.
17749
7a8e04f7
CY
177502011-07-02 Chong Yidong <cyd@stupidchicken.com>
17751
17752 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17753 leave any prefix arg for the up event (Bug#1586).
17754
61352f62
LMI
177552011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17756
69bb1ef7
LMI
17757 * lread.c (syms_of_lread): Mention single symbols defined by
17758 `defvar' or `defconst' (bug#7154).
17759
61352f62 17760 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 17761 (Frequire): Mention get-load-suffixes.
61352f62 17762
28545e04
MR
177632011-07-02 Martin Rudalics <rudalics@gmx.at>
17764
17765 * window.h (window): Remove clone_number slot.
17766 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17767 Remove.
17768 (make_parent_window, make_window, saved_window)
17769 (Fset_window_configuration, save_window_save): Don't deal with
17770 clone numbers.
17771 * buffer.c (Qclone_number): Remove declaration.
17772 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17773
3349e122
SM
177742011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17775
17776 Add multiple inheritance to keymaps.
17777 * keymap.c (Fmake_composed_keymap): New function.
17778 (Fset_keymap_parent): Simplify.
17779 (fix_submap_inheritance): Remove.
17780 (access_keymap_1): New function extracted from access_keymap to handle
17781 embedded parents and handle lists of maps.
17782 (access_keymap): Use it.
17783 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17784 (Fcopy_keymap): Handle embedded parents.
17785 (Fcommand_remapping, define_as_prefix): Simplify.
17786 (Fkey_binding): Simplify.
17787 (syms_of_keymap): Move minibuffer-local-completion-map,
17788 minibuffer-local-filename-completion-map,
17789 minibuffer-local-must-match-map, and
17790 minibuffer-local-filename-must-match-map to Elisp.
17791 (syms_of_keymap): Defsubr make-composed-keymap.
17792 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17793 (parse_menu_item): Trivial simplification.
17794
3279eb87
GM
177952011-07-01 Glenn Morris <rgm@gnu.org>
17796
17797 * Makefile.in (SETTINGS_LIBS): Fix typo.
17798
39cb9e56 177992011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
17800
17801 * coding.c (Fencode_coding_string): Record the last coding system
17802 used, as the function doc string says (bug#8738).
17803
0949d2b6
JD
178042011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17805
17806 * xsettings.c (store_monospaced_changed): Take new font as arg and
17807 check for change against current_mono_font.
17808 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17809 (emacs_settings_constructor, emacs_settings_get_property)
17810 (emacs_settings_set_property, emacs_settings_class_init)
17811 (emacs_settings_init, gsettings_obj): Remove.
17812 (something_changedCB): New function for HAVE_GSETTINGS.
17813 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17814 with value as argument.
17815 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17816 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 17817 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
17818 "changed".
17819
17820 * xgselect.c: Add defined (HAVE_GSETTINGS).
17821 (xgselect_initialize): Ditto.
17822
17823 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17824 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17825 xg_select.
17826
bbc6b304
PE
178272011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17828
17829 * eval.c (struct backtrace): Simplify and port the data structure.
17830 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17831 signed bit field, as this assumption is not portable and it makes
17832 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17833 "char debug_on_exit : 1" as this is not portable either; instead,
17834 use the portable "unsigned int debug_on_exit : 1". Remove unused
17835 member evalargs. Remove obsolete comments about cc bombing out.
17836
9851bfc5
JD
178372011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17838
51bb811f 17839 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
17840 Let HAVE_GSETTINGS override HAVE_GCONF.
17841 (store_monospaced_changed): New function.
17842 (EMACS_SETTINGS): A new type derived from GObject to handle
17843 GSettings notifications.
17844 (emacs_settings_constructor, emacs_settings_get_property)
17845 (emacs_settings_set_property, emacs_settings_class_init):
17846 New functions.
17847 (gsettings_client, gsettings_obj): New variables.
17848 (GSETTINGS_SCHEMA): New define.
17849 (something_changedCB): Call store_monospaced_changed.
17850 (init_gsettings): New function.
17851 (xsettings_initialize): Call init_gsettings.
17852 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17853 to NULL.
17854
640c8776 17855 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
17856 GCONF_CFLAGS/LIBS.
17857
5386012d
MR
178582011-06-29 Martin Rudalics <rudalics@gmx.at>
17859
17860 * window.c (resize_root_window, grow_mini_window)
17861 (shrink_mini_window): Rename Qresize_root_window to
17862 Qwindow_resize_root_window and Qresize_root_window_vertically to
17863 Qwindow_resize_root_window_vertically.
17864
f13e0b08
PE
178652011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17866
17867 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17868
94515237
JB
178692011-06-27 Juanma Barranquero <lekktu@gmail.com>
17870
17871 * makefile.w32-in: Redesign dependencies so they reflect more
17872 clearly which files are directly included by each source file,
17873 and not through other includes.
17874
e43b6e43
MR
178752011-06-27 Martin Rudalics <rudalics@gmx.at>
17876
17877 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17878 (sort_overlays, overlay_strings): When an overlay's clone number
17879 matches the window's clone number process the overlay even if
17880 the overlay's window property doesn't match the current window.
17881
d68443dc
MR
17882 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17883 (Fwindow_hchild): Rename to Fwindow_left_child.
17884 (Fwindow_next): Rename to Fwindow_next_sibling.
17885 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
17886 (resize_window_check): Rename to window_resize_check.
17887 (resize_window_apply): Rename to window_resize_apply.
17888 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17889 (Fdelete_other_windows_internal, resize_frame_windows)
17890 (Fsplit_window_internal, Fdelete_window_internal)
17891 (grow_mini_window, shrink_mini_window)
17892 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 17893
c7e73be5
JD
178942011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17895
17896 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17897 (emacs_fixed_set_min_size): Remove.
17898 (emacs_fixed_new): Take frame as argument.
17899
17900 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17901 (_EmacsFixedPrivate): Remove minwidth/height.
17902 Add struct frame *f.
17903 (emacs_fixed_init): Initialize priv->f.
17904 (get_parent_class, emacs_fixed_set_min_size): Remove.
17905 (emacs_fixed_new): Set priv->f to argument.
17906 (emacs_fixed_get_preferred_width)
17907 (emacs_fixed_get_preferred_height): Use min_width/height from
17908 frames size_hint to set minimum and natural (Bug#8919).
17909 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17910 and use min_width/height from frames size_hint to set
17911 min_width/height (Bug#8919).
17912
17913 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
17914 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17915 Fix indentation.
c7e73be5 17916
cf99dcf8
EZ
179172011-06-26 Eli Zaretskii <eliz@gnu.org>
17918
17919 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17920 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17921 called at ZV.
17922
029529ac
CY
179232011-06-26 Chong Yidong <cyd@stupidchicken.com>
17924
17925 * process.c (wait_reading_process_output): Bypass select if
17926 waiting for a cell while ignoring keyboard input, and input is
17927 pending. Suggested by Jan Djärv (Bug#8869).
17928
7a7ef429
PE
179292011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17930
17931 Use gnulib's dup2 module instead of rolling our own.
17932 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17933
11fdef7d 179342011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
17935
17936 * dispnew.c (scrolling_window): Before scrolling, turn off a
17937 mouse-highlight in the window being scrolled.
17938
cd3520a4
JB
179392011-06-24 Juanma Barranquero <lekktu@gmail.com>
17940
17941 Move DEFSYM to lisp.h and use everywhere.
17942
17943 * character.h (DEFSYM): Move declaration...
17944 * lisp.h (DEFSYM): ...here.
17945
17946 * gnutls.c:
17947 * minibuf.c:
17948 * w32menu.c:
17949 * w32proc.c:
17950 * w32select.c: Don't include character.h.
17951
17952 * alloc.c (syms_of_alloc):
17953 * buffer.c (syms_of_buffer):
17954 * bytecode.c (syms_of_bytecode):
17955 * callint.c (syms_of_callint):
17956 * casefiddle.c (syms_of_casefiddle):
17957 * casetab.c (init_casetab_once):
17958 * category.c (init_category_once, syms_of_category):
17959 * ccl.c (syms_of_ccl):
17960 * cmds.c (syms_of_cmds):
17961 * composite.c (syms_of_composite):
17962 * dbusbind.c (syms_of_dbusbind):
17963 * dired.c (syms_of_dired):
17964 * dispnew.c (syms_of_display):
17965 * doc.c (syms_of_doc):
17966 * editfns.c (syms_of_editfns):
17967 * emacs.c (syms_of_emacs):
17968 * eval.c (syms_of_eval):
17969 * fileio.c (syms_of_fileio):
17970 * fns.c (syms_of_fns):
17971 * frame.c (syms_of_frame):
17972 * fringe.c (syms_of_fringe):
17973 * insdel.c (syms_of_insdel):
17974 * keymap.c (syms_of_keymap):
17975 * lread.c (init_obarray, syms_of_lread):
17976 * macros.c (syms_of_macros):
17977 * msdos.c (syms_of_msdos):
17978 * print.c (syms_of_print):
17979 * process.c (syms_of_process):
17980 * search.c (syms_of_search):
17981 * sound.c (syms_of_sound):
17982 * syntax.c (init_syntax_once, syms_of_syntax):
17983 * terminal.c (syms_of_terminal):
17984 * textprop.c (syms_of_textprop):
17985 * undo.c (syms_of_undo):
17986 * w32.c (globals_of_w32):
17987 * window.c (syms_of_window):
17988 * xdisp.c (syms_of_xdisp):
17989 * xfaces.c (syms_of_xfaces):
17990 * xfns.c (syms_of_xfns):
17991 * xmenu.c (syms_of_xmenu):
17992 * xsettings.c (syms_of_xsettings):
17993 * xterm.c (syms_of_xterm): Use DEFSYM.
17994
4228cf16
TZ
179952011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
17996
cd3520a4 17997 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 17998
7fcccf1e
PE
179992011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18000
7efb4e0e
PE
18001 Integer and buffer overflow fixes (Bug#8873).
18002
ff5844ad
PE
18003 * print.c (printchar, strout): Check for string overflow.
18004 (PRINTPREPARE, printchar, strout):
18005 Don't set size unless allocation succeeds.
18006
90532f02
PE
18007 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18008 for sizes. Check for string overflow more accurately.
18009 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18010
6d84508d
PE
18011 * macros.c: Integer and buffer overflow fixes.
18012 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18013 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18014 Use ptrdiff_t, not int, for sizes.
18015 Don't increment bufsize until after realloc succeeds.
18016 Check for size-calculation overflow.
18017 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18018
437b2cb4
PE
18019 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18020
8b9ac8b4
PE
18021 * lread.c: Integer overflow fixes.
18022 (read_integer): Radix is now EMACS_INT, not int,
18023 to improve quality of diagnostics for out-of-range radices.
18024 Calculate buffer size correctly for out-of-range radices.
18025 (read1): Check for integer overflow in radices, and in
18026 read-circle numbers.
82cb60d3
PE
18027 (read_escape): Avoid int overflow.
18028 (Fload, openp, read_buffer_size, read1)
18029 (substitute_object_recurse, read_vector, read_list, map_obarray):
18030 Use ptrdiff_t, not int, for sizes.
18031 (read1): Use EMACS_INT, not int, for sizes.
20270765 18032 Check for size overflow.
8b9ac8b4 18033
7fcccf1e
PE
18034 * image.c (cache_image): Check for size arithmetic overflow.
18035
bfbbd7e7
PE
18036 * lread.c: Integer overflow issues.
18037 (saved_doc_string_size, saved_doc_string_length)
18038 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18039 Now ptrdiff_t, not int.
18040 (read1): Don't assume doc string length fits in int. Check for
18041 out-of-range doc string lengths.
18042 (read_list): Don't assume file position fits in int.
39019e54 18043 (read_escape): Check for hex character overflow.
bfbbd7e7 18044
4e323265
LL
180452011-06-22 Leo Liu <sdl.web@gmail.com>
18046
18047 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18048 Move to minibuffer.el.
18049
85fece3e
PE
180502011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18051
20b84ce9 18052 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
18053 The following patches are for when GLYPH_DEBUG && !XASSERT.
18054 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18055 * dispnew.c (flush_stdout):
18056 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18057 Mark as externally visible.
18058 * dispnew.c (check_window_matrix_pointers): Now static.
18059 * dispnew.c (window_to_frame_vpos):
18060 * xfns.c (unwind_create_frame):
18061 * xterm.c (x_check_font): Remove unused local.
18062 * scroll.c (CHECK_BOUNDS):
18063 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18064 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18065 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18066 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18067 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18068 Now static.
18069 (debug_method_add): Use va_list and vsprintf rather than relying
18070 on undefined behavior with wrong number of arguments.
18071 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18072 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18073 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18074 since we're not interested in debugging glyphs with old libraries.
18075 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18076 GCC 4.6.0's static checking.
18077
0766b489
PE
180782011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18079
31fd4b32
PE
18080 Integer overflow and signedness fixes (Bug#8873).
18081 A few related buffer overrun fixes, too.
18082
b79e8648
PE
18083 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18084
0766b489
PE
18085 * dispextern.h (struct face.stipple):
18086 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18087 (x_bitmap_mask, x_allocate_bitmap_record)
18088 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18089 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18090 (x_create_bitmap_from_xpm_data):
18091 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18092 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18093 (.bitmaps_last):
18094 * xfaces.c (load_pixmap):
18095 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18096 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18097 (.bitmaps_last, struct x_output.icon_bitmap):
18098 Use ptrdiff_t, not int, for bitmap indexes.
18099 (x_allocate_bitmap_record): Check for size overflow.
18100 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18101
b081724f
PE
18102 Use ptrdiff_t, not int, for overlay counts.
18103 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18104 * editfns.c (overlays_around, get_pos_property):
18105 * textprop.c (get_char_property_and_overlay):
18106 * xdisp.c (next_overlay_change, note_mouse_highlight):
18107 * xfaces.c (face_at_buffer_position):
21514da7
PE
18108 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18109 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18110 (Fnext_overlay_change, Fprevious_overlay_change)
18111 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 18112 Use ptrdiff_t, not int, for sizes.
21514da7 18113 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 18114
3de73e5e
PE
18115 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18116
2606c57b
PE
18117 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18118 (x_session_initialize): Do not assume string length fits in int.
18119
aaafe47a
PE
18120 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18121 This is unlikely, but can occur if DPI is outlandish.
18122
2674ddc8 18123 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
18124 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18125
28154962
PE
18126 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18127 * xrdb.c (magic_file_p, search_magic_path):
18128 Omit last arg SUFFIX; it was always 0. All callers changed.
18129 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18130
7de51af5
PE
18131 * xfont.c (xfont_match): Avoid need for strlen.
18132
25ed6cc3
PE
18133 * xfns.c: Don't assume strlen fits in int.
18134 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18135
4eab31dd
PE
18136 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18137 not unsigned long, as we prefer signed integers. All callers changed.
18138 Detect integer overflow in repeat count.
18139 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 18140 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 18141
171e2a58
PE
18142 * termcap.c: Don't assume sizes fit in int and never overflow.
18143 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18144 (gobble_line): Check for size-calculation overflow.
18145
ad39faca 18146 * minibuf.c (Fread_buffer):
6e5bb2dc 18147 * lread.c (intern, intern_c_string):
74ca2eb3
PE
18148 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18149 Don't assume string length fits in int.
18150
52c61c22 18151 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
18152 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18153
b5b8c9e5
PE
18154 * font.c: Don't assume string length fits in int.
18155 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18156 Use ptrdiff_t, not int.
ccd6111c
PE
18157 (font_intern_prop): Don't assume string length fits in int.
18158 Don't assume integer property fits in fixnum.
18159 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 18160
882f0d81 18161 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 18162 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
18163 Reformulate so as not to need the command string.
18164 Invoke gzip -cd rather than gunzip, as it's more portable.
18165 (lock_info_type, lock_file_1, lock_file):
18166 Don't assume pid_t and time_t fit in unsigned long.
18167 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18168 (current_lock_owner): Prefer signed type for sizes.
18169 Use memcpy, not strncpy, where memcpy is what is really wanted.
18170 Don't assume (via atoi) that time_t and pid_t fit in int.
18171 Check for time_t and/or pid_t out of range, e.g., via a network share.
18172 Don't alloca where an auto var works fine.
18173
93f4cf88
PE
18174 * fileio.c: Fix some integer overflow issues.
18175 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18176 Don't assume string length fits in int.
18177 (directory_file_name): Don't assume string length fits in long.
18178 (make_temp_name): Don't assume pid fits in int, or that its print
18179 length is less than 20.
18180
f3e92b69
PE
18181 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18182
1bfdaf10
PE
18183 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18184
35016e9a
PE
18185 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18186
3d1e65a1
PE
18187 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18188 We prefer signed integers, even for size calculations.
18189
0b963a93
PE
18190 * emacs.c: Don't assume string length fits in 'int'.
18191 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18192 (main): Don't invoke strlen when not needed.
18193
573f4b54
PE
18194 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18195 (XD_DEBUG_MESSAGE): Don't waste a byte.
18196
989f33ba
PE
18197 * callproc.c (getenv_internal_1, getenv_internal)
18198 (Fgetenv_internal):
965d34eb
PE
18199 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18200
e4d29b33
PE
18201 * lread.c (invalid_syntax): Omit length argument.
18202 All uses changed. This doesn't fix a bug, but it simplifies the
18203 code away from its former Hollerith-constant appearance, and it's
18204 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 18205 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 18206
eb49b136
PE
18207 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18208 This didn't break anything, but it didn't help either.
18209 It's confusing to put a bogus integer in a place where the actual
18210 value does not matter.
9f62aeb1 18211 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 18212 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 18213
15375a22
PE
18214 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18215 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18216 implementation.
b61cc01c
PE
18217 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18218 We prefer signed types, and the value cannot exceed the EMACS_INT
18219 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
18220 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18221 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18222 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 18223
53b2623d
PE
18224 * indent.c (sane_tab_width): New function.
18225 (current_column, scan_for_column, Findent_to, position_indentation)
18226 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 18227 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 18228
51cab52b 18229 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 18230
f2ed8a70
PE
18231 * lisp.h (lint_assume): New macro.
18232 * composite.c (composition_gstring_put_cache):
18233 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18234
abe80cc6
PE
18235 * editfns.c, insdel.c:
18236 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 18237
b02c740e
PE
18238 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18239
ebc96716
PE
18240 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18241
b4e50fa0 18242 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 18243 Use much-faster test for byte-length change.
311d5d7c 18244 Don't assume string byte-length fits in 'int'.
a4cf38e4 18245 Check that character arg fits in 'int'.
85461888 18246 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 18247
c0c1ee9f
PE
18248 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18249
a498d7f4
PE
18250 * fns.c (concat): Catch string overflow earlier.
18251 Do not rely on integer wraparound.
18252
51cab52b
PE
18253 * dispextern.h (struct it.overlay_strings_charpos)
18254 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
18255 * xdisp.c (forward_to_next_line_start)
18256 (back_to_previous_visible_line_start)
18257 (reseat_at_next_visible_line_start, next_element_from_buffer):
18258 Don't arbitrarily truncate the value of 'selective' to int.
18259
76031fad
PE
18260 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18261
5eb55db9
PE
18262 * composite.c: Don't truncate sizes to 'int'.
18263 (composition_gstring_p, composition_reseat_it)
18264 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
18265 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18266 not EMACS_UINT, for indexes.
5eb55db9 18267
0703a717
PE
18268 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18269
d6202519
PE
18270 * buffer.c: Include <verify.h>.
18271 (struct sortvec.priority, struct sortstr.priority):
8961a454 18272 Now EMACS_INT, not int.
c20998a7 18273 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
18274 (struct sortstr.size, record_overlay_string)
18275 (struct sortstrlist.size, struct sortlist.used):
18276 Don't truncate size to int.
18277 (record_overlay_string): Check for size-calculation overflow.
d6202519 18278 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 18279
d5a19415
JM
182802011-06-22 Jim Meyering <meyering@redhat.com>
18281
029529ac 18282 Don't leak an XBM-image-sized buffer
d5a19415
JM
18283 * image.c (xbm_load): Free the image buffer after using it.
18284
a9041e6c
PE
182852011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18286
18287 Port to Sun C.
18288 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18289 that Sun C diagnosed.
18290 * fns.c (secure_hash): Fix pointer signedness issue.
18291 * intervals.c (static_offset_intervals): New function.
18292 (offset_intervals): Use it.
18293
7f3f739f
LL
182942011-06-21 Leo Liu <sdl.web@gmail.com>
18295
18296 * deps.mk (fns.o):
18297 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18298 sha512.h.
18299
18300 * fns.c (secure_hash): Rename from crypto_hash_function and change
18301 the first arg to accept symbols.
5b66d427 18302 (Fsecure_hash): New primitive.
7f3f739f
LL
18303 (syms_of_fns): New symbols.
18304
76147d94
DD
183052011-06-20 Deniz Dogan <deniz@dogan.se>
18306
18307 * process.c (Fset_process_buffer): Clarify return value in
18308 docstring.
18309
7d7d0045
CY
183102011-06-18 Chong Yidong <cyd@stupidchicken.com>
18311
18312 * dispnew.c (add_window_display_history): Use BVAR.
18313
18314 * xdisp.c (debug_method_add): Use BVAR.
18315 (check_window_end, dump_glyph_matrix, dump_glyph)
18316 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18317
18318 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18319 Likewise.
18320
18321 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18322 check till after the cache is created in init_frame_faces.
18323
ff2bc410
SM
183242011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18325
18326 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18327
28177add
PE
183282011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18329
dd3482fe
PE
18330 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18331 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18332 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18333
393d71f3 18334 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18335 * fileio.c (Finsert_file_contents):
18336 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18337 Remove the old (too-loose) buffer overflow checks.
18338 They weren't needed, since make_gap checks for buffer overflow.
18339 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18340 The old code merely checked for Emacs fixnum overflow, and relied
18341 on undefined (wraparound) behavior. The new code avoids undefined
18342 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18343
2e6813b0 18344 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18345 Tune. Don't use wider integers than needed. Don't use alloca.
18346 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18347
599a9e4f
PE
18348 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18349
99561444
PE
18350 * insdel.c, lisp.h (buffer_overflow): New function.
18351 (insert_from_buffer_1, replace_range, replace_range_2):
18352 * insdel.c (make_gap_larger):
18353 * editfns.c (Finsert_char):
18354 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18355
28177add
PE
18356 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18357
e69dafad
PE
183582011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18359
4baa020d 18360 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18361
b1c46f02
PE
18362 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18363 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18364
e69dafad
PE
18365 * fileio.c: Don't assume EMACS_INT fits in off_t.
18366 (emacs_lseek): New static function.
18367 (Finsert_file_contents, Fwrite_region): Use it.
18368 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18369
566684ea
PE
18370 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18371
e6966cd6
PE
18372 * fns.c: Don't overflow int when computing a list length.
18373 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18374 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18375 truncation on 64-bit hosts. Check for QUIT every
18376 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18377 faster and is responsive enough.
18378 (Flength): Report an error instead of overflowing an integer.
18379 (Fsafe_length): Return a float if the value is not representable
18380 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 18381 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 18382 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 18383
dd0b0efb
PE
18384 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18385 (header_size, word_size): New constants.
18386 (allocate_vectorlike): Don't check size overflow here.
18387 (allocate_vector): Check it here instead, since this is the only
18388 caller of allocate_vectorlike that could cause overflow.
18389 Check that the new vector's length is representable as a fixnum.
18390
86fe5cfe
PE
18391 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18392 The previous code was bogus. For example, next_almost_prime (32)
18393 returned 39, which is undesirable as it is a multiple of 3; and
18394 next_almost_prime (24) returned 25, which is a multiple of 5 so
18395 why was the code bothering to check for multiples of 7?
18396
80e88859
PE
18397 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18398
4a2f0ad6
PE
18399 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18400
f66c7cf8
PE
18401 Variadic C functions now count arguments with ptrdiff_t.
18402 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18403 Back then I didn't know that the Emacs coding style prefers signed int.
18404 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
18405 were being counted with int, which may truncate counts on 64-bit
18406 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
18407 * lisp.h (struct Lisp_Subr.function.aMANY)
18408 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18409 Arg counts are now ptrdiff_t, not size_t.
18410 All variadic functions and their callers changed accordingly.
18411 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18412 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18413 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18414 * callint.c (Fcall_interactively): Check arg count for overflow,
18415 to avoid potential buffer overrun. Use signed char, not 'int',
18416 for 'varies' array, so that we needn't bother to check its size
18417 calculation for overflow.
18418 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18419 * eval.c (apply_lambda):
18420 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18421 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18422 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18423
a1759b76
PE
18424 * callint.c (Fcall_interactively): Don't use index var as event count.
18425
d96be9fc
PE
18426 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18427 * mem-limits.h (SIZE): Remove; no longer used.
18428
a690a978 18429 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 18430
578c21e6
PE
18431 Remove unnecessary casts.
18432 * xterm.c (x_term_init):
18433 * xfns.c (x_set_border_pixel):
18434 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18435 These aren't needed now that we assume ANSI C.
18436
96f53c6c
PE
18437 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18438 It's more likely to cause problems (due to unsigned overflow)
18439 than to cure them.
18440
83c77d31
PE
18441 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18442
ee2079f1
PE
18443 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18444
6da65536
PE
18445 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18446
7147c4a4
PE
18447 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18448
193e32d9
PE
18449 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18450
e5533da6
PE
18451 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18452
9910e595
PE
18453 GLYPH_CODE_FACE returns EMACS_INT, not int.
18454 * dispextern.h (merge_faces):
18455 * xfaces.c (merge_faces):
01103c44
PE
18456 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18457 Don't assume EMACS_INT fits in int.
9910e595 18458
2638320e
PE
18459 * character.h (CHAR_VALID_P): Remove unused parameter.
18460 * fontset.c, lisp.h, xdisp.c: All uses changed.
18461
045eb8d9
PE
18462 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18463
c1f134b5
PE
18464 * fns.c (concat): Minor tuning based on overflow analysis.
18465 This doesn't fix any bugs. Use int to hold character, instead
18466 of constantly refetching from Emacs object. Use XFASTINT, not
18467 XINT, for value known to be a character. Don't bother comparing
18468 a single byte to 0400, as it's always less.
18469
395fcb93 18470 * floatfns.c (Fexpt):
327eeec8
PE
18471 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18472
abbd3d23
PE
18473 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18474 for characters.
18475
684a03ef
PE
18476 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18477
0fed43f3
PE
18478 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18479 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18480 incorrectly succeed when S was a string, because 4294967386 was
18481 truncated before it was used.
18482
8fd02eb7
PE
18483 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18484 Otherwise, an out-of-range integer could cause undefined behavior
18485 on a 64-bit host.
18486
f8c86b69
PE
18487 * composite.c: Use int, not EMACS_INT, for characters.
18488 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18489 EMACS_INT, for values that are known to be in character range.
18490 This doesn't fix any bugs but is the usual style inside Emacs and
18491 may generate better code on 32-bit machines.
18492
34206dd2
PE
18493 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18494 This is for reasons similar to the recent CHAR_STRING fix.
18495 * charset.c (Fencode_char): Check that character arg is actually
18496 a character. Pass an int to ENCODE_CHAR.
18497 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18498 wider than 'int', as a compile-time check to prevent future regressions
18499 in this area.
18500
c5958d4c 18501 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
18502
18503 Make sure a 64-bit char is never passed to CHAR_STRING.
18504 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18505 by silently ignoring the top 32 bits, allowing some values
18506 that were far too large to be valid characters.
18507 * character.h: Include <verify.h>.
18508 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18509 arguments are no wider than unsigned, as a compile-time check
18510 to prevent future regressions in this area.
18511 * data.c (Faset):
01103c44 18512 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
18513 (Fsubst_char_in_region):
18514 * fns.c (concat):
18515 * xdisp.c (decode_mode_spec_coding):
18516 Adjust to CHAR_STRING's new requirement.
18517 * editfns.c (Finsert_char, Fsubst_char_in_region):
18518 * fns.c (concat): Check that character args are actually
18519 characters. Without this test, these functions did the wrong
18520 thing with wildly out-of-range values on 64-bit hosts.
18521
d37ca623
PE
18522 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18523 These casts should not be needed on 32-bit hosts, either.
18524 * keyboard.c (read_char):
18525 * lread.c (Fload): Remove casts to unsigned.
18526
ea204efb
PE
18527 * lisp.h (UNSIGNED_CMP): New macro.
18528 This fixes comparison bugs on 64-bit hosts.
18529 (ASCII_CHAR_P): Use it.
18530 * casefiddle.c (casify_object):
01103c44 18531 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
18532 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18533 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18534 * dispextern.h (FACE_FROM_ID):
18535 * keyboard.c (read_char): Use UNSIGNED_CMP.
18536
41cb286c
PE
18537 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18538 not to EMACS_INT, to avoid GCC warning.
18539
4a1b9832
PE
18540 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18541
55daad71
PE
18542 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18543 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18544 isn't needed on 32-bit machines.
8f95c75c 18545
01103c44
PE
18546 * buffer.c (Fgenerate_new_buffer_name):
18547 Use EMACS_INT for count, not int.
0ceccced 18548 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
18549
18550 * data.c (Qcompiled_function): Now static.
18551
c6f072e7
PE
18552 * window.c (window_body_lines): Now static.
18553
20ce5912
PE
18554 * image.c (gif_load): Rename local to avoid shadowing.
18555
9c4c5f81
PE
18556 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18557 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18558 * alloc.c (make_save_value): Integer argument is now of type
18559 ptrdiff_t, not int.
18560 (mark_object): Use ptrdiff_t, not int.
18561 * lisp.h (pD): New macro.
18562 * print.c (print_object): Use it.
18563
c0c5c8ae
PE
18564 * alloc.c: Use EMACS_INT, not int, to count objects.
18565 (total_conses, total_markers, total_symbols, total_vector_size)
18566 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
18567 (total_free_floats, total_floats, total_free_intervals)
18568 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
18569 Now EMACS_INT, not int. All uses changed.
18570 (Fgarbage_collect): Compute overall total using a double, so that
18571 integer overflow is less likely to be a problem. Check for overflow
18572 when converting back to an integer.
5a25e253
PE
18573 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18574 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18575 These were 'int' variables that could overflow on 64-bit hosts;
18576 they were never used, so remove them instead of repairing them.
211a0b2a 18577 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
18578 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18579 Previously, this ceilinged at INT_MAX, but that doesn't work on
18580 64-bit machines.
e46bb31a 18581 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 18582
c78baabf 18583 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 18584 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
18585 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18586 when a (possibly-narrower) signed value would do just as well.
18587 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 18588
c9d624c6
PE
18589 * alloc.c: Catch some string size overflows that we were missing.
18590 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18591 for convenience in STRING_BYTES_MAX.
18592 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18593 The definition here is exact; the one in lisp.h was approximate.
18594 (allocate_string_data): Check for string overflow. This catches
18595 some instances we weren't catching before. Also, it catches
18596 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18597 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18598 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 18599
c9d624c6
PE
18600 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18601 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 18602 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 18603
353032ce
PE
18604 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18605
2bccce07
PE
18606 * alloc.c (Fmake_string): Check for out-of-range init.
18607
0ac30604
SM
186082011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18609
18610 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18611
c195f2de
JD
186122011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18613
18614 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18615 xg_get_default_scrollbar_width.
18616
18617 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18618 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18619 (style_changed_cb): Call update_theme_scrollbar_width and call
18620 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18621 all frames (Bug#8505).
18622 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18623 Call gtk_window_set_resizable if HAVE_GTK3.
18624 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18625 and height if HAVE_GTK3 (Bug#8505).
18626 (scroll_bar_width_for_theme): New variable.
18627 (update_theme_scrollbar_width): New function.
18628 (xg_get_default_scrollbar_width): Move code to
18629 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18630 (xg_initialize): Call update_theme_scrollbar_width.
18631
18632 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18633
18634 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18635
e10ac9f1
MR
186362011-06-12 Martin Rudalics <rudalics@gmx.at>
18637
18638 * frame.c (make_frame): Call other_buffer_safely instead of
18639 other_buffer.
18640
18641 * window.c (temp_output_buffer_show): Call display_buffer with
18642 second argument Vtemp_buffer_show_specifiers and reset latter
18643 immediately after the call.
18644 (Vtemp_buffer_show_specifiers): New variable.
18645 (auto_window_vscroll_p, next_screen_context_lines)
18646 (Vscroll_preserve_screen_position): Remove leading asterisks from
18647 doc-strings.
18648
2d3c217e 186492011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 18650
7b7f97e8 18651 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
18652 * buffer.c (Qclone_number): Remove for now, as it's unused.
18653 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18654 (record_buffer): Remove unused local.
18655 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18656 (set_frame_buffer_list): Remove; unused.
18657 * frame.h (other_visible_frames): Remove decl.
18658 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18659 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18660 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18661 if HAVE_GPM.
18662 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18663 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18664 Define only if HAVE_GPM.
18665 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18666 (update_hints_inhibit): Remove; never set. All uses removed.
18667 * widgetprv.h (emacsFrameClassRec): Remove decl.
18668 * window.c (delete_deletable_window): Now returns void, since it
18669 wasn't returning anything.
18670 (compare_window_configurations): Remove unused locals.
18671 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18672 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18673 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18674 the same widths as pointers. This follows up on the 2011-05-06 patch.
18675 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18676 * xterm.h: Likewise.
18677 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18678
1384b89e
JB
186792011-06-12 Juanma Barranquero <lekktu@gmail.com>
18680
18681 * makefile.w32-in: Update dependencies.
18682 (LISP_H): Add lib/intprops.h.
18683
1100a63c
CY
186842011-06-11 Chong Yidong <cyd@stupidchicken.com>
18685
18686 * image.c (gif_load): Add animation frame delay to the metadata.
18687 (syms_of_image): Use DEFSYM. New symbol `delay'.
18688
6198ccd0
MR
186892011-06-11 Martin Rudalics <rudalics@gmx.at>
18690
18691 * window.c (delete_deletable_window): Re-add.
18692 (Fset_window_configuration): Rewrite to handle dead buffers and
18693 consequently deletable windows.
18694 (window_tree, Fwindow_tree): Remove. Supply functionality in
18695 window.el.
18696 (compare_window_configurations): Simplify code.
18697
b6e3633c
AS
186982011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18699
1ab0dee5
AS
18700 * image.c (imagemagick_load_image): Fix type mismatch.
18701 (Fimagemagick_types): Likewise.
18702
b6e3633c
AS
18703 * window.h (replace_buffer_in_windows): Declare.
18704
9397e56f
MR
187052011-06-11 Martin Rudalics <rudalics@gmx.at>
18706
18707 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18708 Qclone_number. Remove external declaration of Qdelete_window.
18709 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18710 code.
640c8776
SM
18711 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18712 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18713 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18714 buffer list implementation.
18715 (other_buffer_safely): New function.
18716 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18717 calls to replace_buffer_in_windows and
18718 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18719 if allowed.
18720 (record_buffer): Inhibit quitting and rewrite using quittable
18721 functions. Run Qbuffer_list_update_hook if allowed.
18722 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18723 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18724 Move switch-to-buffer to window.el.
9397e56f
MR
18725 (bury-buffer): Move to window.el.
18726 (Vbuffer_list_update_hook): New variable.
18727
18728 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18729 section.
18730
18731 * window.h (resize_frame_windows): Move up in code.
18732 (Fwindow_frame): Remove EXFUN.
18733 (replace_buffer_in_all_windows): Remove prototype.
18734 (replace_buffer_in_windows_safely): Add prototype.
18735
18736 * window.c: Declare Qdelete_window static again. Move down
18737 declaration of select_count.
18738 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18739 (Fother_window): Move to window.el.
18740 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18741 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18742 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18743 window.el.
18744 (replace_buffer_in_windows): Implement by calling
18745 Qreplace_buffer_in_windows.
18746 (replace_buffer_in_all_windows): Remove with some functionality
18747 moved into replace_buffer_in_windows_safely.
18748 (replace_buffer_in_windows_safely): New function.
18749 (select_window_norecord, select_frame_norecord): Move in front
18750 of run_window_configuration_change_hook. Remove now obsolete
18751 declarations.
640c8776
SM
18752 (Fset_window_buffer): Rewrite doc-string.
18753 Call Qrecord_window_buffer.
9397e56f
MR
18754 (keys_of_window): Move binding for other-window to window.el.
18755
b50691aa
CY
187562011-06-11 Chong Yidong <cyd@stupidchicken.com>
18757
18758 * dispextern.h (struct image): Replace data member, whose int_val
18759 and ptr_val fields were not used by anything, with a single
18760 lisp_val object.
18761
18762 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18763 (gif_clear_image, gif_load, imagemagick_load_image)
18764 (gs_clear_image, gs_load): Callers changed.
18765
3f754b86
PE
187662011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18767
cca69397
PE
18768 * buffer.h: Include <time.h>, for time_t.
18769 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18770
109e28d0
PE
18771 Fix minor problems found by static checking.
18772
60737f02
PE
18773 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18774
4b66faf3
PE
18775 Make identifiers static if they are not used in other modules.
18776 * data.c (Qcompiled_function, Qframe, Qvector):
18777 * image.c (QimageMagick, Qsvg):
18778 * minibuf.c (Qmetadata):
18779 * window.c (resize_window_check, resize_root_window): Now static.
18780 * window.h (resize_window_check, resize_root_window): Remove decls.
18781
109e28d0
PE
18782 * window.c (window_deletion_count, delete_deletable_window):
18783 Remove; unused.
46a4ce9e
PE
18784 (window_body_lines): Now static.
18785 (Fdelete_other_windows_internal): Mark vars as initialized.
18786 Make sure 'resize_failed' is initialized.
18787 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18788 (resize_window_apply): Remove unused local.
18789 * window.h (delete_deletable_window): Remove decl.
18790
109e28d0 18791 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
18792 (imagemagick_load_image): Fix pointer signedness problem by changing
18793 last arg from unsigned char * to char *. All uses changed.
18794 Also, fix a local for similar reasons.
18795 Remove unused locals. Remove locals to avoid shadowing.
18796 (fn_rsvg_handle_free): Remove; unused.
18797 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 18798 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 18799
3f754b86
PE
18800 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18801
2547adb1
CY
188022011-06-10 Chong Yidong <cyd@stupidchicken.com>
18803
18804 * image.c (gif_load): Fix omitted cast error introduced by
18805 2011-06-06 change.
18806
2c8e37d4
MR
188072011-06-10 Martin Rudalics <rudalics@gmx.at>
18808
18809 * window.h (resize_proportionally, orig_total_lines)
18810 (orig_top_line): Remove from window structure.
18811 (set_window_height, set_window_width, change_window_heights)
18812 (Fdelete_window): Remove prototypes.
18813 (resize_frame_windows): Remove duplicate declaration.
18814
440a42e3
EZ
188152011-06-10 Eli Zaretskii <eliz@gnu.org>
18816
18817 * window.h (resize_frame_windows, resize_window_check)
18818 (delete_deletable_window, resize_root_window)
18819 (resize_frame_windows): Declare prototypes.
18820
18821 * window.c (resize_window_apply): Make definition be "static" to
18822 match the prototype.
18823
562dd5e9
MR
188242011-06-10 Martin Rudalics <rudalics@gmx.at>
18825
18826 * window.c: Remove declarations of Qwindow_size_fixed,
18827 window_min_size_1, window_min_size_2, window_min_size,
18828 size_window, window_fixed_size_p, enlarge_window, delete_window.
18829 Remove static from declaration of Qdelete_window, it's
18830 temporarily needed by Fbury_buffer.
18831 (replace_window): Don't assign orig_top_line and
18832 orig_total_lines.
18833 (Fdelete_window, delete_window): Remove. Window deletion is
18834 handled by window.el.
640c8776
SM
18835 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18836 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
18837 (Fdelete_other_windows): Remove. Deleting other windows is
18838 handled by window.el.
18839 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18840 handled in window.el.
18841 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18842 Window minimum sizes are handled in window.el.
18843 (shrink_windows, size_window, set_window_height)
18844 (set_window_width, change_window_heights, window_height)
18845 (window_width, CURBEG, CURSIZE, enlarge_window)
18846 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18847 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18848 handled in window.el.
18849 (make_dummy_parent): Rename to make_parent_window and give it a
18850 second argument horflag.
18851 (make_window): Don't set resize_proportionally any more.
18852 (Fsplit_window): Remove. Windows are split in window.el.
18853 (save_restore_action, save_restore_orig_size)
18854 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18855 Resize mini windows in window.el.
18856 (grow_mini_window, shrink_mini_window): Implement by calling
18857 Qresize_root_window_vertically, resize_window_check and
18858 resize_window_apply.
640c8776
SM
18859 (saved_window, Fset_window_configuration, save_window_save):
18860 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
18861 resize_proportionally.
18862 (window_min_height, window_min_width): Move to window.el.
18863 (keys_of_window): Move bindings for delete-other-windows,
18864 split-window, delete-window and enlarge-window to window.el.
18865
18866 * buffer.c: Temporarily extern Qdelete_window.
18867 (Fbury_buffer): Temporarily call Qdelete_window instead of
18868 Fdelete_window (Fbury_buffer will move to window.el soon).
18869
18870 * frame.c (set_menu_bar_lines_1): Remove code handling
18871 orig_top_line and orig_total_lines.
18872
18873 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18874 set_window_height but set heights directly.
18875 (change_frame_size_1): Use resize_frame_windows.
18876
18877 * xdisp.c (init_xdisp): Don't use set_window_height but set
18878 heights directly.
18879
640c8776
SM
18880 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18881 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
18882 run_window_configuration_change_hook.
18883
18884 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18885 instead of change_window_heights and run
18886 run_window_configuration_change_hook.
18887
1a13852e
MR
188882011-06-09 Martin Rudalics <rudalics@gmx.at>
18889
18890 * window.c (replace_window): Rename second argument REPLACEMENT to
18891 NEW. New third argument SETFLAG. Rewrite.
18892 (delete_window, make_dummy_parent): Call replace_window with
18893 third argument 1.
18894 (window_list_1): Move down in code.
18895 (run_window_configuration_change_hook): Move set_buffer part
18896 before select_frame_norecord part in order to unwind correctly.
18897 Rename count1 to count.
18898 (recombine_windows, delete_deletable_window, resize_root_window)
18899 (Fdelete_other_windows_internal)
18900 (Frun_window_configuration_change_hook, make_parent_window)
18901 (resize_window_check, resize_window_apply, Fresize_window_apply)
18902 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
18903 (Fdelete_window_internal, Fresize_mini_window_internal):
18904 New functions.
1a13852e
MR
18905 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18906
f3d1777e
MR
189072011-06-08 Martin Rudalics <rudalics@gmx.at>
18908
496e208e
MR
18909 * window.h (window): Add some new members to window structure -
18910 normal_lines, normal_cols, new_total, new_normal, clone_number,
18911 splits, nest, prev_buffers, next_buffers.
18912 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 18913 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 18914
f3d1777e
MR
18915 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18916 Remove.
496e208e
MR
18917 (make_dummy_parent): Set new members of windows structure.
18918 (make_window): Move down in code. Handle new members of window
18919 structure.
18920 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18921 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18922 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18923 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
18924 (Fset_window_next_buffers, Fset_window_clone_number):
18925 New functions.
496e208e
MR
18926 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18927 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18928 Doc-string fixes.
18929 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18930 Argument WINDOW can be now internal window too.
18931 (Fwindow_use_time): Move up in code.
18932 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18933 Rewrite doc-string.
18934 (Fset_window_configuration, saved_window)
18935 (Fcurrent_window_configuration, save_window_save): Handle new
18936 members of window structure.
b9e809c2
MR
18937 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18938 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18939 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18940 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18941 Qget_mru_window, Qresize_root_window,
18942 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18943 Qauto_buffer_name; staticpro them.
f3d1777e 18944
abde8f8c
MR
189452011-06-07 Martin Rudalics <rudalics@gmx.at>
18946
18947 * window.c (Fwindow_total_size, Fwindow_left_column)
18948 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
18949 (Fwindow_list_1): New functions.
18950 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
18951 (Fwindow_width, Fscroll_left, Fscroll_right):
18952 Use window_body_cols instead of window_box_text_cols.
18953 (delete_window, Fset_window_configuration):
18954 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
18955 (delete_all_subwindows): Take a window as argument and not a
18956 structure. Rewrite.
190b47e6
MR
18957 (window_loop): Remove handling of GET_LRU_WINDOW and
18958 GET_LARGEST_WINDOW.
18959 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
18960
18961 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
18962 window_box_text_cols. delete_all_subwindows now takes a
18963 Lisp_Object as argument.
abde8f8c 18964
640c8776
SM
18965 * indent.c (compute_motion, Fcompute_motion):
18966 Use window_body_cols instead of window_box_text_cols.
abde8f8c 18967
fa8a67e6
MR
18968 * frame.c (delete_frame): Call delete_all_subwindows with root
18969 window as argument.
18970
a54e3482
DC
189712011-06-07 Daniel Colascione <dan.colascione@gmail.com>
18972
18973 * fns.c (Fputhash): Document return value.
18974
60002bf5
CY
189752011-06-06 Chong Yidong <cyd@stupidchicken.com>
18976
18977 * image.c (gif_load): Implement gif89a spec "no disposal" method.
18978
0c671da6 189792011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 18980
b862a52a 18981 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 18982
be44ca6c
PE
18983 Check for overflow when converting integer to cons and back.
18984 * charset.c (Fdefine_charset_internal, Fdecode_char):
18985 Use cons_to_unsigned to catch overflow.
18986 (Fencode_char): Use INTEGER_TO_CONS.
18987 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
18988 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
18989 * data.c (long_to_cons, cons_to_long): Remove.
18990 (cons_to_unsigned, cons_to_signed): New functions.
18991 These signal an error for invalid or out-of-range values.
18992 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
18993 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
18994 * font.c (Ffont_variation_glyphs):
18995 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
18996 * lisp.h: Include <intprops.h>.
18997 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
18998 (cons_to_signed, cons_to_unsigned): New decls.
18999 (long_to_cons, cons_to_long): Remove decls.
19000 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19001 (Fprimitive_undo): Use CONS_TO_INTEGER.
19002 * xfns.c (Fx_window_property): Likewise.
19003 * xselect.c: Include <limits.h>.
19004 (x_own_selection, selection_data_to_lisp_data):
19005 Use INTEGER_TO_CONS.
19006 (x_handle_selection_request, x_handle_selection_clear)
19007 (x_get_foreign_selection, Fx_disown_selection_internal)
19008 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19009 (lisp_data_to_selection_data): Use cons_to_unsigned.
19010 (x_fill_property_data): Use cons_to_signed.
19011 Report values out of range.
19012
d1f3d2af
PE
19013 Check for buffer and string overflow more precisely.
19014 * buffer.h (BUF_BYTES_MAX): New macro.
19015 * lisp.h (STRING_BYTES_MAX): New macro.
19016 * alloc.c (Fmake_string):
19017 * character.c (string_escape_byte8):
19018 * coding.c (coding_alloc_by_realloc):
19019 * doprnt.c (doprnt):
19020 * editfns.c (Fformat):
19021 * eval.c (verror):
19022 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19023 since they may not be the same number.
19024 * editfns.c (Finsert_char):
19025 * fileio.c (Finsert_file_contents):
19026 Likewise for BUF_BYTES_MAX.
19027
dd52fcea
PE
19028 * image.c: Use ptrdiff_t, not int, for sizes.
19029 (slurp_file): Switch from int to ptrdiff_t.
19030 All uses changed.
19031 (slurp_file): Check that file size fits in both size_t (for
19032 malloc) and ptrdiff_t (for sanity and safety).
19033
7f9bbdbb
PE
19034 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19035 if b->modtime has its maximal value.
19036
dfe18f82
PE
19037 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19038
84acfcf0
PE
19039 Don't assume time_t can fit into int.
19040 * buffer.h (struct buffer.modtime): Now time_t, not int.
19041 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19042 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19043
ccd9a01a
PE
19044 Minor fixes for signed vs unsigned integers.
19045 * character.h (MAYBE_UNIFY_CHAR):
19046 * charset.c (maybe_unify_char):
19047 * keyboard.c (read_char, reorder_modifiers):
19048 XINT -> XFASTINT, since the integer must be nonnegative.
19049 * ftfont.c (ftfont_spec_pattern):
19050 * keymap.c (access_keymap, silly_event_symbol_error):
19051 XUINT -> XFASTINT, since the integer must be nonnegative.
19052 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19053 since it makes no difference and we prefer signed.
19054 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19055 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19056 nonnegative.
19057
d6d100dd
SM
190582011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19059
19060 * window.h (Fwindow_frame): Declare.
19061
2b6148e4
PE
190622011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19063
19064 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19065 (SPARE_MEMORY): Always define.
19066 (LARGE_REQUEST): Remove.
19067 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19068
f230ecc9
MR
190692011-06-06 Martin Rudalics <rudalics@gmx.at>
19070
727e958e
MR
19071 * lisp.h: Move EXFUNS for Fframe_root_window,
19072 Fframe_first_window and Fset_frame_selected_window to window.h.
19073
19074 * window.h: Move EXFUNS for Fframe_root_window,
19075 Fframe_first_window and Fset_frame_selected_window here from
19076 lisp.h.
19077
19078 * frame.c (Fwindow_frame, Fframe_first_window)
19079 (Fframe_root_window, Fframe_selected_window)
19080 (Fset_frame_selected_window): Move to window.c.
19081 (Factive_minibuffer_window): Move to minibuf.c.
19082 (Fother_visible_frames_p): New function.
19083
19084 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19085
f230ecc9
MR
19086 * window.c (decode_window, decode_any_window): Move up in code.
19087 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19088 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
19089 (Fwindow_buffer): Move up and rewrite doc-string.
19090 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19091 (Fwindow_prev): New functions.
727e958e
MR
19092 (Fwindow_frame): Move here from frame.c. Accept any window as
19093 argument.
19094 (Fframe_root_window, Fframe_first_window)
19095 (Fframe_selected_window): Move here from frame.c. Accept frame
19096 or arbitrary window as argument. Update doc-strings.
19097 (Fminibuffer_window): Move up in code.
19098 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
19099 (Fset_frame_selected_window): Move here from frame.c.
19100 Marginal rewrite.
727e958e
MR
19101 (Fselected_window, select_window, Fselect_window): Move up in
19102 code. Minor doc-string fixes.
f230ecc9 19103
4d09bcf6
PE
191042011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19105
19106 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19107 Do not assume that spare memory exists; that assumption is valid
19108 only if SYSTEM_MALLOC.
19109 (LARGE_REQUEST): New macro, so that the issue of large requests
19110 is separated from the issue of spare memory.
19111
810928a2
AS
191122011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19113
172418ad
AS
19114 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19115 format. (Bug#8806)
19116
43f862f7
AS
19117 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19118
810928a2
AS
19119 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19120 before statements.
19121
a059fe24
JD
191222011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19123
19124 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19125
19126 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19127
19128 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19129 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19130
989bf368
JB
191312011-06-05 Juanma Barranquero <lekktu@gmail.com>
19132
19133 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19134
4b80f674
CY
191352011-06-04 Chong Yidong <cyd@stupidchicken.com>
19136
19137 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19138 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
19139 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19140 New error handlers.
4b80f674
CY
19141 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19142 Obey Vx_select_enable_clipboard_manager. Catch errors in
19143 x_clipboard_manager_save (Bug#8779).
19144 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 19145 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 19146
99a33b77 191472011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
19148
19149 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19150
99a33b77 191512011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
19152
19153 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19154 in the current matrix if keep_current_p is non-zero.
19155
8264569d
EZ
191562011-06-04 Eli Zaretskii <eliz@gnu.org>
19157
19158 * bidi.c (bidi_level_of_next_char): Fix last change.
19159
57f97249
EZ
191602011-06-03 Eli Zaretskii <eliz@gnu.org>
19161
fec2107c 19162 Support bidi reordering of text covered by display properties.
57f97249 19163
fec2107c
EZ
19164 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19165 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19166 (bidi_cache_search, bidi_cache_iterator_state)
19167 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
19168 (bidi_level_of_next_char, bidi_move_to_visually_next):
19169 Support character positions inside a run of characters covered by a
fec2107c
EZ
19170 display string.
19171 (bidi_paragraph_init, bidi_resolve_explicit_1)
19172 (bidi_level_of_next_char): Call bidi_fetch_char and
19173 bidi_fetch_char_advance instead of FETCH_CHAR and
19174 FETCH_CHAR_ADVANCE.
19175 (bidi_init_it): Initialize new members.
19176 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19177 definitions.
19178 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19179 instead of using explicit *_CHAR codes.
d6d100dd
SM
19180 (bidi_resolve_explicit, bidi_resolve_weak):
19181 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
19182 bidirectional text is supported only in multibyte buffers.
19183 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19184 it to initialize the frame_window_p member of struct bidi_it.
19185 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19186 (bidi_resolve_explicit, bidi_resolve_weak)
19187 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19188 bidi_it->nchars is non-positive.
19189 (bidi_level_of_next_char): Don't try to lookup the cache for the
19190 next/previous character if nothing is cached there yet, or if we
19191 were just reseat()'ed to a new position.
c40e2fb2 19192
0e14fe90
EZ
19193 * xdisp.c (set_cursor_from_row): Set start and stop points
19194 according to the row's direction when priming the loop that looks
19195 for the glyph on which to display cursor.
19196 (single_display_spec_intangible_p): Function deleted.
19197 (display_prop_intangible_p): Reimplement to call
19198 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
19199 Accept 3 additional arguments needed by handle_display_spec.
19200 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
19201 values: lists, `(when COND...)' forms, etc.
19202 (single_display_spec_string_p): Support property values that are
19203 lists with the argument STRING its top-level element.
19204 (display_prop_string_p): Fix the condition for processing a
19205 property that is a list to be consistent with handle_display_spec.
fec2107c 19206 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
19207 last portion of handle_display_prop.
19208 (compute_display_string_pos): Accept additional argument
19209 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19210 value of a `display' property is a "replacing spec".
19211 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19212 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19213 the display property, but just return a value indicating whether
19214 the display property will replace the characters it covers.
19215 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19216 frame_window_p members of struct bidi_it.
d6d100dd
SM
19217 (compute_display_string_pos, compute_display_string_end):
19218 New functions.
fec2107c
EZ
19219 (push_it): Accept second argument POSITION, where pop_it should
19220 jump to continue iteration.
19221 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 19222
fec2107c
EZ
19223 * keyboard.c (adjust_point_for_property): Adjust the call to
19224 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
19225
19226 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
19227 (bidi_init_it): Update prototypes.
19228 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
19229 (compute_display_string_pos, compute_display_string_end):
19230 Declare prototypes.
fec2107c
EZ
19231 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19232 EMACS_INT.
fc6f18ce 19233
40087514 192342011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 19235
57f53182
PE
19236 Malloc failure behavior now depends on size of allocation.
19237 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19238 * lisp.h: Change signatures accordingly.
19239 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19240 All callers changed. (Bug#8762)
19241
19242 * gnutls.c: Use Emacs's memory allocators.
19243 Without this change, the gnutls library would invoke malloc etc.
19244 directly, which causes problems on non-SYNC_INPUT hosts, and which
19245 runs afoul of improving memory_full behavior. (Bug#8761)
19246 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19247 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19248 xfree instead of the default malloc, realloc, free.
19249 (Fgnutls_boot): No need to check for memory allocation failure,
19250 since xmalloc does that for us.
19251
ac32cd99 19252 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
19253 * category.c (hash_get_category_set):
19254 * ccl.c (ccl_driver):
19255 * charset.c (Fdefine_charset_internal):
19256 * charset.h (struct charset.hash_index):
19257 * composite.c (get_composition_id, gstring_lookup_cache)
19258 (composition_gstring_put_cache):
19259 * composite.h (struct composition.hash_index):
19260 * dispextern.h (struct image.hash):
19261 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19262 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19263 (hashfn_equal, hashfn_user_defined, make_hash_table)
19264 (maybe_resize_hash_table, hash_lookup, hash_put)
19265 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19266 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19267 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19268 * image.c (make_image, search_image_cache, lookup_image)
19269 (xpm_put_color_table_h):
19270 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 19271 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 19272 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 19273 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
19274 * alloc.c (allocate_vectorlike):
19275 Check for overflow in vector size calculations.
19276 * ccl.c (ccl_driver):
19277 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
19278 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19279 need to be updated by these changes.
40087514
PE
19280 * fns.c (make_hash_table, maybe_resize_hash_table):
19281 Check for integer overflow with large hash tables.
0de4bb68
PE
19282 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19283 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19284 (SXHASH_REDUCE): New macro.
19285 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19286 Use it instead of discarding useful hash info with large hash values.
19287 (sxhash_float): New function.
19288 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19289 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
19290 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19291 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
19292 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19293 Adjust signatures to match updated version of code.
19294 (consing_since_gc): Now EMACS_INT, since a single hash table can
19295 use more than INT_MAX bytes.
19296
698d32e2
DN
192972011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19298
19299 Make it possible to build with GCC-4.6+ -O2 -flto.
19300
19301 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19302
fd6fa53f
SM
193032011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19304
19305 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19306 Call minibuffer-inactive-mode.
19307
864db017
JB
193082011-05-31 Juanma Barranquero <lekktu@gmail.com>
19309
19310 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19311 Update dependencies.
19312
2ad0baf4
DN
193132011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19314
19315 * data.c (init_data): Remove code for UTS, this system is not
19316 supported anymore.
19317
4fcc2638
DN
193182011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19319
19320 Don't force ./temacs to start in terminal mode.
19321
19322 * frame.c (make_initial_frame): Initialize faces in all cases, not
19323 only when CANNOT_DUMP is defined.
19324 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19325
c56e0fd5
DN
193262011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19327
19328 * dispnew.c (add_window_display_history): Use const for the string
19329 pointer. Remove declaration, not needed.
19330
333d54da 193312011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19332
55d4c1b2 19333 Use 'inline', not 'INLINE'.
333d54da 19334 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19335 * alloc.c, fontset.c (INLINE): Remove.
19336 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19337 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19338 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19339 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19340 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19341
738db178
DN
193422011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19343
19344 Make it possible to run ./temacs.
19345
19346 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19347 syms_of_callproc does the same thing. Remove test for
19348 "initialized", do it in the caller.
19349 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19350
620c53a6
SM
193512011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19352
19353 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19354 (read_minibuf): Use get_minibuffer.
19355 (syms_of_minibuf): Use DEFSYM.
19356 (Qmetadata): New var.
19357 * data.c (Qbuffer): Don't make it static.
19358 (syms_of_data): Use DEFSYM.
19359
e003a292
PE
193602011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19361
19362 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19363 (CCL_CODE_MIN): New macro.
19364
ed008a6d
PE
193652011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19366
3687c2ef
PE
19367 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19368
ed008a6d
PE
19369 * eval.c (Qdebug): Now static.
19370 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19371 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19372 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19373
d66c4c7c
CY
193742011-05-29 Chong Yidong <cyd@stupidchicken.com>
19375
19376 * image.c: Various fixes to ImageMagick code comments.
19377 (Fimagemagick_types): Doc fix.
19378
5fbc2025
PE
193792011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19380
0196f88a
PE
19381 Minor fixes prompted by GCC 4.6.0 warnings.
19382
19383 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19384
5fbc2025
PE
19385 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19386 (x_clipboard_manager_save_all): Move extern decl to ...
19387 * xterm.h: ... here, so that it can be checked for consistency.
19388
1dd3c2d9
CY
193892011-05-29 Chong Yidong <cyd@stupidchicken.com>
19390
19391 * xselect.c (x_clipboard_manager_save_frame)
19392 (x_clipboard_manager_save_all): New functions.
19393 (Fx_clipboard_manager_save): Lisp function deleted.
19394
19395 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19396 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19397
19398 * xterm.h: Update prototype.
19399
5ba6571d
WX
194002011-05-28 William Xu <william.xwl@gmail.com>
19401
19402 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19403 exiting (Bug#8239).
19404
3eaff834
JM
194052011-05-28 Jim Meyering <meyering@redhat.com>
19406
e1900994 19407 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
19408 * fns.c (to_uchar): Define.
19409 (crypto_hash_function): Use it to convert some newly-signed
19410 variables to unsigned, to avoid sign-extension bugs. For example,
19411 without this change, (md5 "truc") would evaluate to
19412 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19413 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 19414 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 19415
0f6990a7
PE
194162011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19417
19418 Integer overflow fixes.
c8a9ca5a 19419
08686060
PE
19420 * dbusbind.c: Serial number integer overflow fixes.
19421 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
19422 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19423 to hold a serial number that is too large for a fixnum.
19424 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19425 Check for serial numbers out of range. Decode any serial number
59568bf0 19426 that was so large that it became a float. (Bug#8722)
08686060 19427
2d1fc3c7
PE
19428 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19429 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19430 Use XFASTINT rather than XUINT when numbers are nonnegative.
19431 (xd_append_arg, Fdbus_method_return_internal):
19432 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19433 arguments, check that Lisp number is nonnegative, rather than
59568bf0 19434 silently wrapping negative numbers around. (Bug#8722)
30217ff0 19435 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 19436 (Bug#8722)
2d1fc3c7 19437
c8a9ca5a
PE
19438 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19439
519e1d69
PE
19440 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19441
6df6ae42 19442 ccl: Add integer overflow checks.
30569699
PE
19443 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19444 (IN_INT_RANGE): New macros.
19445 (ccl_driver): Use them to check for integer overflow when
19446 decoding a CCL program. Many of the new checks are whether XINT (x)
19447 fits in int; it doesn't always, on 64-bit hosts. The new version
19448 doesn't catch all possible integer overflows, but it's an
847044ea 19449 improvement. (Bug#8719)
30569699 19450
c11285dc
PE
19451 * alloc.c (make_event_array): Use XINT, not XUINT.
19452 There's no need for unsigned here.
19453
fdccd48e
PE
19454 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19455 This follows up to the 2011-05-06 change that substituted uintptr_t
19456 for EMACS_INT. This case wasn't caught back then.
19457
37910ab2
PE
19458 Rework Fformat to avoid integer overflow issues.
19459 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19460 now (part of C89). Include <verify.h>.
19461 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19462 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19463 (Fformat): Avoid the prepass trying to compute sizes; it was only
19464 approximate and thus did not catch overflow reliably. Instead, walk
19465 through the format just once, formatting and computing sizes as we go,
19466 checking for integer overflow at every step, and allocating a larger
19467 buffer as needed. Keep track separately whether the format is
19468 multibyte. Keep only the most-recently calculated precision, rather
19469 than them all. Record whether each argument has been converted to
19470 string. Use EMACS_INT, not int, for byte and char and arg counts.
19471 Support field widths and precisions larger than INT_MAX. Avoid
19472 sprintf's undefined behavior with conversion specifications such as %#d
19473 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19474 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19475 formatting out-of-range floating point numbers with int
9173deec 19476 formats. (Bug#8668)
37910ab2 19477
2e6578fb
PE
19478 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19479
0ae6bdee
PE
19480 * data.c: Avoid integer truncation in expressions involving floats.
19481 * data.c: Include <intprops.h>.
19482 (arith_driver): When there's an integer overflow in an expression
19483 involving floating point, convert the integers to floating point
19484 so that the resulting value does not suffer from catastrophic
19485 integer truncation. For example, on a 64-bit host (* 4
19486 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19487 Do not rely on undefined behavior after integer overflow.
19488
de883a70
PE
19489 merge count_size_as_multibyte, parse_str_to_multibyte
19490 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 19491 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
19492 Check for integer overflow.
19493 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19494 since it's now a duplicate of the other. This is more of
19495 a character than a buffer op, so better that it's in character.c.
19496 * fns.c, print.c: Adjust to above changes.
19497
2ff916cb
PE
194982011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19499
19500 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19501
f1b54466
PE
195022011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19503
fb1ac845
PE
19504 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19505 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19506 (x_clipboard_manager_save): Now static.
19507 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19508
f1b54466
PE
19509 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19510 (crypto_hash_function): Now static.
19511 Fix pointer signedness problems. Avoid unnecessary initializations.
19512
a9f737ee
CY
195132011-05-27 Chong Yidong <cyd@stupidchicken.com>
19514
19515 * termhooks.h (Vselection_alist): Make it terminal-local.
19516
19517 * terminal.c (create_terminal): Initialize it.
19518
19519 * xselect.c: Support for clipboard managers.
19520 (Vselection_alist): Move to termhooks.h as terminal-local var.
19521 (LOCAL_SELECTION): New macro.
19522 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19523 (symbol_to_x_atom): Remove gratuitous arg.
19524 (x_handle_selection_request, lisp_data_to_selection_data)
19525 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
19526 (x_own_selection, x_get_local_selection, x_convert_selection):
19527 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
19528 (some_frame_on_display): Delete unused function.
19529 (Fx_own_selection_internal, Fx_get_selection_internal)
19530 (Fx_disown_selection_internal, Fx_selection_owner_p)
19531 (Fx_selection_exists_p): New optional frame arg.
19532 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19533 (x_handle_selection_clear): Don't treat other terminals with the
19534 same keyboard specially. Use the terminal-local Vselection_alist.
19535 (x_clear_frame_selections): Use Frun_hook_with_args.
19536
19537 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19538
19539 * xterm.h: Add support for those atoms.
19540
e067f0c1
CY
195412011-05-26 Chong Yidong <cyd@stupidchicken.com>
19542
19543 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19544 (converted_selections, conversion_fail_tag): New global variables.
19545 (x_selection_request_lisp_error): Free the above.
19546 (x_get_local_selection): Remove unnecessary code.
19547 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
19548 of converted selections stored in converted_selections.
19549 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
19550 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19551 (x_convert_selection): New function.
19552 (x_handle_selection_event): Simplify.
19553 (x_get_foreign_selection): Don't ignore incoming requests while
19554 waiting for an answer; this will fail when we implement
19555 SAVE_TARGETS, and seems unnecessary anyway.
19556 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19557 (Vx_sent_selection_functions): Doc fix.
19558
0f4aebc0
LL
195592011-05-26 Leo Liu <sdl.web@gmail.com>
19560
19561 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19562
e61124cd
YM
195632011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19564
19565 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19566
19567 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19568 for fringe update if it has periodic bitmap.
ac389d0c 19569 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
19570 and fringe_bitmap_periodic_p.
19571
19572 * fringe.c (get_fringe_bitmap_data): New function.
19573 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19574 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19575 row. Mark glyph row for fringe update if periodicity changed.
19576
19577 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19578 for fringe update unless it has periodic bitmap.
19579
f16d9837
KH
195802011-05-25 Kenichi Handa <handa@m17n.org>
19581
19582 * xdisp.c (get_next_display_element): Set correct it->face_id for
19583 a static composition.
19584
e1b90ef6
LL
195852011-05-24 Leo Liu <sdl.web@gmail.com>
19586
19587 * deps.mk (fns.o):
19588 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19589
19590 * fns.c (crypto_hash_function, Fsha1): New function.
19591 (Fmd5): Use crypto_hash_function.
19592 (syms_of_fns): Add Ssha1.
19593
7400048f
PE
195942011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19595
19596 * gnutls.c: Remove unused macros.
19597 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19598 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19599 Remove macros that are defined and never used.
19600 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19601
abb71cf4
CY
196022011-05-22 Chong Yidong <cyd@stupidchicken.com>
19603
19604 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19605 (Fx_get_selection_internal): Minor cleanup.
19606 (Fx_own_selection_internal): Rename arguments for consistency with
19607 select.el.
19608
6307db39
PE
196092011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19610
19611 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19612
f3d4e0a4
CY
196132011-05-22 Chong Yidong <cyd@stupidchicken.com>
19614
19615 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19616
4d8ade89
YM
196172011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19618
19619 * dispnew.c (scrolling_window): Don't exclude the case that the
19620 last enabled row in the desired matrix touches the bottom boundary.
19621
32078c8d
GM
196222011-05-21 Glenn Morris <rgm@gnu.org>
19623
19624 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
19625 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19626 and add some more files.
32078c8d 19627
7285dc67
EZ
196282011-05-20 Eli Zaretskii <eliz@gnu.org>
19629
19630 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19631 report_file_error introduced by the change from 2011-05-07.
19632
89d1bd22
PE
196332011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19634
19635 * systime.h (Time): Define only if emacs is defined.
19636 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19637 where the include path doesn't have X11/X.h by default. See
19638 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19639
cd394be1 196402011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
19641
19642 * composite.c (find_automatic_composition): Fix previous change.
19643
b9704ad9
GM
196442011-05-20 Glenn Morris <rgm@gnu.org>
19645
19646 * lisp.mk: New file, split from Makefile.in.
19647 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19648 (shortlisp): Remove.
19649 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19650
4a720484
GM
196512011-05-19 Glenn Morris <rgm@gnu.org>
19652
19653 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19654 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19655 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19656 (lisp): Set the order to that of loadup.el.
19657 (shortlisp): Make it a copy of $lisp.
19658 (SOME_MACHINE_LISP): Remove.
19659 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19660 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19661
a28d4396
KH
196622011-05-18 Kenichi Handa <handa@m17n.org>
19663
19664 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19665 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19666 (find_automatic_composition): Mostly rewrite for efficiency.
19667
a2b1fa8e
JB
196682011-05-18 Juanma Barranquero <lekktu@gmail.com>
19669
19670 * makefile.w32-in: Update dependencies.
19671
8e1f5610
CS
196722011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19673
19674 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19675 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19676
7025ee00 196772011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19678
cdfa6eab
PE
19679 Fix some integer overflow issues, such as string length overflow.
19680
06d6db33
PE
19681 * insdel.c (count_size_as_multibyte): Check for string overflow.
19682
2b4560a8
PE
19683 * character.c (lisp_string_width): Check for string overflow.
19684 Use EMACS_INT, not int, for string indexes and lengths; in
19685 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19686 the resulting string length overflows an EMACS_INT; instead,
19687 report a string overflow if no precision given. When checking for
19688 precision exhaustion, use a check that cannot possibly have
19689 integer overflow. (Bug#8675)
19690 * character.h (lisp_string_width): Adjust to new signature.
19691
cb93f9be
PE
19692 * alloc.c (string_overflow): New function.
19693 (Fmake_string): Use it. This doesn't change behavior, but saves
19694 a few bytes and will simplify future changes.
19695 * character.c (string_escape_byte8): Likewise.
19696 * lisp.h (string_overflow): New decl.
19697
1a1f3366
PE
19698 Fixups, following up to the user-interface timestamp change.
19699 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19700 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19701 * msdos.c (mouse_get_pos): Likewise.
19702 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19703 * w32gui.h (Time): Define by including "systime.h" rather than by
19704 declaring it ourselves. (Bug#8664)
19705
d4e3e4d3
PE
19706 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19707 * image.c (clear_image_cache): Likewise.
19708
f6a24d19
PE
19709 * term.c (term_mouse_position): Don't assume time_t wraparound.
19710
08dc5ae6
PE
19711 Be more systematic about user-interface timestamps.
19712 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19713 and sometimes 'EMACS_UINT', to represent these timestamps.
19714 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19715 This makes the code easier to follow, and makes it easier to catch
19716 integer overflow bugs such as Bug#8664.
19717 * frame.c (Fmouse_position, Fmouse_pixel_position):
19718 Use Time, not unsigned long, for user-interface timestamps.
19719 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19720 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19721 * keyboard.h (last_event_timestamp): Likewise.
19722 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19723 * menu.h (xmenu_show): Likewise.
19724 * term.c (term_mouse_position): Likewise.
19725 * termhooks.h (struct input_event.timestamp): Likewise.
19726 (struct terminal.mouse_position_hook): Likewise.
19727 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19728 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19729 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19730 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19731 what it was before.
19732 * menu.h, termhooks.h: Include "systime.h", for Time.
19733
8e55734a
PE
19734 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19735 Don't assume that the difference between two unsigned long values
19736 can fit into an integer. At this point, we know button_down_time
19737 <= event->timestamp, so the difference must be nonnegative, so
19738 there's no need to cast the result if double-click-time is
19739 nonnegative, as it should be; check that it's nonnegative, just in
19740 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19741 apart (about 25 days). (Bug#8664)
8e55734a 19742
841f1b75 19743 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 19744 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 19745
3e26f69c
PE
19746 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19747 that always fit in int. Use a sentinel instead of a counter, to
19748 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
19749 * frame.h (struct frame): Use int for menu_bar_items_used
19750 instead of EMACS_INT, since it always fits in int.
3e26f69c 19751
5cc152c0
PE
19752 * menu.c (grow_menu_items): Check for int overflow.
19753
d89eb65e
PE
19754 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19755
5235bd3e
PE
19756 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19757 Before, the code was not consistent. These values cannot exceed
19758 2**31 - 1 so there's no need to make them unsigned.
19759 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19760 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19761 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19762 as modifiers.
19763 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19764
bc827e23
PE
19765 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19766 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19767 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19768 presumably because the widths might not match.
19769
78eb494e
PE
19770 * window.c (size_window): Avoid needless test at loop start.
19771
04f2d78b
CB
197722011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19773
19774 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19775
d2fc7e3d 197762011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
19777
19778 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19779
d2fc7e3d 197802011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
19781
19782 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19783 `width' to `bar_area_x' and `bar_area_width', respectively.
19784 (x_scroll_run): Take account of fringe background extension.
19785
04f2d78b
CB
19786 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19787 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
19788 `bar_area_width', respectively.
19789 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19790 background extension.
19791
79b70037
GM
197922011-05-10 Jim Meyering <meyering@redhat.com>
19793
19794 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19795
2f142cc5
JB
197962011-05-10 Juanma Barranquero <lekktu@gmail.com>
19797
19798 * image.c (Finit_image_library): Return t for built-in image types,
19799 like pbm and xbm. (Bug#8640)
19800
57679c86
AS
198012011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19802
19803 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19804
888c9e86
EZ
198052011-05-07 Eli Zaretskii <eliz@gnu.org>
19806
b0512a1d
EZ
19807 * w32console.c (Fset_screen_color): Doc fix.
19808 (Fget_screen_color): New function.
19809 (syms_of_ntterm): Defsubr it.
19810
7285dc67
EZ
19811 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19812 unlink the temporary file if Fcall_process didn't create it in the
19813 first place.
19814 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19815 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
19816 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19817 cue to call_process_cleanup not to close that handle.
19818
4d3fcc8e
BK
198192011-05-07 Ben Key <bkey76@gmail.com>
19820
19821 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19822 one of two shell specific rules, either bootstrap-temacs-CMD or
19823 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19824 to the previous implementation of the bootstrap-temacs rule.
19825 The bootstrap-temacs-CMD rule is similar to the previous
19826 implementation of the bootstrap-temacs rule except that it
19827 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19828 variable.
19829
19830 These changes, along with some changes to nt/configure.bat,
19831 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19832 earlier fix to add support for --cflags and --ldflags options
19833 that include quotes so that it works whether make uses cmd or
19834 sh as the shell.
19835
b4289b64
MA
198362011-05-06 Michael Albinus <michael.albinus@gmx.de>
19837
19838 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19839 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19840 is a constant.
19841 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19842 a string. Handle both cases.
19843 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19844 (Fdbus_register_method): Use Qinvalid_function.
19845
af4c0e28
JB
198462011-05-06 Juanma Barranquero <lekktu@gmail.com>
19847
19848 * makefile.w32-in: Update dependencies.
19849 (LISP_H): Add inttypes.h and stdin.h.
19850 (PROCESS_H): Add unistd.h.
19851
c51453d9
EZ
198522011-05-06 Eli Zaretskii <eliz@gnu.org>
19853
19854 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19855 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19856
8ff0ac3c 198572011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 19858
4c4b566b
PE
19859 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19860
aab2b9b5
PE
19861 * term.c (vfatal): Remove stray call to va_end.
19862 It's not needed and the C Standard doesn't allow it here anyway.
19863
c378da0b
PE
19864 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19865 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19866
288b08c7
PE
19867 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19868 bytes.
19869
e3601888
PE
19870 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19871
db6c0e74
PE
19872 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19873
dd5963ea
PE
19874 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19875
88c9450f
PE
19876 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19877
2f9442b8
PE
19878 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19879
c032b5f8
PE
19880 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19881 * charset.c (Fdefine_charset_internal): Don't initialize
19882 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 19883 32-bit int (Bug#8600).
a108c10b
PE
19884
19885 * lread.c (read_integer): Be more consistent with string-to-number.
19886 Use string_to_number to do the actual conversion; this avoids
19887 rounding errors and fixes some other screwups. Without this fix,
19888 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19889 (digit_to_number): Move earlier, for benefit of read_integer.
19890 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 19891 not a digit in any supported base. (Bug#8602)
a108c10b 19892
ad5f9eea
PE
19893 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19894
aec1708a
PE
19895 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19896 to match comment at start of function. This also removes a
19897 GCC warning about overflow in a 32+64-bit port.
19898
47be4ab5
PE
19899 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19900
371cac43
PE
19901 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19902 Reported by Stefan Monnier in
19903 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
19904 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19905 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 19906
d01a7826
PE
19907 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19908 (EMACS_UINTPTR): Likewise, with uintptr_t.
19909
7fd47d5c
PE
19910 * lisp.h: Prefer 64-bit EMACS_INT if available.
19911 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19912 on 32-bit hosts that have 64-bit int, so that they can access
19913 large files.
122b0c86
PE
19914 However, temporarily disable this change unless the temporary
19915 symbol WIDE_EMACS_INT is defined.
7fd47d5c 19916
8727937b
PE
19917 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19918
8ac068ac
PE
19919 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19920 This removes an assumption that EMACS_INT and long are the same
19921 width as pointers. The assumption is true for Emacs porting targets
19922 now, but we want to make other targets possible.
19923 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19924 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19925 In the rest of the code, change types of integers that hold casted
19926 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19927 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19928 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19929 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19930 No need to cast type when ORing.
19931 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19932 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19933 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19934 assume EMACS_INT is the same width as char *.
19935 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19936 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19937 Remove no-longer-needed casts.
19938 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19939 (xg_tool_bar_help_callback, xg_make_tool_item):
19940 Use EMACS_INTPTR to hold an integer
19941 that will be cast to void *; this can avoid a GCC warning
19942 if EMACS_INT is not the same width as void *.
19943 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19944 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19945 (current_message_1, set_message_1):
19946 Use a local to convert to proper width without a cast.
19947 * xmenu.c (dialog_selection_callback): Likewise.
19948
ede49d71
PE
19949 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
19950 Also, don't assume VALBITS / RAND_BITS is less than 5,
19951 and don't rely on undefined behavior when shifting a 1 left into
19952 the sign bit.
19953 * lisp.h (get_random): Change signature to match.
19954
2f30ecd0
PE
19955 * lread.c (hash_string): Use size_t, not int, for hash computation.
19956 Normally we prefer signed values; but hashing is special, because
19957 it's better to use unsigned division on hash table sizes so that
19958 the remainder is nonnegative. Also, size_t is the natural width
19959 for hashing into memory. The previous code used 'int', which doesn't
19960 retain enough info to hash well into very large tables.
19961 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
19962
2a866e7b
PE
19963 * dbusbind.c: Don't possibly lose pointer info when converting.
19964 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19965 Use XPNTR rather than XHASH, so that the high-order bits of
19966 the pointer aren't lost when converting through void *.
19967
51639eac
PE
19968 * eval.c (Fautoload): Don't double-shift a pointer.
19969
92394119
PE
19970 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
19971
dbdb9a7c
JB
199722011-05-06 Juanma Barranquero <lekktu@gmail.com>
19973
19974 * gnutls.c (DEF_GNUTLS_FN):
19975 * image.c (DEF_IMGLIB_FN): Make function pointers static.
19976
db7a0b4f
AS
199772011-05-05 Andreas Schwab <schwab@linux-m68k.org>
19978
19979 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
19980 marker. (Bug#8610)
19981
cd394be1 199822011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
19983
19984 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
19985 New version that can reserve upto 2GB of heap space.
19986
f7ff1b0f 199872011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
19988
19989 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
19990
639c109b
TZ
199912011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
19992
19993 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
19994 `gnutls_certificate_set_x509_key_file'.
19995
d2127135
JB
199962011-05-05 Juanma Barranquero <lekktu@gmail.com>
19997
19998 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
19999 Update dependencies.
20000
e968f4f3
JB
200012011-05-04 Juanma Barranquero <lekktu@gmail.com>
20002
20003 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20004 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20005 Remove unused parameter `fildes'.
20006 * process.c (read_process_output, send_process): Don't pass it.
20007
84d358f0
JB
200082011-05-04 Juanma Barranquero <lekktu@gmail.com>
20009
20010 Fix previous change: the library cache is defined in w32.c.
20011 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20012 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20013
0898ca10
JB
200142011-05-04 Juanma Barranquero <lekktu@gmail.com>
20015
20016 Implement dynamic loading of GnuTLS on Windows.
20017
20018 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20019 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20020 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20021 Declare.
20022
20023 * gnutls.c (Qgnutls_dll): Define.
20024 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20025 (gnutls_*): Declare function pointers.
20026 (init_gnutls_functions): New function to initialize function pointers.
20027 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20028 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20029 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20030 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20031 (emacs_gnutls_write, emacs_gnutls_read)
20032 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20033 (Fgnutls_available_p): New function.
20034 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20035 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20036 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20037
20038 * image.c: Include w32.h.
20039 (Vimage_type_cache): Delete.
20040 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20041 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20042 (w32_delayed_load): Move to w32.c.
20043
20044 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20045
20046 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20047 (w32_delayed_load): Move from image.c. When loading a library, record
20048 its filename in the :loaded-from property of the library id.
20049 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20050 Initialize and staticpro them.
20051 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20052
20053 * process.c: Include lisp.h before w32.h, not after.
20054 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20055 instead of gnutls_record_check_pending.
20056
20057 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20058
ff4de4aa
TZ
200592011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20060
20061 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20062 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20063 as passed in.
20064
abe95abb
JD
200652011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20066
20067 * xterm.c (x_set_frame_alpha): Do not set property on anything
20068 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20069
e16e55d4
JB
200702011-05-02 Juanma Barranquero <lekktu@gmail.com>
20071
20072 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20073
bafcf6a5
JB
200742011-05-02 Juanma Barranquero <lekktu@gmail.com>
20075
20076 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20077 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20078 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20079 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20080 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20081 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20082 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20083 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20084 (Qgnutls_bootprop_callbacks_verify): Make static.
20085
e7a6747f
AS
200862011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20087
19ed11ba
AS
20088 * callproc.c: Indentation fixup.
20089
e7a6747f 20090 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
20091 (wait_for_termination, interruptible_wait_for_termination):
20092 Move after wait_for_termination_1.
e7a6747f 20093
1ef14cb4
LMI
200942011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20095
20096 * sysdep.c (interruptible_wait_for_termination): New function
20097 which is like wait_for_termination, but allows keyboard
20098 interruptions.
20099
20100 * callproc.c (Fcall_process): Add (:file "file") as an option for
20101 the STDOUT buffer.
20102 (Fcall_process_region): Ditto.
20103
330d880c
EZ
201042011-04-30 Eli Zaretskii <eliz@gnu.org>
20105
8db90b73
EZ
20106 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20107 rather than `XVECTOR (FOO)->size'.
20108
330d880c
EZ
20109 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20110 inttypes.h, as a gnulib replacement is used if it not available in
20111 system headers.
20112
15cbd324
EZ
201132011-04-21 Eli Zaretskii <eliz@gnu.org>
20114
20115 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20116 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20117 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20118
20119 * coding.c (coding_alloc_by_realloc): Error out if destination
20120 will grow beyond MOST_POSITIVE_FIXNUM.
20121 (decode_coding_emacs_mule): Abort if there isn't enough place in
20122 charbuf for the composition carryover bytes. Reserve an extra
20123 space for up to 2 characters produced in a loop.
20124 (decode_coding_iso_2022): Abort if there isn't enough place in
20125 charbuf for the composition carryover bytes.
20126
201272011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 20128
ae940cca
EZ
20129 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20130 aborting when %lld or %lll format is passed.
20131 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20132 %llo or %llx format is passed. (Bug#8545)
20133
03ab8921
EZ
20134 * window.c (window_scroll_line_based): Use a marker instead of
20135 simple variables to record original value of point. (Bug#7952)
20136
afda1437
EZ
20137 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20138 produced by %s or %c overflows available buffer space. (Bug#8545)
20139
f76dee0c
PE
201402011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20141
20142 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 20143 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 20144
fdc5744d
JB
201452011-04-28 Juanma Barranquero <lekktu@gmail.com>
20146
20147 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20148
638f053a
JB
201492011-04-28 Juanma Barranquero <lekktu@gmail.com>
20150
20151 * keyboard.c (Qdelayed_warnings_hook): Define.
20152 (command_loop_1): Run `delayed-warnings-hook'
20153 if Vdelayed_warnings_list is non-nil.
20154 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20155 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20156
d178f871
EZ
201572011-04-28 Eli Zaretskii <eliz@gnu.org>
20158
20159 * doprnt.c (doprnt): Don't return value smaller than the buffer
20160 size if the message was truncated. (Bug#8545).
20161
b124fd93
JB
201622011-04-28 Juanma Barranquero <lekktu@gmail.com>
20163
20164 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20165 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20166
e810457d
PE
201672011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20168
20169 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20170
ea51cceb
JB
201712011-04-27 Juanma Barranquero <lekktu@gmail.com>
20172
20173 * makefile.w32-in: Update dependencies.
20174
94dcfacf
EZ
201752011-04-27 Eli Zaretskii <eliz@gnu.org>
20176
20177 Improve `doprnt' and its usage. (Bug#8545)
20178 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20179 `format_end'. Remove support for %l as a conversion specifier.
20180 Don't use xrealloc. Improve diagnostics when the %l size modifier
20181 is used. Update the commentary.
20182
20183 * eval.c (verror): Simplify calculation of size_t.
20184
20185 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20186 messages.
20187
f61f41d7
PE
201882011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20189
20190 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20191 change.
20192
96fb4434
PE
201932011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20194
20195 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20196 This makes this file independent of the recent pseudovector change.
20197
671875da 201982011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 20199
69e9b5a3
PE
20200 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20201
b5f869a7 20202 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 20203 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 20204 Remove unused local.
c8926152 20205 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 20206
841a1577 20207 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
20208 GCC 4.6.0 optimizes based on type-based alias analysis.
20209 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
20210 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20211 != &v->size, and therefore "v->size = 1; b->size = 2; return
20212 v->size;" must therefore return 1. This assumption is incorrect
20213 for Emacs, since it type-puns struct Lisp_Vector * with many other
20214 types. To fix this problem, this patch adds a new type struct
f904488f 20215 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
20216 and pseudovectors, and helps optimizing compilers not get fooled
20217 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20218 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
20219 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20220 the size member.
eab3844f
PE
20221 (XSETPVECTYPE): Rewrite in terms of new macro.
20222 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20223 This is a bit clearer, and further avoids the possibility of
20224 undesirable aliasing.
20225 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 20226 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
20227 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20228 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
20229 (ASIZE): Now uses header.size rather than size.
20230 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
20231 to avoid the hassle of writing XVECTOR (foo)->header.size.
20232 (struct vectorlike_header): New type.
eab3844f
PE
20233 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20234 object, to help avoid aliasing.
20235 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20236 (SUBRP): Likewise, since Lisp_Subr is a special case.
20237 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20238 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20239 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 20240 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
20241 changed to be "header.size" and "header.next".
20242 * buffer.h (struct buffer): Likewise.
20243 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20244 * frame.h (struct frame): Likewise.
20245 * process.h (struct Lisp_Process): Likewise.
20246 * termhooks.h (struct terminal): Likewise.
20247 * window.c (struct save_window_data, struct saved_window): Likewise.
20248 * window.h (struct window): Likewise.
20249 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20250 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20251 * buffer.c (init_buffer_once): Likewise.
20252 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20253 special case.
20254 * process.c (Fformat_network_address): Use local var for size,
20255 for brevity.
20256
0df1eac5
PE
20257 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20258
847ab9d1 20259 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
20260 * data.c (atof): Remove decl; no longer used or needed.
20261 (digit_to_number): Move to lread.c.
20262 (Fstring_to_number): Use new string_to_number function, to be
20263 consistent with how the Lisp reader treats infinities and NaNs.
20264 Do not assume that floating-point numbers represent EMACS_INT
20265 without losing information; this is not true on most 64-bit hosts.
20266 Avoid double-rounding errors, by insisting on integers when
20267 parsing non-base-10 numbers, as the documentation specifies.
20268 * lisp.h (string_to_number): New decl, replacing ...
20269 (isfloat_string): Remove.
bc0a5c13 20270 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 20271 (read1): Do not accept +. and -. as integers; this
452f4150
PE
20272 appears to have been a coding error. Similarly, do not accept
20273 strings like +-1e0 as floating point numbers. Do not report
20274 overflow for integer overflows unless the base is not 10 which
20275 means we have no simple and reliable way to continue.
20276 Break out the floating-point parsing into a new
20277 function string_to_number, so that Fstring_to_number parses
20278 floating point numbers consistently with the Lisp reader.
04f2d78b 20279 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
20280 (E_CHAR, EXP_INT): Remove, replacing with ...
20281 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20282 (string_to_number): New function, replacing isfloat_string.
20283 This function checks for valid syntax and produces the resulting
20284 Lisp float number too. Rework it so that string-to-number
bc0a5c13 20285 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
20286 so that overflow for non-base-10 numbers is reported only when
20287 there's no portable and simple way to convert to floating point.
452f4150 20288
67769ffc
PE
20289 * textprop.c (set_text_properties_1): Rewrite for clarity,
20290 and to avoid GCC warning about integer overflow.
20291
c20db43f
PE
20292 * intervals.h (struct interval): Use EMACS_INT for members
20293 where EMACS_UINT might cause problems. See
20294 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20295 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20296 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20297 All uses changed.
37aa2f85
PE
20298 (offset_intervals): Tell GCC not to worry about length overflow
20299 when negating a negative length.
c20db43f 20300
2538aa2f
PE
20301 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20302 (overrun_check_free): Likewise.
20303
f2d3008d
PE
20304 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20305 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20306 word size.
20307
ec8df744
PE
20308 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20309 (gnutls_make_error): Rename local to avoid shadowing.
20310 (gnutls_emacs_global_deinit): ifdef out; not used.
20311 (Fgnutls_boot): Use const for pointer to readonly storage.
20312 Comment out unused local. Fix pointer signedness problems.
20313
640ee02d
PE
20314 * lread.c (openp): Don't stuff size_t into an 'int'.
20315 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20316 about possible signed overflow.
20317
6048fb2a
PE
20318 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20319 (GDK_KEY_g): Don't define if already defined.
20320 (xg_prepare_tooltip): Avoid pointer signedness problem.
20321 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20322
fa3c87e1
PE
20323 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20324 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20325
2172544b
PE
20326 * xfns.c (Fx_window_property): Simplify a bit,
20327 to make a bit faster and to avoid GCC 4.6.0 warning.
20328 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20329
9b821a21
PE
20330 * fns.c (internal_equal): Don't assume size_t fits in int.
20331
3c616cfa
PE
20332 * alloc.c (compact_small_strings): Tighten assertion a little.
20333
c2982e87
PE
20334 Replace pEd with more-general pI, and fix some printf arg casts.
20335 * lisp.h (pI): New macro, generalizing old pEd macro to other
20336 conversion specifiers. For example, use "...%"pI"d..." rather
20337 than "...%"pEd"...".
20338 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20339 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20340 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20341 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20342 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20343 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20344 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20345 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20346 64-bit hosts.
20347 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20348 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20349 * print.c (safe_debug_print, print_object): Likewise.
20350 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20351 to int.
6f04d126
PE
20352 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20353 avoiding the 0 flag, which is not portable.
c2982e87
PE
20354 * process.c (Fmake_network_process): Use pI to avoid cast.
20355 * region-cache.c (pp_cache): Likewise.
20356 * xdisp.c (decode_mode_spec): Likewise.
20357 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20358 behavior on 64-bit hosts with printf arg.
6f04d126 20359 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20360 (x_stop_queuing_selection_requests): Likewise.
20361 (x_get_window_property): Don't truncate byte count to an 'int'
20362 when tracing.
0b432f21 20363
5e073ec7
PE
20364 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20365 here, since it parses constructs like leading '-' and spaces,
20366 which are not wanted; and it overflows with large numbers.
20367 Instead, simply match F[0-9]+, which is what is wanted anyway.
20368
36372bf9
PE
20369 * alloc.c: Remove unportable assumptions about struct layout.
20370 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20371 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20372 (allocate_vectorlike, make_pure_vector): Use the new macros,
20373 plus offsetof, to remove unportable assumptions about struct layout.
20374 These assumptions hold on all porting targets that I know of, but
20375 they are not guaranteed, they're easy to remove, and removing them
20376 makes further changes easier.
20377
0b432f21
PE
20378 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20379 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
20380 (string_overrun_cookie): Now const. Use initializers that
20381 don't formally overflow signed char, to avoid warnings.
000098c1
PE
20382 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20383 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
20384 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20385 multiple of sizeof (EMACS_INT); it need not be, if
20386 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 20387 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 20388
895009e1
JB
203892011-04-26 Juanma Barranquero <lekktu@gmail.com>
20390
20391 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20392
6a7a1b0b
TZ
203932011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20394
20395 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 20396 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
20397 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20398
841a1577 203992011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
20400
20401 * lisp.h (Qdebug): List symbol.
895009e1 20402 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
20403 * keyboard.c (debug-on-event): New variable.
20404 (handle_user_signal): Break into debugger when debug-on-event
20405 matches the current signal symbol.
20406
f2d3ba6f
DN
204072011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20408
20409 * alloc.c (check_sblock, check_string_bytes)
20410 (check_string_free_list): Convert to standard C.
20411
42ce4c63
TZ
204122011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20413
20414 * w32.c (emacs_gnutls_push): Fix typo.
20415
825cd63c
EZ
204162011-04-25 Eli Zaretskii <eliz@gnu.org>
20417
fb11d64d
EZ
20418 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20419 "cast to pointer from integer of different size".
20420
825cd63c
EZ
20421 Improve doprnt and its use in verror. (Bug#8545)
20422 * doprnt.c (doprnt): Document the set of format control sequences
20423 supported by the function. Use SAFE_ALLOCA instead of always
20424 using `alloca'.
20425
20426 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20427 is one byte too soon. Don't use xrealloc; instead xfree and
20428 xmalloc anew.
20429
e061a11b
TZ
204302011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20431
20432 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20433 callbacks stage.
20434
20435 * gnutls.c: Renamed global_initialized to
20436 gnutls_global_initialized. Added internals for the
20437 :verify-hostname-error, :verify-error, and :verify-flags
20438 parameters of `gnutls-boot' and documented those parameters in the
20439 docstring. Start callback support.
9173deec
JB
20440 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20441 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20442 on error. Return error code.
e061a11b
TZ
20443 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20444 (emacs_gnutls_read): Likewise.
20445 (Fgnutls_boot): Return handshake error code.
20446 (emacs_gnutls_handle_error): New function.
20447 (wsaerror_to_errno): Likewise.
20448
20449 * w32.h (emacs_gnutls_pull): Add prototype.
20450 (emacs_gnutls_push): Likewise.
20451
20452 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20453 (emacs_gnutls_push): Likewise.
20454
204552011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20456
20457 * process.c (wait_reading_process_output): Check if GnuTLS
20458 buffered some data internally if no FDs are set for TLS
20459 connections.
20460
20461 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20462 (LIBS): Link to USER_LIBS.
20463 ($(BLD)/gnutls.$(0)): New target.
20464
fa6996bc
EZ
204652011-04-24 Eli Zaretskii <eliz@gnu.org>
20466
eb35682e
EZ
20467 * xdisp.c (handle_single_display_spec): Rename the
20468 display_replaced_before_p argument into display_replaced_p, to
20469 make it consistent with the commentary. Fix typos in the
20470 commentary.
20471
e2ad650c
EZ
20472 * textprop.c (syms_of_textprop): Remove dead code.
20473 (copy_text_properties): Delete obsolete commentary about an
20474 interface that was deleted long ago. Fix typos in the description
20475 of arguments.
20476
1b2de274
EZ
20477 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20478 to changes in oldXMenu/XMenu.h from 2011-04-16.
20479 <menu_help_message, prev_menu_help_message>: Constify.
20480 (IT_menu_make_room): menu->help_text is now `const char **';
20481 adjust.
20482
20483 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20484 to changes in oldXMenu/XMenu.h from 2011-04-16.
20485 (struct XMenu): Declare `help_text' `const char **'.
20486
20487 * xfaces.c <Qunspecified>: Make extern again.
20488
20489 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 20490 required by POSIX.
1b2de274 20491
762b15be
EZ
20492 * doc.c (get_doc_string): Improve the format passed to `error'.
20493
20494 * doprnt.c (doprnt): Improve commentary.
20495
20496 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20497
20498 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20499 them with etags.
20500
f1052e5d
EZ
20501 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20502 changes in globals.h immediately force recompilation.
762b15be
EZ
20503 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20504 $(CURDIR)/s/ms-w32.h.
20505 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 20506
fa6996bc
EZ
20507 * character.c (Fchar_direction): Function deleted.
20508 (syms_of_character): Don't defsubr it.
20509 <char-direction-table>: Deleted.
20510
e6c3da20
EZ
205112011-04-23 Eli Zaretskii <eliz@gnu.org>
20512
20513 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20514 * doprnt.c: Include limits.h.
20515 (SIZE_MAX): New macro.
04f2d78b
CB
20516 (doprnt): Return a size_t value. 2nd arg is now size_t.
20517 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
20518 Improve overflow protection. Support `l' modifier for integer
20519 conversions. Support %l conversion. Don't assume an EMACS_INT
20520 argument for integer conversions and for %c.
20521
20522 * lisp.h (doprnt): Restore prototype.
20523
20524 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20525 $(SRC)/character.h.
20526
20527 * Makefile.in (base_obj): Add back doprnt.o.
20528
20529 * deps.mk (doprnt.o): Add back prerequisites.
20530 (callint.o): Depend on character.h.
20531
20532 * eval.c (internal_lisp_condition_case): Include the handler
20533 representation in the error message.
20534 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20535 when breaking from the loop.
20536
20537 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20538
20539 * callint.c (Fcall_interactively): When displaying error message
20540 about invalid control letter, pass the character's codepoint, not
20541 a pointer to its multibyte form. Improve display of the character
20542 in octal and display also its hex code.
20543
20544 * character.c (char_string): Use %x to display the (unsigned)
20545 codepoint of an invalid character, to avoid displaying a bogus
20546 negative value.
20547
20548 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20549 `error', not SYMBOL_NAME itself.
20550
20551 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20552 character arguments to `error'.
20553
20554 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20555 to `error' in error message about FINAL_CHAR argument. Make sure
20556 FINAL_CHAR is a character, and use %c when it is passed as
20557 argument to `error'.
20558
4ffd0d6b 205592011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
20560
20561 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20562
20563 * w32.c: Include <time.h>.
20564 (sys_localtime): New function.
20565
4ffd0d6b 205662011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
20567
20568 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20569
4ffd0d6b 20570 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 20571
4ffd0d6b 205722011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 20573
4ffd0d6b
GM
20574 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20575 zombies (Bug#8467).
aac0c6e3 20576
04c56954
EZ
205772011-04-19 Eli Zaretskii <eliz@gnu.org>
20578
20579 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20580 gl_state.e_property when gl_state.object is Qt.
20581
20582 * insdel.c (make_gap_larger): Remove limitation of buffer size
20583 to <= INT_MAX.
20584
16a43933
CY
205852011-04-18 Chong Yidong <cyd@stupidchicken.com>
20586
20587 * xdisp.c (lookup_glyphless_char_display)
20588 (produce_glyphless_glyph): Handle cons cell entry in
20589 glyphless-char-display.
20590 (Vglyphless_char_display): Document it.
20591
20592 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20593 glyphless-char-display.
20594
4581706e
CY
205952011-04-17 Chong Yidong <cyd@stupidchicken.com>
20596
20597 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20598
20599 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20600
20601 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20602 definition for no-X builds.
20603
4887c6e2 206042011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 20605
fd35b6f9
PE
20606 Static checks with GCC 4.6.0 and non-default toolkits.
20607
5c1ccb01
PE
20608 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20609
006c5daa
PE
20610 * process.c (keyboard_bit_set): Define only if SIGIO.
20611 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20612 (send_process): Repair possible setjmp clobbering.
20613
efc736d3
PE
20614 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20615
4e2fe2e6
PE
20616 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20617
f97334a2
PE
20618 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20619
4e75f29d
PE
20620 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20621 Define only if needed.
20622
90efadd1
PE
20623 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20624 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 20625 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 20626
3c647824
PE
20627 * dispextern.h (struct redisplay_interface): Rename param
20628 to avoid shadowing.
e264f262 20629 * termhooks.h (struct terminal): Likewise.
761383f4 20630 * xterm.c (xembed_send_message): Likewise.
3c647824 20631
b58c5c4a
PE
20632 * insdel.c (make_gap_smaller): Define only if
20633 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20634
cad59032
PE
20635 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20636 it.
20637
c339dc2e
PE
20638 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20639 so that we aren't warned about unused symbols.
20640
91a3e27b
PE
20641 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20642
399c71d3 20643 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 20644
8ffc96f5
PE
20645 * xfns.c (x_real_positions): Mark locals as initialized.
20646
eef9bc79
PE
20647 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20648
098db9dd
PE
20649 * xterm.c: Fix problems found by static analysis with other toolkits.
20650 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
20651 (x_dispatch_event): Declare static if USE_GTK, and
20652 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 20653 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 20654 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
20655 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20656 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 20657
eb18f6cc
PE
20658 * xmenu.c (menu_help_callback): Pointer type fixes.
20659 Use const pointers when pointing at readonly data. Avoid pointer
20660 signedness clashes.
20661 (FALSE): Remove unused macro.
20662 (update_frame_menubar): Remove unused decl.
20663
1fe72bf8
PE
20664 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20665
60d9e1db
PE
20666 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20667 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20668 (single_menu_item): Rename local to avoid shadowing.
20669
39261c26
PE
20670 * keyboard.c (make_lispy_event): Remove unused local var.
20671
018c5e19
PE
20672 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20673 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20674
63d2b86e
PE
20675 * bitmaps: Change bitmaps from unsigned char back to the X11
20676 compatible char. Avoid the old compiler warnings about
20677 out-of-range initializers by using, for example, '\xab' rather
20678 than 0xab.
20679
aefd87e1
PE
20680 * xgselect.c (xgselect_initialize): Check vs interface
20681 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20682
bf501fb9
PE
20683 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20684
e9829fdf
PE
20685 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20686 to read-only memory.
20687
1086c095
PE
20688 * fns.c (vector): Remove; this old hack is no longer needed.
20689
2baccd04 20690 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20691 Remove unused var.
dde42981 20692 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20693
72391843 20694 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20695
436c16df 20696 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20697 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20698 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20699
92bb796d 20700 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20701 (x_term_init): Remove local to avoid shadowing.
92bb796d 20702
764430a3 20703 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20704
20705 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20706 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20707
d1dfb56c
EZ
207082011-04-16 Eli Zaretskii <eliz@gnu.org>
20709
c4354cb4
EZ
20710 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20711
d1dfb56c
EZ
20712 Fix regex.c, syntax.c and friends for buffers > 2GB.
20713 * syntax.h (struct gl_state_s): Declare character position members
20714 EMACS_INT.
20715
20716 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20717
04f2d78b
CB
20718 * textprop.c (verify_interval_modification, interval_of):
20719 Declare arguments EMACS_INT.
d1dfb56c
EZ
20720
20721 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20722 EMACS_INT.
20723
20724 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20725
20726 * indent.c (Fvertical_motion): Local variable it_start is now
20727 EMACS_INT.
20728
20729 * regex.c (re_match, re_match_2, re_match_2_internal)
20730 (bcmp_translate, regcomp, regexec, print_double_string)
20731 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20732 (re_compile_pattern, re_exec): Declare arguments and local
20733 variables `size_t' and `ssize_t' and return values `regoff_t', as
20734 appropriate.
20735 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20736 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20737 <compile_stack_type>: `size' and `avail' are now `size_t'.
20738
20739 * regex.h <regoff_t>: Use ssize_t, not int.
20740 (re_search, re_search_2, re_match, re_match_2): Arguments that
20741 specify buffer/string position and length are now ssize_t and
20742 size_t. Return type is regoff_t.
20743
613052cd
BK
207442011-04-16 Ben Key <bkey76@gmail.com>
20745
20746 * nsfont.m: Fixed bugs in ns_get_family and
20747 ns_descriptor_to_entity that were caused by using free to
20748 deallocate memory blocks that were allocated by xmalloc (via
20749 xstrdup). This caused Emacs to crash when compiled with
20750 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20751 --enable-checking=xmallocoverrun). xfree is now used to
20752 deallocate these memory blocks.
20753
4170f62f 207542011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 20755
71b41406
PE
20756 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20757
9587a89d
PE
20758 emacs_write: Accept and return EMACS_INT for sizes.
20759 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20760 et seq.
20761 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20762 Accept and return EMACS_INT.
20763 (emacs_gnutls_write): Return the number of bytes written on
20764 partial writes.
20765 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
20766 (emacs_read, emacs_write): Remove check for negative size, as the
20767 Emacs source code has been audited now.
9587a89d
PE
20768 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20769 (emacs_read, emacs_write): Use it.
273a5f82
PE
20770 * process.c (send_process): Adjust to the new signatures of
20771 emacs_write and emacs_gnutls_write. Do not attempt to store
20772 a byte offset into an 'int'; it might overflow.
9587a89d 20773 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 20774
3e047f51
PE
20775 * sound.c: Don't assume sizes fit in 'int'.
20776 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 20777 Return EMACS_INT, not int.
3e047f51 20778 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
20779 Accept EMACS_INT, not int.
20780 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
20781 record read return values.
20782
cc39a9db
BK
207832011-04-15 Ben Key <bkey76@gmail.com>
20784
c9d0ec6d
JB
20785 * keyboard.c (Qundefined): Don't declare static since it is used
20786 in nsfns.m.
20787 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20788 static since they are used in nsfont.m.
cc39a9db 20789
6c60eb9f
SM
207902011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20791
20792 * process.c (Qprocessp): Don't declare static.
20793 * lisp.h (Qprocessp): Declare again.
20794
7990b61a
JB
207952011-04-15 Juanma Barranquero <lekktu@gmail.com>
20796
20797 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20798
5d4cb038
PE
207992011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20800
8bd7b830 20801 Improve C-level modularity by making more things 'static'.
cd64ea1d 20802
e3b27b31
PE
20803 Don't publish debugger-only interfaces to other modules.
20804 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20805 (verify_bytepos, count_markers): Move decls to the only modules
20806 that need them.
20807 * region-cache.h (pp_cache): Likewise.
20808 * window.h (check_all_windows): Likewise.
20809 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20810
5d4cb038
PE
20811 * sysdep.c (croak): Now static, if
20812 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20813 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
20814
20815 * alloc.c (refill_memory_reserve): Now static if
20816 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20817 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 20818
e87b6180
PE
20819 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20820 Define only if USE_LUCID.
20821
ac64929e
PE
20822 * xrdb.c (x_customization_string, x_rm_string): Now static.
20823
6f37259d
PE
20824 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20825 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20826
1683e3ab
PE
20827 * xdisp.c (draw_row_with_mouse_face): Now static.
20828 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20829
de9c2632
PE
20830 * window.h (check_all_windows): Mark externally visible.
20831
2b96acb7
PE
20832 * window.c (window_deletion_count): Now static.
20833
20834 * undo.c: Make symbols static if they're not exported.
20835 (last_undo_buffer, last_boundary_position, pending_boundary):
20836 Now static.
20837
50436f33
PE
20838 * textprop.c (interval_insert_behind_hooks): Now static.
20839 (interval_insert_in_front_hooks): Likewise.
20840
64520e5c
PE
20841 * term.c: Make symbols static if they're not exported.
20842 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20843 (max_frame_lines, tty_set_terminal_modes):
20844 (tty_reset_terminal_modes, tty_turn_off_highlight):
20845 (get_tty_terminal): Now static.
20846 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20847 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 20848 HAVE_WINDOW_SYSTEM.
64520e5c
PE
20849 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20850 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20851
1fa53021
PE
20852 * sysdep.c: Make symbols static if they're not exported.
20853 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20854 Now static.
20855 (sigprocmask_set, full_mask): Remove; unused.
20856 (wait_debugging): Mark as visible.
20857 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20858 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20859
d4b43b22
PE
20860 * syntax.c (syntax_temp): Define only if !__GNUC__.
20861
b7c513d0
PE
20862 * sound.c (current_sound_device, current_sound): Now static.
20863
989b29ad
PE
20864 * search.c (searchbufs, searchbuf_head): Now static.
20865
13a55a78
PE
20866 * scroll.c (scroll_cost): Remove; unused.
20867 * dispextern.h (scroll_cost): Remove decl.
20868
de68a1fc
PE
20869 * region-cache.h (pp_cache): Mark as externally visible.
20870
40ccffa6
PE
20871 * process.c: Make symbols static if they're not exported.
20872 (process_tick, update_tick, create_process, chan_process):
20873 (Vprocess_alist, proc_buffered_char, datagram_access):
20874 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20875 (deactivate_process): Mark defn as static, as well as decl.
20876 * lisp.h (create_process): Remove decl.
20877 * process.h (chan_process, Vprocess_alist): Remove decls.
20878
ad64fc97
PE
20879 * print.c: Make symbols static if they're not exported.
20880 (print_depth, new_backquote_output, being_printed, print_buffer):
20881 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20882 (print_interval, print_number_index, initial_stderr_stream):
20883 Now static.
20884 * lisp.h (Fprinc): Remove decl.
20885 (debug_output_compilation_hack): Mark as externally visible.
20886
adddb265
PE
20887 * sysdep.c (croak): Move decl from here to syssignal.h.
20888 * syssignal.h (croak): Put it here, so the API can be checked when
20889 'croak' is called from dissociate_if_controlling_tty.
20890
1717ede2
PE
20891 * minibuf.c: Make symbols static if they're not exported.
20892 (minibuf_save_list, choose_minibuf_frame): Now static.
20893 * lisp.h (choose_minibuf_frame): Remove decl.
20894
fa5fb2bc
PE
20895 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20896
1e3890d1
PE
20897 * lread.c: Make symbols static if they're not exported.
20898 (read_objects, initial_obarray, oblookup_last_bucket_number):
20899 Now static.
20900 (make_symbol): Remove; unused.
20901 * lisp.h (initial_obarray, make_symbol): Remove decls.
20902
8a1414fa
PE
20903 * keyboard.c: Make symbols static if they're not exported.
20904 (single_kboard, recent_keys_index, total_keys, recent_keys):
20905 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20906 (this_single_command_key_start, echoing, last_auto_save):
20907 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20908 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20909 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20910 (Vlispy_mouse_stem, double_click_count):
20911 Now static.
20912 (force_auto_save_soon): Define only if SIGDANGER.
20913 (ignore_mouse_drag_p): Now static if
20914 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20915 (print_help): Remove; unused.
20916 (stop_character, last_timer_event): Mark as externally visible.
20917 * keyboard.h (ignore_mouse_drag_p): Declare only if
20918 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20919 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20920 * lisp.h (echoing): Remove decl.
20921 (force_auto_save_soon): Declare only if SIGDANGER.
20922 * xdisp.c (redisplay_window): Simplify code, to make it more
20923 obvious that ignore_mouse_drag_p is not accessed if !defined
20924 USE_GTK && !defined HAVE_NS.
20925
93ea6e8f
PE
20926 * intervals.c: Make symbols static if they're not exported.
20927 (merge_properties_sticky, merge_interval_right, delete_interval):
20928 Now static.
20929 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20930
77382fcc
PE
20931 * insdel.c: Make symbols static if they're not exported.
20932 However, leave prepare_to_modify_buffer alone. It's never
20933 called from outside this function, but that appears to be a bug.
20934 (combine_after_change_list, combine_after_change_buffer):
4889fc82 20935 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
20936 (adjust_after_replace_noundo): Remove; unused.
20937 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 20938 (signal_before_change): Remove decls.
77382fcc 20939
9306c32e
PE
20940 * indent.c (val_compute_motion, val_vmotion): Now static.
20941
cd44d2eb
PE
20942 * image.c: Make symbols static if they're not exported.
20943 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20944 if USE_GTK.
20945 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20946 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
20947
ad9a7a06
PE
20948 * fringe.c (standard_bitmaps): Now static.
20949 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
20950
81626931
PE
20951 * frame.c: Make symbols static if they're not exported.
20952 (x_report_frame_params, make_terminal_frame): Now static.
20953 (get_frame_param): Now static, unless HAVE_NS.
20954 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
20955 (x_get_resource_string): Remove; not used.
20956 * frame.h (make_terminal_frame, x_report_frame_params):
20957 (x_get_resource_string); Remove decls.
20958 (x_fullscreen_adjust): Declare only if WINDOWSNT.
20959 * lisp.h (get_frame_param): Declare only if HAVE_NS.
20960
239f9db9
PE
20961 * font.c, fontset.c: Make symbols static if they're not exported.
20962 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
20963 (FACE_SUITABLE_FOR_CHAR_P): Use it.
20964 * font.c (font_close_object): Now static.
20965 * font.h (font_close_object): Remove.
20966 * fontset.c (FONTSET_OBJLIST): Remove.
20967 (free_realized_fontset) #if-0 the body, which does nothing.
20968 (face_suitable_for_char_p): #if-0, as it's never called.
20969 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
20970 * xfaces.c (face_at_string_position):
20971 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
20972 since 0 is always ASCII.
20973
dfcf3579
PE
20974 * fns.c (weak_hash_tables): Now static.
20975
5045092b
PE
20976 * fileio.c: Make symbols static if they're not exported.
20977 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
20978 (Vwrite_region_annotation_buffers): Now static.
20979
57a96f5c
PE
20980 * eval.c: Make symbols static if they're not exported.
20981 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
20982 * lisp.h (backtrace_list): Remove decl.
20983
35f08c38
PE
20984 * emacs.c: Make symbols static if they're not exported.
20985 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
20986 (fatal_error_code, fatal_error_signal_hook, standard_args):
20987 Now static.
20988 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
20989 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
20990 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
20991 * lisp.h (fatal_error_signal_hook): Remove decl.
20992 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
20993
f44bd759
PE
20994 * editfns.c: Move a (normally-unused) function to its only use.
20995 * editfns.c, lisp.h (get_operating_system_release): Remove.
20996 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
20997 worth the hassle of breaking this out.
20998
b532497d
PE
20999 * xterm.c: Make symbols static if they're not exported.
21000 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21001 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21002 (x_destroy_window, x_delete_display):
21003 Now static.
21004 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21005 (x_mouse_leave): Remove; unused.
21006 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21007 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21008 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21009 Remove decls.
21010 (x_mouse_leave): Declare only if WINDOWSNT.
21011 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21012 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21013 USE_X_TOOLKIT.
21014
1675728f
PE
21015 * ftxfont.c: Make symbols static if they're not exported.
21016 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21017 HAVE_FREETYPE.
21018 * font.h (ftxfont_driver): Likewise.
21019
e4cebfca
PE
21020 * xfns.c: Make symbols static if they're not exported.
21021 (x_last_font_name, x_display_info_for_name):
21022 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21023 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21024 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21025 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21026 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21027 (last_show_tip_args): Now static.
21028 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21029 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21030 (x_screen_planes): Remove; unused.
21031 * dispextern.h (x_screen_planes): Remove decl.
21032
5bf46f05
PE
21033 * dispnew.c: Make symbols static if they're not exported.
21034 * dispextern.h (redraw_garbaged_frames, scrolling):
21035 (increment_row_positions): Remove.
21036 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21037 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21038 Now static.
21039 (redraw_garbaged_frames): Remove; unused.
21040
435f4c28
PE
21041 * xfaces.c: Make symbols static if they're not exported.
21042 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21043 Remove decls.
21044 * xterm.h (defined_color): Remove decls.
21045 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21046 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21047 (menu_face_changed_default, defined_color, free_realized_face):
21048 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21049 (ascii_face_of_lisp_face): Remove; unused.
21050
8524aef3
PE
21051 * xdisp.c: Make symbols static if they're not exported.
21052 * dispextern.h (scratch_glyph_row, window_box_edges):
21053 (glyph_to_pixel_coords, set_cursor_from_row):
21054 (get_next_display_element, set_iterator_to_next):
21055 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21056 (show_mouse_face): Remove decls
21057 * frame.h (message_buf_print): Likewise.
21058 * lisp.h (pop_message, set_message, check_point_in_composition):
21059 Likewise.
21060 * xterm.h (set_vertical_scroll_bar): Likewise.
21061 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21062 (message_buf_print, scratch_glyph_row, displayed_buffer):
21063 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21064 (get_next_display_element, show_mouse_face, window_box_edges):
21065 (frame_to_window_pixel_xy, check_point_in_composition):
21066 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21067 (glyph_to_pixel_coords): Remove; unused.
21068
16390cd2
PE
21069 * dired.c (file_name_completion): Now static.
21070
21071 * dbusbind.c (xd_in_read_queued_messages): Now static.
21072
a25f4dfa
PE
21073 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21074 * data.c (circular_list_error): Remove.
21075
14a9c8df
PE
21076 * commands.h (last_point_position, last_point_position_buffer):
21077 (last_point_position_window): Remove decls.
21078 * keyboard.c: Make these variables static.
21079
04f2d78b
CB
21080 * coding.h (coding, code_convert_region, encode_coding_gap):
21081 Remove decls.
74ab6df5
PE
21082 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21083 (iso_code_class, detect_coding, code_convert_region): Now static.
21084 (encode_coding_gap): Remove; unused.
21085
38dfbee1
PE
21086 * chartab.c (chartab_chars, chartab_bits): Now static.
21087
a2cb4e63
PE
21088 * charset.h (charset_iso_8859_1): Remove decl.
21089 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21090 Now static.
21091
127198fd
PE
21092 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21093 * ccl.c (Vccl_program_table): Now static.
21094 (check_ccl_update): Remove; unused.
21095
d85b608f
PE
21096 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21097 * category.h: ... from here.
21098 * category.c (check_category_table, set_category_set): Now static.
21099
31cd66f3
PE
21100 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21101 * lisp.h: Remove these decls.
21102
c358e587
PE
21103 * buffer.c (buffer_count): Remove unused var.
21104
e78aecca
PE
21105 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21106 so that it's not optimized away.
21107 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21108 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21109 exported only to the debugger.
21110
e192d7d3 21111 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 21112 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 21113
92470028
PE
21114 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21115 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21116 was inaccessible from Lisp.
21117 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21118 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21119
244ed907
PE
21120 alloc.c: Import and export fewer symbols, and remove unused items.
21121 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21122 is defined.
21123 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21124 it's not optimized away by whole-program optimization.
21125 (message_enable_multibyte, free_misc): Remove.
21126 (catchlist, handlerlist, mark_backtrace):
21127 Declare only if BYTE_MARK_STACK.
21128 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21129 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21130 (message_enable_multibyte): Remove decl.
21131 (free_misc, interval_free_list, float_block, float_block_index):
21132 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21133 (cons_free_list, last_marked_index):
21134 Now static.
21135 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21136 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21137 (mark_backtrace): Define only if BYTE_MARK_STACK.
21138 * xdisp.c (message_enable_multibyte): Now static.
21139
61c2b50e 21140 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
21141 This makes it easier for human readers (and static analyzers)
21142 to see whether these variables are used from other modules.
21143 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21144 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21145 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21146 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21147 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21148 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21149 * xmenu.c, xselect.c:
21150 Declare Q* vars static if they are not used in other modules.
21151 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21152 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21153 Remove decls of unexported vars.
21154 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21155
95c82688
PE
21156 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21157
16a97296
PE
21158 Make Emacs functions such as Fatom 'static' by default.
21159 This makes it easier for human readers (and static analyzers)
21160 to see whether these functions can be called from other modules.
21161 DEFUN now defines a static function. To make the function external
21162 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
21163 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21164 (Finit_image_library):
16a97296
PE
21165 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21166 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21167 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21168 Remove decls, since these functions are now static.
21169 (Funintern, Fget_internal_run_time): New decls, since these functions
21170 were already external.
95c82688 21171
16a97296
PE
21172 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21173 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21174 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21175 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21176 * keyboard.c, keymap.c, lread.c:
21177 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21178 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21179 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21180 Mark functions with DEFUE instead of DEFUN,
21181 if they are used in other modules.
21182 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21183 decls for now-static functions.
21184 * buffer.h (Fdelete_overlay): Remove decl.
21185 * callproc.c (Fgetenv_internal): Mark as internal.
21186 * composite.c (Fremove_list_of_text_properties): Remove decl.
21187 (Fcomposition_get_gstring): New forward static decl.
21188 * composite.h (Fcomposite_get_gstring): Remove decl.
21189 * dired.c (Ffile_attributes): New forward static decl.
21190 * doc.c (Fdocumntation_property): New forward static decl.
21191 * eval.c (Ffetch_bytecode): New forward static decl.
21192 (Funintern): Remove extern decl; now in .h file where it belongs.
21193 * fileio.c (Fmake_symbolic_link): New forward static decl.
21194 * image.c (Finit_image_library): New forward static decl.
21195 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21196 * intervals.h (Fprevious_property_change):
21197 (Fremove_list_of_text_properties): Remove decls.
21198 * keyboard.c (Fthis_command_keys): Remove decl.
21199 (Fcommand_execute): New forward static decl.
21200 * keymap.c (Flookup_key): New forward static decl.
21201 (Fcopy_keymap): Now static.
21202 * keymap.h (Flookup_key): Remove decl.
21203 * process.c (Fget_process): New forward static decl.
21204 (Fprocess_datagram_address): Mark as internal.
21205 * syntax.c (Fsyntax_table_p): New forward static decl.
21206 (skip_chars): Remove duplicate decl.
21207 * textprop.c (Fprevious_property_change): New forward static decl.
21208 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21209 Now internal.
21210 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21211 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21212
785bbd42
PE
21213 * editfns.c (Fformat): Remove unreachable code.
21214
8b913b57
AS
212152011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21216
21217 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21218 change. (Bug#8496)
21219
a6744a35
EZ
212202011-04-13 Eli Zaretskii <eliz@gnu.org>
21221
21222 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21223 when at ZV. (Bug#8487)
21224
e7974947
AS
212252011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21226
baad03f0
AS
21227 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21228 (Bug#8437)
21229 * keyboard.c (parse_tool_bar_item): Likewise.
21230 * sound.c (sound_cleanup, alsa_close): Likewise.
21231 * termcap.c (tgetent): Likewise.
21232 * xfns.c (x_default_font_parameter): Likewise.
21233 * xsettings.c (read_and_apply_settings): Likewise.
21234
e7974947
AS
21235 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21236 (overrun_check_free): Protoize.
21237
28272684
PE
212382011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21239
21240 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21241 since callers should never pass a negative size.
21242 Change the signature to match that of plain 'read' and 'write'; see
21243 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21244 * lisp.h: Update prototypes of emacs_write and emacs_read.
21245
11997c76
EZ
212462011-04-11 Eli Zaretskii <eliz@gnu.org>
21247
21248 * xdisp.c (redisplay_window): Don't try to determine the character
21249 position of the scroll margin if the window start point w->startp
e896f03c 21250 is outside the buffer's accessible region. (Bug#8468)
11997c76 21251
8a2cbd72
EZ
212522011-04-10 Eli Zaretskii <eliz@gnu.org>
21253
21254 Fix write-region and its subroutines for buffers > 2GB.
21255 * fileio.c (a_write, e_write): Modify declaration of arguments and
21256 local variables to support buffers larger than 2GB.
21257 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21258
21259 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21260 argument, local variables, and return value.
21261
21262 * lisp.h: Update prototypes of emacs_write and emacs_read.
21263
21264 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21265
4073e537 212662011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 21267
1ebfdcb6
PE
21268 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21269
b2ded58d
PE
21270 Fix more problems found by GCC 4.6.0's static checks.
21271
7d66342c
PE
21272 * xdisp.c (vmessage): Use a better test for character truncation.
21273
bbf47d44
PE
21274 * charset.c (load_charset_map): <, not <=, for optimization,
21275 and to avoid potential problems with integer overflow.
9248994d 21276 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 21277 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 21278 * editfns.c (Fformat): Likewise.
1e69125e 21279 * syntax.c (skip_chars): Likewise.
3befa583 21280
e3019616
PE
21281 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21282 This also lets GCC 4.6.0 generate slightly better loop code.
21283
becfa255
PE
21284 * callint.c (Fcall_interactively): <, not <=, for optimization.
21285 (Fcall_interactively): Count the number of arguments produced,
21286 not the number of arguments given. This is simpler and lets GCC
21287 4.6.0 generate slightly better code.
21288
dae0cd48
PE
21289 * ftfont.c: Distingish more carefully between FcChar8 and char.
21290 The previous code passed unsigned char * to a functions like
21291 strlen and xstrcasecmp that expect char *, which does not
21292 conform to the C standard.
21293 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21294 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21295 char * when the C standard requires it.
21296
76032d70
PE
21297 * keyboard.c (read_char): Remove unused var.
21298
eb3f1cc8
PE
21299 * eval.c: Port to Windows vsnprintf (Bug#8435).
21300 Include <limits.h>.
21301 (SIZE_MAX): Define if the headers do not.
21302 (verror): Do not give up if vsnprintf returns a negative count.
21303 Instead, grow the buffer. This ports to Windows vsnprintf, which
21304 does not conform to C99. Problem reported by Eli Zaretskii.
21305 Also, simplify the allocation scheme, by avoiding the need for
21306 calling realloc, and removing the ALLOCATED variable.
21307
70476b54
PE
21308 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21309
12020a9e
PE
21310 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21311 But keep the doprint source code for now, as we might revamp it
21312 and use it again (Bug#8435).
ea6c7ae6
PE
21313 * lisp.h (doprnt): Remove.
21314 * Makefile.in (base_obj): Remove doprnt.o.
21315 * deps.mk (doprnt.o): Remove.
21316
5fdb398c
PE
21317 error: Print 32- and 64-bit integers portably (Bug#8435).
21318 Without this change, on typical 64-bit hosts error ("...%d...", N)
21319 was used to print both 32- and 64-bit integers N, which relied on
21320 undefined behavior.
61bdb816 21321 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21322 * lisp.h (error, verror): Mark as printf-like functions.
21323 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21324 Report overflow in size calculations when allocating printf buffer.
21325 Do not truncate output string at its first null byte.
21326 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21327 Truncate the output at a character boundary, since vsnprintf does not
21328 do that.
21329 * charset.c (check_iso_charset_parameter): Convert internal
21330 character to string before calling 'error', since %c now has the
21331 printf meaning.
21332 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21333 overflow when computing char to be passed to 'error'. Do not
21334 pass Lisp_Object to 'error'; pass the integer instead.
21335 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21336 formatted with plain %d.
21337
b189fa66
PE
21338 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21339
bff87ef0
PE
21340 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21341
7e2cac20
PE
21342 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21343
ce4d90b5
PE
21344 * xterm.c (x_catch_errors): Remove duplicate declaration.
21345
266c9547
PE
21346 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21347
79c49ad2
PE
21348 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21349
368f4090
JM
213502011-04-10 Jim Meyering <meyering@redhat.com>
21351
21352 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21353 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21354 return ssize_t not "int", and use size_t as the buffer length.
21355 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21356 * gnutls.h: Update declarations.
21357 * process.c (read_process_output): Use ssize_t, to match.
21358 (send_process): Likewise.
21359
a32d4040
CY
213602011-04-09 Chong Yidong <cyd@stupidchicken.com>
21361
21362 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21363
8546720e 213642011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 21365
04f2d78b
CB
21366 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21367 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 21368
8546720e
GM
21369 * xterm.c (handle_one_xevent):
21370 * xmenu.c (create_and_show_popup_menu):
21371 * xselect.c (x_decline_selection_request)
21372 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 21373
0a2f5c1a 213742011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
21375
21376 Fix some uses of `int' instead of EMACS_INT.
21377 * search.c (string_match_1, fast_string_match)
21378 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21379 (scan_buffer, find_next_newline_no_quit)
21380 (find_before_next_newline, search_command, Freplace_match)
21381 (Fmatch_data): Make some `int' variables be EMACS_INT.
21382
21383 * xdisp.c (display_count_lines): 3rd argument and return value now
21384 EMACS_INT. All callers changed.
21385 (pint2hrstr): Last argument is now EMACS_INT.
21386
21387 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21388 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21389 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21390 (decode_coding_utf_16, decode_coding_emacs_mule)
21391 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21392 (decode_coding_ccl, decode_coding_charset)
21393 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21394 (decode_coding_iso_2022, decode_coding_emacs_mule)
21395 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21396 <char_offset, last_offset>: Declare EMACS_INT.
21397 (encode_coding_utf_8, encode_coding_utf_16)
21398 (encode_coding_emacs_mule, encode_invocation_designation)
21399 (encode_designation_at_bol, encode_coding_iso_2022)
21400 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21401 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21402 Declare EMACS_INT.
21403 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21404 (encode_invocation_designation): Last argument P_NCHARS is now
21405 EMACS_INT.
21406 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21407 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21408
21409 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21410 All users changed.
21411
21412 * ccl.c (Fccl_execute_on_string): Declare some variables
21413 EMACS_INT.
21414
8546720e 214152011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
21416
21417 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21418
4e19a977
CS
214192011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21420
21421 * process.c (Fformat_network_address): Doc fix.
21422
87302331
R
214232011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21424
ee7683eb 21425 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 21426
cbb59342
CY
214272011-04-08 Chong Yidong <cyd@stupidchicken.com>
21428
21429 * keyboard.c (read_char): Call Lisp function help-form-show,
21430 instead of using internal_with_output_to_temp_buffer.
21431 (Qhelp_form_show): New var.
e0d38eeb 21432 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
21433
21434 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21435
21436 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21437
e67a13ab
CY
214382011-04-06 Chong Yidong <cyd@stupidchicken.com>
21439
04f2d78b
CB
21440 * process.c (Flist_processes): Remove to Lisp.
21441 (list_processes_1): Delete.
e67a13ab 21442
973f782d
EZ
214432011-04-06 Eli Zaretskii <eliz@gnu.org>
21444
7c106b1e
EZ
21445 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21446
973f782d
EZ
21447 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21448
41cf7d1a 214492011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 21450
ca23cc88
PE
21451 Fix more problems found by GCC 4.6.0's static checks.
21452
f390e2d5
PE
21453 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21454
42eea0d0
PE
21455 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21456
b69769da 21457 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 21458
f9541e84
PE
21459 * xdisp.c (vmessage): Mark as a printf-like function.
21460
13841b55
PE
21461 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21462
c136c10f
PE
21463 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21464
5e2d4a30
PE
21465 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21466 printf-like functions.
21467 (tiff_load): Add casts to remove these marks before passing them
21468 to system-supplied API.
21469
583f48b9
PE
21470 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21471
b25d760e
PE
21472 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21473 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
21474 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21475 directly, rather than having caller test rule sign. This avoids
21476 some unnecessary tests.
21477 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21478 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21479 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 21480
bc7b6697 21481 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 21482 (xfont_open): Avoid unnecessary tests.
bc7b6697 21483
27ccc379
PE
21484 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21485
dcd5c89a
PE
21486 * composite.h, composite.c (composition_gstring_put_cache):
21487 Use EMACS_INT, not int, for length.
21488
b13a45c6
PE
21489 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21490 breaking out part of COMPOSITION_DECODE_RULE.
21491 (COMPOSITION_DECODE_RULE): Use it.
21492 * composite.c (get_composition_id): Remove unused local vars,
21493 by using the new macro.
21494
1e792e4d
PE
21495 * textprop.c (set_text_properties_1): Change while to do-while,
21496 since the condition is always true at first.
21497
dc6c6455 21498 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
21499 (interval_deletion_adjustment): Return unsigned value.
21500 All uses changed.
dc6c6455 21501
aba7731a
PE
21502 * process.c (list_processes_1, create_pty, read_process_output):
21503 (exec_sentinel): Remove vars that were set but not used.
afd4052b 21504 (create_pty): Remove unnecessary "volatile"s.
bc57d757 21505 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 21506 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 21507 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 21508
fdfc4bf3
PE
21509 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21510
fca8fe46 21511 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 21512 (update_syntax_table): Use unsigned instead of int.
fca8fe46 21513
06a0259a 21514 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 21515 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 21516 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 21517
e7b9e80f
PE
21518 * print.c (print_error_message): Avoid int overflow.
21519
56201685
PE
21520 * font.c (font_list_entities): Redo for clarity,
21521 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21522
78834453 21523 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 21524 (font_score): Avoid potential overflow in diff calculation.
78834453 21525
0bc0b309 21526 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 21527 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 21528
e610eaca
PE
21529 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21530
b895abce
PE
21531 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21532 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21533 can always succeed if overflow has undefined behavior.
21534
1f1d9321 21535 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 21536 (wordify): Omit three unnecessary tests.
1f1d9321 21537
c59478bc
PE
21538 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21539 All callers changed. This avoids the need for an unused var.
21540
79b73827
PE
21541 * casefiddle.c (casify_region): Remove var that is set but not used.
21542
a4db5dfe
PE
21543 * dired.c (file_name_completion): Remove var that is set but not used.
21544
43aae36e
PE
21545 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21546
2a47c44d 21547 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 21548 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 21549
a37c69bf
PE
21550 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21551 Check for integer overflow on size calculations.
21552
328ab8e7
PE
21553 * buffer.c (Fprevious_overlay_change): Remove var that is set
21554 but not used.
21555
e5a2a5cb
PE
21556 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21557 Remove vars that are set but not used.
8d84a6eb 21558 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 21559 (timer_check_2): Mark vars as initialized.
e5a2a5cb 21560
a60e5f68
PE
21561 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21562
f661cb61 21563 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 21564 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 21565
f0397f5a
PE
21566 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21567 that are set but not used.
21568
8664db06 21569 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 21570 if XCreateBitmapFromData fails (Bug#8410).
8664db06 21571
6abdaa4a
PE
21572 * xselect.c (x_get_local_selection, x_handle_property_notify):
21573 Remove vars that are set but not used.
21574
0ce7538d 21575 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 21576 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 21577
9ae848fc
PE
21578 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21579 Remove var that is set but not used.
0b918413
PE
21580 (scroll_bar_windows_size): Now size_t, not int.
21581 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21582 Check for overflow.
9ae848fc 21583
a5a62657
PE
21584 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21585 (map_tty_color) [!defined MSDOS]: Likewise.
21586
5c5cdd39
PE
21587 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21588
66ebf983
PE
21589 * coding.c: Remove vars that are set but not used.
21590 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21591 All callers changed.
21592 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21593 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21594 (decode_coding_charset): Remove vars that are set but not used.
21595
1be4d761
PE
21596 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21597 that is set but not used.
21598
47553fa8
PE
21599 * print.c (print_object): Remove var that is set but not used.
21600
1f7196bf 21601 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
21602 The gnulib version avoids calling malloc in the usual case,
21603 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21604 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21605 * filelock.c (current_lock_owner): Likewise.
21606 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21607 * sysdep.c: Include allocator.h, careadlinkat.h.
21608 (emacs_no_realloc_allocator): New static constant.
21609 (emacs_readlink): New function.
fdb61804
PE
21610 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21611 ../lib/careadlinkat.h.
d1fdcab7 21612
f84c17c7
SM
216132011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21614
21615 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21616 first non-nil return value).
21617
ef3862ad
JD
216182011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21619
21620 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21621 if not defined (Bug#8403).
21622
376a7006
JB
216232011-04-02 Juanma Barranquero <lekktu@gmail.com>
21624
21625 * xdisp.c (display_count_lines): Remove parameter `start',
21626 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21627 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21628 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21629 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21630 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21631 and thereabouts. All callers changed.
21632 (get_per_char_metric): Remove parameter `f', unused since
21633 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21634
6ca3801d
JM
216352011-04-02 Jim Meyering <meyering@redhat.com>
21636
21637 do not dereference NULL upon failed strdup
21638 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21639 (ns_get_family): Likewise.
21640
d8e2b5ba
JB
216412011-04-02 Juanma Barranquero <lekktu@gmail.com>
21642
21643 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21644
8c74fcbd
JD
216452011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21646
21647 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21648 later (Bug#8403).
21649
7200d79c
SM
216502011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21651
03408648 21652 Add lexical binding.
7200d79c 21653
03408648
SM
21654 * window.c (Ftemp_output_buffer_show): New fun.
21655 (Fsave_window_excursion):
21656 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21657
21658 * lread.c (lisp_file_lexically_bound_p): New function.
21659 (Fload): Bind Qlexical_binding.
21660 (readevalloop): Remove `evalfun' arg.
21661 Bind Qinternal_interpreter_environment.
21662 (Feval_buffer): Bind Qlexical_binding.
21663 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21664 Mark as dynamic.
21665 (syms_of_lread): Declare `lexical-binding'.
21666
21667 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21668
21669 * keyboard.c (eval_dyn): New fun.
21670 (menu_item_eval_property): Use it.
ca105506
SM
21671
21672 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21673
03408648
SM
21674 * fns.c (concat, mapcar1): Accept byte-code-functions.
21675
21676 * eval.c (Fsetq): Handle lexical vars.
21677 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21678 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21679 (FletX, Flet): Obey lexical binding.
21680 (Fcommandp): Handle closures.
21681 (Feval): New `lexical' arg.
21682 (eval_sub): New function extracted from Feval. Use it almost
21683 everywhere where Feval was used. Look up vars in lexical env.
21684 Handle closures.
21685 (Ffunctionp): Move from subr.el.
21686 (Ffuncall): Handle closures.
21687 (apply_lambda): Remove `eval_flags'.
21688 (funcall_lambda): Handle closures and new byte-code-functions.
21689 (Fspecial_variable_p): New function.
21690 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21691 but without exporting it to Lisp.
23aba0ea 21692
23aba0ea 21693 * doc.c (Fdocumentation, store_function_docstring):
03408648 21694 * data.c (Finteractive_form): Handle closures.
23aba0ea 21695
03408648
SM
21696 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21697 interactive spec.
ba83908c 21698
04f2d78b
CB
21699 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21700 New byte-codes.
03408648
SM
21701 (exec_byte_code): New function extracted from Fbyte_code to handle new
21702 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21703
03408648 21704 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21705
03408648 21706 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21707
e2abce01
JB
217082011-03-31 Juanma Barranquero <lekktu@gmail.com>
21709
21710 * xdisp.c (redisplay_internal): Fix prototype.
21711
63696a73 217122011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21713
63696a73 21714 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21715 (try_scrolling): Use it when setting scroll_limit.
21716 Limit scrolling to 100 screen lines.
63696a73
EZ
21717 (redisplay_window): Even when falling back on "recentering",
21718 position point in the window according to scroll-conservatively,
21719 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21720
21721 (try_scrolling): When point is above the window, allow searching
21722 as far as scroll_max, or one screenful, to compute vertical
21723 distance from PT to the scroll margin position. This prevents
21724 try_scrolling from unnecessarily failing when
21725 scroll-conservatively is set to a value slightly larger than the
21726 window height. Clean up the case of PT below the margin at bottom
21727 of window: scroll_max can no longer be INT_MAX. When aggressive
21728 scrolling is in use, don't let point enter the opposite scroll
21729 margin as result of the scroll.
21730 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21731 threshold of 100 lines for never-recentering scrolling.
21732
e4cc2dfc
JB
217332011-03-31 Juanma Barranquero <lekktu@gmail.com>
21734
21735 * dispextern.h (move_it_by_lines):
21736 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21737 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21738 (message_log_check_duplicate): Remove parameters `prev_bol' and
21739 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21740 (redisplay_internal): Remove parameter `preserve_echo_area',
21741 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21742
21743 * indent.c (Fvertical_motion):
21744 * window.c (window_scroll_pixel_based, Frecenter):
21745 Don't pass `need_y_p' to `move_it_by_lines'.
21746
1c470562
SM
217472011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21748
44f230aa
SM
21749 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21750 steal a few bits to be more compact.
21751 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21752 Remove unneeded casts.
21753
1c470562
SM
21754 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21755
888adce9
ZK
217562011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21757
21758 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21759 binding" message (bug#7967).
21760
f838ed7b
PE
217612011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21762
77861b95
PE
21763 Fix more problems found by GCC 4.6.0's static checks.
21764
de6dbc14
PE
21765 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21766 Remove unused local var.
21767
f838ed7b
PE
21768 * editfns.c (Fmessage_box): Remove unused local var.
21769
792c7b2b
PE
21770 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21771 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21772 Omit unused local vars.
c499e557 21773 * window.c (shrink_windows): Omit unused local var.
b01a1c29 21774 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
21775 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21776 Omit unused local var.
21777
ba0165e1
PE
21778 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21779 Don't assume string length fits in int.
32ad8845 21780 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 21781 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 21782
3c59b4c9
PE
21783 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21784 instead of alloca (Bug#8344).
21785
a3eed478 21786 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 21787 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 21788
eb4d412d
PE
21789 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21790
1658b401
PE
21791 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21792 concerns.
21793
21794 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21795
21796 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 21797
9a2c6e05
PE
21798 * keyboard.c (syms_of_keyboard): Use the same style as later
21799 in this function when indexing through an array. This also
21800 works around GCC bug 48267.
21801
03d0a109
PE
21802 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21803
44f730c8
PE
21804 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21805
fe75f926
PE
21806 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21807 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21808
ffa8c828
PE
21809 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21810 This avoids undefined behavior on integer overflow, and is a bit
21811 more convenient anyway since it is compared to a size_t variable.
21812
c5101a77
PE
21813 Variadic C functions now count arguments with size_t, not int.
21814 This avoids an unnecessary limitation on 64-bit machines, which
21815 caused (substring ...) to crash on large vectors (Bug#8344).
21816 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21817 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 21818 All variadic functions and their callers changed accordingly.
c5101a77
PE
21819 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21820 * data.c (arith_driver, float_arith_driver): Likewise.
21821 * editfns.c (general_insert_function): Likewise.
21822 * eval.c (struct backtrace.nargs, interactive_p)
21823 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21824 (funcall_lambda, mark_backtrace): Likewise.
21825 * fns.c (concat): Likewise.
21826 * frame.c (x_set_frame_parameters): Likewise.
21827 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21828 0 if not found, not -1. All callers changed.
21829
dd3f25f7
PE
21830 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21831 (stack_copy_size): Now size_t, not int.
21832 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21833
461c2ab9
JB
218342011-03-28 Juanma Barranquero <lekktu@gmail.com>
21835
21836 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21837 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21838 All callers changed.
21839
21840 * lisp.h (multibyte_char_to_unibyte):
21841 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21842 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21843 * character.h (CHAR_TO_BYTE8):
21844 * cmds.c (internal_self_insert):
21845 * editfns.c (general_insert_function):
21846 * keymap.c (push_key_description):
21847 * search.c (Freplace_match):
21848 * xdisp.c (message_dolog, set_message_1): All callers changed.
21849
f6d62986
SM
218502011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21851
21852 * keyboard.c (safe_run_hook_funcall): New function.
21853 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21854 don't set the hook to nil, but remove the offending function instead.
21855 (Qcommand_hook_internal): Remove, unused.
21856 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21857 Vcommand_hook_internal.
21858
21859 * eval.c (enum run_hooks_condition): Remove.
21860 (funcall_nil, funcall_not): New functions.
21861 (run_hook_with_args): Call each function through a `funcall' argument.
21862 Remove `cond' argument, now redundant.
21863 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21864 (Frun_hook_with_args_until_failure): Adjust accordingly.
21865 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21866
1db5b1ad
JB
218672011-03-28 Juanma Barranquero <lekktu@gmail.com>
21868
21869 * dispextern.h (string_buffer_position): Remove declaration.
21870
21871 * print.c (strout): Remove parameter `multibyte', unused since
21872 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21873
21874 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21875 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21876 All callers changed.
21877
21878 * w32.c (_wsa_errlist): Use braces for struct initializers.
21879
21880 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21881 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21882 All callers changed.
21883 (string_buffer_position): Likewise. Also, make static (it's never
21884 used outside xdisp.c).
21885 (cursor_row_p): Remove parameter `w', unused since
21886 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21887 (decode_mode_spec): Remove parameter `precision', introduced during
21888 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21889 All callers changed.
21890
5ffb62aa
JD
218912011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21892
21893 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21894
461c2ab9 218952011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
21896
21897 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21898 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21899 (ns_update_auto_hide_menu_bar): New functions.
21900 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21901 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21902 ns_constrain_all_frames.
21903 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21904 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21905
5c380ffb
JD
219062011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21907
21908 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21909
9af30bdf
GM
219102011-03-27 Glenn Morris <rgm@gnu.org>
21911
21912 * syssignal.h: Replace RETSIGTYPE with void.
21913 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21914 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21915 Replace SIGTYPE with void everywhere.
21916 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21917 * s/template.h (SIGTYPE): Remove commented out definition.
21918
e2abce01
JB
219192011-03-26 Eli Zaretskii <eliz@gnu.org>
21920
21921 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21922 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21923
f868cd8a
JB
219242011-03-26 Juanma Barranquero <lekktu@gmail.com>
21925
59eb0929
JB
21926 * w32.c (read_unc_volume): Use parameter `henum', instead of
21927 global variable `wget_enum_handle'.
21928
21929 * keymap.c (describe_vector): Remove parameters `indices' and
21930 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21931 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21932
f868cd8a
JB
21933 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21934
21935 * keyboard.c (timer_check): Remove parameter `do_it_now',
21936 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21937 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21938 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21939
21940 * keyboard.c (read_char):
21941 * w32menu.c (w32_menu_display_help):
21942 * xmenu.c (show_help_event, menu_help_callback):
21943 Adjust calls to `show_help_echo'.
21944
21945 * gtkutil.c (xg_maybe_add_timer):
21946 * keyboard.c (readable_events):
21947 * process.c (wait_reading_process_output):
21948 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
21949
21950 * insdel.c (adjust_markers_gap_motion):
21951 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
21952 (gap_left, gap_right): Don't call it.
21953
2ecf6fdb
CY
219542011-03-25 Chong Yidong <cyd@stupidchicken.com>
21955
21956 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
21957 incurred during fontification.
21958
6b1f9ba4
JB
219592011-03-25 Juanma Barranquero <lekktu@gmail.com>
21960
21961 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
21962 (DEFVAR_PER_BUFFER): Don't pass it.
21963
21964 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
21965 (scrolling_window): Don't pass it.
21966
0f4a96b5
JB
219672011-03-25 Juanma Barranquero <lekktu@gmail.com>
21968
21969 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
21970
21971 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
21972 and `suffix'.
21973 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
21974 of variables specific to SELinux and computation of `encoded_absname'.
21975
21976 * image.c (XPutPixel): Remove unused variable `height'.
21977
21978 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
21979
21980 * unexw32.c (get_section_info): Remove unused variable `section'.
21981
21982 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
21983 (system_process_attributes): Remove unused variable `sess'.
21984 (sys_read): Remove unused variable `err'.
21985
21986 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
21987 (w32_wnd_proc): Remove unused variable `isdead'.
21988 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
21989 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
21990 (x_create_tip_frame): Remove unused variable `tem'.
21991
21992 * w32inevt.c (w32_console_read_socket):
21993 Remove unused variable `no_events'.
21994
21995 * w32term.c (x_draw_composite_glyph_string_foreground):
21996 Remove unused variable `width'.
21997
1149507c
JB
219982011-03-24 Juanma Barranquero <lekktu@gmail.com>
21999
22000 * w32term.c (x_set_glyph_string_clipping):
22001 Don't pass uninitialized region to CombineRgn.
22002
9c88f339
JB
220032011-03-23 Juanma Barranquero <lekktu@gmail.com>
22004
22005 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22006 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22007 (Fx_close_connection): Remove unused variable `i'.
22008
22009 * w32font.c (w32font_draw): Return number of glyphs.
22010 (w32font_open_internal): Remove unused variable `i'.
22011 (w32font_driver): Add missing initializer.
22012
22013 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22014 (fill_in_menu): Remove unused variable `items_added'.
22015
22016 * w32term.c (last_mouse_press_frame): Remove static global variable.
22017 (w32_clip_to_row): Remove unused variable `f'.
22018 (x_delete_terminal): Remove unused variable `i'.
22019
22020 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22021 (NOTHING): Remove unused static global variable.
22022 (uniscribe_check_otf): Remove unused variable `table'.
22023 (uniscribe_font_driver): Add missing initializers.
22024
dee091a3
JD
220252011-03-23 Julien Danjou <julien@danjou.info>
22026
22027 * term.c (Fsuspend_tty, Fresume_tty):
22028 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22029 * window.c (temp_output_buffer_show):
22030 * insdel.c (signal_before_change):
22031 * frame.c (Fhandle_switch_frame):
22032 * fileio.c (Fdo_auto_save):
22033 * emacs.c (Fkill_emacs):
22034 * editfns.c (save_excursion_restore):
22035 * cmds.c (internal_self_insert):
22036 * callint.c (Fcall_interactively):
22037 * buffer.c (Fkill_all_local_variables):
22038 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22039 Use Frun_hooks.
0f4a96b5 22040 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 22041 unconditionally since it does the check itself.
dee091a3 22042
2c520ab5 220432011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 22044
c9c49752
PE
22045 Fix more problems found by GCC 4.5.2's static checks.
22046
8abc3f12
PE
22047 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22048 the first time through the loop, since we know p0 < p1 then.
22049 This also avoids a gcc -Wstrict-overflow warning.
22050
a2d26660
PE
22051 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22052 leading to a memory leak, possible in functions like
22053 load_charset_map_from_file that can allocate an unbounded number
b12ef411 22054 of objects (Bug#8318).
a2d26660 22055
916c72e9
PE
22056 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22057 that could (at least in theory) be that large.
22058
19ab8a18
PE
22059 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22060 This is less likely to overflow, and avoids undefined behavior if
22061 overflow does occur. All callers changed. Use strtoul to scan
22062 for the unsigned long integer.
b7cbbd6f
PE
22063 (pint2hrstr): Simplify and tune code slightly.
22064 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 22065
f0641eff
PE
22066 * scroll.c (do_scrolling): Work around GCC bug 48228.
22067 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22068
7f650bb9
PE
22069 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22070 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
22071 (validate_x_resource_name): Simplify count usage.
22072 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 22073
37dd57d1
PE
22074 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22075 fail (Bug#8306).
81e56e61 22076
699979fc 22077 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 22078
401bf9b4
PE
22079 * process.c (Fmake_network_process): Use socklen_t, not int,
22080 where POSIX says socklen_t is required in portable programs.
22081 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 22082 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
22083 (Fmake_network_process, server_accept_connection):
22084 (wait_reading_process_output, read_process_output):
22085 Likewise.
22086
b93aacde
PE
22087 * process.c: Rename or move locals to avoid shadowing.
22088 (list_processes_1, Fmake_network_process):
22089 (read_process_output_error_handler, exec_sentinel_error_handler):
22090 Rename or move locals.
4dc343ee 22091 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 22092 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 22093 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 22094 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 22095 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 22096
af8a867c 22097 Make tparam.h and terminfo.c consistent.
44f230aa
SM
22098 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22099 Include tparam.h instead, since it declares them.
af8a867c
PE
22100 * cm.h (PC): Remove extern decl; tparam.h now does this.
22101 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22102 * terminfo.c: Include tparam.h, to check interfaces.
22103 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22104 (tparam): Adjust signature to match interface in tparam.h;
22105 this removes some undefined behavior. Check that outstring and len
22106 are zero, which they always are with Emacs.
22107 * tparam.h (PC, BC, UP): New extern decls.
22108
0248044d 22109 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 22110 (xftfont_open): Rename locals to avoid shadowing.
0248044d 22111
8ff096c1 22112 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
22113 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22114 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 22115 (ftfont_list): Remove unused local.
49eaafba
PE
22116 (get_adstyle_property, ftfont_pattern_entity):
22117 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22118 Rename locals to avoid shadowing.
8ff096c1 22119
e2be39f6
PE
22120 * xfont.c (xfont_list_family): Mark var as initialized.
22121
c9735e30
PE
22122 * xml.c (make_dom): Now static.
22123
8f5201ae
PE
22124 * composite.c (composition_compute_stop_pos): Rename local to
22125 avoid shadowing.
b246f932
PE
22126 (composition_reseat_it): Remove unused locals.
22127 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 22128 (composition_update_it): Mark var as initialized.
11b61122
PE
22129 (find_automatic_composition): Mark vars as initialized,
22130 with a FIXME (Bug#8290).
8f5201ae 22131
760fbc2c
PE
22132 character.h: Rename locals to avoid shadowing.
22133 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22134 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22135 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22136 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22137 to avoid shadowing.
22138
ff08eb85
PE
22139 * textprop.c (property_change_between_p): Remove; unused.
22140
fc7bf025
PE
22141 * intervals.c (interval_start_pos): Now static.
22142
235d7abc
PE
22143 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22144
44f230aa
SM
22145 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22146 Rename locals to avoid shadowing.
3e7d6594 22147
50060332
PE
22148 * sound.c (wav_play, au_play, Fplay_sound_internal):
22149 Fix pointer signedness.
d01f234b 22150 (alsa_choose_format): Remove unused local var.
c83b8872
PE
22151 (wav_play): Initialize a variable to 0, to prevent undefined
22152 behavior (Bug#8278).
50060332 22153
c4fc4e30
PE
22154 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22155
918436ed
PE
22156 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22157
c939f91b
PE
22158 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22159 clobbering (Bug#8298).
b9c7f648
PE
22160 * sysdep.c (sys_subshell): Likewise.
22161 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 22162
6bd8c144
PE
22163 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22164 This should get cleaned up, so that child_setup has the
22165 same signature on all platforms.
22166
7710357c 22167 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 22168 (relocate_fd): Rename locals to avoid shadowing.
7710357c 22169
c59da222
CY
221702011-03-22 Chong Yidong <cyd@stupidchicken.com>
22171
22172 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22173 not to be necessary, and produces flickering.
22174
66b87493
GM
221752011-03-20 Glenn Morris <rgm@gnu.org>
22176
22177 * config.in: Remove file.
22178
45b6f6d5
JB
221792011-03-20 Juanma Barranquero <lekktu@gmail.com>
22180
22181 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22182 are now in src/globals.h.
22183 (syms_of_minibuf): Remove spurious & from previous change.
22184
cd394be1 221852011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
22186
22187 * minibuf.c (completing-read-function): New variable.
22188 (completing-read-default): Rename from completing-read.
22189 (completing-read): Call completing-read-function.
22190
b14e3e21
CY
221912011-03-19 Juanma Barranquero <lekktu@gmail.com>
22192
22193 * xfaces.c (Fx_load_color_file):
22194 Read color file from absolute filename (bug#8250).
22195
f2b726e6
JB
221962011-03-19 Juanma Barranquero <lekktu@gmail.com>
22197
22198 * makefile.w32-in: Update dependencies.
22199
09f6ff02
EZ
222002011-03-17 Eli Zaretskii <eliz@gnu.org>
22201
22202 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22203
29a6015a
PE
222042011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22205
a3a6c54e
PE
22206 Fix more problems found by GCC 4.5.2's static checks.
22207
b766f867
PE
22208 * process.c (make_serial_process_unwind, send_process_trap):
22209 (sigchld_handler): Now static.
22210
be02381c
PE
22211 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22212 That way, the code declares only the vars that it needs.
22213 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22214 * s/cygwin.h (PTY_ITERATION): Likewise.
22215 * s/darwin.h (PTY_ITERATION): Likewise.
22216 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22217
57048744
PE
22218 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22219 * process.c (allocate_pty): Don't declare stb unless it's needed.
22220
7914961c 22221 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
22222 (CONSTANTLIM): Remove; unused.
22223 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22224 Define only if needed.
7914961c 22225
b3967b18
PE
22226 * unexelf.c (unexec): Name an expression,
22227 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
22228 Use a different way to cause a compilation error if anyone uses
22229 n rather than nn, a way that does not involve shadowing.
73366a00 22230 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 22231
29a6015a
PE
22232 * deps.mk (unexalpha.o): Remove; unused.
22233
43cfc33e 22234 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 22235 * unexec.h: New file.
ce701a33
PE
22236 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22237 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22238 Depend on unexec.h.
22239 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22240 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22241 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 22242 Change as necessary to match prototype in unexec.h.
ce701a33 22243
01f44d5a
PE
22244 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22245 shadowing.
4f63c6bb 22246 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 22247
a6670b0b
PE
22248 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22249 Rename locals to avoid shadowing.
22250
cef2010d 22251 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 22252 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 22253
d4d7173a
PE
22254 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22255
f08b802a
PE
22256 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22257 warning when compiling print.c.
22258
3ddb0639
PE
22259 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22260 instead of using an uninitialized var.
5ad03b97 22261 (font_sort_entities): Mark var as initialized.
3ddb0639 22262
170a2692
PE
22263 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22264
e663c700
PE
22265 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22266 pointers to constants.
89bc529a 22267 (font_parse_fcname): Remove unused vars.
7b81e2d0 22268 (font_delete_unmatched): Now static.
ea838e10 22269 (font_get_spec): Remove; unused.
13a547c6
PE
22270 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22271 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22272 Rename or move locals to avoid shadowing.
e663c700 22273
2a80c887 22274 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 22275 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 22276
1384fa33 22277 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 22278 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 22279
8b2c52e9
PE
22280 * alloc.c (mark_backtrace): Move decl from here ...
22281 * lisp.h: ... to here, so that it can be checked.
22282
475545b5 22283 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 22284 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
22285 (lisp_indirect_variable): Name an expression,
22286 to avoid gcc -Wbad-function-cast warning.
1faed8ae 22287 (Fdefvar): Rename locals to avoid shadowing.
475545b5 22288
b1349114 22289 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 22290 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 22291 Use const pointer when appropriate.
b1349114 22292
a2928364
PE
22293 * lisp.h (get_system_name, get_operating_system_release):
22294 Move decls here, to check interfaces.
22295 * process.c (get_operating_system_release): Move decl to lisp.h.
22296 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
22297 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22298 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22299 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
22300 (Fformat_time_string, Fencode_time, Finsert_char):
22301 (Ftranslate_region_internal, Fformat):
22302 Rename or remove local vars to avoid shadowing.
9710023e 22303 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 22304
a415e694
PE
22305 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22306 avoid shadowing.
22307
8ef4622d
PE
22308 * lisp.h (eassert): Check that the argument compiles, even if
22309 ENABLE_CHECKING is not defined.
22310
946f9a5b
PE
22311 * data.c (Findirect_variable): Name an expression, to avoid
22312 gcc -Wbad-function-cast warning.
112396d6 22313 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22314 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22315 (Fmake_variable_buffer_local, Fmake_local_variable):
22316 Mark variables as initialized.
52746918 22317 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22318
e5aab7e7 22319 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22320 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22321 Rename locals to avoid shadowing.
dff45157
PE
22322 (mark_stack): Move local variables into the #ifdef region where
22323 they're used.
7bc26fdb
PE
22324 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22325 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22326 needed otherwise.
22327 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22328 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22329 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22330
e5aab7e7
PE
22331 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22332 avoids undefined behavior in theory.
22333
4da60324
PE
22334 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22335
88043301
PE
22336 Use functions, not macros, for up- and down-casing (Bug#8254).
22337 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22338 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22339 to use the following functions instead of these macros.
22340 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22341 EMACS_INT, since callers assume the returned value fits in int.
22342 (upcase1): Likewise, for UPCASE_TABLE.
22343 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22344 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22345 the race-condition problem in the old DOWNCASE.
88043301 22346
19ed5445
PE
22347 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22348 Rename locals to avoid shadowing.
22349 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22350 (regex_compile, re_search_2, re_match_2_internal):
22351 Remove unused local vars.
952db0d7
PE
22352 (FREE_VAR): Rewrite so as not to use empty "else",
22353 which gcc can warn about.
da053e48 22354 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22355 (RETALLOC_IF): Define only if needed.
22356 (WORDCHAR_P): Likewise. This one is never needed, but is used
22357 only in a comment talking about a compiler bug, so put inside
22358 the #if 0 of that comment.
22359 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22360 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22361 Remove; unused.
19ed5445 22362
1f3561e4 22363 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
22364 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22365 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 22366
ded6f8f7
PE
22367 * search.c (simple_search): Remove unused var.
22368
dbd37a95
PE
22369 * dired.c (compile_pattern): Move decl from here ...
22370 * lisp.h: ... to here, so that it can be checked.
22371 (struct re_registers): New forward decl.
22372
7e47afad
PE
22373 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22374
85f24f61
PE
22375 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22376 All uses changed.
22377 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22378 Rename locals to avoid shadowing.
5671df8f 22379 (Fvertical_motion): Mark locals as initialized.
85f24f61 22380
181aa2be 22381 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 22382 (casify_region): Mark local as initialized.
181aa2be 22383
930d429c
PE
22384 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22385
7082eac6
PE
22386 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22387 New macros, so that the caller can use some names other than
22388 gcpro1, gcpro2, etc.
22389 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22390 of the new macros.
22391 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22392 argument, for consistency with GCPRO2_VAR, etc: it is now the
22393 prefix of the variable, not the variable itself. All uses
22394 changed.
38b2c076
PE
22395 * dired.c (directory_files_internal, file_name_completion):
22396 Rename locals to avoid shadowing.
22397
15206ed9
PE
22398 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22399 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22400 dired.c's scmp function, had undefined behavior.
22401 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22402 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22403 * buffer.h: ... to here, because these macros use current_buffer,
22404 and the new implementation with inline functions needs to have
22405 current_buffer in scope now, rather than later when the macros
22406 are used.
22407 (downcase, upcase1): New static inline functions.
22408 (DOWNCASE, UPCASE1): Reimplement using these functions.
22409 This avoids undefined behavior in expressions like
22410 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22411 from race conditions in accessing the global variables
22412 case_temp1 and case_temp2.
22413 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22414 * lisp.h (case_temp1, case_temp2): Remove their decls.
22415 * character.h (ASCII_CHAR_P): Move from here ...
22416 * lisp.h: ... to here, so that the inline functions mentioned
22417 above can use them.
22418
4a6bea26
PE
22419 * dired.c (directory_files_internal_unwind): Now static.
22420
f14b7e14
PE
22421 * fileio.c (file_name_as_directory, directory_file_name):
22422 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22423 Now static.
2893f146
PE
22424 (file_name_as_directory): Use const pointers when appropriate.
22425 (Fexpand_file_name): Likewise. In particular, newdir might
22426 point at constant storage, so make it a const pointer.
fd4ead52 22427 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
22428 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22429 signedness issues.
f839df0c
PE
22430 (Fset_file_times, Finsert_file_contents, auto_save_error):
22431 Rename locals to avoid shadowing.
f14b7e14 22432
5716756e 22433 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
22434 (Ftry_completion, Fall_completions): Rename or remove locals
22435 to avoid shadowing.
5716756e 22436
b4c3046a
PE
22437 * marker.c (bytepos_to_charpos): Remove; unused.
22438
b45db522
PE
22439 * lisp.h (verify_bytepos, count_markers): New decls,
22440 so that gcc does not warn that these functions aren't declared.
22441
85876d07
PE
22442 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22443 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 22444 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 22445 (copy_text): Remove unused local var.
85876d07 22446
03d78a21 22447 * filelock.c (within_one_second): Now static.
b3dd38ab 22448 (lock_file_1): Rename local to avoid shadowing.
03d78a21 22449
5df8f01b
PE
22450 * buffer.c (fix_overlays_before): Mark locals as initialized.
22451 (fix_start_end_in_overlays): Likewise. This function should be
22452 simplified by using pointers-to-pointers, but that's a different
22453 matter.
b1d876f1 22454 (switch_to_buffer_1): Now static.
8f54f30a
PE
22455 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22456 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 22457
a70072c9 22458 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 22459 Fix pointer signedness issue.
edced198
PE
22460 (sys_subshell): Mark local as volatile if checking for lint,
22461 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 22462 (MAXPATHLEN): Define only if needed.
a70072c9 22463
a0977c44
PE
22464 * process.c (serial_open, serial_configure): Move decls from here ...
22465 * systty.h: ... to here, so that they can be checked.
22466
a884fdcc
PE
22467 * fns.c (get_random, seed_random): Move extern decls from here ...
22468 * lisp.h: ... to here, so that they can be checked.
22469
604efe86 22470 * sysdep.c (reset_io): Now static.
b8950c94 22471 (wait_for_termination_signal): Remove; unused.
604efe86 22472
38fc62d9
PE
22473 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22474 (copy_keymap_item, append_key, push_text_char_description):
22475 Now static.
1004a21a 22476 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 22477 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
22478 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22479 (describe_map_tree):
22480 Rename locals to avoid shadowing.
38fc62d9 22481
2f2650da
PE
22482 * keyboard.c: Declare functions static if they are not used elsewhere.
22483 (echo_char, echo_dash, cmd_error, top_level_2):
22484 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
22485 (read_char, kbd_buffer_get_event, make_lispy_position):
22486 (make_lispy_event, make_lispy_movement, apply_modifiers):
22487 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22488 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22489 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 22490 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 22491 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 22492
a053e86c 22493 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
22494 (mark_kboards): Move decl here ...
22495 * alloc.c (mark_kboards): ... from here.
a053e86c 22496
4752793e
PE
22497 * lisp.h (force_auto_save_soon): New decl.
22498
74f10ca7 22499 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
22500 (DEFINE_DUMMY_FUNCTION): New macro.
22501 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22502 Use it.
c03cd23f
PE
22503 (main): Add casts to avoid warnings
22504 if GCC considers string literals to be constants.
74f10ca7 22505
022e70d4
PE
22506 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22507
59d6fe83
PE
22508 * dbusbind.c: Pointer signedness fixes.
22509 (xd_signature, xd_append_arg, xd_initialize):
22510 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22511 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22512 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22513 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22514
78320123
PE
22515 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22516 if GCC considers string literals to be constants.
49cebcca 22517 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 22518
35ac2a97
SM
225192011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22520
fb103ca9
SM
22521 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22522 (print_preprocess, print_object): New macro to fix last change.
22523
35ac2a97
SM
22524 * print.c (print_preprocess): Don't forget font objects.
22525
62973b41
JB
225262011-03-16 Juanma Barranquero <lekktu@gmail.com>
22527
22528 * emacs.c (USAGE3): Doc fixes.
22529
0e48bb22
AS
225302011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22531
22532 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22533 structure.
22534
7684e57b
JB
225352011-03-14 Juanma Barranquero <lekktu@gmail.com>
22536
22537 * lisp.h (VWindow_system, Qfile_name_history):
22538 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22539 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22540 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22541
22542 * w32select.c: Don't #include "keyboard.h".
c96bbc66 22543 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
22544
22545 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22546 * w32console.c (detect_input_pending, read_input_pending)
22547 (encode_terminal_code):
22548 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22549 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22550 (w32_system_caret_y, Qfile_name_history):
22551 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22552 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22553 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22554 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22555 * w32proc.c (Qlocal, report_file_error):
22556 * w32term.c (Vwindow_system, updating_frame):
22557 * w32uniscribe.c (initialized, uniscribe_font_driver):
22558 Remove unneeded extern declarations.
22559
2aa46d6c
CY
225602011-03-14 Chong Yidong <cyd@stupidchicken.com>
22561
c96bbc66 22562 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 22563
cffc6f3b
CY
225642011-03-13 Chong Yidong <cyd@stupidchicken.com>
22565
22566 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22567 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22568 These macros can no longer be used for assignment.
22569
44f230aa
SM
22570 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22571 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
22572 (record_buffer_markers, fetch_buffer_markers): New functions for
22573 recording and fetching special buffer markers.
22574 (set_buffer_internal_1, set_buffer_temp): Use them.
22575
22576 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22577
22578 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22579
22580 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22581 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22582
22583 * xdisp.c (hscroll_window_tree):
22584 (reconsider_clip_changes): Use PT instead of BUF_PT.
22585
d251f04b
EZ
225862011-03-13 Eli Zaretskii <eliz@gnu.org>
22587
22588 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22589 $(EMACS_ROOT)/lib/intprops.h.
22590
f0c77cd1
PE
225912011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22592
3eca4629
PE
22593 Fix more problems found by GCC 4.5.2's static checks.
22594
7c86ee98
PE
22595 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22596 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
22597 (xg_free_frame_widgets): Make it clear that a local variable is
22598 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
22599 (gdk_window_get_screen): Make it clear that this macro is needed
22600 only if USE_GTK_TOOLTIP.
1e5524e7
PE
22601 (int_gtk_range_get_value): New function, which avoids a diagnostic
22602 from gcc -Wbad-function-cast.
22603 (xg_set_toolkit_scroll_bar_thumb): Use it.
22604 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22605 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
22606 (get_utf8_string, xg_get_file_with_chooser):
22607 Rename locals to avoid shadowing.
22608 (create_dialog): Move locals to avoid shadowing.
7c86ee98 22609
41729b81
PE
22610 * xgselect.c (xg_select): Remove unused var.
22611
f0c77cd1
PE
22612 * image.c (four_corners_best): Mark locals as initialized.
22613 (gif_load): Initialize transparent_p to zero (Bug#8238).
22614 Mark another local as initialized.
ec6cf4c6 22615 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 22616
ce0ad53d 22617 * image.c (clear_image_cache): Now static.
d5d5a617 22618 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 22619 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
22620 (x_edge_detection): Remove unnecessary cast that
22621 gcc -Wbad-function-cast diagnoses.
2037898d 22622 (gif_load): Fix pointer signedness.
6ae141d6
PE
22623 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22624 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 22625
33383987 226262011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 22627
d32df629
PE
22628 Improve quality of tests for time stamp overflow.
22629 For example, without this patch (encode-time 0 0 0 1 1
22630 1152921504606846976) returns the obviously-bogus value (-948597
22631 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22632 reports time overflow. See
22633 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
22634 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22635 * editfns.c: Include limits.h and intprops.h.
22636 (TIME_T_MIN, TIME_T_MAX): New macros.
22637 (time_overflow): Move earlier, to before first use.
22638 (hi_time, lo_time): New functions, for an accurate test for
22639 out-of-range times.
22640 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22641 (Fget_internal_run_time): Don't assume time_t fits in int.
22642 (make_time): Use list2 instead of Fcons twice.
22643 (Fdecode_time): More accurate test for out-of-range times.
22644 (check_tm_member): New function.
22645 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
22646 (lisp_time_argument): Don't rely on undefined left-shift and
22647 right-shift behavior when checking for time stamp overflow.
8be6f318 22648
fe31d94c
PE
22649 * editfns.c (time_overflow): New function, refactoring common code.
22650 (Fformat_time_string, Fdecode_time, Fencode_time):
22651 (Fcurrent_time_string): Use it.
22652
8be6f318
PE
22653 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22654 * dired.c (make_time): Move to ...
22655 * editfns.c (make_time): ... here.
22656 * systime.h: Note the move.
22657
09d9db2c 226582011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 22659
126bc0dc
YM
22660 * fringe.c (update_window_fringes): Remove unused variables.
22661
c47cbdfd
YM
22662 * unexmacosx.c (copy_data_segment): Also copy __got section.
22663 (Bug#8223)
22664
7ac80be9
EZ
226652011-03-12 Eli Zaretskii <eliz@gnu.org>
22666
c96bbc66 22667 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22668 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22669 Constify `char *' arguments and their references according to
22670 prototypes in tparam.h.
22671
ecb0f94d 22672 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22673
7ac80be9
EZ
22674 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22675 Adapt all references accordingly.
22676
22677 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22678
ef1fd07e
TT
226792011-03-11 Tom Tromey <tromey@redhat.com>
22680
22681 * buffer.c (syms_of_buffer): Remove obsolete comment.
22682
7ef4b50c
EZ
226832011-03-11 Eli Zaretskii <eliz@gnu.org>
22684
22685 * termhooks.h (encode_terminal_code): Declare prototype.
22686
22687 * msdos.c (encode_terminal_code): Don't declare prototype.
22688
22689 * term.c (encode_terminal_code): Now external again, used by
22690 w32console.c and msdos.c.
22691
44f230aa
SM
22692 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22693 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22694
4b1ec863 226952011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22696
1714f52b 22697 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22698
4b1ec863
PE
22699 * fringe.c (update_window_fringes): Mark locals as initialized
22700 (Bug#8227).
22701 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22702
524c7aa6
PE
22703 * alloc.c (mark_fringe_data): Move decl from here ...
22704 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22705 to check its interface.
22706 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22707
a5c0af81 22708 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22709 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22710 (fontset_font): Mark local as initialized.
a9a06e0b 22711 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22712
b4716021
PE
22713 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22714
811e9bac 22715 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22716 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22717 (x_own_selection, Fx_disown_selection_internal): Rename locals
22718 to avoid shadowing.
22719 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22720
7e3ab302
PE
22721 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22722 so that the caller can use some name other than gcpro1.
22723 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22724 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22725 (Fx_backspace_delete_keys_p):
22726 Use them to avoid shadowing, and rename vars to avoid shadowing.
22727 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22728 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22729 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22730 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22731 Remove unused locals.
7e3ab302
PE
22732 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22733 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22734 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22735 macros.
f78faa98 22736
e2b13473
PE
22737 * xterm.h (x_mouse_leave): New decl.
22738
77f23912
PE
22739 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22740 Remove unused functions.
cdf4ba58
PE
22741 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22742 (x_calc_absolute_position): Now static.
7411c686 22743 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 22744 Don't declare local "event" unless it's used.
ed7bf3a5
PE
22745 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22746 unless they are used.
38d0b34a
PE
22747 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22748 (x_fatal_error_signal): Remove; not used.
a6067996
PE
22749 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22750 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22751 (x_error_catcher, x_connection_closed, x_error_handler):
22752 (x_error_quitter, xembed_send_message, x_iconify_frame):
22753 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 22754 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 22755 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 22756
44f230aa
SM
22757 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22758 Rename or move locals to avoid shadowing.
6b463e58 22759 (tty_defined_color, merge_face_heights): Now static.
5967d051 22760 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
22761 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22762 does not deduce is never used uninitialized.
73719eba
PE
22763 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22764 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 22765
426994c3 22766 * terminal.c (store_terminal_param): Now static.
5489860b 22767
032f1620 22768 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 22769 (set_frame_menubar): Remove unused local.
d4323972 22770 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
22771 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22772 since they might point to immutable storage.
281585b0
PE
22773 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22774 since it's unused otherwise.
032f1620 22775
367c19e5 22776 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 22777 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
22778 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22779 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 22780 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
22781 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22782 does not deduce are never used uninitialized.
70739cbe 22783
07b48fa9
PE
22784 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22785
8868a238 22786 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
22787 * window.c (window_loop, size_window):
22788 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 22789
7e5cf297 22790 * window.c (display_buffer): Now static.
d6550a9f
PE
22791 (size_window): Mark variables that gcc -Wuninitialized
22792 does not deduce are never used uninitialized.
a586633d
PE
22793 * window.h (check_all_windows): New decl, to forestall
22794 gcc -Wmissing-prototypes diagnostic.
5b555da1 22795 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 22796
f6095868
PE
22797 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22798 shadowing.
22799 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
22800 Include <limits.h>.
22801 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22802 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
22803 (load_charset_map): Mark variables that gcc -Wuninitialized
22804 does not deduce are never used uninitialized.
53df7c11 22805 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 22806
f38b440c
PE
22807 * coding.c (coding_set_source, coding_set_destination):
22808 Use "else { /* comment */ }" rather than "else /* comment */;"
22809 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
22810 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22811 a block, when the outer 'i' will do.
22812 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22813 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22814 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22815 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22816 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22817 Rename locals to avoid shadowing.
22818 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
22819 * coding.c (emacs_mule_char, encode_invocation_designation):
22820 Now static, since they're not used elsewhere.
413bb2db 22821 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 22822 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
22823 (decode_coding_emacs_mule): Mark variables that gcc
22824 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
22825 (detect_coding_iso_2022): Initialize a local variable that might
22826 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 22827 this initialization is needed. (Bug#8211)
5f58e762
PE
22828 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22829 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22830 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22831 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22832 Remove unused macros.
f38b440c 22833
232b38b9 22834 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 22835 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 22836 * character.c (string_count_byte8): Likewise.
232b38b9 22837
fb90da1b
PE
22838 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22839 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22840
fb93dbc2
PE
22841 * chartab.c (copy_sub_char_table): Now static, since it's not used
22842 elsewhere.
5c156ace
PE
22843 (sub_char_table_ref_and_range, char_table_ref_and_range):
22844 Rename locals to avoid shadowing.
bbcd0949 22845 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 22846
7d3b3862 22847 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 22848 (BIDI_BOB): Remove unused macro.
7d3b3862 22849
6be7d3da
PE
22850 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22851 deduce are never used uninitialized.
c2ed9c8b 22852 * term.c (encode_terminal_code): Likewise.
6be7d3da 22853
75f8807f 22854 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 22855
50938595
PE
22856 * tparam.h: New file.
22857 * term.c, tparam.h: Include it.
22858 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22859 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22860 Move these decls to tparam.h, and make them agree with what
22861 is actually in tparam.c. The previous trick of using incompatible
22862 decls in different modules does not conform to the C standard.
22863 All callers of tparam changed to use tparam's actual API.
22864 * tparam.c (tparam1, tparam, tgoto):
22865 Use const pointers where appropriate.
22866
fbceeba2
PE
22867 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22868 * cm.h (struct cm): Likewise.
22869 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22870 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22871 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22872 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22873 (turn_on_face, init_tty): Likewise.
22874 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 22875
7f3f1250
PE
22876 * term.c (term_mouse_position): Rename local to avoid shadowing.
22877
e6ca6543
PE
22878 * alloc.c (mark_ttys): Move decl from here ...
22879 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22880
c40f8d15
AS
228812011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22882
22883 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22884
cfe0661d
JB
228852011-03-09 Juanma Barranquero <lekktu@gmail.com>
22886
22887 * search.c (compile_pattern_1): Remove argument regp, unused since
22888 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22889 (compile_pattern): Don't pass it.
22890
0afb4571
J
228912011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22892
22893 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22894 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22895 for ! HAVE_GTK3.
22896 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22897
22898 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22899
22900 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22901 gdk_window_get_screen, gdk_window_get_geometry,
22902 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22903 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22904 (xg_get_pixbuf_from_pixmap): New function.
22905 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22906 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22907 Call xg_get_pixbuf_from_pixmap instead of
22908 gdk_pixbuf_get_from_drawable.
22909 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22910 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22911 (xg_check_special_colors): Use GtkStyleContext and its functions
22912 for HAVE_GTK3.
22913 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22914 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22915 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
22916 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22917 Call gtk_widget_get_preferred_size.
0afb4571
J
22918 (xg_frame_resized): gdk_window_get_geometry only takes 5
22919 parameters.
44f230aa
SM
22920 (xg_win_to_widget, xg_event_is_for_menubar):
22921 Call gdk_x11_window_lookup_for_display.
0afb4571
J
22922 (xg_set_widget_bg): New function.
22923 (delete_cb): New function.
895009e1 22924 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 22925 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
22926 (xg_set_background_color): Call xg_set_widget_bg.
22927 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22928 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22929 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22930 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22931 if ! HAVE_GTK3.
22932 (update_frame_tool_bar): Call gtk_widget_hide.
22933 (xg_initialize): Use GDK_KEY_g.
22934
22935 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22936 if ! HAVE_GTK3
22937 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22938
22939 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22940 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22941 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22942
1c2cc4ef
JB
229432011-03-08 Juanma Barranquero <lekktu@gmail.com>
22944
22945 * w32xfns.c (select_palette): Check success of RealizePalette against
22946 GDI_ERROR, not zero.
22947
33383987 22948See ChangeLog.11 for earlier changes.
aac0c6e3
MR
22949
22950;; Local Variables:
22951;; coding: utf-8
aac0c6e3
MR
22952;; End:
22953
ab422c4d 22954 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
22955
22956 This file is part of GNU Emacs.
22957
22958 GNU Emacs is free software: you can redistribute it and/or modify
22959 it under the terms of the GNU General Public License as published by
22960 the Free Software Foundation, either version 3 of the License, or
22961 (at your option) any later version.
22962
22963 GNU Emacs is distributed in the hope that it will be useful,
22964 but WITHOUT ANY WARRANTY; without even the implied warranty of
22965 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22966 GNU General Public License for more details.
22967
22968 You should have received a copy of the GNU General Public License
22969 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.